Professional Documents
Culture Documents
Maths
Maths
Objectives
General objective
To simulate and visualize speed control of an automobile for range and battery life optimization.
Specific objectives.
The Electric Vehicle Simulator described here provides a detailed analysis of important vehicle
parameters including battery capacity, motor power, drive train and body weight. The simulator file
is divided into three main parts:
The reference speed generator consists of two main Simulink blocks and is responsible for providing a
manufactured reference speed for relative comparisons. The second section consists of the motor and
motor controller which drives the motor speed and power based on the interpreted output from a
pulse-width modulation (PWM) controller. The last section is responsible for simulating the vehicle’s
gearbox and gearbox ratio, wheel configuration parameters along with the weight, drag, and other
properties of the vehicle body [1]. Figure 1 shows the six main blocks of the functional block
diagram, which demonstrate the sequence and specific functions used.
Simulink Code Analysis
This section describes the code and design process along with specific descriptions on each block’s
characteristics and its main purpose. Figure 2 demonstrates the application of the drive source and
driver controller. In this section of Simulink code, a multiport switch is used to determine the input
reference speed in kilometers per hour. With the reference speed source chosen, it is connected to the
Longitudinal Driver Generator (LDG). The LDG is responsible for determining the acceleration and
braking from the reference speed source. The LDG output is a variable value from zero to one which
is subsequently inputted to the Motor Controller Subsystem (MCS).
Fig. 2. Driver Generator Code
The MCS section of code is the most complex. This subsystem interprets the acceleration and braking
signals of the LDG and converts those source signals into an electrical reference through two
controlled voltage sources. This signal acts as multiple inputs for the PWM controller to output a PWM
signal for the H-Bridge, thus controlling the motor’s functions. Control Subsystem Part I (Figure 3)
represents the Simulink code input to the PWM controller. The output signals to the right of the PWM
controller are connected to the left side reference lines of Figure 4.
Fig. 3. Control Subsystem Part I.
Control Subsystem Part II (Figure 4) represents the flow of signal from the PWM controller of Figure
3 into the PWM reference inputs of the H-Bridge. The H-Bridge is powered by an external DC
battery whose voltage and capacity are determined by the individual car simulation. This H-Bridge
then controls the DC motor’s speed and polarity to match the input references as closely as possible.
Lastly, a current sensor is connected in series to the positive terminal of the battery. By measuring the
rate of current of the battery and adding a gain in series, integrating with respect to time, then
subtracting that value by 1, the overall battery capacity throughout the drive cycle can be viewed by
adding a value to the overall output.
Fig. 4. Control Subsystem Part II.
Figure 5 consists of the vehicle body subsystem. This section is responsible for generating a physical
representation of a vehicle by simulating a gearbox, tire configuration, and the vehicle body. The
gearbox connects the driveline with a user defined fixed ratio and outputs the angular velocity as
a function of this ratio. The tires are represented using their corresponding Magic Formula
Coefficients where rolling radius and rolling resistances can be determined by the vehicle [6]. The
vehicle body interprets the normal force due to the tires in a two-axle configuration and simulating
rotational movement depending on the drive train configuration. The diagram represents the wheels in a
rear-wheel-drive configuration.
Fig. 5. Vehicle Body Subsystem.
B. Parameter Implementation
This section’s information emphasizes the chosen variables and characteristics of our simulation’s
customizability. Vehicle Simulation Parameters (Table I) groups the various characteristics of each car
and provides a reference for the block parameters. To implement these custom parameters, we start with
the motor control subsystem’s right side as shown in Figure 4. The DC battery is the first Simulink
block that needs user input. The two most important characteristics from the car are the battery voltage
and capacity. The battery voltage also determines the output voltage of the H-Bridge to the motor [6].
Results
Observation.
The battery life reduces with time as the speed of the vehicle increases.
There are some spikes in the current
Explanation.
The spikes in the battery current is as a result of regenerative braking which produces power to recharge
the battery again.
Observation.
The input signal from the driving cycle fluctuates up and down
The output velocity from the electric car fluctuates following the input signal
Conclusion
In conclusion therefore, from the observations of the graphs above, our electric vehicle car model is
correct.
Relationship between battery life and output velocity of the electric vehicle.
The output current data from the battery was transferred to the workspace window by using the To
Workspace window in Simulink.
The output velocity data from the battery was transferred to the workspace window by using the To
Workspace window in Simulink.
A graph of battery current against velocity of the vehicle was plotted by using the plot command in the
command window.
To control the speed of an automobile to ensure long range and battery life.
Procedure
Ɵ (s ) K Kf K Kf
= = 17
)( )
V f (s ) R f Bs ( 1+ s τ m ) ( 1+ s τ f )
(
R f Bs 1+ s
J
B
L
1+ s f
Rf
Where
J
τ m= mechanical time constant
B
Lf
τ f= time constant for field current
Rf
The above equation was modelled in Simulink to come up with a motor model which accepts velocity
and outputs speed.
Speed sensor.
The speed sensor gets speed from the car model and sends this to the controller. The speed sensor was
modelled in Simulink as shown in the blocks.
The controller.
We used an MPC controller from the Simulink library. This controller allows a number of input signals
like the motor speed and sensor speed and outputs a difference of the two speeds.
This car model was built in Simulink as shown in the diagram below.
The model takes an input from the motor sensor and produces a corresponding acceleration.
The produced acceleration is converted into velocity by using the integrator block.
The produced velocity is again integrated using the integrator block to get the position output.
The position output from the car model is then taken to the 3D visualization block.
To visualize speed control of an automobile.
This was done using the automated driving tool box found in the Simulink library.
From this library, we picked the simulation 3D visualization block
This block was then connected to the position output from the autonomous vehicle model.
From the automated tool box, a simulation 3D scene scenario block was added to the Simulink
model to bring in the animations and scenes.
Results