## 2 Materials and Methods
### Guide Positioning Control  
For the discharge and weighing of powder, the linear guide is controlled to slide the weighing mechanism to the assigned gallipot. The block needs to be accurately guided to the assigned position so that the powder discharge coupler on the weighing mechanism is able to accurately couple with the drive of the gear discharge mechanism on the gallipot base. Nevertheless, the block bears the weights of all components on the weighing mechanism, potentially resulting in inadequate starting torque when the guide motor directly starts at the requested speed. This situation could cause starting failure due to stalling or blocking. After the guide motor starts running, if control pulse signals are abruptly stopped when the block reaches the stop point, the motor rotor would pass the equilibrium point due to the system inertia. When the inertia is great, the stepping motor rotor might turn to the next equilibrium point, causing inaccurate positioning. Therefore, stalling and overshooting will appear, respectively, during the starting and stopping periods, and proper speed control for the stepping motor would need to be applied for starting and stopping. Motors play a critical role in automation. Motors can be categorized into direct-current motors, alternate-current motors, servomotors, and stepping motors, based on their structure and control methods. From the perspective of horsepower, DC motors and AC motors present better horsepower; however, servomotors and stepping motors present better position control. A stepping motor (stepper motor; step motor), as a type of DC brushless motor, possesses matched stator gear teeth (toothed electromagnets) and rotor gear teeth. The operating principle of a stepping motor is to energize one electromagnet by an external drive circuit to attract the rotor gear teeth. When the gear's teeth are aligned to the first electromagnet, they are slightly offset from the next electromagnet. Then the next electromagnet is energized, and the first is de-energized, making the gear rotate slightly to align with the next one. This process is repeated, and each of these rotations is called  
Figure 19: Schematic diagram of automatic weighing controller controlling four motors. a step, moving the shaft by a fixed angle. A stepping motor is controlled by open-loop control, which is simple and does not need any positioning sensors, such as Hall sensors or encoders, so that the cost on control is low. The input signals are pulse signals, and a stepping motor rotates proportionally with the pulse signals in order to achieve accurate control of position and speed with good stability. According to their structure, stepping motors can be classified into the permanent magnet (PM) type, the variable reluctance (VR) type, and the hybrid type, as shown in Figure 20.  
Figure 21 displays the schematic diagram of the stepping motor control, where a microcontroller sends out a train of pulses and a driver amplifies the signals to move the shaft through a fixed angle. Because open-loop control is used for stepping motors, preventing the stepping motor from stalling and overshooting becomes key to their operation. Therefore, the starting and stopping speedsof a stepping motor should be controlled properly. Two different speed control methods are used in this study. The first speed control method is trapezoidal curve control. Figure 22 shows a constant speed operation during the period t2, a constant acceleration during the starting period t1, and a constant deceleration during the stopping period t3. Based on the definition of \"stalling\", when the changes of the control frequency for acceleration during t1 or deceleration during t3 are larger than what a stepping motor can respond to, stalling will stop the stepping motor. This would affect the normal operation of the system. For this reason, the speed changes of a stepping motor must be accurately controlled. The trapezoidal curve control uses constant acceleration and deceleration.