Ij3c 4
Ij3c 4
3 (2016) 33
No
Next Step ?
Yes
Start
n=0
Duty(n) = 50%
Duty = 100%
No Yes
Yes No I > Iref ?
All Ifb = 0 ?
Duty = 0%
Duty = 100% Duty(n+1) Duty(n+1)
= Duty(n)+1% = Duty(n)-1%
PWM Out
PWM Out
Duty(n+1) No Duty(n+1) No
>80 % ? < 20 % ?
Stop
No Yes Yes
I = Iref ?
Yes Duty(n+1) Duty(n+1)
= 80 % = 20 %
n=n+1
PWM Out
Next Step? No
Yes
First, the current detector checks whether the smaller than the desired. Otherwise, the average
current feedback signal ( I fb ) exists or not. If no current is greater than the desired. With this
algorithm, the ADC for current detection is
feedback signal is detected, the PWM module then unnecessary.
sets the duty cycle to 0 %, i.e., turns off the PWM
modules. Otherwise, if the current feedback signal
exists, the PWM duty cycle is then set to be 100 %. 4. The System Modelling and
In this during, it is called the delay time, and the
winding current increases rapidly. After the Simulation
comparator outputs VA 1 , i.e., I fb I cmd , the
PWM module then resets the PWM duty cycle to 50 The overall block diagram for simulations
%, and adjusts the duty cycle according to the shown in Fig. 5 includes all the components
average of winding current. In the developed system, corresponding to the real hardware system. In Fig. 5,
the upper and lower bounds of PWM duty cycle are the block (1) includes the generation of speed
set to be 80 % and 20 %, respectively. The adjusting command and DDA algorithm, and block (2) is the
procedures of PWM duty cycle for average current current regulator; block (3) is the driver and motors,
regulation are: (1) If the winding current is greater and block (4) is the current comparators. Motion
control is dominated by a trapezoidal velocity profile
than the current command ( I fb I cmd ), the as shown in Fig. 6. Two-axis synchronous motion
PWM module decreases the PWM duty cycle 1 % per control is realized by DDA and included in block (1)
sampling period (0.25 s ), and the minimum duty [10]. The maximum operation speed is set as 180 rpm
cycle is 20 %. (2) If the average current is smaller which is according to the real condition for a
than the current command, then PWM module commercial caving machine [10].
increases the PWM duty cycle 1 %, and the The stepping motor model is created by Sim
maximum duty cycle is 80 %. Power System module in Matlab as shown in Fig. 7.
In this strategy, the average of winding currents Furthermore, the current control module is shown in
is calculated by a counter which accumulates the Fig. 8, which is developed to generate the
amount of clock pulses for the current level being corresponding Verilog HDL file for realizing the
higher or lower than the command, and the frequency actual hardware controller by FPGA. In this module,
of clock pulse is 4 MHz. When the output of two 0.5 resistors are set to detect the current as
comparator is VA 0 , the counter increases,
in the real system.
otherwise, the counter decreases. If the accumulated
value is negative, the average of winding currents is
International Journal of Computer, Consumer and Control (IJ3C), Vol. 5, No.3 (2016) 37
(1)
(4)
(2)
(3)
Figure 7: The hybrid stepping motor module and full-step driver module.
First, to demonstrate the four speed commands shown in Fig. 10 which is from the simulated results
shown in Fig. 6 in steady-state condition, Figs. 9 and of the average current regulation. Since the adjusting
10 are the results to demonstrate their performances. rate for the average current method is 1 % per
In Fig. 9, it shows the four step speeds, 45 rpm, 90 sampling time, the slow adjusting rate causes the
rpm, 135 rpm and 180 rpm in peak current regulation, system with a slow regulation rate in their current
and the system which is modulated in 20 kHz has response as compared with the method of peak
lower ripple current as compared with those results current regulation. Regarding the acceleration and
International Journal of Computer, Consumer and Control (IJ3C), Vol. 5, No.3 (2016) 39
Phase B
Current
Phase A
PWM
Phase A Current Command
Phase A
(a)
Current
Phase B Phase A
PWM PWM
Phase A Current Command
Phase B Current Command
Phase B Phase A
Current Current
Phase B
PWM
(a) Phase B Current Command
Phase B
Current
Phase A
PWM
Phase A Current Command
(b)
Phase A
Current
Phase A
Phase B PWM
PWM Phase A Current Command
Phase B Current Command
Phase A
Phase B Current
Current
Phase B
PWM
Phase B Current Command
(b) Phase A
Current
Phase A
PWM
Phase A Current Command
(c)
Phase A
current
Phase A
Phase B PWM
PWM Phase A Current Command
Phase B Current Command
Phase B Phase A
current Current
Phase B
PWM
Phase B Current Command
(c)
Phase B
Current
Phase A
PWM
Phase A Current Command (d)
Phase A
Current
Figure 10: The simulated steady-state currents
Phase B
PWM respond to the average current
Phase B Current Command
control method for speed commands:
Phase B
Current (a) 45 rpm, (b) 90 rpm, (c) 135 rpm
and (d) 180 rpm.
Phase A
(d) PWM
Phase A Current Command
Phase A
Figure 9: The steady-state current responses for Current
Phase B
Current
(a)
International Journal of Computer, Consumer and Control (IJ3C), Vol. 5, No.3 (2016) 40
Phase A
Phase A PWM
PWM Phase A Current Command
Phase A Current Command
Phase A Phase A
Current Current
Phase B
PWM Phase B
Phase B Current Command PWM
Phase A Current Command
Phase B Phase B
Current Current
(b) (b)
Figure 11: The simulated responses of peak Figure 12: The simulated response of average
current regulation on: (a) current regulation on: (a)
acceleration, (b) deceleration. acceleration, (b) deceleration.
Phase A
PWM
Phase A Current Command
Phase A
Current
Phase B
Current
(a)
Delay
PWM
Time
Phase A
PWM 10V/DIV
Phase B
PWM
Phase A
PWM
Phase B
PWM
PWM
10V/DIV
Current
1A/DIV
(a)
PWM
10V/DIV
Current
1A/DIV
(b)
Figure 16: The experimental results of the gate driver signals and current responses in acceleration and
deceleration. (a) The peak current regulation algorithm; (b) the average current regulation
algorithm.
International Journal of Computer, Consumer and Control (IJ3C), Vol. 5, No.3 (2016) 42
5. The Experimental Setup and To verify the validness and correctness, the
conditions of hardware realizations are set the same
Results as the software evaluation process as shown in
Section 4. The PWM signals of power converter are
To actually verify the validness of system captured by a logic analyzer and digital oscilloscope
modelling and hardware controller design, an as shown in Figs. 14 and 15, respectively. It is
XYZ-table which is driven by stepping motors is obvious that the current control process includes the
built as shown in Fig. 13. It includes the human dead-time module, delay-time module and PWM
machine interface (HMI), the power converter, the module.
speed command generator, comparator and current
regulator as the block diagram shown in Fig. 5. HMI First, the effects of acceleration and
programmed by C++ language can directly read the deceleration for both the current control strategies are
G codes and convert them into a series of stepping shown in Fig. 16, where there are the current
commands. The stepping commands on HMI are responses from the hardware realized by a peak
transferred to the stepping motor drive system current regulator. The traces are the PWM signals of
through the UART interface. The stepping motor gate driver and the corresponding phase current,
drives are controlled by FPGA-based system, and the respectively. Besides, Fig. 16(b) shows the results of
hardware Verilog code is created from those a current control by the average current regulator.
modelling as stated in Section 4, and realized by The two figures are very similar to the results as the
Altera Cyclone III C10 FPGA. The power converter simulations by Matlab/Simulink and ModelSim. The
includes the photocouples, gate drivers IR2101 and peak current response is fast enough to regulate the
power MOSFET. The experimental current responses stator current to a quite small ripple as compared with
are captured by a current probe and digital the average current algorithm. However, the peak
oscilloscope to illustrate their performances. current strategy has a bigger high frequency noise
The procedures of experiment are as follows: than average current one.
1) The controller is designed to drive the Afterward, the following demonstrations are
XYZ-table for a commerical caving the four steady-state current responses of 45 rpm, 90
machine. The stepping commands are from rpm, 135 rpm and 180 rpm, respectively, to verify the
the G-code on HMI, and they are performance in different operating speeds. Figs.
transferred to the FPGA-based controller 17(a)~(d) are the results for motors controlled in peak
by UART interface with 19200 bps. current regulation, and Fig. 18(a)~(d) are the
2) The acceleration and deceleration are corresponding results for average current regulation.
according to the desired trapezoidal These responses and trajectories deeply match to the
velocity profile as shown in Fig. 6. The co-simulation results as shown in Section 4. Through
stepping commands and the constraints of those simulation results and hardware realized system,
maximum speed are also decided by the the modelling about the stepping motor drive system
HMI system. incorported with an XYZ-table and the hardware
3) An embedded micro controller 8051 in controller created by Verilog HDL codes are
FPGA receives the serial commands from successfully modelled and hardware realized.
HMI, and converts them into the stepping
commands for 3-axis stepping motor
drives. According to the stepping
commands, the designed three control
modules: dead-time module, delay-time
module and PWM module, are then
sequentially executed to control the
currents on the desired level. The
experimental results about the hardware
regulators are shown in the following.
International Journal of Computer, Consumer and Control (IJ3C), Vol. 5, No.3 (2016) 43
PWM
10V/DIV
1A/DIV
Current
(a)
PWM
10V/DIV
1A/DIV
Current
(b)
PWM
10V/DIV
1A/DIV
Current
(c)
International Journal of Computer, Consumer and Control (IJ3C), Vol. 5, No.3 (2016) 44
PWM
10V/DIV
1A/DIV
Current
(d)
Figure 17: The steady-state current responses for peak current control method on speed command: (a) 45
rpm, (b) 90 rpm, (c) 135 rpm and (d) 180 rpm.
PWM
10V/DIV
1A/DIV
Current
(a)
International Journal of Computer, Consumer and Control (IJ3C), Vol. 5, No.3 (2016) 45
PWM
10V/DIV
1A/DIV
Current
(b)
PWM
10V/DIV
1A/DIV
Current
(c)
PWM
10V/DIV
1A/DIV
Current
(d)
Figure 18: The steady-state current responses for average current control method on speed command: (a)
45 rpm, (b) 90 rpm, (c) 135 rpm and (d) 180 rpm.
International Journal of Computer, Consumer and Control (IJ3C), Vol. 5, No.3 (2016) 46