$30.00 $18.00
1 Introduction
This project is an individual project in which you are asked to design a controller for your
Buggy (autonomous) team (go to https://www.springcarnival.org/buggy.shtml, if you would
like to find out more about Buggy).
A control engineer would take the following steps for designing a controller for this system:
1. Examine control model (nonlinear) [already provided to you].
2. Linearize the state space system equations. [P1]
3. Develop a PID controller for the system. [P1]
4. Check the controllability and stabilizability of the system. [P2]
5. Design feedback controller using Pole Placement. [P2]
6. Design optimal controller. [P3]
7. Design stochastic controller. [P4]
This project is designed to get you well acquainted with the controller designing process for
a 4 wheeler vehicle. The project is subdivided into 4 assignments as:
P1 (a) Linearize the state space model.
(b) Design a PID lateral and PID longitudinal controller.
P2 (a) Check the controllability and stabilizability of the linearized system.
(b) Pole placement.
P3 (a) Design an optimal controller for the vehicle.
P4 (a) Design a Kalman Filter to filter disturbances in the states.
(b) Race with other Buggy teams in the class
The deadlines of the 4 subparts will be :
• P1 is due at 5:00 PM on Nov.12th
• P2 is due at 5:00 PM on Nov.19th
• P3 is due at 5:00 PM on Nov.26th
• P4 is due at 5:00 PM on Dec.10th
2
2 Model
Figure 1: Bicycle model[2]
Figure 2: Tire slipangle[2]
Here you will use the bicycle model for the vehicle, which is a popular model in the study
of vehicle dynamics. Shown in Figure 1, the car is modeled as a twowheel vehicle in two
degree of freedom, described in longitudinal and lateral dynamics separately. The model
parameters are defined in Table 1.
2.1 Lateral dynamics
Ignoring road bank angle and applying Newton’s second law of motion along the y axis
may = Fyf cos δf + Fyr
where ay =
d
2
y
dt2
inertial
is the inertial acceleration of the vehicle at the center of geometry
in the direction of the y axis, Fyf and Fyr are the lateral tire forces of the front and rear
3
wheels respectively and δf is the front wheel angle which will be denoted as δ later. Two
terms contribute to ay: the acceleration ¨y which is due to motion along the y axis and the
centripetal acceleration . Hence
ay = ¨y + ψ˙x˙
Combining the two equations, the equation for the lateral translational motion of the vehicle
is obtained as
y¨ = −ψ˙x˙ +
1
m
(Fyf cos δ + Fyr)
Moment balance about the axis yields the equation for the yaw dynamics as
ψI¨
z = lfFyf − lrFyr
The next step is to model the lateral tire forces Fyf and Fyr. Experimental results show
that the lateral tire force of a tire is proportional to the slipangle for small slipangles when
vehicle’s speed is large enough, let’s say when ˙x ≥ 0.5 m/s. The slip angle of a tire is defined
as the angle between the orientation of the tire and the orientation of the velocity vector of
the vehicle. the slip angle of the front and rear wheel is
αf = δ − θV f
αr = −θV r
where θV p is the angle between the velocity vector and the longitudinal axis of the vehicle,
for p ∈ {f, r}. A linear approximation of the tire forces are given by
Fyf = 2Cα
δ −
y˙ + lfψ˙
x˙
!
Fyr = 2Cα
−
y˙ − lrψ˙
x˙
!
where Cα is called the cornering stiffness of tires. If ˙x < 0.5 m/s, we just set Fyf and Fyr
both to zeros.
2.2 Longitudinal dynamics
Similarly, a force balance along the vehicle longitudinal axis yields
x¨ = ψ˙y˙ + ax
max = F − sign( ˙x)Ff
Ff = fmg
where F is the total tire force along x axis, Ff is the force due to rolling resistance at the
tires, and f is the friction coefficient. sign function returns +1 when ˙x ≥ 1 otherwise 1.
4
2.3 Global coordinates
In the global frame we have
X˙ = ˙x cos ψ − y˙ sin ψ
Y˙ = ˙x sin ψ + ˙y cos ψ
2.4 System equation
Gathering all the equations, if ˙x ≥ 0.5 m/s we have:
y¨ = −ψ˙x˙ +
2Cα
m
(cos δ
δ −
y˙ + lfψ˙
x˙
!
−
y˙ − lrψ˙
x˙
)
x¨ = ψ˙y˙ +
1
m
(F − fmg)
ψ¨ =
2lfCα
Iz
δ −
y˙ + lfψ˙
x˙
!
−
2lrCα
Iz
−
y˙ − lrψ˙
x˙
!
X˙ = ˙x cos ψ − y˙ sin ψ
Y˙ = ˙x sin ψ + ˙y cos ψ
otherwise since the lateral tire forces are zeros we only consider the longitudinal model.
2.5 Measurements
The observable states are with some Gaussian noise = N(0, σ), where
y =
x˙
y˙
ψ˙
X
Y
ψ
+ , σ =
0.5 · · · 0
0.5
0.05
.
.
. 0.05
1
0 0.5
.
2.6 Physical constraints
The system satisfies the constraints that:
δ 6
π
6
rad/s

˙δ 6
π
6
rad/s
F 6 10000 N
0 m/s 6 x˙ 6 100 m/s
y˙ 6 10m/s
5
Table 1: Model parameters.
Name Description Unit Value
( ˙x, y˙) Vehicle’s velocity along the direction of
vehicle frame
m/s State
(X, Y ) Vehicle’s coordinates in the world
frame
m State
ψ, ψ˙ Body yaw angle, angular speed rad State
δ or δf Front wheel angle rad State
˙δ Steering Rate rad Input
F Total input force N Input
m Vehicle mass kg 1000
lr Length from front tire to the center of
mass
m 1.7
lf Length from front tire to the center of
mass
m 1.1
Cα Cornering stiffness of each tire N 15000
Iz Yaw intertia kg mˆ2 3344
Fpq Tire force, p ∈ {x, y},q ∈ {f, r} N Depend on input force
m vehicle mass Kg 2000
f Friction coefficient 1 0.01
3 Resources
3.1 Buggy Simulator
A Buggy Simulator designed in python has been provided along with the assignment. The
simulator takes the control command [steering, longitudinal Force] and then generates the
buggy state after the given fixed time step (fixed fps) as output. Additional script util.py
contains functions to help you design and execute the controller. Please design your controller
in controller.py. After the complete run, a response plot is generated by the simulator.
This plot contains visualization of the buggy trajectory and variation of states with respect
to time.
3.2 Trajectory Data
The trajectory is given in buggyTrace.csv. It contains the coordinates of the trajectory:
(x, y). The satellite map of the track is shown in Figure 3.
6
Figure 3: Buggy track[3]
4 P1:Problems [Due 5:00 PM, November 12]
Exercise 1. Model Linearization
As mentioned in class, model linearization is always the first step for nonlinear control.
During this assignment, you will approximate the given model with a linear model.
Since the longitudinal term ˙x is nonlinear in the lateral dynamics, we can simplify the controller by controlling the lateral and longitudinal states separately. You are required to write
the system dynamics in linear forms as ˙s1 = A1s1 + B1u and ˙s2 = A2s2 + B2u in terms of
the following given input and states:
u =
δ
F
, s1 =
y
y˙
ψ
ψ˙
, s2 =
x
x˙
7
Exercise 2. Introduction to the Simulator. The Buggy Simulator has been implemented
as a python code in the BuggySimulator.py, takes the steering, brake and longitudinal force
as input.
For this question, you have to design a PID longitudinal controller and a PID lateral controller for the vehicle. PID is an error based controller, that requires tuning of the proportional, derivative and integral gains.
Design the controllers in controller.py.
[You have to edit only the controller.py python script]
Execute the main.py python script to check your controller. It generates a performance plot
and saves the vehicle states in a .npz file. Submit the Buggystates and the response plot
with the code.
Your controller is required to achieve the following performance criteria:
1. Time to complete the loop = 450 s
2. Maximum deviation from the reference trajectory = 8.0 m
3. Average deviation from the reference trajectory = 4.5 m
8
5 Reference
1. Rajamani Rajesh. Vehicle dynamics and control. Springer Science & Business Media,
2011.
2. Kong Jason, et al. ”Kinematic and dynamic vehicle models for autonomous driving
control design.” Intelligent Vehicles Symposium, 2015.
3. cmubuggy.org, https://cmubuggy.org/reference/File:Course_hill1.png
9
WhatsApp us