Copyright © IFAC System, Structure and Control Oaxaca, Mexico, USA, 8-10 December 2004
ElSEVIER
IFAC PUBLICATIONS
www.
DISCRETE-TIME NONLlNEAR CONTROL OF A PERMANENT MAGNET STEPPER MOTOR
v. Vasquez-Lopez', R. Castro-Linares. Ja. Alvarez-Gallegos. (wasquez, jalvarez, rcastro]@mail.cinvestav.mx Department of Electrical Engineering CINVESTAV, IPN Apdo.-postal 14-740, 07000 Mexico, D.F., Mexico
Abstract: This paper is concerned with the def;ign and experimental test of a controller-observer scheme for the angular position of a permanent magnet (PM) stepper motor. First, a discrete-time model of a class of nonlinear singularly perturbed systems is derived which is used to design a controller using the sliding mode technique.This design is then applied to the model of P!l.I stepper motor. A discrete-time observer is also designed to estimate the nOll measurable states required ill the control law. Some results obtained when the proposed cOlltrollerobserver scheme is implemented on an experimental set-up are shown to evaluate the performance of the scheme. Copyright © 2004 IFAC
Keywords: Singular perturbation, Sliding-mode discrete-time, Stepper Illotor
settling time which tends to be oscillatory in openloop drives (Kenjo & Suwara, 1994: Acarlcy 2(02). The performance of a stepper motor can be improved by means of using position feedback to detennine the adequating phase to be switched in proper timings. Closed-loop control is then the natural choice if the stepper motor itself is utilized effectively in applications where effectiveness is more important than cost.
INTRODUCTION
Permanellt Ivlagnet (PM) Stepper 1vIotors are electromagnetic incremental motion devices which convert electric pulses into discrete angular displacelllents. Some advantages of the stepper motors arc that they can be easily interfaced with digital systems and have high torque to inertia ratios. Also, friction is low in a stepper motor , providing, at the same time, very high torque at low speeds: up to 5 time the continuous torque of a d.c. commutator motor of the same size or double the torque of the equivalent brushless motor. However, the performance of a stepping motor is limited under the open-loop drive . For instance, a stepping motor driven in the open-loop mode might fail to follow a pulse command when the frecuellcy of the pulse train is high enough or the inertial load is too heavy. l\loreover, the motor motion have a step response with large overshoot and a relatively long
On the other hand a method used for model reduction of large-scale systems is the singular perturbation methodology, that allows to decompose it into two subsystems of lower dimension, both described in different time scales (see, for example, Kokotovic et aI, 1986) . Besides, diseretization and sample data control of systems described by non-linear singularly perturbed differential equations have not received great attention, due to the difficulties encountered with the discretization of non-linear systems. However, it is possible to define a reduced sampled system on the basis of which a slow control scheme can be designed (Barbot et ai, 1996). Also, the sliding mode control has become a very powerful tool for control design,
1 v. Vasqllcz-L';pez is also working in (he ~Jcchanical and '\Jechatronics Engineering Dcpartment. Tccnoiogico de ~!onlcr rey CE~1
321
since it is kuown to be insensitive to variations or perturbatious of plant parameters (sce, for example, Utkin, 1992). For discrete-time systems, however, very few design techniques arc available (Gao et ai, 1995: SatptHrk et. ai, 1987). Introducing different concepts for the so-called discrete-time sliding mode or quasisliding mode. The results presented in this work complete a research made by the authors that makes use of the singular perturbation and sliding mode lllethodology for a kind of Pl\I stepper motors (sce. for example Castro et ai, 2001). The principal differences between Castro et al. (2001) and this work is that in the latter once is interested in exploiting the discrete version of the techniques above mentioned , i.e., using the discretization scheme of two-time-scale nOli-linear continuoustime systems for the model of a PM stepper motor. From this decomposition. a st.ate feedback based 011 discrete-time sliding lllode techniques is designed for the slow subsystem and npplied to the original system. ;'.{oreover. experimental results arc developed when the methodology is applied to a Pl\1 stepper motor. The experimental results obtnined witness the feasibility of the proposed approach.
::-(n
+ 1) = ::-(71.) +
[
aI~
a2 ] + 2"F 2 (x(n))
+F2(:r(n)):;(n)
[h(.r(n))
+ g2(:c(n))u(n)]
(:3)
where Iz is an m x m identity matrix. The dynamies (2)-(3) arc known as the dominant fast sampled dynamics ill the sense that it emphasizes the fast component dynamics in the context of fast samplillg (Barbot et al. 1996). One lllay apply the singular perturbatiollmethodology to equations (2)-(3) and obtain two subsystems of lower dilllension, both described in different time scales, called the slow and fast subsystems. A feedback can then be independently designed for each of these reduced subsystems, namely H., and u f' for the slow and fast subsystem, respectively. These feed backs constitute the so-called composite control urn) = uAn) + 'lLf(n). The slow and fast subsystems arc obtained using the quasi -steady-state method given in Djemai et al. (1999). The slow subsystem is obtaiued by neglecting the fast modcs; thus (2) is replaced by its steady-state algebraic equation while 'tl f (u) b neglected. leading to the dynamics .r(n + 1) = .f(n)
+
E(l2F(:"f')
2'
+ EO' [1, (x) + F, (;r):(n)] .
(1)
.
[h(x) + F2(i,):(n) + g2(.I:)u,(n)] ,
1. SII\GULARLY PERTURBED DIFFERENCE
EQUATIONS Consider the following class of nonlinear perturbed systems
:(n) = z(n)
sillgularl~'
.r = I, (x) + F, (:c)z. fi = h(x) + F2(.r)z + g2(:r)u
:r(n)
F2(X) and
~2 F 2 (.f)]
[h(.f)
+ 6(.r):(n) (.5)
[QJ z +
,,2
Ff (j·)]
are assumed to be non-
singular. so that
Substituting (6) into (-1) results in the slow subsystelll
:r.,(n
+ 1)
= x,(n)
+ wf(x.,) + W·
g(.r,)u,(n)
(7)
where .IAn) = x(n) and
f(:c,(n)) = 11 (:r,) - F, (.r,)F2-' (x,)h(x,), 9(·r,,(n)) = -F, (.c,)F2-' (X,)Y2(X.)
+ w [1, (:r(n)) + F, (x(n))::-(nl]
(8)
To obtain the fast subsystem it is assullled that the slow variables arc constant during the fast transiellts. i.e., :rAn + 1) = .r,,(n) = x(n) =constant and u,(n + 1) = u,(n) =constant. Then , substracting (.5) from (3) and setting T] = :(n) - :(n) results in the fast su bsystelll
( . + EQ2F1(;r(n))[/()) 2 2 :r(n + F2(:r n)):;(n) +92(.r(n))u(n)]
+
where :1: and : denote the slow dynamics of (2) and (3). FrOlll (5), onc has that
(1 )
The exact sampling of the continuous system (1) involves infinite series which are unreasonable in practice. Following the approach described in Barbot et al. (1996). Let us assume a fixed sampling period 15 , sufficiently close to the parameter f. such that 15 = Qf where 0' is a real positive number, with Qf slllall enough. After truncation and approximation. a sampled simplified model of system (1) can be obtained which takes the form
+ 1) =
[aJ=
+g2(.t)u,(n) ],
\\'here .r E 8 1 , C Rn .• is the slow state, :; E 8 z e Rn! is the fast state, 'U ER" is the control input, f is a small positive parameter such that f E [0,1) . .f,. h, the columns of the matricc:> F,. F2 and 92 arc assumed to be bounded and analytic functions. It is also supposed that f, (0) = h(O) = 0 and. for u = n the origin (.r,:) = (0.0) is an isolated equilibrium state, and that F2 (.:c) is nonsingular for all x E 8 I '
:r(n
+
(2)
322
11(n + 1) =
11
+
+ ( (}l= + ~2 F2( .r )) F2(;r)7J
(al. + ~2
2.2 Fast sliding control design (9)
A fast controller design for the fast snhsystelll (9) can be obtained in a similar way to t.he onc used for the slow control. That is, one ('onsiciers a function
F2(:r)) 92(j:)H/(n)
2. DISCRETE-TIl\1E SLIDING l\IODE CONTROL DESIGN
eT
= [Ch'" Cl .. ] with ch, ... , Cl .. real conwhere stants and 7],. (n.) is the reference signal. The fast control takes the form
2.1 Slow sliding control design
(20)
Consider the slow subsystem (7). The objective is to track a known time varying reference ;C r (n) signal which is generated for a specific control purpose. The following function is proposed:
O',,(;r,(n) - x.,(n)) =
e:
(.rAn) - .IAn))
with
[CT <1>,.lJ2(·y)r' -eT 7],.(71, + 1) ]
1L"lf(n) = -
(10)
where e,! = [c", ... c"" 1 ' with c"" ... , C" " real constants. In accordance to SatptHrk et al (10S7) , a necessary and sufficient condition for the exist.ence of a so-called discrete-time sliding mode is expressed as
[cr (aI"
= L,O'" (.I:,.(n) - x,(n))
2
where the matrix <1>, = + '2 F2(.r)) .rJ2(.r) ] is assumed to he nonsingular and L f # 0 is a scalar weighting value satisfying -1 < Lf < l.
By imposing t.he dynalllics
+ 1)
(21) (22)
(11)
O',(n
[efr}1 + eT <1>, F2Jlf
( 12)
where L" is a scalar difIerent from 0 with - 1 < L" < 1, condition (11) is satisfied. From (12) a slow sliding cOl1trol strateg~· can be derin'd obtaining
3. APPLICATION TO THE Pl\I STEPPER ~IOTOR
(13)
The mathcmatical model for the P",l st.epper mot or is given by the following equations (sec I\enjo & Suwara, (199-4) ; for Cl detailed explanat.ion and derivation)
with
1 -din = -v elt L"
-
R. L"
-'l
k", . , + -WSlll( l\ B) L . - 1
di IJ 1 R. k,,, , = -'('b - -11 - -wcos( 'V_B) £It L ' L ') L ' , tilL' k",.. . , kll/ . , B cost lv.B) - -w £it = - -.]1 (/ "Sill ( ' i\_i B) + -'(' .] -
where the lllatrix [C.?·y (:r,,)]-' is assullled to be nOI1singular for all .r" (n). Now let V (a,(n)) he a candidate of a fUl1ction defined by
U
L~'apunov
V (a,(n)) = O'~(nk,(n).
J
(16)
clt
whcre in. ib and v,,, Vb are the currents and voltages in phases A and B , respectively, "'" is the rotor angular velocity and B is the rotor Hngnlar position. Land R are the self-inductance and resistance of each phase willdings, km is the Illotor t.orque constant. N-, is t.he number of rotor teeth, J is the rotor inertia. B is t.he viscous friction constant and T L is the load torque. The term kd sin( -4 "V, B) represents the detcnt torque dne to the permancnt rotor magnet interacting with t.hc magnetic material of the stator poles. In model (23) one neglects the slight conpling between the pha.ses, the small changc in the inductance as a function of the rotor position and the variation on inductance due t.o magnetic satlll'ation. In the present work one also neglects the Jetent torque (i.e. one sets kcl = 0 N -
When the sliding feedback (13) is used. (12) holds and equation (17) satisfies
(1- L~) a~(nk,(n) < O.
Thus, the equilibriulll a., = 0 of system (12) is stable (sce Vidyasagar. 1993, chapter 5, pages 26·1268). l'vIoreover V' (a,(n + 1)) = L~\/ (a,(n)). whose solution is given by
= (L~r \/ (a,(O))
J
dB -=w
ti\/ (a,) = a~(n + l)a,(n + 1) - a~(n)a,(n). (17)
~; (a,,(n))
.]
kcl . (-4N.., B) - -TL
- - Sill
The forward difference function 6.\/ (0',) = \/ (O',(n + 1)) - \/ (O',,(n)) is given by
~v' (a,) = -
"
(18)
Since - 1 < L ., < 1, V (a., (n)) is therefore lllonotonically decreasing as n -> DO. Thus a ,,(n) -> 0 as n -> )C, which shows uniform stability of the dynamics (12).
m/A ).
323
;r,.(n) and e,,(n) = x,,(n}. The control for the slow subsystcm (27), is t.hen givcn by
3.1 Singular perturbation methodology The lIlodel (23) can be put in the standard singularly pertmbed forlll (1), setting ;Z; = col(B,w), z col(i",i/)), U = coi(U".Vb) and t = L, this is
11 (.r)
= [
-~f ':22 - ~; ] , F2(.C)
0
F (.r) = ~ , .J
with
Uf;'I .•
-Rh
=
(n)
JR =~ "0'''',,,(.3
0.]
ItN.(n}
h(.r)= [ f..:,:,;c:sin(,N)x,,) ] , 92(.1:) = h -k",.1:2 cos(N-f'c,)
where h is an 2 x 2 identity matrix. When applying the methodology described in Section 11. the slow and fast subsystems of the PI\! stepper motor dynamics , take the form
2
['Vbf 1'."f ]
(25)
2
where iJ = 0' - R''2 . Equations (2.:1) and (25) arc obtained using the first approximation in E of t he fast discrete d ynamics. This approximation is different froIll the Euler approximation. On t.he other hand , the eigenvalues of t.he fast subs~'stem are located inside t.he unit circle if o' is chosen such that < O'R < 2 for a given R . Therefore, t.here is no need to apply a fast control law. and one sets 1t f = O.
F'2] , G = F= [ 111 F2 , F22
COS(k3.1:", }u.
8()(n) = He(n).
+ 1) ( :C"2 n + 1 )
+ 100'.1'", (n) , ::O'TL EO;" :/11 n - - J- + J R It,,
= .T." (n) .
= ox."
where 9 = 1 - ::Q ( ~
()
+ Gu(n}
(28)
[E:1.:4] ,H= JR
[Ut
[1 0
01
o
0], F2' =
[~] ,
F22
f(n) = x,,(n} - .1:,(11,)
(20)
where .i:e(n} is the estimate of :re(n), c(n} = [f' ~, (e;,)1] I C~l E Rand e;, E R2 arc the estimation errors. and H is the output matrix. The proposed observer then lu1.'; the following forlll (Lee & Lee , 1999):
(26)
where 1£., is a new input signal. Thus. the new slow red uced system becomes
.r " (n
.r,.(n))
[~ -E~/.J] . A sliding surface is now defined by
The slow control is designcd for the slow subsystem (21). For doing this, onc can notice that the parameter N_, which represents the number of rotor teeth, is precisely known. This suggests the assignment Vb ., =
+ C,EO' + ('30) ;1:"2(11)]
JR = ---L,a,(.r,(n )::0'/';",C3
with 111 = 1, F'2 =
sin(1.:3;c." )1t."
- c,;1'." (n)
where
3.2 Slow discrete Sliding mode controller
= -
.
;r,(n + 1} = F.cc(n} .I/(n} = H:c,(n)
°
VU"
C3EO' T/ + 1) + J-
The designed control rcquirel; full lIlec1.SUl'Clllents of () and w (:r, and .Q). However. only ('urrent and position Illeasurelllcnts are usually available in practice. On the other hand , it is a lso adequate to estinmte the load torque T/. In order to estimate this torque' and the motor speed, an sliding observer is designed. In this case, the design of the observer is based only on t he slow reduced lllodel because the fast subs:orst ('lU is asymptot ically stable and its effects on t.he slow 511 bsystem can be negle(,ted. Consider t.he ext.euded slow reduced systcm (27) and let .r'3 (n) = T/, 13:.' defining :c" = col(:1'"" X"2' .r"3)' onc obtains the slow reduced system in the linear forlll
/'1/.8 ] [ 1.'/),';
'112
c,:r,.(n
3.3 Speed and torque estimation
(2.:1)
['i1] +;3/
[
+C2(:1'(1I.} - (C4
-sfTl(N-y.1:,) cOS(N).1:1)
7),(n+l)]=(I_ d R)/ [ 112(n + 1) 2
= it",! .. (n) + It;v, (11)
1£,,(n}
;i:,(n + 1) = Fi,,(n)
+ GIt(n} + /{(y - i)l + Lt,,,,! (30)
where v,,! E R is a compensation input. The observer
(?_-,)
gains 1\- =
Kf 1T, where /,;, E Rand K2 E
[I.:,
R2 and L = [l, Lf] T, where l, E Rand L2 E R2, are to be determined. From (28), (29) and (:30) the corresponuiug observer error dynam ics can be obtained as follows:
+ ~).
Since it is desired that the rotor position tracks a known time varying refcrencc ,1',.(n), the following slow func t ion as is cho::;en:
e(n
+ 1) =
(F - /{H)e(n} - Lv",(n)
(31)
According to the sliding surfacc defined by (29), t he equivalent compensation input 1',,'1 can be obtained by setting so(n + 1) = 0, that is
wherc c, , C2, C3 and C4 are constant coefficients chosen in order to satisfy condition (11) and el'(n) = X"l (n)-
vcq(n)
324
=
(HL)-' H(F - I\-H} e(n}.
(32)
Here. it is assumed that H L I- 0. This compensation input guarantees the existence of the ideal discretetime sliding mode after one sampling instant . and the errors remain on the sliding surface thereafter (Lee & Lee, 1999). \Vhen the compensation input t'eq is applied to system (31) the ideal sliding mode error dynamics is obtained:
Rotor pOSit i on (d eg )
'I
s l e pangle ( 1 8d&g)
op on loop (!lSPO""1 -
Closf! d loop response
e( n + 1) = [I - L (H L)-l H] (F - KH) ern) Time ISeC)
• ( a)
°L2F12] ern) 0 F ' 22 - -1-[ e2l 1 ~
Phase yollages (V I
where e21 = L2 (f~~-I") + (F21 - K2) ' Therefo re. the reduced order error dynalllics is
. ',· ·-· Pha se vottage v, - ---- Phase '1 0 11898 V ,
/ ... :'\ :" ':/ \/ ".: \: \'
Wi t h an appropriate selection of L. tile observat,ioll error C(lI) converges to if the eigenvalues of F22 !r;F12 are inside t he unite circle.
'.
"
,-
,._ -_.-- . . -. -
-
"
,.
°
(b)
Notice that the compensation injJlltl'e,, (n) (32) cannot be directly implemented since it depends Oil the tenns [( 2('11.) f'3(n) Through simple nmnipulation. t.he cOlllpensation input can also be expressed as
f'.
I)",ln)
= (H L )- l (y(n
P r a se c u rrent ( A)
(1 - H Il ) x
+ 1) -
HF:i;(n) - HGu (n))
-Philsecurrer'lli Ph,,!€! CU rl en l.:
(33)
Usillg (33) in the proposed observer, estimation of the unavaila ble states is t.hen perfol'llJ ed. (c )
·1. EXPERIMENTAL RESULTS
The objective in the experiments was to make t he rotor shaft, to rota tc onc step a nd three st.eps (one step = LSD ), as fa:;t as possible and with the least ;UllOllJlt of overshoot (critical daIllped response). The controller law gains were chosen a.~ (:1 = 1. 7. (:2 = 0.012 , ('3 = 0.01-15. C4 = O.0-t85 and L ., 0.01525. The obscr\'(~r gain vector was chosen as 1\' = col(H"H2 , H3) = (19 .5.0.65,1.12) and L = col( L1.L2.L3) = (0.0-15, 0,45 , 0.155). The initial COI1ditions of the motor variables and the estimat es were fixed to zero. The time closed-loop respOIlses con'csponding to angular position tracking. phase voltages. pha.<;e currents and estimation states when the shaft of the motor rotates onc step are showl1 in Figs. (a)-(e). In figure (f) the closed-loop position angular response is showed and comparated with an open loop response obtained when the step seqnenee is cha nged every 0.0025 sce. in order to move the rotor shaft :3 steps. From these plots , onc can notice a fast response of the system with no overshoot on the rotor position. Also, the control variables are kept within practical limits operation (sce Fig. g). 0ne can also notice a small delay in the rotor position sequence for both experil1Ients. This is due to the electronic circuits associated to the controller actuators.
In this section we present the reslIlts obtained through laboratory experimentation using a P~I stepper motor. described by equations (23). The stepper Illotor used for experiments has SO rotor teeth, two stator phases, and the foll owing values slIpplied by the manufacturer: maximum current = 6.0A , phase resista nce = 0.25!l, plwse inductance = 2.3 mH , viscous friction const.ant = 6 x 10- 4 N - m /rad/s a nd rotor inertia = 187.2 x 10- 6 h"g - m 2 . The;;e villues cOl'l'espond to a Sl\IB3 stepping motor built by Aerotcch wired in a bipolar arrangcment . In order to llleasure the phase currents and the angular position. t.he National Instrument data adquision board 6025E was used together with a pentillJn II personal computer at 120 l\IHz with 256 1\lb in RAl\l wa:; used. The programming language used was La b\Vindowf;/ CVL The sampling period used in the experiment was O.Ols. which is the resolution limit of the board. The angular position is obtained via a n optical encoder atta{'hed to the shaft of the motor. The phase currents are measured by LE:'.l HAW 15-P Hall-dfect sensors and pulse width modulated (PWl\I) a mplifiers arc used as controller actuators.
325
00
of the 1Il0tor parameters. Implementation results of the developed controller-observer litructure on an experimental set up illustrate the good performance results, making it a promising approach for t.he control of this kiud of electromechanical devices. Onc advantage of the methodology proposed in this work is t.hat the dilicrete-time model of a Pl\I stepper motor is obtained and used for the cont.roller and observer design. This leads to straightforward and simple implementat.ion of these designs. Also. the sampling period used is inferior to the onc used in previous approaches where a cont.inuous control law i~ implemented.
Estimation load torque (N-m)
(d'
Estimation speed rolor (rad /s)
References Acarnley, P. (2002). Stepping motors a guide to theory and practice. 4th cd. , The Institution of Electrical Engineers. Uni ted Kingdom. Castro, R., Alvarez .la. &. V,bquez V. (2001). Sliding mode control and st.ate estimation for a class of Ilonlincar singularly perturbed syslcms, DynamiCS and Control, Vol. 11. pp. 25-·1G. Barbot, .J.P.. Djcmai, ]\.1.. ]\."[onHco, S. & NormadCyrot.. D. (199G). Analysis and cont.rol of non linear non linear singularly pert.urbed systcms under sampling. Control and DynamiCS Systems. Vol. 79 , pp.
(e)
Rotor pos ition (deg)
203-216.
Djelllai. 1\1.. .LP. Barbot & H.K. Khalil. (1999). Digital 11111It.iratc control for a class of nOll-lincar singularly perturbed systems. Int. Journal of Control. Vol. 72. No. 10, pp. 851-8G5. Gao, W .. Wang. Y. &. HOlllaifa. A. (1995). Discrelctillle variable st.ructure cont.rol s.yst.ems. IEEE Trans. On Industrial Electronics, Vol. ·12, Ko. 2. pp. 117-122. 1995. Kenjo T. &. Suwara. A. (199·1). Stepping Motors and Their Microprocessor Controls . Second Edition . Oxford: Clarendoll Press. Kokotovic, P.V .. KhaJiI, ILK.. 0 'Reilly, .1. (198G). Singular Perturbations Methods in Control: Analysis and design. Academic Press, Loudon. Lee, S.:\1. &. Lee, B.H. (1999) . A discrete-time sliding mode controller and observer wit.h computat.ion t.ime delay. Control Engineering Practice. Vol. 7, pp. 9··13955. Satptiirk. S.Z .. Isteganopulos, Y. &. Kaynak. O. (1987). On the stahility of discrete-time sliding Illode control system , IEEE Transactions on Automatic Control, Vol. 32, pp. 930-932. Utkin.V.1. (1992). Sliding modes in control optimization. Springer-Verlag: Berlin. Vidyasagar, :\1. (1993). Nonlinear systems analysis, 2nd edn, Prentice Hall.
stP.p an;lle ( 5
Tun
('I
4
(J
1 ~l:' C '
Phase \fOlIages (V)
............ Phllse ... atlagll! V - - Pha ~e ~ oltaQII! v:
(.1
Tlr'l£l I sec)
5. COI\CLUSIONS In this paper. a discrete-time nOlllinear controlobserver structure for the trajectory tracking of allgular position in a P;\I stepper motor ha.<:; been developed and tested in an experimental set up. COllsidering that the position rotor f) is available, a sliding-mode observer is also designed to expollentially estimate the speed w, the position rotor e and the load torque T L. Though no experimcntal results are given here for different load torques, it is shown that the control schemes adequately compensates the magnetic detelltion torque and the uncertainty in the nominal values
326