1. Introduction
Stepper motors are adopted in a variety of drive applications because of their high precision of positioning, low costs of the driver, simplicity of operation, and high torque at low speeds. However, stepper motors suffer from some drawbacks such as missed steps, decreased torque at high speeds, resonances, and high power consumption. Speed and position closed-loop and current vector control are good choices to overcome these drawbacks mentioned above.
Regarding closed-loop position control, which usually uses the encoder to compensate for the position error, the end point can be adjusted by commanding additional step pulses to bring the motor back to the correct position. Furthermore, closed-loop control can also operate the stepper motor in microstepping mode, and the accuracy of position can be verified and adjusted dependent on the resolution of the encoder. The control mode of the stepper motor is thus gradually developed into closed-loop control, and adopts a highly efficient controller to achieve better performance [
1,
2,
3] as compared with open-loop control.
Vector control has been widely used in induction motors [
4] and permanent magnet synchronous motors (PMSMs) [
5,
6]. Because of the fact that the hybrid stepper motor is similar to permanent magnet synchronous motors or brushless DC motors in the mechanism of action, the theoretical basis and analysis foundation of the vector control for the stepper motor are also proposed [
1,
7]. To this end, the vector control strategy is used in the drive system design of the hybrid stepper motor. As the two-phase hybrid stepper motors are different from the conventional three-phase PMSMs or brushless DC motors (BLDCMs), we do not need to construct the functions of
−
transformations.
As a result of their flexibility and high performance, field programmable gate array (FPGA) has been widely used in hardware controller realization. Some examples include the design of the Proportional-Integral-Derivative (PID) controller [
8] and the fuzzy controller [
5]. It is also applied in power electronics circuits [
9] and drive system designs of PMSMs [
5,
6,
10], induction motors [
4], switched reluctance motors [
11], and BLDCMs [
12]. Furthermore, FPGA is suitable for the development of an embedded system or a system on a chip (SoC), and the developed embedded system can be a part of a complete motion control system.
In this study, we use FPGA in the stepper motor drive system design, and adopt vector control for the regulation of the inner current loop. Furthermore, to get the trapezoidal velocity profile for point to point command, an encoder is used to close the position and velocity control loop. All the hardware circuits are realized by FPGA. The design starts from building the drive system in a Matrix Labaratory (Matlab)/Simulink platform [
9], and the software system is simulated on Quartus II and Modelsim [
10,
13]. The resulting digital hardware system is in the type of Verilog code and is practically implemented on an Altera Cyclone III FPGA. Finally, the developed hardware control system and the power module are applied to a hybrid stepper motor to show the validity and performance.
The contents of the paper are as follows. In
Section 2, the experimental setup and system modelling are presented. Then, the simulation results and discussions are given for the built system in
Section 3. The experimental results are shown in
Section 4. Finally, the conclusions are given in
Section 5.
3. The Functional Simulation and Discussions
The functional simulation for the proposed FPGA-based drive system is demonstrated using Matlab/Simulink. The commands are generated by pulse generator, which outputs the pulse string command to the position controller with the maximum pulse rates of 31.4 rad/s, 314 rad/s, and 0.314 rad/s for the medium, high, and low speed commands, respectively. The above pulse rates result in maximum speed commands of 300 rpm, 3000 rpm, and 3 rpm, respectively. In the meanwhile, the accelerations are also taken into consideration for different pulse rates.
Figure 8 demonstrates the generated speed and position commands for the system operated at 31.4 rad/s with acceleration of 31.4 rad/s
2. The parameters of the controller for the simulated system are set as those shown in
Table 2. Furthermore, for the speed command of 314 rad/s, the field weaken control is activated once the speed increases passed 100 rad/s, and a negative d-axis current command is added to let the system enter that region.
The simulated results for the command of pulse rate of 31.4 rad/s are shown in
Figure 9 and
Figure 10. The speed response of
Figure 9 shows that the motor speed follows the pulse command and stays on it thereafter, and the current response of
Figure 8 shows that the two stator currents are in quadrature.
The simulated results for the speed command of 314 rad/s are shown in
Figure 11 and
Figure 12. Under this condition, the field weaken control is used. First, the region of field weaken begins when the speed is beyond 100 rad/s. Thus, during the acceleration, the current vector control enters the field weaken operation from the normal condition, which slightly affects the responses during the acceleration period. The system finally reaches the desired speed. Because the system enters the field weaken region, it requires a greater current than the one under the normal condition.
The simulated results for the speed command of 0.314 rad/s are shown in
Figure 13 and
Figure 14. As a result of the rather low speed operation, the speed response has a little resonance. As the speed feedback is from the difference of the encoder counter per sampling period, a low speed causes low precision on speed. This is also revealed in the current responses for the phases A and B. Of course, the low precision for speed feedback can be solved by calculating the period instead of the frequency of the encoder pulse. The procedure will be implemented for experiment.
4. The Experimental Results and Discussion
The commands are made by a pulse generator, which outputs the pulse string to the position controller, and the pulse rate is equal to the desired speed. The position controller accepts the pulse string and the feedback from the encoder counter to close the position control loop. The speed controller gets the encoder pulse, calculates the pulse rate, and converts it to the shaft speed as the feedback signal to close the speed control loop. Finally, the stator currents of the stepper motor are acquired from Hall current sensors, and fed back to FPGA through ADC to close the current control loop. As in the functional simulation, three speed commands, namely, 300 rpm, 3000 rpm, and 3 rpm, with different accelerations are practically used to test the performance of the developed hardware system. Furthermore, to demonstrate the performance of the pulse generator and position/speed controller, a 12-bit up/down counter is used to accumulate the pulses generated from the encoder. Its output is connected to a 12-bit DAC to convert the digital value of the counter to analog voltage, and is shown on the oscilloscope. The output voltage range of DAC is 0–5 V. According to the waveform of DAC, it is easy to verify the motor speed and check the smoothness of the rotation of the motor shaft. Furthermore, the motor is directly axis-coupled to a disk as the load, as shown in
Figure 1.
First, the output of DAC for 300 rpm speed command is shown in
Figure 15, where the period is about 41 ms. Each of one triangle cycles is equal to 1.2868 radians, shown in (8).
The decimal range of the DAC counter is 0–4095, it has total 4096 counters, and the resolution of encoder is 20,000 p/rev. The motor speed can be obtaiuned by (9):
The waveform demonstrates that the speed is quite smooth under the proposed vector control system.
The current responses are shown in
Figure 16, where the period is about 4 ms, and phase currents A and B are in quadrature. The peak-to-peak value of the current is about 1 A.
As the pole pair for the proposed hybrid stepper motor is 50, that is,
P = 50. According to (10), the result is the same as the speed obtained from (9).
Next, we will demonstrate the performance with the speed command of 3000 rpm using the vector control, where the current control loop is in the field weaken region as the motor runs beyond the rated speed. The current responses of
Figure 17 are the control results, where the peak-to-peak current is about 2 A. As the speed of 3000 rpm is beyond the rated speed, the direct component is a negative value by placing the voltage
ahead of the q-axis.
The position responses for the speed command of 3000 rpm are shown in
Figure 18. The motor speed from the curve shown in
Figure 16 is approximately
The speed can also be verified by
Figure 17, which has a period about 400
, which corresponds to 3000 rpm.
Compared with the results of
Figure 15 and
Figure 18, their sloping sides are very smooth, that is, the motor is run under a very stable condition.
Finally, the low speed condition is performed with the speed command of 3 rpm, the position and current responses are shown in
Figure 19 and
Figure 20, respectively. With the position response of
Figure 19, the speed is calculated as follows:
However, in the low speed range, the speed is calculated by measuring the period of the encoder pulse instead of the frequency. Furthermore, as the command is from the pulse string generator to the position controller, once the position error is very close to zero, the speed control loop will be skipped, and the current command will come directly from the position controller. With those strategies, we obtained a smooth speed response as in
Figure 19, and current response as in
Figure 20, where the phase currents are in quadrature.
In viewing those experimental results, one has demonstrated the performance for high, medium, and low speed commands, and the performances for different position/speed requirements are fitted to those desired through the closed-loop position and speed control.
The position experimental results are shown in
Figure 21,
Figure 22 and
Figure 23. The position command is to rotate the motor with the trapezoidal velocity profile as shown in
Figure 21, where the acceleration and deceleration are
and
, respectively, and the maximum velocity is 300 rpm. The total rotation is 30 revolutions, which is equal to 600,000 counts from the encoder. The DAC is used to convert the digital position and velocity signals to analog voltage with the appropriate ratio, as shown in
Figure 21 and
Figure 22. To verify the end point value of the position counter, a 9-bit logical analyzer is used. The stepper motor of the experiment has pole pair 50 and 20,000 p/rev encoder, in which one electrical cycle is equal to 400 encoder pulses. Thus, we create a 400-step counter, which needs 9 bits in order to receive the pulses sent from the encoder, will be cleared (the value is 00000000) initially. According to
Figure 23, the binary value of the 9-bit counter is 000000000 at the position marked “starting”. With the control of position controller and the pulse string generator, the value at the end point is also 000000000, that is, in this experiment, the final position stops exactly at the command.