Controller Design For Automotives
Raghvendra Joshi Anup Kotur Atharv Purohith
Student Student Student
Electonics and Communication Dept. Electonics and Communication Dept. Electonics and Communication Dept.
K.L.E Technological University K.L.E Technological University K.L.E Technological University
Hubballi, India Hubballi, India Hubballi, India
01fe20bec146@[Link] 01fe20bec100@[Link] 01fe20bec114@[Link]
Prithviraj S T
Student
Electonics and Communication Dept.
K.L.E Technological University
Hubballi, India
01fe20bec074@[Link]
Abstract—As autonomous vehicles (AVs) become closer to trajectories within a limited time is still a challenge due to
reality, researchers are focused on developing motion control complex and fluctuating dynamic environment elements. In
approaches that ensure both safety and comfort for passengers addition to considering the vehicle’s dynamic properties and
and other road users. Traditional path-following control algo-
rithms often result in overly cautious and uncomfortable driving varying environment elements, it is also important to take into
behaviors, as the AV corrects its states for even slight deviations account the human factors in the design of AV motion control.
from a planned trajectory. To address this, a safety corridor- To this end, this study aims to build a unique path, based
based vehicle motion control approach has been developed, using on the environmental risk elements and the vehicle’s dynamic
a corridor derived from the feedback of actual drivers in a properties, where drivers’ behaviour are considered. Within
driving simulator. The safety corridor enables the AV to have
safe trajectories within it, while a corridor-based PID and Model the corridor, vehicle motion control algorithms are developed
Predictive Control (MPC) achieves a smooth and comfortable to make sure the AVs can provide a smooth and comfortable
trajectory by applying trajectory constraints within the safety movement for the drivers. As a dynamic optimization control
corridor. By investigating human-driven vehicle behavior and algorithm, Model Predictive Control (MPC) is an advanta-
the vehicle’s dynamic capabilities, the safety corridor and motion geous approach for dealing with nonlinear dynamic problems
controller were tested in four typical scenarios and demonstrated
human-like or human-oriented behavior, which is expected to with multiple constraints
be more acceptable to both drivers and other road users. This
II. V EHICLE DYNAMICS
approach provides a promising solution for achieving both safety
and comfort in AVs, ensuring a more natural driving behavior In this section, Using a bicycle model, we will now learn
for users and a safer road environment for all. how to create an automobile model. As seen in figure, a
Index Terms—Vehicle dynamics, Matlab/Simulink, Vehicle ”bicycle” model of the car with two degrees of freedom is
Controller, PID, MPC
taken into consideration. The lateral location of the vehicle
and the yaw angle of the vehicle serve as representations of
I. I NTRODUCTION the two degrees of freedom. The vehicle’s lateral position
Motion planning and trajectory following are essential is determined by measuring from the point O, the vehicle’s
components for automated vehicles (AVs) to navigate safely rotational centre, along the lateral axis of the vehicle. The
on the road. However, existing approaches of AVs control global axis is used to measure the yaw angle of the vehicle.
and execution mainly focus on avoiding obstacles, and may Vx represents the vehicle’s longitudinal velocity at its centre
neglect the comfort and sense of security for the drivers and of gravity.
passengers. This may result in a nervous experience for them
and potentially cause traffic jams and accidents. Therefore, it
is necessary to consider the dynamic properties of the vehicle,
such as stability requirement and tyre/road interaction, and
develop motion planning models that can generate smooth
and achievable trajectories. The motion planning models
are typically based on collision avoidance systems and can
be classified into four categories: graph search-based plans,
sampling-based plans, interpolating curve plans, and numerical Figure 1.1 Vehicle Dynamics
optimization approaches. However, generating collision-free
A. Mathematical Modelling B. State Space Modelling
The influence of road bank angle will be considered later. We use state-space representation which is a mathematical
Ignoring road bank angle for now and applying Newton’s model of a physical system as a set of input, output and
second law for motion along the y axis. The 2 degrees of state variables related by first-order differential equations or
freedom considered difference equations.
1) Lateral postion y This is our final Transfer function. Using this transfer
2) Vehicle yaw angle ψ function we create a simulink model which traces the given
path.
may = Fyf + Fyr
0 1 0 0
Lateral translation motion 2caf If −2carIr
0 − 2cafmvx
+2car
0 −vx − mvx
′′ A=
0
m(y + ψVx ) = Fyf + Fyr 0 0 1
2
−2carIr +2carIr 2
0 − 2caf Ifizvx 0 − 2caf Ifizvx
Moments equation about Z axis
0
Iz ψ ′ = lf Fyf − lr Fyr 2caf
m
B=
0
Here, lf :Distance of front wheel from the center of gravity. 2If
iz
lr :Distance of rear wheel from the center of gravity.
Fyf :Lateral front tyre force. Using the above state space model, we derive the transfer
Fyr :Lateral rear tyre force function of the bicycle model of the vehicle.
These forces are proportional to slip angle.
αf : Slip angle of front wheel. fC f C 2 2
V (s) m s + Imu (Cr la lb + Cr lb − la mu )
αr : Slip angle of rear wheel. = C l2 +C l2 C Cr (la +lb )2 −Cf la +Cr lb
δ(s) C +C
s2 + ( fmu r + f aIu r b )s + f Imu 2 + I
αf = δ − θ( vf ) C f la Cf Cr (la +lb )
R(s) I s+ Imu
= 2 +C l2
Cf la Cf Cr (la +lb )2 −Cf la +Cr lb
here δ is the Steering angle. δ(s) C +C
s2 + ( fmu r + r b
)s + +
Iu Imu2 I
This transfer function is fed to the simulink model which will
α = −θr be controlled by a motion controller
Therefore,the force of front wheel
III. ACTION OF PID CONTROLLER ON THE DYNAMIC
Fyf = 2Cαf (δ − θvf )
CAR MODEL
The force on rear wheel A PID (Proportional-Integral-Derivative) controller is a
widely used feedback control strategy that is known for its
Fyr = 2Cαr (−θvr ) simplicity and effectiveness. It is commonly employed in
Cα is the tyre stiffness. various industries and applications to regulate and stabilize
θv is the tyre velocity angle. system variables.
θf is given by The PID controller calculates a control signal based on three
terms: proportional, integral, and derivative. The proportional
Vy + lf ψ ′
tan(θvf ) = term responds to the current error, which is the difference
Vx between the desired setpoint and the actual measured value.
θr is given by The proportional gain determines the strength of the response
V y − lr ψ ′ and adjusts the control signal proportionally to the error.
tan(θvr ) = The integral term takes into account the accumulated error
Vx
over time. It integrates the error signal to continuously adjust
Using small angle approximations and notation the control output and eliminate steady-state errors. The inte-
gral gain amplifies the effect of the integral term and allows
Vy = y ′
the controller to respond to prolonged errors.
y ′ + lf ψ ′ The derivative term accounts for the rate of change of the
θvf = error. It provides a damping effect by anticipating future error
Vx
trends and counteracting rapid changes in the system. The
y ′ − lr ψ ′ derivative gain controls the sensitivity of the controller to the
θvr = rate of error change.
Vx
The combination of these three terms allows the PID Additionally, we have calculated and recorded the integrated
controller to achieve a balance between responsiveness and square error for this trajectory, providing a quantitative mea-
stability. By tuning the gains, the controller’s behavior can be sure of the deviation between the system response and the
adjusted to meet specific requirements, such as fast response, desired trajectory over time.
minimal overshoot, or robustness to disturbances. Similarly, for the ramp trajectory, the PID controller exhibits
While PID controllers are relatively simple and intuitive, the ability to track a linearly increasing input. As the setpoint
they can effectively control a wide range of systems, gradually increases, the controller adjusts the control signal
from simple temperature regulation to complex industrial to ensure a smooth and accurate response from the system.
processes. However, they are most effective in systems with By evaluating the integrated square error, we can assess the
linear dynamics and well-understood characteristics. In more performance of the controller in terms of minimizing the
complex situations, advanced control techniques like MPC or cumulative error between the system output and the ramp
adaptive control may be necessary trajectory.
The inclusion of the integrated square error for each
trajectory allows us to assess the overall performance of the
PID controller in terms of tracking accuracy and control
effort. By analyzing these metrics, we can fine-tune the PID
gains and optimize the controller’s performance for specific
application requirements.
Figure 3.1: PID controller • Action of PID controller for a sine wave trajectory input
for a run time of 10ms.
A. Flowchart
The below flowchart of a PID controller gives a detailed
information about how a PID controller works. Here, P is the
proportional part, I is the integral part, D is the derivative part.
Figure 3.4:ISE=0.339
Figure 3.2: PID controller system
• Action of PID controller for a ramp trajectory input for
B. PID controller design a run time of 10ms.
The PID co-efficient gains are,
• Proportional gain, Kp=10
• Integral gain, Ki=10
• Derivative gain, Kd=5
• Filter co-efficient=100
.
Figure 3.4:ISE=0.6258
D. Pros and Cons of PID controller
1) Pros:
• Process independent
• Leads to a ’reasonable’ solution when tuned for most
Figure 3.3: PID controller system
situations
C. Responses of PID controller on custom trajectories • Inexpensive: Most of the modern controllers are PID
• Can be tuned without a great amount of experience
In our Simulink implementation, we have utilized a PID
controller to regulate and control various input trajectories, required.
such as a sine wave trajectory and ramp trajectory. 2) Cons:
For the sine wave trajectory, the PID controller effectively • Not optimal for the problems
tracks the sinusoidal input, ensuring that the system output • Can be unstable unless tuned properly
closely follows the desired waveform. By adjusting the pro- • Not dependent on the process
portional, integral, and derivative gains of the controller, we • Hunting (oscillation about an operating point)
can achieve a balance between responsiveness and stability. • Derivative noise amplification
IV. ACTION OF MPC CONTROLLER ON THE DYNAMIC B. MPC Design in Simulink
CAR MODEL MPC co-efficients used in our model,
A. Model Predictive Controller • Sample time=0.1s
A Model Predictive Controller (MPC) is an advanced con- • Predictive horizon=100
trol strategy widely used in various industries and applica- • Control horizon=6
tions. MPC is a model-based control technique that utilizes a
mathematical model of the system being controlled to make
predictions and optimize control actions.
The key idea behind MPC is to predict the future behavior
of the system based on its current state and inputs, and then
use this prediction to calculate the optimal control action that
minimizes a specified cost function. This predictive nature sets
MPC apart from traditional controllers, as it can consider both Figure 4.3 MPC system with the dynamic car model
current and future system states in decision-making.
MPC operates in a receding horizon fashion, meaning that C. Responses of MPC controller on custom trajectories
it solves an optimization problem repeatedly at each time In our Simulink implementation, we have utilized an ad-
step, but only implements the first control action of the vanced Model Predictive Controller (MPC) to control and reg-
optimal sequence. As time progresses, the horizon shifts, and ulate various input trajectories, such as a sine wave trajectory,
the optimization problem is solved again, incorporating new ramp trajectory, and impulse trajectory. The MPC controller
measurements and updating the predictions. stands out for its ability to incorporate a mathematical model
By taking into account constraints on system variables, of the system being controlled and make predictions to opti-
MPC ensures that the control actions remain within safe and mize control actions.
feasible boundaries. This is particularly beneficial in control- For the sine wave trajectory, the MPC controller demon-
ling complex systems with multiple inputs and outputs, where strates its capability to accurately track and follow the si-
interactions and constraints need to be carefully managed. nusoidal input. By leveraging the predictive nature of MPC,
MPC finds applications in various fields, such as process the controller anticipates the future behavior of the system
industries, robotics, automotive systems, energy management, and generates optimal control actions to ensure a close match
and more. Its ability to handle nonlinearities, uncertainties, and between the system response and the desired trajectory. Ad-
constraints, along with its predictive nature, make it a powerful ditionally, we have calculated the integrated square error for
control strategy for tackling challenging control problems. this trajectory, which provides a quantitative measure of the
cumulative discrepancy between the system output and the
desired sine wave trajectory over time.
Similarly, for the ramp trajectory, the MPC controller show-
cases its ability to effectively track a linearly increasing input.
By leveraging the mathematical model of the system, the
controller optimizes the control actions to achieve a smooth
and precise response as the setpoint gradually increases. The
Figure 4.1 Model Predictive Controller integrated square error analysis enables us to assess the
performance of the controller in terms of minimizing the
MPC controller is an optimal control technique which uses accumulated error between the system output and the desired
a model of the plan to make predictions about future out- ramp trajectory;
[Link] is the flowchart which gives the detailed informa- Here are our MPC controller outputs on simulink for including
tion about the controller. a sine wave trajectory and ramp trajectory,
• Action of MPC controller for a sine wave trajectory input
for a run time of 10ms.
Figure 4.2 MPC system for the dynamic car model
Figure 3.4:ISE=0.1322
• Action of MPC controller for a ramp trajectory input for 3) Integral time Squared Error(ITSE)
a run time of 10ms. The square of the mistake is continuously integrated and
then multiplied with time(t).This performance measure
and its variants are frequently used in linear optimal
control and estimation theory. It is created by integrating
the square of the system error over a defined period of
time. Z ∞
IT SE = te2 (t)dt
0
Figure 3.4:ISE=0.2543 4) Integral time Absolute Error(ITAE)
The absolute mistake increased by the passage of
D. Observations made on MPC controller
time is integrated by ITAE. As a result, errors that
• MPC model is inaccurate over short duration of travels occur after a lengthy period of time are weighted
• MPC model can take multiple system control variables significantly more strongly than errors that occur at
as inputs the beginning of the response. Systems tuned using
• MPC model is time incurring over large lengths of ITAE settle substantially more quickly than those tuned
simulation using the other two approaches. This has the drawback
Hence a trade-off must be between accuracy vs speed. of resulting in systems with sluggish initial responses
from ITAE adjustment (necessary to avoid sustained
V. R ESULTS AND D ISCUSSION
oscillation).
A. Performance Indices Z ∞
One or more parameters must be chosen when designing a IT AE = t|e(t)|dt
control system for a physical process in order to provide the 0
optimal performance. Performance Indices, a measurement, We have used the earlier said performance indices to mea-
are applied for this [Link] four formulas that are functions sure the performance and the accuracy of the system. er-
of an error signal are used to provide the standard performance ror=reference trajectory - controlled trajectory
index criterion. The error signal e(t) in a control system is
B. Error Calculations using Simulink
given by
e(t) = r(t) − c(t) Using the above equations, We calculate the errors using
simulink because calculating errors can help in,
where, r(t) is input or reference signal and c(t) is output signal
• Performance Evaluation
The four performance indices in control system are:
• Control System Tuning
1) Integral Square Error(ISE) • Feedback Loop Closure
The square of the mistake is continuously integrated by • Error-Based Control Strategies
ISE. ISE will penalize bigger mistakes more severely • System Diagnosis and Fault Detection
than smaller ones (since the square of a large error • Performance Comparison
will be much bigger). Control systems designed to
reduce ISE have a tendency to swiftly eradicate major
errors, but they can tolerate persistent tiny faults for
an extended length of time. This frequently results
in quick reactions but with noticeable, low amplitude
oscillation.
Z ∞
ISE = e2 (t)dt
0
2) Integral Absolute Error(IAE)
The absolute error is integrated over time by the IAE. It
doesn’t give any of the faults in a system’s answer any
more significance. Though typically with less persistent
oscillation, it tends to yield slower responses than ISE
Figure 5.1 Error Calculations
optimum systems.
Z ∞
IAE = |e(t)|dt
0
C. Performance Indices Calculation VIII. R EFRENCES
1) Error calculation of PID Controller: • Rajesh Rajamani,Vehicle dynamics and control,springer
science and business media,2011
Input ISE IAE ITSE ITAE • Apollo lectures and Seminars on AVs
Sinusoidal 0.339 1.639 16.36 3.339 • Kevin Telse,Lateral dynamics of a linear single track
Pulse 0.5928 1.933 5.928 19.33 vehicle.
Ramp 0.6258 2.472 24.72 6.258 • [Link] .Vehicle Dynamics by
Step 0.08496 0.3125 31.25 0.8496 [Link],Department of Engineering
Hemisphere 0.8443 2.178 8.443 21.78 Design,IIT Madras.
• Mustafa Lotfi,Vehicle Lateral Controlling using opti-
2) Error calculation for MPC Controller:
mized PID Controller(GitHub repository).
Input ISE IAE ITSE ITAE • MathWorks repository for PID and MPC and vehicle
Sinusoidal 0.1322 1.038 10.38 1.322 models.
Pulse 0.8895 1.344 13.44 8.895 • Performance Indices in Control System-
Ramp 0.2543 1.59 15.9 2.543 ISE,IAE,ITSE,ITAE July 21, 2017 by Electricalvoice.
Step 0.09 0.1345 1.325 0.9 • AN INTRODUCTION OF AUTONOMOUS VEHICLES
Hemisphere 0.5502 1.487 14.87 5.502 AND A BRIEF SURVEY” Tirumalapudi Raviteja, Rajay
Vedaraj .I.S.
VI. R ESULT A NALYSIS
MPC is more accurate than the PID control system.
• As the degree of motion(freedom)increases the error in
the PID controller increases while the increase in error
of MPC is reasonable.
• PID is an hard coded controller and hence is difficult to
tune for further [Link] overshoot and the delay
by the contoller cannot be minimized to a large extent.
• In MPC control system as the sample time and the pre-
diction of the controller increases the error is minimized
and the model is self optimized.
PID controller:
• Was accurate for small durations of time t=0 to t=20s and
later the model was inaccurate .
• Was accurate for small scalar gains.
• The controller can optimize only one control parameter
• It is simple yet an effective
model for small scale simulations
MPC controller :
• Was inaccurate for small simulations durations but was
accurate as the training sample increased in size t greater
than or equal to 100s.
• The MPC can optimize a matrix of state variables and
has a inbuilt reference.
• It is a powerful higher grade controller which finds
application in EVs.
VII. C ONCLUSION
MPC controller is more efficient than a PID controller
due to this MPCs are more widely used in autonomous
vehicles and autonomous electronics. However PIDs are also
a very powerful yet simple controller in design of autonomous
vehicles.