AMME3500-amme3500代写
时间:2023-04-05
AMME 3500 DESIGN PROJECT 1 ©2022 IEEE
AMME 3500 DESIGN PROJECT 1
CRUISE CONTROL AND LATERAL CONTROL (LANE CHANGING)
Adit Kaushikkumar Shah, SID:480529503
School of Mechnical, Aerospace and Mechatronic Engineering
The University of Syndey
Sydney, Australia
asha0224@uni.sydney.edu.au
Abstract— This report focuses on designing the basic
components of an autonomous car such as cruise control and
lateral control by drawing directly on the knowledge of
linearization, second-order systems and second-order control
systems through numerical simulations performed using
MATLAB via Simulink.
Keywords—Linearisation, Controller Design, Validation,
Lane change, Disturbance, Feedback Gain
1. INTRODUCTION
The need for autonomous cars has increased in the recent
years due to the added comfort and safety. This is achieved by
installing cruise control and lateral control (lane-changing)
systems in the vehicle which help in reducing the fatigue
experienced by the drivers while travelling long distances. A
cruise control system is used to maintain a constant speed
under the effect of external disturbances like wind and grade
of the road by automatically controlling the speed of the
vehicle while the lateral control helps in automatic lane
changes. Hence, helping to improve travel efficacy.
This report emphases on designing the cruise control and
lateral control system for Toyota Camry Hybrid (Ascent)
which is currently in huge demand. It is a smooth front-wheel
drive with a four-cylinder engine, above average fuel
economy and a top speed of 180 kmph. The non-linear
dynamics for each system will be linearized and the controller
will be designed by choosing specific gains. Finally, the
feedback system with the controller will be validated by
running the system via Simulink against disturbances like
slope, additional mass and varying velocities. The relevant
physical properties and dimensions for Toyota Camry are
tabulated below as per the car module from the company [1].
Property Magnitude Unit
Curb weight (Including a 70kg
driver), m
1665 kg
Frontal Cross sectional Area, A 2.6588 m2
Drag Coefficient, CD 0.27 N.A
Wheelbase ( + ) 2.825 mm
Acceleration from 0-100kmph 7.8 s
Density of Air, ρ 1.225 kgm-3
Table 1: Physical Properties and Relevant Dimensions for Toyota
Camry
2. LONGITUDINAL CONTROLLER
2.1 Linearization
The car is considered to be moving along a straight line with
its velocity described by ‘v(t)’ at time ‘t’. Considering the
force demanded by the engine as the control input ‘u’, the non-
linear dynamics for the vehicle are follows:
̇ +
1
2
2 =
A drag coefficient of 0.27 is chosen which is a reasonable
assumption for an average automobile sedan. Considering the
equilibrium conditions for velocity and input force to be
(ve, ue), the system is linearized as follows:
̇ = (, ) =
−
2
With = 0.5, a positive constant.
At equilibrium, ̇ = ( , ) = 0
Hence,
=
2 = 0.5
2 (1)
Linearizing via Taylor Expansion at equilibrium points to
obtain:
(, ) = ( , ) + (
)
,
( − )
+ (
)
,
( − )
̇ = 0 −
2
( − ) +
−
Hence, the Linearized equation is:
̇ + = ()
For, ̇ = ̇ − ( , ), = − = −
Substituting equation (1) and values of ̇, , into
equation (2),
̇ =
1
( + 0.5
2 − ()) (3)
Hence, substituting known values from Table 1,
̇ =
( + .
− . () (4)
Considering the following conditions:
Equilibrium Condition (, )
1. (25kmph, 21.205 N)
2. (50kmph, 84.818 N)
3. (100kmph, 339.274 N)
Initial Condition v (0) = 0 m/s
Table 2 Equilibrium Pairs and Initial Conditions
AMME
3500 DESIGN PROJECT 1 ©2022 IEEE
The data in Table-2 is calculated using Equation (1) and the
car is assumed to start from rest (initial conditions).
The linearised equations obtained at the equilibrium pairs are
as follows:
Equilibrium Pair Linearised Equation
1. (25kmph, 21.205 N) ̇ + . − . =
2. (50kmph, 84.818 N) ̇ + . − . =
3. (100kmph, 339.274 N) ̇ + . − . =
Table 3 Linearized Equilibrium Equations for velocity in (m/s)
The three liner dynamics are simulated to obtain the
trajectories of velocities as follows:
Figure 1 Linearized Plant for a single equilibrium pair
Figure 2 Linearized v(t) trajectories for equilibrium pairs
Note: An additional trajectory for the trivial equilibrium pair
of (0m/s, 0N) has been added in figure 2 to compare with
positive velocities.
Similarities:
As per Figure 2, all the equilibrium velocities follow an
exponential trajectory and reach a stable value/equilibrium as
time goes to infinity. The magnitude of velocity is inversely
proportional to the time taken to reach the steady state which
implies that 100kmph reaches its equilibrium value the fastest
while 25kmph reaches the slowest. All the three trajectories
portray stable behaviour by achieving the respective steady
state values as time and increases.
Differences:
The initial growth/steepness is highest for 100kmph while it
decreases gradually with a decrease in the velocity and the
trajectory becomes flatter. The three trajectories start from an
initial value of zero and do not cross each other over the course
of time and become parallel as time tends to infinity.
The trivial (0m/s, 0N) trajectory is a continuously increasing
straight line which crosses all the three equilibrium
trajectories and goes to infinity as time increases. This is
makes it unstable and a poor choice for the equilibrium
conditions.
2.2 Controller Design and Effectiveness
2.2.1. Controller Design
A PI (Proportional Integral) controller is chosen for the car
which helps in achieving a desired reference speed. The PI
Controller makes use of a feedback loop to measure the errors
by obtaining the difference between the output (v) and the
reference (r). The reference to be a constant which ensures
that the zero in the system does not affect the output as the
transfer function for this controller does not have a zero.
The equilibrium conditions fixed to design the controller are:
( , ) = (50ℎ, 84.818) = (13.89
, 84.818)
The general form of a PI controller to substitute in the
linearised equation is as follows:
() = ( − ) + ∫[() − ()]
0
(5)
Now, substituting the value of ‘u’ from equation 5 into
equation 3 and rearrange to obtain:
̇ − 0.5
2 + ()
= ( − ) + ∫[() − ()]
0
Now, differentiating both sides of the previous equation,
dividing by ‘m’ and rearranging to obtain,
̈ +
+
̇ +
=
(6)
Note: ̇ = 0 ′′ ()′
Comparing equation 6 to the general second order system:
̈() + 2̇() +
2() = (7)
Hence,
=
+
,
=
(8)
In accordance with the specifications of Toyota Camry from
Table-1, it takes 7.8 seconds to accelerate from 0-100 kmph.
As per this stat, the rise time of the car is considered to be in
the range of 6-10s. Using this the KI values for the controller
are chosen follows:
0 < < 10 ⇒ 0 <
1.8
< 10 (9)
Substituting the value of = √
from equation 8,
0 <
1.8
√
< 10 ⇒ (
1.8
10
)
2
< < (
1.8
6
)
2
AMME
3500 DESIGN PROJECT 1 ©2022 IEEE
Using mass of the car from Table 1,
. < < . ()
Thus, = is chosen to design the PI controller
The overshoot for the controller is desired to be less than 5%
which implies the damping coefficient () shall be:
< 5% ⇒
−
√1−2 < 5% ⇒ . < < ()
Substituting value of ′′ from equation 8 into equation 11 and
rearranging,
0.69 <
+
2√
< 1
Using values properties from Table 1 and KI= 140,
. < < . ()
Note: The damping ratio is considered less than 1 to ensure
the system does not become overdamped.
Using equation 12, = is chosen to design the
controller.
Substituting = 140 and = 712 , the linearised model
from equation 6 is as follows:
̈ + . ̇ + . = . ()
With the transfer function,
() =
.
+ . + .
2.2.2. Effectiveness
A. Single Velocity
The controller is attached to the block diagram of the
linearized plant from figure 1 and a feedback loop is added to
make a closed-loop control system as follows:
Figure 3 System Block Diagram
Figure 4 PI Controller Block Diagram
After running the block diagram on Simulink, the trajectory
for the linearized close-loop velocity with a PI controller is
shown in Figure 5. It is evident from the graph that the
controller designed can achieve the desired velocity of
50kmph. The rise time as per the trajectory falls under the
chosen range of 6 – 10 seconds. Other parameters are
calculated as follows:
=
+
2√
= . ⇒ =
−
√1−2 = . %
= √
= 0.29
⇒ =
1.8
= 6.3
Figure 5 Velocity for linear model using PI Controller
As shown in figure 5, the settling time for the response is
around 20 seconds with a rise time of 6.3 seconds and an
overshoot of 2.83% which meet the requirements hence the PI
controller designed is effective. The step time for the reference
is chosen to be zero while the stop time for the simulation is
set at 30 seconds which is slightly higher than the settling time.
This aids in studying the velocity response completely till it
stabilizes.
B. Changes in reference velocity
The numerical simulations performed in this section test the
ability of the controller to achieve the desired speed when the
cruise control speed is changed by the driver due to varying
speed limits on different sections of the roads and while
driving in traffic which involves continuous increase and
decrease in the speeds.
Figure 6 Changing reference speeds to test the controller
As shown in figure 6, the target speed is changed at different
time intervals to simulate real life drive settings for different
roads like highways. As shown in figure 7 below, the car starts
from rest and accelerates to 20kmph then goes from 20 to
50kmph, followed by a deacceleration from 50 to 40kmph
followed by an acceleration from 40 to 70kmph and finally
AMME
3500 DESIGN PROJECT 1 ©2022 IEEE
reaches 100kmph from 70kmph. Each speed change happens
over a 30 second time interval and the motion is studied over
a total time gap of 150s.
It is evident from figure 7 that the desired target speed is
achieved every time regardless the acceleration or the
deacceleration of the car in a time span of 20 seconds which
is the settling time. A positive overshoot is witnessed when
there is a sudden increase in the target speed while a small
undershoot is observed when the velocity of the car is reduced
from 50 to 40kmph. All the overshoots and the undershoot
observed are under 5% (2.83%) and the desired velocity is
achieved before the change occurs implying the proper
functioning and a good performance of the PI controller. A
time span of 30 seconds is chosen to witness the complete
velocity response of the vehicle till the velocity stabilizes and
this provides ample time to the driver to adjust the velocity
accordingly depending upon sudden disturbances which shall
be discussed later in the report.
Figure 7 Velocity output while changing reference speeds
C. Change in Mass of the Car (Additional Passengers)
This section uses numerical simulations to observe the closed
loop dynamics of the linearized velocity using the PI
controller and the thrust produced by the car due to the change
in the vehicle’s mass by addition of extra passengers. The
mass of each additional passenger is considered to be 70kg
[5].
Figure 8 Velocity Output with changing mass of the vehicle
As seen in figure 8, the addition of extra passengers does not
affect the output velocity of the car a lot. The rise time slightly
increases with an increase in the passengers, but the difference
is very low hence cannot be observed with a naked eye. The
settling time tends to decrease a bit with the addition of
passengers. The overshoots are observed to increase slightly
with the increase of mass, but all the overshoots obtained are
well under five percent which show the effectiveness of the
designed PI controller.
Figure 9 Thrust Produced by adding passengers
Figure 9 depicts the thrust force required by the vehicle
when the passengers are increased. It is evident from the
figure that the trust force required by the engine increases
with an increase in the number of passengers. The force
becomes negative after the velocity output is stabilized as
the settling time is reached implying a negative error. The
maximum thrust required as per Figure 9 is 9900 N for three
additional passengers. As per the specifications of Toyota
Camry, the maximum power produced by the engine is
160kW [2]. As per this, the thrust force produced by the
engine at the equilibrium velocity of 50 kmph is:
ℎ() =
= 11.52
(. ) > (. ) ()
As the maximum force required by the engine for additional
passengers (extra mass) is lower than the force produced by
the engine shows the controller operates properly.
2.3 Validation of the PI Controller
2.3.1 Disturbance due to an uphill slope
This section will test the controller designed previously
before real-life validations. The two key challenges to be
tested are:
• The controller designed in the last section is for a
linear model (equation 2) while the actual system is
non-linear.
• There can be disturbances while the car encounters
a transition from float road to a steep slope.
Consider the Free-Body Diagram for the car going uphill in
Figure 10 with all relevant forces acting on the vehicle.
AMME
3500 DESIGN PROJECT 1 ©2022 IEEE
Figure 10 Free Body Diagram of the Car on the slope
Now, the equations of motion are developed considering the
car encounters an uphill slope of 15% grade:
Note: ‘Fd’ represents the drag force in Figure 10 with the
equation:
=
1
2
2 (15)
The steepness of the slope is calculated as follows:
15% ⇒ = 0.15
Hence,
= arctan(0.15) = 0.148 (16)
Writing the k using the free body diagram of the car from
figure 10:
∑ = ̇ = − −
Substituting equation 15 into equation 16 to obtain the
equation of motion:
̇ +
= − ()
Hence,
The new equation of motion is of the form:
̇ +
= + ()
Where the ‘d’ is the disturbance experienced by the non-
linear system as follows:
= = − ()
2.3.2 Closed Loop Dynamics using the PI Controller for
the disturbance
This section explores the closed loop dynamics for the
velocity of the car by substituting the linear PI controller as
a reference to track the non-linear model obtained with
disturbance in equation 18.
Figure 11 Reference Tracking for the non-linear system using
linear controller
Figure 11 represents the block diagram for linear PI
controller being used as the reference for the non-linear
system. Figure 12 represents the non-linear system along
with the added disturbance due to the uphill grade. The
disturbance (d) is added at a step time of 30 seconds which
is a few seconds after the settling time. This implies that the
car achieves the desired velocity before the disturbance
which helps in studying the behavior of the car properly.
Figure 12 Non-Linear System
A. Close loop dynamics for different reference speeds
As shown in Figure 13 below, the close loop dynamics
obtained are almost the same. The velocity is allowed to
settle initially via the controller and then disturbance is
applied after the settling time at 30 seconds. It is evident that
there is a sudden decrease in the velocity of the car as it
comes across an uphill gradient and the velocity stabilizes
after 15-16 seconds showing the controller is working
properly. There is a very little increase in the overshoot at
higher velocities, but it still remains well under 5%. The rise
time decreases as the velocity of the car increases which
shows that at lower velocities around 20kmph, the car might
tend to come back a little when it encounters a slope due to
the higher rise time.
Figure 13 Close-loop dynamics for different reference speeds
along with added disturbance
B. Effect of changing feedback gains on the steady state
error
This section explores the effect of changing the feedback
gains of the controller on the system response characteristics
like the steady state error. The respective gains Kp and Ki
are increase to 2x, 3x and 4x respectively.
Effect of Changing Kp: It is evident from Figure 14 that
increasing Kp increases the steady state error significantly.
For the original value of Kp (712), there is little negative
error initially which stabilizes to zero and sees a big jump at
30 seconds when the car encounters the slope and finally
settles down after 20 seconds. The other error trajectories
AMME
3500 DESIGN PROJECT 1 ©2022 IEEE
for 2x, 3x and 4x Kp follow a similar path, but they do not
dip as much as the original value and stay on the positive
error for their entire course. There is a little rise in the error
value when the disturbance is applied, and the error
minimizes as time increases. To conclude, the error increase
with increasing Kp and it becomes completely positive.
Figure 14 Effect on Steady State error upon varying controller
gains
Effect of changing KI: Changing KI has a completely
opposite effect on the error compared to changing Kp. The
error trajectories follow a similar part for each KI value
where they decrease from a fixed value of 14m/s to a
negative error, then stabilize to zero for a while, rise a little
on the positive side when the car encounters the slope at 30
seconds and finally minimize to zero within the next 10-12
seconds. As KI increases, the steady state errors decrease
significantly and have a larger dip on the negative error side
initially. The time taken by the error to settle after the
disturbance is applied decreases as KI increases and is much
faster to when Kp was changed.
C. Comparison of force required by the engine
Figure 15 compares the force required by the engine with
and without the disturbance.
Figure 15 Force required (u) comparison
Initially, the force required is the same till the 30 second
mark when the car is on a flat road. When the car comes up
against the slope, there is a sudden drop in the velocity due
to the grade’s disturbance seen in figure 13. This reduction
in velocity creates more load on the engine resulting an
increase in the force required by the engine as shown in
figure 15. Finally, the force achieves a higher steady state
value of roughly 2200 N when the velocity of the car settles
at the equilibrium 50kmph chosen while designing the
controller.
3. LATERAL CONTROLLER
3.1 Linearization
This section looks into the lateral (side-to-side) motion of
the vehicle, in particular for automatic lane changes. The
car’s schematic is shown below in figure 16.
Figure 16 Car's schematic for lateral control
Note: Assuming v > 0 is a constant and the control input
is the angle of steering wheel.
Chosen Values: Wheelbase of Toyota Camry: + =
2.825 (Table 1)
Linearizing Assumptions:
• Vehicle moving in x-direction. The lateral position
‘y’ is to be controlled.
• () ≈ 0 = 30ℎ
• Small Angle assumption is valid⇒ ≈ 0, ≈
0, ≈ 0
• = = 1.4125
Appling the above assumptions to the motion of the center
of mass (CoM) is described by the following equations:
̇ = ( + ) = (20)
̇ = ( + ) = ( + ) (21)
̇ =
() =
0
(22)
The algebraic equation between and rotation angle is
given by:
AMME
3500 DESIGN PROJECT 1 ©2022 IEEE
( ) =
+
() ⇒ =
()
Hence,
̇ =
(24)
Now, differentiating equation 21 using product rule to
obtain lateral position dynamics,
̈ = (̇ + ̇) + ̇( + ) (25)
Now, using the linearizing assumptions of small angle and
substituting the values of ‘̇′, ‘’ and ‘̇’ from equations
22 ,23 and 24 respectively into equation 25,
̈ =
̇ +
= ̇ + ()
With,
=
, =
()
Hence, the transfer function for the linearized equation is as
follows.
() = =
(28)
Substituting equation 27 and 28 into equation 26,
2 = + 2 (29)
Hence the transfer function from steering wheel angle to
lateral position is as follows:
() =
=
+
=
(
+
)
()
For 0 = 30ℎ = 8.33 /,
= . , = . ()
Hence,
() =
4.1667 + 24.582
2
(32)
3.2 Controller Design
This section focuses on designing a PD (Proportional
Derivative Controller) for lateral control. A typical PD
controller varies the output in regard to the error and its
derivative. This type of controller is mainly used to reduce
quantities such as rise time and overshoot. Hence, it is
beneficial for lane changing as by reducing the rise time and
overshoot, the lane change will happen quickly.
The general form of a PI controller to substitute in the
linearized equation is as follows:
= ( − ) + (̇ − ̇) (33)
Differentiating equation 33,
̇ = (̇ − ̇) + (̈ − ̈) (34)
Now, substituting equations 33 and 34 into equation 26 to
obtain:
̈ +
+
1 +
̇ +
1 +
=
1 +
(35)
Comparing equation 35 with equation 7 of the general
second order system,
2 =
1 +
(36)
And,
2 =
+
1 +
(37)
Now, assuming the rise to be 6 seconds and the overshoot to
be less than 5% for a damping coefficient > . ,
= 6 =
1.8
, = 0.8 (38)
Combining equations 36, 37 and 38 and substituting values
of ‘A’ and ‘B’.
(
1.8
6
)
2
=
24.582
1 + 4.1667
(39)
2 ∗ 0.8 ∗
1.8
6
=
4.1667 + 24.528
1 + 4.1667
(40)
Solving equations 39 and 40 simultaneously,
= . , = .
= =
.
= .
=
−
√1−2 = . %
Hence, the settling time for the system is 16.37 seconds and
the maximum overshoot is 1.51% which is well under the
desired 5% making sure the lane change happens quickly
and the car does not exceed the boundary width of the lane.
Now, simulating closed loop dynamics for the linearized
system with the PD controller designed:
Figure 17 Linearized Lateral Change system with PD Controller
AMME
3500 DESIGN PROJECT 1 ©2022 IEEE
As shown in figure 17, the PD Controller is connected to the
transfer function for the linearized lateral change plant for a
constant velocity of 30kmph as the transfer function is
dependent on the velocity. The reference is considered to be
3.5 meters which is the Australian standard width for a lane.
3.3 Validations
This section simulates and plots the system dynamics for
lateral control at a variety of speeds to achieve the goal of
smooth and accurate lane change.
3.3.1 Lane change at Positive Velocities
Figure 18 Close loop response for diiferent positive speeds
The lateral response for 40, 60 and 80kmph are shown in
figure 18. It is evident from the figure that there is a very
small overshoot (<1%) for 40 kmph while at higher speeds,
there is negligible overshoot. The rise time and settling
times for lane changing increases with higher speeds going
up to 6 seconds and 17 seconds respectively.
3.3.2 Lane Changing in reverse (Negative Velocities)
Figure 19 Lateral Response while reversing (negative speeds)
The lateral response while the vehicle is going in reverse at
-10 and -20kmph is shown in figure 19. It is evident from
the zoomed in figure that initially, while the car goes into
reverse, the lateral displecement reduces below zero to -
0.19m for -20kmph and -0.17m for -10kmph and then the
lateral position increases to a high overshoot follwed by an
unstable behaviour for both velocities. The undershoot
experienced in the beginning implies that the car goes into
the opposite direction of the steady state response before the
lane change starts.
The unstable behavior of the velocites implies the graph
explodes due to the occurrence of a system zero of the
transfer function which happens when the numerator for the
transfer function goes to zero.
4. DISCUSSIONS AND CONCLUSIONS
This report explores and designs the crusie control and
lateral control system for a Toyota Corolla Hybrid by
designing control systems for both and validating them
against real-life scenarios. The first section involves
linearisng the non-linear model and plotting velocity
trajecotries for 3 sppeds at equilibrium. The results showed
that the rate of achieving equilibrium is inversly related to
the velocity.
A PI controlled was used to simulate the velocity response
for the linearized system. The results obtained showed that
the controller functioned effectively and the desired
velocites were achieved every time the car’s speed was
changed with very low overshoots and low rise times. The
settling times were fairly consistent overall. The velocity
response obtained by changing the car’s mass upon adding
passengers was very consistent with the reference velocites
being achieved. The rise times and overshoots slightly
increased with the mass but reamined under the ranges of 6-
10 seconds and <5% respectively. The cruise control system
achieved the desired speeds when the car was tested against
a 15% slope grade at different speeds. Finally, The feedback
gains of the PI controller were changed to the study the
steady state errors. The results obtained showed that the
errors increased when the proportional gains were increased
and stabilized quickly while the erorrs decreased when the
integral gains were increased with slighlty higher settling
times. The thrust forces obtained with increasing passengers
and while traversing on a slope were lower than the
maximum load provided by the engine indicating
effectivenss.
The second half of the report simulates the lateral control for
the linearized response using transfer function at postive and
negative velocites. The results showed that the lane changed
was achieved succesfully for positve velocites with
negligible overshoots and low rise times while in reverse,
the graph explodes and shows unstable behavior due to the
presense of a zero in the trasfer function. To conclude, the
PI and PD controllers are effective with ‘P’ ensuring stable
erros, ‘I’ and ‘D’ reducing the errros and its rates
respectively.
5. REFERENCES
[1] Toyota Camry Dimensions, Length, Width and Height -
autoX. (2022). Retrieved 3 April 2022, from
https://www.autox.com/new-
cars/toyota/camry/dimensions/
[2] What is the acceleration in The Toyota Camry, Toyota
Camry FAQ | CarTrade. (2022). Retrieved 3 April 2022,
from https://www.cartrade.com/toyota-
cars/camry/faqs/what-is-the-acceleration-in-the-toyota-
camry
[3] Cottingham, D., 2022. Road Widths. [online] Driver
Knowledge Test (DKT) Resources. Available at:
widths/> [Accessed 1 April 2022].