Ben Gallup ME237 Semester Project Sliding Mode Control: A Comparison of Sliding Surface Approach Dynamics Contents Project overview 2 The Model 3 Design of the Sliding Mode Controller 3 4 Control Law Forms and Evaluation 4 5 Step Response 7 6 Trajectory Tracking 2 7 Conclusions 3 Project overview Sliding mode control (SMC) is a well-known and powerful tool for robust control of nonlinear systems. Put briey, SMC entails the construction of a surface on which, by denition, the error asymptotically approaches zero (in a 'sliding mode'), paired the formulation of dynamics that guarantee approach to this surface. One shortcoming of this process is that it contains no notion of economy and aims simply for functionality. The principal purpose of this project is to investigate four dierent approaches to the second part of SMC design - the formulation of surface approach dynamics - in the light of optimal behavior. We will use a matched-uncertainty two-state nonlinear model of an automobile engine to apply each of these four approaches to two control scenarios - step response and trajectory tracking - and evaluate their performance both qualitatively and quantitatively. Using one of these four approaches, we will also briey investigate the eects of dierent parameter choices on the rst part of SMC design, the construction of the sliding surface. 2 The Model The model used is taken directly from the Fall 25 ME237 Problem Set 6, Problem. It fundamentally models the principal engine dynamics of a vehicle in constant gear as the following two-state system:
m a = c T C(α) c 2 m a ω e ω e = J [T i T f T d T r ] () The two states are m a, the mass of air in the intake manifold in kg and ω e the rotational speed of the engine in rad/s, and the rest of the terms are: T C(α), throttle characteristic as a function of throttle angle. In the problem set, this is modeled as { cos(.4 α.6 α < 79.46 T C(α) = α 79.46 (2) Note this is a one-to-one function whose output is bounded between and. This project ignores throttle dynamics already, so we can use T C, bounded between and, and ignore its dependence on α to simplify matters. Deriving α from a known T C is clearly straightforward, and does not introduce new behavior. J, eective vehicle inertia seen at the engine, 36.42kg m 2 T i, engine indicated torque in N m, modeled as T i = c 3 m a T f, torque loss due to engine friction in N m, modeled as T f =.56ω e + 5. T d, torque loss due to wind drag in N m, modeled as T d = c 4 ω 2 e T r, torque loss due to rolling resistance at the wheels in N m, modeled as T r = 2.5 The remaining constants are given as c =.6kg/s c 2 =.952 c 3 = 47469N m/kg c 4 =.26N m s 2 Also, we are given that the linear speed in m/s, v, of the vehicle as a function of engine speed is v =.289ω e (3) The given constants are for a vehicle in fourth gear operation assuming there is no slip at the wheel and no exibility in the transmission. The model also assumes perfect fuel injection control. To incorporate model uncertainty, we add an error term ɛ to the m a equation. This is matched error - that is, it is in the same channel as the control input. This can be compensated for with a single sliding surface. Were the error in 2
another channel, or unmatched, a number of more complicated techniques such as multiple sliding surfaces, dynamic surface control, or integrator backstepping can be used. Intuition gained from the inspection of matched error and a single sliding surface will be of use in more complicated techniques, especially that of multiple sliding surfaces. With all terms entered, the nal system is expressed as m a = c T C c 2 m a ω e + ɛ ω e = J [c 3m a.56ω e 5. c 4 ωe 2 2.5] After attempting several trials with various error forms, we chose to use sinusoidal error of the form ɛ = ɛ max sin(w error t). We will use ɛ max =.7 kg/s, which is roughly 25% of the typical steadystate value for c 2 m a ω e. This simulates error in the estimated ow of air to the engine. Sinusoidal error was chosen over gaussian white noise as all controllers handled gaussian white noise with no signicant behavior changes compared to a zero-error situation. 3 Design of the Sliding Mode Controller As previously mentioned, a sliding mode controller has two parts; the sliding surface, and the o-surface dynamics. The rst step to deriving this controller is to decide the expression of error. For this model we will use (4) e = ω e ω d (5) Given the two steps we must now take, we work backwards by postulating that the o-surface dynamics must be of the form Ṡ = f(s) (6) where f(s) is any non-decreasing odd function. That is to say, the change in S, the 'distance' of the current state o of the sliding surface, is always opposite the sign of S. This is the equation that we must use our control to enforce. To do so, Ṡ must be a function of our control input, T C. In order for Ṡ to be a function of T C, it must be a function of the second derivative of our error, or ë, which in turn implies S should only be a function of e and its rst derivative, ė. The simplest such function that guarantees e as t is S = ė + λe = Given that we want e to decay to zero within 5 seconds, and that simple exponential decay to zero occurs in approximately four time constants, the obvious choice for λ is 4 5 3
Consequently, if S is driven to zero, the tracking error, e will also be driven to zero. Combining this with Equation 6 yields ë + λė = f(s) ω e ω d + λω e λω d = f(s) J [c 3m a.56ω e 2c 4 ω e ω e ] = f(s) λω e + λω d + ω d m a = [J ( f(s) λω e + λω d + ω d ) +.56ω e + 2c 4 ω e ω e ] c 2 At this point we insert the equation for m a from Equation 4, but we do not include the error term ɛ, as we are designing our controller at this point and the error is unknown. Doing so and solving for T C produces T C = {c 2 m a ω e + } [J ( f(s) λω e + λω d + ω d ) +.56ω e + 2c 4 ω e ω e ] c c 3 4 Control Law Forms and Evaluation As stated previously, the f(s) in Equation 6 can be any non-decreasing odd function. This includes odd-power polynomials, inverse tangent, hyperbolic tangent, and any satisfactory noncontinuous function, such as sign(s) or sat(s). For this project we will evaluate four control law forms as shown below in Table. The motivation for choosing these control laws are their varying combinations of behavior for both small and large values of S Table : Proposed Control Laws Slope Near S = Ṡ for large S f (S) = K sign(s) K f 2 (S) = K S K K S f 3 (S) = K S 5 small very large f 4 (S) = K atan( S K 2 ) > f 2,< f K For each law we will tune the available parameters to meet a principal design goal. For this project we will consider two tests:. Starting at 4mph, in response to a step change to 6 mph, tune the control law such that the system reaches 59 mph in 5 seconds with no overshoot. 2. Given that tuning, investigate the behavior of a constant acceleration from 4 mph to 6 mph over ve seconds Quantitatively we will evaluate each response four ways:. Integral of the control eort, T C 4 (7)
2. Integral of the absolute value of the derivative of the control eort, T C 3. Fuel consumption 4. Fuel economy Finding the integral of the control eort and its derivative are straightforward. Fuel consumption can be derived from known air consumption - the second term of the m a equation from Equation, c 2 m a ω e is the air leaving the manifold to the engine. Under the perfect fuel injection assumption, the integral of this term multiplied by the target fuel-air ratio β is the fuel consumption. This target ratio is taken from the Fall 25 ME237 Problem Set 6, Problem 2, where β = 4.7. The nal quantative measure, fuel economy, is simply fuel consumption divided by the integral of velocity, given by Equation 3. Qualitatively, we will evaluate the acceleration imposed on the vehicle (and driver). We will do so under the assumption that accelerations exceeding.5g and oscillations exceeding.5g would be percieved as uncomfortable. For comparsion,.5g, acting on a 9kg (2lbs @ g) person would be an added force of 44N (lbs). Further data regarding the sensitivity of human operators to specic magnitudes and frequencies of acceleration would provide a more pertinent motivation but is beyond the scope of this project. Two potentially useful baselines for evaluation are the behavior under bangbang control, which is approximately the minimum time solution, and the steady state fuel consumption and economy. Figure shows the bang-bang control behavior, and serves as an example of graphs to follow. 5
Engine Performance under bang bang control.8.6.4 u dt = 2.6 u dot dt =.88 fc dt =.6kg FE = 4.67mpg 59mph (.7% error).2.2.8.6.4 Linear Acceleration [g] peak =.68g.4.2.6.2 2 4 6 8 2 4 6 8 Figure : System behavior under bang-bang control All performance plots will have these two windows, and a third. In the left window will be traces of the control eort, T C in red, the percent error ω e ω d ω d in blue, and the normalized value of the o-surface distance S in green. A small blue box shows the time to the settling target of 59mph. Also shown are the values of the four evaluation criteria - integral of the control eort, integral of the absolute value of the derivative of the control eort, the fuel consumption in kg, and the fuel economy in mi/gal. In the upper right, for sliding control, will be a plot showing f(s) of Table. In the lower right is a plot of linear acceleration with the peak acceleration noted. For reference, for seconds at a steady-state of 4 mph the fuel consumption is.887 kg and fuel economy is 7.89 mpg. For 6 mph the fuel consumption is.485 kg and fuel economy is.47 mpg. For further reference, a purely linear acceleration from 4 mph to 6 mph over 5 seconds with 5 seconds cruising at 6 mph would consume.337 kg of fuel at.47 mph. These are entirely constructed values of consumption and economy based on a number of assumptions, so they do not necessarily connect to real world values, but serve to evaluate controller designs. 6
5 Step Response This section contains the 4mph-6mphstep responses of each of the four controllers..9.8 = K *sign(s); K = 2; s = e dot +λ*e, λ =.8 59mph (.7% error) 2.7.6.5 u dt = 2.45 u dot dt = 34.7 2 2 2 fc dt =.kg s.4 FE = 4.64mpg.4 Linear Acceleration [g] peak =.356g.3.3.2.2... 2 4 6 8 2 4 6 8 Figure 2: f - Signum control Table 2: Quantitative Observations Controller Controller Type T C dt C dt FC (kg) FE(mpg) f Signum 2.45 34.7. 4.64 f 2 - high gain Linear 2.54.926.4 4.66 f 2 - low gain Linear 2.5 2.93.2 4.67 f 3 - high gain Quintic 2.54.69.4 4.66 f 3 - low gain Quintic 2.52 3.27.3 4.7 f 4 - high gain Arctangent 2.5.43.2 4.65 f 4 - low gain Arctangent 2.48 2.37. 4.65 Table 3: Qualitative Observations 7
= K *s; K = 2; s = e dot +λ*e, λ =.8.9 59mph (.7% error) 4 2.8.7 u dt = 2.54 2.6.5.4.3.2. u dt =.926 dot 4 2 2 fc dt =.4kg s Linear Acceleration [g] peak =.639g FE = 4.66mpg.8.6.4.2.2 2 4 6 8 2 4 6 8 Figure 3: f 2 - linear control, high gain = K *s; K = 2; s = e dot +λ*e, λ =.8.9.8 59mph (.7% error) 4 2.7.6.5 u dt = 2.5 2 u dt = 2.93 dot 4 fc dt =.2kg 2 2 s.4 FE = 4.67mpg.6 Linear Acceleration [g] peak =.452g.3.5.2.4.3..2.. 2 4 6 8 2 4 6 8 Figure 4: f 2 - linear control, low gain 8
.9 = K *s. 5 ; K = ; s = e dot +λ*e, λ =.8 59mph (.7% error) 4 x 6 2.8.7 u dt = 2.54 2.6.5 u dot dt =.69 fc dt =.4kg 4 2 2 s.4 FE = 4.66mpg.8 Linear Acceleration [g] peak =.648g.3.6.2.4.2..2 2 4 6 8 2 4 6 8 Figure 5: f 3 - quintic control, high gain.9.8 = K *s. 5 ; K =.; s = e dot +λ*e, λ =.8 59mph (.7% error) 4 2.7.6.5 u dt = 2.52 2 u dot dt = 3.27 4 fc dt =.3kg 2 2 s.4 FE = 4.7mpg.6 Linear Acceleration [g] peak =.578g.3.5.2.4.3..2.. 2 4 6 8 2 4 6 8 Figure 6: f 3 - quintic control, low gain 9
= K *atan(s/k 2 )*2/pi; K = 4; K 2 =.33333; s = e dot +λ*e, λ =.8.9 59mph (.7% error) 4 2.8.7 u dt = 2.5 2.6.5.4.3.2 u dot dt =.43 4 2 2 fc dt =.2kg s FE = 4.65mpg.6.5.4.3.2 Linear Acceleration [g] peak =.425g... 2 4 6 8 2 4 6 8 Figure 7: f 4 - arctangent control, high gain = K *atan(s/k 2 )*2/pi; K = 3; K 2 = 5; s = e dot +λ*e, λ =.8.9.8 59mph (.7% error) 4 2.7.6.5 u dt = 2.48 u dot dt = 2.37 2 4 2 2 fc dt =.kg s.4 FE = 4.65mpg.4 Linear Acceleration [g] peak =.33g.3.3.2.2... 2 4 6 8 2 4 6 8 Figure 8: f 4 - arctangent control, low gain
Controller Acceleration notes f Dip during initial rise, moderate spike, good low-freq SS behavior f 2 - high gain Huge intial spike, moderately good SS oscillation f 2 - low gain High-Moderate initial spike, poor SS oscillation f 3 - high gain Huge initial spike, moderately poor SS oscillation f 3 - low gain Huge initial spike, very poor SS oscillation f 4 - high gain Moderate initial spike, very good SS oscillation f 4 - low gain Dip during initial rise, very poor SS oscillation Unfortunately the rst and most obvious conclusion is that the quantitative data completely fails to dierentiate between drastically dierent behaviors. The criteria were chosen to highlight dierences in performance, which Table 2 shows they do not. All of the acceleration proles produced have fundamentally similar under this analysis. The only outlier is dt C dt for signum control, which is simply an artifact of high frequency sliding mode chatter. Note that all simulations also have very poor fuel economy, which is not surprising given the sharp or oscillatory nature of most acceleration proles. Consequently, we are left to rely on qualitative observations of these distinctly unique control laws. There are two positive qualities to note - nonexcessive initial acceleration, and low-amplitude steady-state oscillation. Two control laws exhibit both of these qualities - signum control and arctangent control. The most likely explanation for this lies in the common features of both well-behaved control laws - They both vary rapidly near small values of sand saturate to a high value for high values of s. Table 4 shows critiques of the various control laws. Table 4: Controller Critique Controller Acceleration notes f Saturated Ṡ for high S supresses peak, but sharp variation near S = supresses low frequency oscillation, at the expensive of high frequency chatter f 2 - high gain High Ṡ for high S induces peak, but sharp variation near S = supresses oscillation f 2 - low gain Low but unbounded Ṡ for high S partially supresses peak, but slow variation near S = allows oscillation f 3 - high gain High Ṡ for high S induces peak, but slow variation near S = allows oscillation f 3 - low gain High Ṡ for high S induces peak, but slow variation near S = allows oscillation f 4 - high gain Saturated Ṡ for high S supresses peak, but sharp variation near S = supresses oscillation f 4 - low gain Low saturated Ṡ for high S supresses peak but allows dip, and slow variation near S = allows oscillation
.8 = K *s; K = 2; s = e dot +λ*e, λ =.8 u dt = 2.69 75 7 65 Actual and Target Velocities [mph] Actual Target.6 u dot dt =.25 6.4 fc dt =.kg 55 5.2.2.4 FE = 5.75mpg 45 5 5 time [s].2.5. Linear Acceleration [g] peak =.99g.6.5.8.5 5 5 5 5 Figure 9: High Gain Linear Control Tracking Note in Table that the formulation of f 4, the arctangent control, has two parameters: K which governs high-s saturation magnitude, and K 2 which governs near-origin behavior. It is this two-parameter variation that allows the drastic dierence between f 4 high-gain control and f 4 low-gain control. 6 Trajectory Tracking Another reasonable test is to track a desired trajectory, as opposed to a simple test response. Given the uniformly poor nature of most of the control laws, we shall compare only two of the best in terms of minimal steady state oscillation - the high-gain linear control and high-gain arctangent control. While signum control did well under the given criteria, its high-frequency jitter makes it undesirable for reasons of driver comfort. Note that forcing adherence to a desired trajectory should eliminate the unwanted acceleration peaks that plagued the step responses. Notice that the linear control exerts much smaller control eort, and consequently fails to compensate for the error. This results in a noticable oscillation in acceleration. The arctangent control clearly exerts more control eort, and does a much better job of squashing oscillation. This is certainly due to the sharper behavior of arctangent near the origin, as this kind of error is clearly a phenomenon near s =. Also of note are the spikes in the value of S at the beginning and end of the acceleration phase. The forumulation of S includes ė, which in turn includes ω d, which is now nonzero and discontinuous. If the 2
s = K *atan(s/k ); K = 4; K =.33333; s = e +λ*e, λ =.8 dot 2 2 dot 75 7.8 u dt = 2.68 65 Actual and Target Velocities [mph] Actual Target.6.4.2.2.4.6 u dot dt = 2. fc dt =.kg FE = 5.76mpg 6 55 5.5 45 5 5 time [s].2..5 Linear Acceleration [g] peak =.95g.8.5 5 5 5 5 Figure : High Gain Arctangent Control Tracking acceleration were more severe, and the spike of greater magnitude, a control law that does not saturate could be fooled into overexerting itself - yet another reason to favor bounded control laws. 7 Conclusions While the quantitative data was essentially useless, qualitative observations led to insight that can clearly be used productively in future sliding mode control design. In the presence of time-dependent error, it is of vital importance to have a control law that enforces sharp o-surface dynamics for values of S near. Without such sharp action, the system responds lackadaisically to error, and does not eect any change until signicant error has appeared. Also, the ideal control law for this application saturates for higher values of S, and prevents overreaction and peaky response to large departures from the sliding surface. In summary, for this application the ideal control law is continuous, highly sensitive near S =, and saturated for large values of S. The arctangent function lls all of these requirements, and additionally oers two degrees of freedom for application-specic tuning. In any application where non-peaky reaction and error robustness are required, arctangent-based o-surface dynamics are a compelling choice. Sliding mode control also oers other areas for further research into economical, and hopefully optimal control. Multiple sliding surfaces introduce added degrees of complexity, but will give more control over state trajectory shaping. Investigating the eects of changing λin the sliding surface used could be of interest. Additionally, the entire process performed for this project could be ap- 3
plied to sliding surface design - where any odd, non-decreasing function could be used to dene o-surface dynamics, the same family of functions could be used to dene the sliding surface itself. Any of these approaches seem like promising ways to improve on the behavior of systems under sliding mode control. 4