Difference between revisions of "Cruise control"

From FBSwiki
Jump to: navigation, search
(Dynamic model)
(updated <math> to <amsmath>)
 
Line 11: Line 11:
  
 
To develop a mathematical model we start with a force balance for
 
To develop a mathematical model we start with a force balance for
the car body. Let <math>v</math> be the speed of the car,
+
the car body. Let <amsmath>v</amsmath> be the speed of the car,
<math>m</math> the total mass (including passengers),
+
<amsmath>m</amsmath> the total mass (including passengers),
<math>F</math> the force generated by the contact of the wheels
+
<amsmath>F</amsmath> the force generated by the contact of the wheels
with the road, and <math>F_d</math> the disturbance force due to
+
with the road, and <amsmath>F_d</amsmath> the disturbance force due to
 
gravity, friction and aerodynamic drag. The equation of motion of
 
gravity, friction and aerodynamic drag. The equation of motion of
 
the car is simply  
 
the car is simply  
Line 21: Line 21:
 
</amsmath></center>
 
</amsmath></center>
  
The force <math>F</math> is generated by the engine, whose torque
+
The force <amsmath>F</amsmath> is generated by the engine, whose torque
 
is proportional to the rate of fuel injection, which is itself
 
is proportional to the rate of fuel injection, which is itself
 
proportional to a control signal <amsmath>0 \leq u \leq 1</amsmath>
 
proportional to a control signal <amsmath>0 \leq u \leq 1</amsmath>
 
that controls the throttle position. The torque also depends on
 
that controls the throttle position. The torque also depends on
engine speed <math>\omega</math>. A simple representation of the
+
engine speed <amsmath>\omega</amsmath>. A simple representation of the
 
torque at full throttle is given by the torque curve
 
torque at full throttle is given by the torque curve
 
<center><amsmath>
 
<center><amsmath>
Line 32: Line 32:
 
   \label{eq:cruise:torque}
 
   \label{eq:cruise:torque}
 
</amsmath></center>
 
</amsmath></center>
where the maximum torque <math>T_m</math> is obtained at engine
+
where the maximum torque <amsmath>T_m</amsmath> is obtained at engine
speed <math>\omega_m</math>.  Typical parameters are <math>T_m =
+
speed <amsmath>\omega_m</amsmath>.  Typical parameters are <amsmath>T_m =
190</math> Nm, <math>\omega_m</math> = 420 rad/s (about 4000 RPM)
+
190</amsmath> Nm, <amsmath>\omega_m</amsmath> = 420 rad/s (about 4000 RPM)
and <math>\beta = 0.4</math>.
+
and <amsmath>\beta = 0.4</amsmath>.
  
Let <math>n</math> be the gear ratio and <math>r</math> the wheel
+
Let <amsmath>n</amsmath> be the gear ratio and <amsmath>r</amsmath> the wheel
 
radius. The engine speed is related to the velocity through the
 
radius. The engine speed is related to the velocity through the
 
expression
 
expression
Line 48: Line 48:
 
</amsmath></center>
 
</amsmath></center>
 
[[Image:cruise-gearcurves.png|right]]
 
[[Image:cruise-gearcurves.png|right]]
Typical values of <math>\alpha_n</math> for gears 1 through 5 are <math>\alpha_1 = 40</math>, <math>\alpha_2 = 25</math>, <math>\alpha_3 = 16</math>, <math>\alpha_4 = 12</math> and <math>\alpha_5 = 10</math>. The inverse of <math>\alpha_n</math> has a physical interpretation as the effective wheel radius.  The figure to the right shows the torque as a function of vehicle speed. The figure shows that the effect of the gear is to "flatten" the torque curve so that an almost full torque can be obtained almost over the whole speed range.
+
Typical values of <amsmath>\alpha_n</amsmath> for gears 1 through 5 are <amsmath>\alpha_1 = 40</amsmath>, <amsmath>\alpha_2 = 25</amsmath>, <amsmath>\alpha_3 = 16</amsmath>, <amsmath>\alpha_4 = 12</amsmath> and <amsmath>\alpha_5 = 10</amsmath>. The inverse of <amsmath>\alpha_n</amsmath> has a physical interpretation as the effective wheel radius.  The figure to the right shows the torque as a function of vehicle speed. The figure shows that the effect of the gear is to "flatten" the torque curve so that an almost full torque can be obtained almost over the whole speed range.
  
The disturbance force <math>F_d</math> has three major components: <math>F_g</math>, the forces due to gravity; <math>F_r</math>, the forces due to rolling friction; and <math>F_a</math>, the aerodynamic drag.  Letting the slope of the
+
The disturbance force <amsmath>F_d</amsmath> has three major components: <amsmath>F_g</amsmath>, the forces due to gravity; <amsmath>F_r</amsmath>, the forces due to rolling friction; and <amsmath>F_a</amsmath>, the aerodynamic drag.  Letting the slope of the
road be <math>\theta</math>, gravity gives the force <math>F_g = m g \sin\theta</math>, where <amsmath>g = 9.8\,
+
road be <amsmath>\theta</amsmath>, gravity gives the force <amsmath>F_g = m g \sin\theta</amsmath>, where <amsmath>g = 9.8\,
 
\text{m}/\text{s}^2</amsmath> is the gravitational constant.  A simple model of rolling friction is
 
\text{m}/\text{s}^2</amsmath> is the gravitational constant.  A simple model of rolling friction is
 
<center><amsmath>
 
<center><amsmath>
 
   F_r = m g C_r\, \text{sgn}(v),
 
   F_r = m g C_r\, \text{sgn}(v),
 
</amsmath></center>
 
</amsmath></center>
where <math>C_r</math> is the coefficient of rolling friction and sgn(<math>v</math>) is the sign of <math>v</math> or zero if <math>v = 0</math>.  A typical value for the coefficient of rolling friction is <math>C_r = 0.01</math>.  Finally, the aerodynamic drag is proportional to the square of the speed:
+
where <amsmath>C_r</amsmath> is the coefficient of rolling friction and sgn(<amsmath>v</amsmath>) is the sign of <amsmath>v</amsmath> or zero if <amsmath>v = 0</amsmath>.  A typical value for the coefficient of rolling friction is <amsmath>C_r = 0.01</amsmath>.  Finally, the aerodynamic drag is proportional to the square of the speed:
 
<center><amsmath>
 
<center><amsmath>
 
   F_a = \frac{1}{2} \rho C_d A v^2,
 
   F_a = \frac{1}{2} \rho C_d A v^2,
 
</amsmath></center>
 
</amsmath></center>
where <math>\rho</math> is the density of air, <math>C_d</math> is the shape-dependent aerodynamic drag coefficient and
+
where <amsmath>\rho</amsmath> is the density of air, <amsmath>C_d</amsmath> is the shape-dependent aerodynamic drag coefficient and
<math>A</math> is the frontal area of the car.  Typical parameters are <math>\rho = </math> 1.3 k/m<math>{}^3</math>, <math>C_d = 0.32</math> and <math>A =</math> 2.4 m<math>{}^2</math>.
+
<amsmath>A</amsmath> is the frontal area of the car.  Typical parameters are <amsmath>\rho = </amsmath> 1.3 k/m<amsmath>{}^3</amsmath>, <amsmath>C_d = 0.32</amsmath> and <amsmath>A =</amsmath> 2.4 m<amsmath>{}^2</amsmath>.
  
  

Latest revision as of 03:13, 14 October 2014

This page documents the cruise control system that is used as a running example throughout the text. A detailed description of the dynamics of this system are presented in Chapter 3 - Examples. This page contains a description of the system, including the models and commands used to generate some of the plots in the text.

Introduction

Speedsys.jpg

Cruise control is the term used to describe a control system that regulates the speed of an automobile. Cruise control was commercially introduced in 1958 as an option on the Chrysler Imperial. The basic operation of a cruise controller is to sense the speed of the vehicle, compare this speed to a desired reference, and then accelerate or decelerate the car as required. The figure to the right shows a block diagram of this feedback system.

A simple control algorithm for controlling the speed is to use a "proportional plus integral" feedback. In this algorithm, we choose the amount of gas flowing to the engine based on both the error between the current and desired speed, and the integral of that error.
Speedresp.png
The plot on the right shows the results of this feedback for a step change in the desired speed and a variety of different masses for the car (which might result from having a different number of passengers or towing a trailer). Notice that independent of the mass (which varies by a factor of 3), the steady state speed of the vehicle always approaches the desired speed and achieves that speed within approximately 5 seconds. Thus the performance of the system is robust with respect to this uncertainty.

Dynamic model

To develop a mathematical model we start with a force balance for the car body. Let math be the speed of the car, math the total mass (including passengers), math the force generated by the contact of the wheels with the road, and math the disturbance force due to gravity, friction and aerodynamic drag. The equation of motion of the car is simply

math

The force math is generated by the engine, whose torque is proportional to the rate of fuel injection, which is itself proportional to a control signal math that controls the throttle position. The torque also depends on engine speed math. A simple representation of the torque at full throttle is given by the torque curve

math

where the maximum torque math is obtained at engine speed math. Typical parameters are math Nm, math = 420 rad/s (about 4000 RPM) and math.

Let math be the gear ratio and math the wheel radius. The engine speed is related to the velocity through the expression

math

and the driving force can be written as

math
Cruise-gearcurves.png

Typical values of math for gears 1 through 5 are math, math, math, math and math. The inverse of math has a physical interpretation as the effective wheel radius. The figure to the right shows the torque as a function of vehicle speed. The figure shows that the effect of the gear is to "flatten" the torque curve so that an almost full torque can be obtained almost over the whole speed range.

The disturbance force math has three major components: math, the forces due to gravity; math, the forces due to rolling friction; and math, the aerodynamic drag. Letting the slope of the road be math, gravity gives the force math, where math is the gravitational constant. A simple model of rolling friction is

math

where math is the coefficient of rolling friction and sgn(math) is the sign of math or zero if math. A typical value for the coefficient of rolling friction is math. Finally, the aerodynamic drag is proportional to the square of the speed:

math

where math is the density of air, math is the shape-dependent aerodynamic drag coefficient and math is the frontal area of the car. Typical parameters are math 1.3 k/mmath, math and math 2.4 mmath.


SIMULINK model

The file cruise_ctrl.mdl contains a nonlinear model of a cruise controller for a car, depicted below.

Cruise ctrl.png

The model contains all of the dynamics described in Section 3.1.

MATLAB model

An alternative model for the system is a MATLAB model suitable for use with the 'ode45' function. The file {{{2}}} contains a nonlinear model of the car dynamics consistent with the description given in Section 3.1.

MATLAB files

A number of MATLAB files are available that correspond to examples in the printed text. This section contains links to the various files that are available. Note that you will also need some of the MATLAB tools.

Standalone versions of the model:

  • cruise_ctrl.mdl - SIMULINK model for cruise controller in Section 3.1
  • cruisedyn.m - MATLAB function to compute the acceleration given the vehicle state, inputs and parameters

Linearized models (all files required):

Controller designs (require linearized models):

Exercises

The following exercises make use of the cruise control model described here:

Further Reading