Technical Report OSU-CISRC-3/95-TR10, Comp. & Info. Sci., 1995
1
Adaptive Simulation and Control of Variable-Structure Control Systems in Sliding Regimes Feng Zhao
Department of Computer and Information Science The Ohio State University Columbus, OH 43210 E-mail:
[email protected] Vadim I. Utkiny
Department of Electrical Engineering and Department of Mechanical Engineering The Ohio State University Columbus, OH 43210 March 18, 1995
Abstract Conventional simulation and control methods for sliding mode control systems are limited by the available sampling bandwidth and allowable tracking error. Consequently, these methods suer from harmful chattering. This paper presents an adaptive method for the discrete-time simulation and control of sliding mode control systems, based on an analysis on the relationship between tracking error and sampling rate for these systems. Our analysis shows that the tracking error decreases as the sampling time interval decreases when the sliding condition exists. Supported by the National Science Foundation's National Young Investigator Award CCR-9457802, the Alfred P. Sloan Foundation Research Fellowship, and the National Science Foundation grant CCR9308639. y Ford Professor of Electro-mechanical Systems.
The adaptive method exploits the concept of discrete sliding mode; the method adjusts its sampling rate to ensure that the tracking error is bounded within a boundary layer of the sliding surface. To simulate a sliding mode system in discrete time, we present an adaptive integration scheme that follows the ideal system within a given tolerance. Likewise, the adaptive method can be used to generate discrete control signals for sliding mode systems. Simulation results on examples have shown that the adaptive method is free of chattering.
1 Introduction Many man-made electro-mechanical systems operate in discontinuous regimes. A controlled system can operate in a sliding mode in which the system switches in nitely fast between two control signals and evolves on a manifold known as the sliding surface [4]. Simulation and control of continuous systems can be tackled with modern analytical analysis or computational simulation. However, discontinuous systems such as the sliding mode systems pose sever challenges to simulation and control design: 1. Chattering is common in practice. In sliding mode systems, practical considerations limit the sampling at a nite rate that results in chattering along the sliding surface. Figure 1 shows an example of a system chattering between two vector elds along the sliding surface s = 0. Chattering can also be induced by the imprecision knowledge about the position of sliding surfaces or disturbances. The chattering is often harmful as it may excite unmodeled high-frequency dynamics of the system. 2. A sliding mode system is inherently sti. Fast and slow dynamics coexist in a sliding mode system. The fast component is characterized by the chattering motion, whereas the slow component is the average dynamics on the sliding surface, determined by the geometric property of the surface. The chattering on a sliding surface is typically much faster than the slow \sliding" along the sliding surface. 3. Simulation of sliding mode systems can be troublesome. It is well-known that sti dynamical systems are dicult to investigate numerically. We would like to following the slow component in a sti system. However, to ensure numerical stability, the step-size of numerical integration is limited by the fast component of the dynamics. Hence, the errors are accumulated in following the slow component. 2
s=0
s=0
(a)
(b)
Figure 1: Chattering in sliding mode control system: (a) the vector eld near a sliding surface s = 0; (b) the chattering due to nite sampling rate or disturbances. The Runge-Kutta integration method reacts less sensitively to discontinuities in the right-hand side of dierential equations than multi-step or extrapolation methods [3]. Consequently, the Runge-Kutta method is commonly used for integrating discontinuous systems. However, sliding mode systems are switching between two vector elds at an in nite rate; this forces the xed step-size Runge-Kutta integrator to limit its step-size. The adaptive Runge-Kutta integrator behaves even worse: it is either too conservative or overshoots by a lot as it tries to adjust its step-size based on an error estimate for continuous systems; the discontinuities destroy the smooth relationship between the error and the step-size. 4. Generating discrete control signals for sliding mode systems is dicult. Practical systems are often controlled by digital computers that issue control signals at sampled time points dictated by the control bandwidth (sampling frequency). The control signal is held constant between the successive sampling points. How do we guarantee that the controlled system follows the desired sliding surface closely between the sampled points, i.e., to ensure that the system trajectory is within an -boundary-layer of the desired sliding surface without over-conservatively limiting the step-size? In this paper, we develop a discrete simulation and control scheme that is able to take the largest possible step-size while keeping the error within bounds. The scheme dynamically exploits the trade-o between the sampling rate and tracking accuracy.
3
1
x k+1 dt1,u1
dt2,u2 dt3,u3
2
x k+1 3 x k+1
dtn,un
x
s=0
xn k+1
k
Figure 2: Adaptive tracking of a sliding surface within an -boundary-layer.
2 Adaptive Tracking Within a Boundary Layer Discrete-time simulation follows a continuous-time system at sampled time points, whereas discrete-time controller issues control signal to a continuous-time system at sampled time points. A xed-rate sampling method for sliding mode systems accumulates errors while trying to accommodate the fast dynamics, and is often limited by the available control bandwidth. We develop an adaptive method for sliding mode systems that dynamically adjusts the sampling interval and determines appropriate control signal so that the resulting continuous-time system follows the ideal system within a given tolerance. We formulate the adaptive tracking method as a boundary value problem: at each sampling point, nd a sampling interval size and an equivalent control that cause the controlled system to follow the ideal system within a prespeci ed tolerance during the interval and agree with the ideal system at the end of the interval. More speci cally, given a dynamical control system x_ = f (x; u; t) and a sliding surface s = 0, we want to compute = tk+1 ? tk and u such that
k s(tk < t < tk+1; u) kmax s(tk+1; u) = 0
where is the boundary layer thickness of the sliding surface, and u is held constant in (tk ; tk+1]. The state xk of the system at t = tk is assumed to be on s = 0, i.e., s(tk ; u) = 0. This ensures that the constraint k s(tk < t < tk+1; u) kmax can be satis ed. The idea of adaptive tracking is illustrated in Figure 2. 4
x(tk+dt)
f(xk,u,tk )
s=0
s(t k+dt)
x
x
k+1
k
Figure 3: Tracking deviation vs. sampling interval in adaptive tracking. The simulated (or controlled) system agrees with the ideal system at tk ; k = 1; 2; :::. In between tk 's, the tracking error is bounded by , the boundary layer thickness. In fact, the boundary layer thickness can be dynamically adjusted as well to further exploit the available sampling bandwidth and computational resources. The system operating in this fashion is said to be in the discrete sliding mode [5].
3 Analysis of Tracking Error vs. Sampling Rate In the ideal case of in nitely fast sampling, a control system will slide along a surface s = 0 if the sliding condition exists. However, when the sampling rate is nite, how does the tracking error varies with the sampling rate? The following analysis derives the relationship between the tracking error measured by k s k and the length of the sampling interval .
3.1 The general case A general control system is given by
x_ = f (x; u; t) with a sliding surface de ned as
(1)
s = Cx = 0
Figure 3 schematically shows how the tracking error varies with the sampling interval.
Theorem 3.1 Given > 0, s(tk ) = 0, and k Cf (x; u; t) k K , then there exists t > 0 such that
s(t) = s(tk + t) K t < 5
where K is a constant.
Proof. Given s = Cx, the derivative is
ds = C x_ = Cf (x; u; t) dt
Then
Z
tk +t
Cf (x; u; t)dt By the Mean Value Theorem for integrals, there exists 2 [tk ; tk + t] such that s(t) = s(tk + t) = s(tk ) + Z
tk +t
tk
tk
Cf (x; u; t)dt = Cf (x ; u; )t
Let K1 =k Cf (x ; u; ) k. Since s(tk ) = 0 and K1 K , we have
k s(t) k= K1t K t Therefore, for a given > 0, we can choose t to ensure that k s(t) k< .
End of Proof.
To further reveal the structure of K1 in the proof, we express s(t) in terms of a Taylor series when df (x; u; t) exists
dt
2 ) = s(tk ) + [Cf (xk ; u; tk ) + O(t)]t + O ( t s(t) = s(tk + t) = s(tk ) + t ds dt tk
Hence, the expression
K1 =k Cf (xk ; u; tk) + O(t) k
represents the sum of the vector eld in the surface normal direction and a small term that vanishes as t ! 0. When the system (1) slides along s = 0, an equivalent control ueq is de ned to be u that satis es ds = Cf (x; u; t) = 0 dt Suppose the system (1) is on the sliding surface at tk , that is, s(tk ) = 0. The system is said to be in a discrete sliding mode if there exists ukeq , held constant in (tk ; tt+1], that causes sk+1 = s(tk+1) = Cxk+1 = 0
Theorem 3.2 If s(tk ) = 0 and ukeq exists, as = tk+1 ? tk ! 0, the equivalent control for the discrete sliding approaches the equivalent control for the continuous sliding in the limit, i.e., ukeq ! ueq .
6
Proof. Given that sk = s(tk ) = 0 and sk+1 = s(tk+1) = 0, ds = Cf (x ; u ; t ) = lim sk+1 ? sk = 0
dt tk
k
keq k
!0
We have ukeq = ueq in the limit by de nition.
End of Proof.
In summary, for t , as = tk+1 ? tk ! 0, k s(t) k=k s(tk + t) k= K1 t K t K: Furthermore, when the sliding condition exists, i.e., ueq exists, as ! 0, K1 =k Cf (x ; ukeq ; ) k!k Cf (xk ; ueq ; tk ) k= 0 We conclude our analysis with the following remarks: The Theorems 3.1 and 3.2 also hold for a general sliding surface s = g(x) = 0, by dg in the proof. with simply replacing C in the derivative ds dt dx
The condition k Cf (x; u; t) k K implies that the vector eld is bounded in the direction of the surface normal of s = 0. The sliding condition ensures that ueq exists, and k Cf (xk ; ukeq ; tk ) k! 0 as ! 0.
In the equivalent control, ukeq depends on xk and and is constant within (tk ; tk+1], while ueq is a function of the state. Because ukeq ! ueq as ! 0, ueq serves as
a good initial guess for ukeq in the adaptive sliding method to be developed in Section 4. If sk 6= 0, ukeq does not necessarily approach ueq in the limit of ! 0.
3.2 The linear system Let us consider the special case of a linear control system x_ = Ax + Bu: By Theorem 3.1, we have k s(t) k= K1 t where K1 =k CAx + CBukeq k. As ! 0, we have
x ! xk ukeq ! ueq
where ueq = ?(CB )?1 (CA)xk , and K1 =k CAx + CBukeq k! 0 7
4 The Adaptive Sliding Method Based on the analysis on how the tracking error depends on the sampling interval size, we develop the follow methods to solve the boundary value problem posed in Section 2. We treat the desired and ukeq as the zeros of s(tk + ; u) and apply the Newton's method to nd these zeros that also satisfy
k s(tk < t < tk + ; ukeq ) kmax 1. The adaptive method: Fix rst, nd u such that s(tk + ; u) = 0. Once u is found, check if k s kmax and possibly iterate over . The Newton's method is used to nd u: u = u ? s(tk + ; uold) new
old
ds du uold
where s(tk + ; uold ) is computed by numerical integration, and the derivative, ds , is evaluated using du uold
ds = s(tk + ; u1 ) ? s(tk + ; u2) du uold u1 ? u2 u1 =uold
ds does not vary with u. In systems that are linear in u, du
2. Variants of the adaptive method:
(a) Fix u, nd such that s(tk + ; u) = 0. Then check if k s kmax and possibly iterate over u. (b) Fix u, nd such that k s kmax . Then iterate over u to enforce s(tk + ; u) = 0.
Discussions:
The adaptive method applies to both discrete-time simulation and discrete-time control generation, as it computes at each step the control ukeq and time interval .
8
The adaptive method and its variants are examples of the shooting method for
boundary value problems. They are all implicit methods. Consequently, they are expected to work well for sliding mode systems which are typically very sti. As the system is constrained to agree with the ideal system at the end of each time interval, the error of each step is not carried over to the next step and thus does not accumulate over time.
Newton's method converges quadratically in the neighborhood of zeros. Choosing a good initial guess is very important. In the adaptive method, a good initial guess for u is uinit = ueq where ueq itself is computed by the Newton's method on
s_ = C x_ = Cf (xk ; ueq ; tk ) = 0 In the variant 2(a), can be found with numerical integration. The updating formula for u in the variant 2(b) is the same as that for the adaptive method 1.
Transients before reaching the sliding surface should be integrated using conven-
tional integration scheme, for example, the Runge-Kutta method. The adaptive sliding would have trouble as it tries to enforce the constraint k s kmax . A system can also hit the sliding surface and then leave as in the 2nd example of Section 7 for starting points far away from the origin. Only when the system is on the sliding surface (or within an -boundary-layer of the sliding surface in practice) and starts to slide should the adaptive method be used.
Suppose the control u of the sliding mode system varies within the domain k u k u0, where u0 and ?u0 are extreme values of the discontinuous control components. The equivalent control ukeq is said to be within the admissible domain if k ukeq k u0. In practice, ukeq is replaced by u0 k uukeq k when k ukeq k> u0. keq
5 An Adaptive Algorithm We present the following algorithm that implements the adaptive method of Section 4.
Algorithm 5.1 Adaptive-integrator(xk , , ) 1. Compute ukeq
9
2. Compute tracking error e =k s(0 < t < ; ukeq ) kmax
e
3. Compute new step-size new = k 4. If e > , call Adaptive-integrator(xk , new , ); else, output xk , ukeq , and call Adaptive-integrator(xk+1 , new , ).
In applying the algorithm in practice, additional considerations are worth elaborating: 1. When xk is initially away from s = 0, we use a regular integration method such as Runge-Kutta integration to follow the trajectory. 2. The adaptive algorithm is used when the sliding condition exists, i.e., xk is within the -boundary-layer of s = 0 and ukeq is within the admissible domain. In practice, whenever k s(xk ) k , the sliding condition can be experimentally checked by Newton's method on Cf (xk ; ueq ; tk ) = 0: if ueq is found by Newton's method and is within the admissible domain, the sliding condition exists; otherwise, either the Newton's method fails to nd ueq , or the system is not in sliding mode, in which case a conventional integration should be used. 3. is the initial integration step-size; speci es the tolerance on tracking error and can be dynamically adjusted if necessary. The safety factor k, 0 < k < 1, is typically k = 0:9. 4. ukeq is computed using Newton's method with the initial guess ueq , as described in the adaptive method of Section 4. The error e can be computed via polynomial interpolation over a few points in [tk ; tk+1]. 5. As the analysis in Section 3 shows, e K and as ! 0, K ! 0. Thus the stepsize updating formula new = k is over-conservative in satisfying the tolerance e when decreasing the step-size.
6 An Example Consider a control system given by 8 < :
x_1 = x2 x_2 = u 10
(2)
The control u is speci ed as 8
0
u= 1
Rewrite the system in the matrix notation:
x_ = Ax + Bu where
2
A=4 0 1 0 0 2
(3)
3 5
3
B=4 0 5 1 Following the theory of linear systems [1], the solution of the system (3) at tk+1 = tk + is x(k+1) = A x(k) + B u where AZ = eA B = 0 eA(? ) Bd Assume u is held constant in (tk ; tk+1]. Suppose the sliding surface is given by s = Cx = 0. Assume s(x(k) ) = x(1k) + x(2k) = 0. We adjust u to ensure that the new state, x(k+1) , is also on the surface, i.e., sk+1 = Cx(k+1) = CAx(k) + CB u = 0 We have the equivalent control for discrete sliding
ukeq = ?(CB )?1CA x(k) In the system (2), since
eAt = I + At + 2!1 (At)2 + ::: = I + At 1 t = 2 4
We have
3
0 1
5
2
A = 1 4
0 1
11
3 5
x2
u=1
x1
u=-1
s=0
Figure 4: Vector elds of the system for u = 1 and u = ?1. 2
3
4
5
2 =2 B =
Thus that is,
2
3 2 3 2 =2 1 5 x(k ) + 4 5u x(k+1) = 4 0 1
2
x(1k+1) = x1(k) + x(2k) + 2 u x(2k+1) = x(2k) + u The sliding surface is s = x1 + x2 = Cx where 8 > < > :
h
C= 1 1
i
Figure 4 shows the vector elds for u = 1 and u = ?1. Let s = 0, then x1 + x2 = 0, i.e., x1 + x_1 = 0. Thus x1 converges to 0 asymptotically. Let s_ = 0, then x_1 + x_2 = 0, i.e., x_2 + ueq = 0. The equivalent control for continuous sliding is ueq = ?x2 . 12
We now compute the equivalent control for discrete sliding ukeq = ?(CB )?1CA x(k) Since CA = [ 1 + 1 ] 2
CB = + 2
Hence (because s(x(k) ) = 0). To nd k s kmax , let Thus At tmax = =2,
(k) + ( + 1)x(k) (k) x x 1 2 2 ukeq = ? = ? 2 1 + 2 + 2
ds = C x_ = x + u = x(k) + u t + u = 0 2 keq keq max 2 dt (k) x 2 tmax = ?1 ? u = =2 keq 2
k s kmax=k Cx k= jx1 + x2jt=tk +tmax = jx(2k)j 4 + 2 As %, we have k ukeq k& and k s kmax%. As ! 0, ukeq ! ueq and k s kmax ! 0. Let k s kmax , i.e., 2 jx(2k) j 4 + 2
Solving the quadratic inequality, we have q + 2 + 4jx(2k) j 0 (k)
jx2 j
Let then the maximum time interval is
= (k) jx2 j
p
max = + 2 + 4 1. As % (i.e., larger or smaller jx(2k)j), max %. 2. As & (i.e., smaller or larger jx(2k)j), max %.
Not surprisingly, the result here agrees with the analysis presented in Section 3. 13
7 Simulation Results We have implemented the adaptive algorithm described in Section 5 in Scheme, a dialect of LISP [2]. The simulation was run on an HP-735 workstation. The computational results on two examples are described here. The rst example is the system (2) that we analyzed in Section 6. Its solution was analytically derived there. In the simulation, the system is integrated with the adaptive sliding method starting at (1; ?1). The integrated trajectories for two dierent tolerances are plotted in Figure 5. Figure 6 shows how the tracking error k s k varies over time. For comparison, the results of the xed and adaptive step-size 4th-order Runge-Kutta integrations are also plotted in Figures 7 and 8 respectively. A sample printout of the integration data points is shown here for the adaptive sliding algorithm with tolerance = 0:01, where the state is described by #(t x1 x2 ): #(0 1 -1) (h .1 u_k_eq .95238 e .0011905 new-h .756) #(.1 .90476 -.90476) (h .756 u_k_eq .65658 e .046907 new-h .14505) (h .14505 u_k_eq .84358 e .0022186 new-h .58841) #(.24505 .7824 -.7824) (h .58841 u_k_eq .60454 e .026164 new-h .20241) (h .20241 u_k_eq .71049 e .0036385 new-h .50066) #(.44746 .63859 -.63859) (h .50066 u_k_eq .51074 e .016003 new-h .28157) (h .28157 u_k_eq .55978 e .0055477 new-h .4568) #(.72903 .48097 -.48097) (h .4568 u_k_eq .39154 e .010213 new-h .40256) (h .40256 u_k_eq .40038 e .0081104 new-h .44671) #(1.1316 .31979 -.31979) (h .44671 u_k_eq .26141 e .0065205 new-h .61658) #(1.5783 .20302 -.20302) (h .61658 u_k_eq .15518 e .0073743 new-h .75251) #(2.1949 .10734 -.10734) (h .75251 u_k_eq .077994 e .0055207 new-h 1.2268) #(2.9474 .048648 -.048648) (h 1.2268 u_k_eq .030153 e .0056724 new-h 1.9464) #(4.1742 .011658 -.011658) (h 1.9464 u_k_eq .0059079 e .0027979 new-h 6.2612) #(6.1206 .00015822 -.00015822) ...
14
The adaptive sliding method is free of chattering as shown in Figure 5. The step-size of the adaptive sliding algorithm is much larger than that of the xed step-size RungeKutta method for comparable tracking tolerance requirement; see Figures 5 and 7. The adaptive sliding algorithm takes about 10 steps to converge to the origin with tolerance = 0:01, and the xed step-size Runge-Kutta takes about 500 steps with step-size h = 0:01 to do the same. Figure 8 shows that the adaptive Runge-Kutta compares unfavorably even against the xed step-size Runge-Kutta. The second example we have run simulation on is 8 < :
x_1 = x2 x_2 = ?1:5x22 cos 3x1 + u
with a sliding surface s = 20x1 + x2 = 0. The control is 8
0
u= 1
The integrated trajectories using the adaptive sliding algorithm for three dierent tolerances are plotted in Figure 9. The xed step-size 4th-order Runge-Kutta results are plotted in Figure 10. The adaptive sliding algorithm also performs better than the xed step-size Runge-Kutta for comparable tracking tolerance requirement.
8 Conclusion We have presented an analysis on the relationship between tracking error and sampling rate for sliding mode control systems and an adaptive method for the discrete-time simulation and control of these systems. Our analysis shows that the tracking error decreases as the sampling time interval decreases when the sliding condition exists. An adaptive method have been developed based on the concept of discrete sliding mode; the method adjusts its sampling rate to ensure that the tracking error is bounded within a boundary layer of the sliding surface. To simulate a sliding mode system in discrete time, we present an adaptive integration scheme that follows the ideal system within a given tolerance. Likewise, the adaptive method can be used to generate discrete control signals for sliding mode systems. Simulation results on examples have shown that the adaptive method is free of chattering, and works well against conventional simulation methods such as the Runge-Kutta method. We plan to apply the adaptive method to additional control problems and to the simulation of discrete control planning studied in [7]. 15
References [1] M. W. Hirsh and S. Smale, Dierential Equations, Dynamical Systems and Linear Algebra. Academic Press, NY, 1974. [2] C. Hanson, \MIT Scheme Reference Manual." AI-TR-1281, MIT Arti cial Intelligence Lab, 1991. [3] J. Stoer and R. Bulirsch, Introduction to Numerical Analysis. Springer-Verlag, 1993. [4] V. I. Utkin, Sliding Modes in Control and Optimization. Springer-Verlag, 1992. [5] V. I. Utkin, \Sliding Modes Control in Discrete-Time and Dierence Systems." In Variable Structure and Lyapunov Control, A. S. I. Zinober (ed), Springer-Verlag, 1993. [6] F. Zhao, \Phase Space Navigator: Towards Automating Control Synthesis in Phase Spaces for Nonlinear Control Systems." Proc. 3rd IFAC Int'l Workshop on AI in Real Time Control, Pergamon Press, 1991. [7] F. Zhao, \Intelligent Simulation in Designing Complex Dynamical Control Systems", in Arti cial Intelligence in Industrial Decision Making, Control, and Automation. Tzafestas and Verbruggen (eds.), pp. 127-158, Kluwer, 1995.
16
Figure 5: Adaptive sliding integration for two dierent tolerances = 0:1 and = 0:01 in the rst example. The trajectories shown are free of chattering.
17
Figure 6: Tracking error s of the adaptive method varies over time in the rst example, with tolerances = 0:1 and = 0:01 respectively.
18
Figure 7: Fixed step-size 4th-order Runge-Kutta integration in the rst example, with step-sizes h = 0:1 and h = 0:01 respectively. The trajectories chatter along the sliding surface as the result of nite sampling rate.
19
Figure 8: Adaptive 4th-order Runge-Kutta integration in the rst example, with tolerances = 0:1 and = 0:01 respectively. Notice how trajectories are jumping around as the integrator tries to adjust its step-size.
20
Figure 9: Adaptive sliding integration in the second example, with tolerances = 0:1, 0:01, and 0:001 respectively.
21
Figure 10: Fixed step-size 4th-order Runge-Kutta integration in the second example, with step-size h = 0:01.
22