SICE-ICASE International Joint Conference 2006 Oct. 18-21, 2006 in Bexco, Busan, Korea
Application of Velocity Profile Generation and Closed-Loop Control in Step Motor Control System Ngoc Quy Le 1, Jung Uk Cho 1, and Jae Wook Jeon2
School of Information and Communication Engineering, Sungkyunkwan University, Suwon, Korea (Tel: +82-31-290-7237; E-mail: {quylO0l, ichead}gece.skku.ac.kr) 2 School of Information and Communication Engineering, Sungkyunkwan University, Suwon, Korea (Tel: +82-31-290-7129; E-mail: jwjeongyurim.skku.ac.kr)
Abstract: Step motors are widely used in motion control systems. The step motor controller must perform high-precision positioning and smooth movement operation. In motion systems applying velocity profile control, the velocity of the motor gradually increases or decreases, to avoid the negative effect caused by the sudden change in velocity. Previous research proposes several step motor controller designs, that contain several modules, including a velocity profile generator, step motor driver, and feedback counter. These controllers are able to perform precise positioning and provide smooth motion operation. However, because these controllers operate in an open-loop control so the synchronous condition can be lost when disturbances in load torque exist. This paper presents the application of closed-loop control in the step motor controller. The control algorithm is based on two mode operations: open-loop and closed-loop. The controller operates in open-loop mode when it remains synchronized, and switches to closed-loop mode when it loses synchronization. This paper presents an algorithm for generating various velocity profiles and closed-loop control algorithms. The experiment is performed on a 16-b DSP, to verify the performance of the design. The experimental results show a velocity profile of unsymmetrical shape and demonstrate effective closed-loop control in an actual step motor system.
Keywords: Motion controller, velocity profile, step motor, DSP, closed-loop.
1. INTRODUCTION The step motor can operate without feedback, and therefore has been used in open loop positioning systems for many years. In a motion system, the step motor controller must perform positioning smoothly, and rapidly, with no overshoot or loss of steps. Researchers have proposed different techniques for generating velocity profiles, with the goal of controlling the step motor smoothly. The velocity profile generating algorithm can be performed by selecting a poly-nominal function [1]. This technique is excellent when the order of the poly-nominal is low, however, when the order of the poly-nominal increases, the required calculation time also increases, this problem makes it difficult to use in applications. Another technique uses digital convolution [2, 3]. This technique is easier to use in the controller, but the time for acceleration and deceleration must be equal, forming a problem in practical application. To solve these problems, a different technique is applied. The controller calculates velocity and the number of pulses in every sampling interval in advance, by using velocity and distance [4-7]. In this algorithm, the calculation time can also be reduced and it is possible to generate any kind of velocity profile. This technique is built in several hardware circuits based on DSP and FPGA [8, 9]. However, the general problem of the above research is the step out problem of varying load conditions, according to the use of open-loop control algorithms. Therefore, the solution to step-out problem is applying a closed-loop control algorithm. Some work has been conducted on the closed-loop control algorithm [10-13]. The feedback loop is performed using the optical
89-950038-5-5 98560/06/$10 © 2006 ICASE
encoder. The controller selects open-loop and closed-loop control according to the error between the motor and command position. This algorithm can prevent the step motor from losing steps. In addition, the controller can adapt with varying load and speed conditions, by adjusting the lead angle value. However, these controllers require a command pulse generator, which sends pulses to the controller at different rates. The rate of these pulses follows a given velocity profile trapezoidal, sine shape, S shape or unsymmetrical shape. The requirement for an additional device for sending command pulses increases the price of the motion system. In this paper, the objective is to propose a step motor controller that can perform smooth motion without using a command pulse generator. This new step motor controller reduces the price of the motion system. In addition, by applying a closed-loop control algorithm, the proposed controller can avoid the step-out problem inherent in open-loop controllers.
2. VELOCITY PROFILE GENERATING TECHNIQUE In this section, the velocity profile generator used in this work is illustrated. First, the controller calculates tables of coefficients for acceleration and deceleration, and stores these tables in memory, using a given set of parameters, desired distance S, maximum velocity Vmax, sampling interval Ts, acceleration time Ta, deceleration time Td and desired shape of velocity. If the number of intervals that the motor should move in acceleration, deceleration and constant velocity intervals are Na, Nd and N, respectively, then, the following relationship holds.
3593
Ta =NaT
T
=NdTs S
(1)
ak =Na
kIN,
(k-1)IN,
kINd
f fa(u)du
for k =1,2,...,Na
for k 1,2, ...I ,Nd
=
(7)
N=
VmaxTs
-aaNa-adNd
ayk fNd f|d(u)du
(k-1)INd
If fa(u) and fd(u) are functions for represen L1Ig characteristics of acceleration path and deceleration path, then aa and ad are determined by (2).
a, = ffa(u)dU
0
(2)
ad = ff(u)du
0
With a given characteristic function, the value of 6 is
a 0.5 a
with Trapezoidal and S-curve with Bell shape.
(3)
If N 0
Vm,T, is used to determine the number of pulses that the motor moves in each interval.
The new value of
If N0
1< k < Na Na+1
1
SP(kT )
=
l dyVVmT,
aYkV.T VmT,
Na+1< k < Na +N
Na+N+1
varying load conditions. This section describes a control algorithm, consisting of a combination of closed-loop and open-loop controls [11, 12]. Fig. 1 is the general structure of a closed-loop motion system. A closed-loop motion system contains a micro-controller, an optical encoder, a motor driver and a command pulse generator. The controller will control the motor according to the difference between the value of the command position and feedback position of the
motor.
3.1 Closed-loop controller The previous section depicts a technique for generating the velocity profile, and therefore finding the desired command speed in each sampling interval. The controller can apply this technique to an open-loop control algorithm. However, this open-loop control algorithm could lose steps when operating under
In Eq. (6), the coefficients ayk and dyk are calculated in advance and stored in a look up table.
3594
Command Pulse Controller
Motor Driver
Mor
Encodler
Fig. 1 Structure of closed-loop motion system. The micro controller receives the command velocity in a number of pulses in every sampling intervals, the micro controller accumulates a number of pulses in each sampling interval into a CPOS (command position) register. Similarity, the micro-controller counts feedback signals from an encoder, thus the actual position of the motor is stored in the MPOS (motor position) register. In CPOS and MPOS comparison, the micro-controller computes XPOS (excitation position) and sends this to the motor driver. The closed-loop control algorithm is expressed by the flow chart in Fig. 2. When the deviation between CPOS and MPOS is equal or smaller than 1 full-step (900 electrical angle), the controller sends CPOS to the step motor driver as XPOS. This is the open-loop mode ofthe controller. When the deviation between CPOS and MPOS is larger than 1 full-step, the micro-controller switches to closed-loop mode. In this case, XPOS is computed by adjusting MPOS by an amount called LeadAngle (LA). LeadAngle can be fixed as a full-step (900 electrical angle), alternatively, LeadAngle can vary based on the speed and load conditions ofthe motor. Fig. 3 shows the static torque characteristic of a step motor. If the excitation position is origination of the axis, then the torque created by the motor is changed to a value depending on the position of the motor. When the displacement between MPOS and XPOS is smaller than +1 full-step, the torque increases with displacement and direction is such as to resist the displacement. In larger displacements, the torque decreases and eventually changes sign, this situation is shown by the dashed line. A peak value is reached at +1 full-step displacement, and the controller should remain at this peak value for larger displacements. For this reason, in the closed-loop control mode, the value of LeadAngle can be selected at 1 full-step, and the solid line expresses the torque of the
_
~
* Created Torque
_+ ~~~
2 Closed-loop control algorithm.
MPOS
Closed Loop Mode
Open Loop Mode
Closed Loop Mode
Fig. 3 Static torque characteristic of Step motor.
3.2 LeadAngle computation In order to achieve higher velocity, the LeadAngle value is recomputed for adapting to the change in speed, load torque and back EMF. This section presents a method to compute the LeadAngle value based on speed, load torque and back EMF [13]. Fig. 4 depicts the dq-transformation analysis method [14, 15]. The d-axis component and q-axis component of voltage applied to the motor are named vd and vq,
respectively.
V=
I=
(9)
Vd and vq are expressed by
closed-loop algorithm. This algorithm appears to be satisfactory under static conditions, however when the motor moves, there are the effects of load torque and back EMF (electromagnetic force) on control circuit. Therefore, the LeadAngle value should be adjusted according to the variation in speed, load torque, and back EMF. In particular, if the LeadAngle value is selected at 900, the controller can control the step motor up to approximately 1500rpm. This LeadAngle value is satisfactory for low speed applications. However, when a higher velocity is needed, a more detailed analysis is required for describing the relationship in the LeadAngle value with speed, load torque and back
EMF.
L
I=L R+pLd R WLq iF 1+ (D.FOl" R
(q Lce,Ld
+PLq J Liq J
reLI LI
(10)
In Eq. (10), p is the derivative operator, Ld, Lq are the d-axis and q-axis components of the inductance of motor wilding, W)re is the rotational angular frequency of the rotor and Dm is the magnetic flux of the rotor that has an identical direction to that of d-Axis.
q-Axis \
/3-Axis
d-Axis a-Axis
Fig. 4 dq-transformation
3595
Ld and Lq are assumed constant and equal, so that pLd=pLq=0 and Ld=Lq=L. Eq. (10) is approximated by
(1 1).
R
re L,
l
,] 0
(11)
Setting
sin o =COS7=
R
co
re;L
PRRe
R
(12)
Z=R2+r2eL2
If the LeadAngle value is y, then
{Vd
=
_-I
(13)
I L
Vcos y
Rsa
vq =Vsiny
Rsb
Solve (1 1) for iq
ncoc
l2bit
N
V(V
<(,_\
R
(14)
VD
Decodng
If torque is proportional to the value of iq, by constant Kt, it can be said that iq represents the load torque condition of the motor (15).
T=Ktiq
=
(TMS32OF2812) Fig. BlockdiagmCoCnft
Fig.
6 Block
diagram
of
experiment system
Kt{ {
sin(y-o)-R2(re'oIm
+sin (
+
}
(15)
Solve (14) for LeadAngle:
Components Micro Controller Step Motor Optical Encoder Damper Load
Table 1 Components for experiment
|
Part Numbtr Ma|ifnufactuirer Texas Instrument TMS320F2812 MS23C USdigital E5D-1000-I | USdigital D6CL-6.3F Oriental motor
y=tan
R
Oilre,mjD
(16)
Tqhle 9? Chrncterkiti,c of Accelerntion qncl De:velertion
In using (16), the micro controller can perform the compute LeadAngle value according to speed, load torque and back EMF of the motor.
S shape
I sin 2
z u--
I 2
+1
1 sin 2
;r u
3 2
+1
Bell (Sine)
shape
Sl2 U2
sin 2u)
.z
co
zu
4. EXPERIMENT
The implementation of the described velocity profile generating algorithm and closed-loop control algorithm is built on a DSP based system. The performance of the controller is verified by experimental result when control a step motor. Fig. 5 is experiment system and Fig. 6 is the block diagram of the experiment system. The experiment system includes: micro controller DSP TMS320F2812, step motor type MS23C, optical encoder E5D-1000-I and damper D6CL-6.3F. These components are
summarized in table 1.
Unsymmetrical
2{ sin 7z(u -2 u
+1
The feedback signals from the encoder are decoded, counted and stored in the MPOS register. Two sensing resisters Rsa and Rsb exist for feedback of the information of current in the two phases of the motor. DSP regulates the current by adjusting the duty cycle of PWM pulses to the H-bridge Driver, based on the difference between the desired current value and feedback current from the ADC module. At the same time, DSP takes control of the velocity profile generating, closed-loop controlling and LeadAngle computing.
3596
The controller is tested in 2 situations. In first experiment, the controller is tested in normal conditions, without any variation in load torque. Thus, there is no step-out situation. In second experiment, the controller is tested for overload conditions, and step-out situations occur. In both cases, the controller generates the desired velocity profile in an unsymmetrical form that includes acceleration of a sine shape and deceleration of an S shape. Table 2 is a list of functions for some commonly used characteristics: trapezoidal, Bell (Sine) shape, S shape and unsymmetrical. Fig. 7 is an experiment with normal operation, there is no overload condition. The result demonstrates that the controller can generate velocity command in the desired shape (unsymmetrical) and the LeadAngle value is changed to adapt to the speed of the motor. The dash line demonstrates the velocity command from the velocity profile generator. The desired velocity command is in unsymmetrical form. The solid line is the response of the step motor. These two plots almost overlap each other. In this experiment, the step motor can track command velocity correctly up to a maximum speed of 3000 rpm. If careful review is made at the end of movement, at approximately 1400 ms, some differences exist between the velocity command and the feedback response of the motor. This problem is caused by the variation in generated torque of the step motor when moving at a speed below 500 rpm. Fig. 8 is a plot of LeadAngle value in normal operation. The time is 0 ms, velocity is zero, and the LeadAngle value is 900, this is the same as with static conditions. When the speed of the motor increases, the LeadAngle value increases rapidly to 1800. When the speed of the motor is greater than 1000 rpm, the LeadAngle value is constant at 1800. When the motor reduces speed, at speeds slower than 1000 rpm, the LeadAngle value begins to reduce, until the speed of the motor is 0 rpm, the LeadAngle value is 900. Second, the experiment is carried out in overload situations. The closed-loop control algorithm can be seen to prevent a motor from losing step. In Fig. 9, the dash line is the output of the velocity profile generator in unsymmetrical form. The desired maximum speed is 3000 rpm. The solid line is the response of the motor, the motor starts to move and can follow a desired command velocity. At 250 ms, there is high torque applied to the shaft of the motor. After high torque is applied, the speed of motor is reduced to approximately 500 rpm. The speed of motor is increased rapidly to the high speed of approximately 4200 rpm, at approximately 300ms after the high torque is removed. The motor moves at high speed until the position of the motor catches the command position at 800 ms. The motor has recovered the synchronous condition with the command position. After synchronizing with the desired command position, the motor continues to move until the command position stops. This proves that the proposed controller avoids losing step problems when step-out occurs.
Normal Condition
3500 l
- - -
3000 2500 2000
-
-Command Speed Feedback Speed
-
-
E 1500-
1000 500
-
-
[ms]
Fig. 7 Experiment without step-out conditions
Lead Angle
200 180 160 140
-_ 120 -
12
0
cm
10080 60 40 20
-
Lead Angle
0
0 200 400 600 800 1000 1200 1400 1600
[ms]
Fig. 8 LeadAngle value with normal operation
Step-out Condition
4500 4000 3500 3000 2500
0.
Command Speed Feedback Speed
2000 1500 1000 500 0 -500 500 1000 1500 2000
[ms]
Fig. 9 Experiment when step-out conditions occur
5. CONCLUSSION
This research introduces a step motor controller. The proposed controller can generate an arbitrary velocity profile and perform smooth motion without using an external device for generating a velocity profile. Thus, the cost ofthe motion system is reduced. In addition, the closed-loop control algorithm and LeadAngle calculation are discussed. The closed-loop control algorithm motor can avoid the losing step problem when overload occurs. The LeadAngle value in
3597
the closed-loop control algorithm is computed for adapting to the change in speed, load torque and back EMF of the motor, therefore, the motor can track the command velocity at high speed.
ACKNOWLEDEMENTS
This work was financially supported by the Ministry of Education and Human Resources Development (MOE), the Ministry of Commerce, Industry and Energy (MOCIE) and the Ministry of Labor (MOLAB), through the fostering project of the Lab of Excellency project.
REFERENCES [1] Fu KS, Gonzalez RC, Lee CSG. Robotics: control, sensing, vision and intelligence. New York:
McGraw-Hill, 1987. [2] Kim DI, Jeon JW, Kim S. Software acceleration/deceleration methods for industrial robots and CNC machine tools. Mechatronics 1994; 4(1):37-53. [3] Khalsa DS. High performance motion control trajectory commands based on the convolution integral and digital filtering. Proceeding of Intelligent Motion 1990: 54-61. [4] Jae W. Jeon, "Method for Controlling the Traveling Path of a Robot During Acceleration and Deceleration" United States Patent, Pat. Num. 5373439, Dec. 13, 1994. [5] Jae Wook Jeon, "An Efficient Acceleration for Fast Motion of Industrial Robots" Proceedings of the 1995 IEEE IECON, Vol. 2, pp. 1336-1341, 6-10 Nov. 1995.
[6] Jae Wook Jeon, Young Youl Ha, "A generalized approach for the acceleration and deceleration of industrial robots and CNC machine tools" Industrial Electronics, IEEE Transactions, Vol. 47, No. 1, pp. 133-139, Feb. 2000. [7] Jae Wook Jeon, "Efficient acceleration and deceleration technique for short distance movement in industrial robots and CNC machine tools" IEE Electronics Lett., Vol. 36, No. 8, pp. 766-768, Apr. 2000. [8] Jae Wook Jeon, Yun Ki Kim, "FPGA based acceleration and deceleration circuit for industrial robots and CNC machine tools" Mechatronics, Vol. 12, No. 1, pp. 635-642, 2002. [9] Jung Uk Cho, Jae Wook Jeon, "A Motion-Control Chip to Generate Velocity Profile of Desired Characteristics" ETRI Journal, Vol. 27, No. 5, pp. 563-568, Oct. 2005. [10] P.J. Clarkson, P.P. Acarnley, "Closed-loop control of stepping motor systems" Industry applications, Vol. 24, No. 4, pp. 685-691, Jul.-Aug. 1988. [11] J. B. Grimbleby "Simple algorithm for closed loop control of stepping motor" IEEE Proc.-Electr Power Appl, Vol. 142, No. 1, pp. 5-13 January 1995. [12] Akihiko Hoda and Kzuo Abe, "Control apparatus for position control motor" United States Patent, Pat. Num. 6121744, Sep. 19, 2000. [13] Akio Takemori, Yoshifumi Kuwano, Yukinari Takahashi Hiroaki Taka, "Stepping Motor Driver" United States Patent, Pat. Num. 6850026, Feb. 1, 2005. [14] Chee-Mun Ong, Dynamic Simulation of Electric Machinery, Prentice Hall, New Jersey, 1998. [15] A. E. Fitzgerald, Charles Kingsley and Stephen D. Umans, Electric Machinery, McGraw-Hill, Singapore, 2003.
3598