All Courses
All Courses
Objective:- Create a MATLAB model of electric car which uses lithium ion battery and suitable motor. Choose suitable blocks from Simscape or Powertrain block set. Implement the vehicle speed control using PI controller and generate brake and accelerator commands. Avoid using readymade driver block for speed control. Prepare…
Abhishek kumar singh
updated on 27 Apr 2022
Objective:- Create a MATLAB model of electric car which uses lithium ion battery and suitable motor. Choose suitable blocks from Simscape or Powertrain block set. Implement the vehicle speed control using PI controller and generate brake and accelerator commands. Avoid using readymade driver block for speed control.
Prepare a report about your model including following:
Objectives, System level configurations, Model parameters, Results, Conclusion.
Model view:-
Introduction:-
For this model we have used PID controller which is directly taken from the library and tuned it as per the vehicle requirement or can make manual PID. I have made both the things but the value of P,I and D is the same as per the tuned value.
Driver block:-
Driver block subsystem:-
In this driver block system we used PID controller for tuning the reference velocity and running velocity.
Manual PID controller:-
In this model i have made the PID controller by constant, integrator and derivative blocks. But the values which i have taken by PID controller block after tuning. To check that my manual made PID controller ork same or not.
PID Controller:-
The PID Controller block implements a PID controller (PID, PI, PD, P only, or I only). The block is identical to the Discrete PID controller block with the Time domain parameter set to Continuous-time
.
The block output is a weighted sum of the input signal, the integral of the input signal, and the derivative of the input signal. The weights are the proportional, integral, and derivative gain parameters. A first-order pole filters the derivative action.
The block supports several controller types and structures. Configurable options in the block include:
Controller type (PID, PI, PD, P only, or I only) — See the Controller parameter.
Controller form (Parallel or Ideal) — See the Form parameter.
Time domain (continuous or discrete) — See the Time domain parameter.
Initial conditions and reset trigger — See the Source and External reset parameters.
Output saturation limits and built-in anti-windup mechanism — See the Limit output parameter.
Signal tracking for bumpless control transfer and multiloop control — See the Enable tracking mode parameter.
Electrical Circuit subsystem:-
Controlled PWM Voltage:-
Electrical input ports — The block calculates the duty cycle based on the reference voltage across its ref+ and ref- ports. This modeling variant is the default.
PS input — Specify the duty cycle value directly by using an input physical signal port.
Next i have used a controlled PWM voltage to provide a controlled pulse width modulated voltage to the H-bridge block. The pulse of voltage created by this block are dependent on the duty cycle which is in that ratio of the time that the switch is ON to the time taken for one cycle. The duty cycle formula is given by
Duty cycle:- Ton/(Ton+Toff)
Ton/Tcyc, Where Tcyc= time taken for one cycle
For the Electrical input ports variant of the block, the demanded duty cycle is
100∗Vref−VminVmax−Vmin percent
where:
Vref is the reference voltage across the ref+ and ref- ports.
Vmin is the minimum reference voltage.
Vmax is the maximum reference voltage.
The value of the Output voltage amplitude parameter determines amplitude of the output voltage.
At time zero, the pulse is initialized as high, unless the Pulse delay time parameter is greater than zero, or the demanded duty cycle is zero.
H-Bridge:-
The H-Bridge block represents an H-bridge motor driver. The block has the following two Simulation mode options:
PWM- The H-Bridge block output is a controlled voltage that depends on the input signal at the PWM port. If the input signal has a value greater than the Enable threshold voltage parameter value, the H-Bridge block output is on and has a value equal to the value of the Output voltage amplitude parameter. If it has a value less than the Enable threshold voltage parameter value, the block maintains the load circuit using one of the following three Freewheeling mode options:
if the PWM frequency is large enough. Synchronous operation where freewheeling is via a bridge arm back to the supply also helps smooth the current. For cases where the current is not smooth, or possibly discontinuous (that is, it goes to zero between PWM cycles), use the Unsmoothed or discontinuous
option. For this option, you must also provide values for the Total load series resistance, Total load series inductance, and PWM frequency. During simulation, the block uses these values to calculate a more accurate value for H-bridge output voltage that achieves the same average current as would be present if simulating in PWM mode.
DC motor:-
The DC Motor block represents the electrical and torque characteristics of a DC motor using the following equivalent circuit model:
You specify the equivalent circuit parameters for this model when you set the Model parameterization parameter to By equivalent circuit parameters
. The resistor R corresponds to the resistance you specify in the Armature resistance parameter. The inductor L corresponds to the inductance you specify in the Armature inductance parameter.
You can specify how to generate the magnetic field of the DC motor by setting the Field type parameter to the desired option. The permanent magnets in the motor induce the following back emf vb in the armature:
where kv is the Back-emf constant and ω is the angular velocity. The motor produces the following torque, which is proportional to the motor current i:
where kt is the Torque constant. The DC Motor block assumes that there are no electromagnetic losses. This means that mechanical power is equal to the electrical power dissipated by the back emf in the armature. Equating these two terms gives:
As a result, you specify either kv or kt in the block parameters.
If the magnetic field is generated from the current flowing through the windings, the Back-emf constant depends on the field current If:
where Laf is the Field-armature mutual inductance.
The torque-speed characteristic for the DC Motor block is related to the parameters in the preceding figure. When you set the Model parameterization parameter to By stall torque & no-load speed
or By rated power, rated speed & no-load speed
, the block solves for the equivalent circuit parameters as follows:
For the steady-state torque-speed relationship, L has no effect.
Sum the voltages around the loop and rearrange for i:
Vehicle Body:-
Subsystem of the Vehicle body and wheel:-
The above block is forming a subsystem which serves as a part of the whole vehicle. Four tires are connected where the right two tires are the rear wheels and left two tire are the front wheels. They are interconnected to the hub of the vehicle body block. And their respective axles are connected accordingly. We here have connected the rear axle with the gear as we want the model to be a rear wheel drive vehicle. Here the wind velocity part and hill climbing angle ports are connected to physical constant blocks which is kept as zero.
Vehicle body:-
The Vehicle Body block represents a two-axle vehicle body in longitudinal motion. The vehicle can have the same or a different number of wheels on each axle. For example, two wheels on the front axle and one wheel on the rear axle. The vehicle wheels are assumed identical in size. The vehicle can also have a center of gravity (CG) that is at or below the plane of travel.
The block accounts for body mass, aerodynamic drag, road incline, and weight distribution between axles due to acceleration and road profile. Optionally include pitch and suspension dynamics. The vehicle does not move vertically relative to the ground.
The block has an option to include an externally-defined mass and an externally-defined inertia. The mass, inertia, and center of gravity of the vehicle body can vary over the course of simulation in response to system changes.
Tire(Magic formula):-
The Tire (Magic Formula) block models a tire with longitudinal behavior given by the Magic Formula an empirical equation based on four fitting coefficients. The block can model tire dynamics under constant or variable pavement conditions.
The longitudinal direction of the tire is the same as its direction of motion as it rolls on pavement. This block is a structural component based on the Tire road interaction(Magic formula) block.
To increase the fidelity of the tire model, you can specify properties such as tire compliance, inertia, and rolling resistance. However, these properties increase the complexity of the tire model and can slow down simulation. Consider ignoring tire compliance and inertia if simulating the model in real time or if preparing the model for hardware-in-the-loop (HIL) simulation.
Simple gear:-
This block models a gear system with fixed gear ratio with no intertia effects. However we can modify the messing of the gear teeth, Here the follower to base teeth ratio has been set to 2 and the output shaft rotates in the same direction as the input shaft.
These blocks are forming a subsystem which serves as a part of the whole vehicle. Four tires are connected where the right two tires are front wheel and the left two tires are rear wheel. They are interconnected with the vehicle by the Hub port and the axle are also connected accordingly. Here we have connected the rear axle with the gear as we want the model to be a rear wheel drive vehicle.
Battery system:-
The battery will be the energy store of the EV and will contain the electrical energy in DC form and provide this energy to operate.
Result (1):- Model is as per PID controller block.
Here we have our first graph of reference voltage and feedback voltage. So our running velocity is following the reference velocity.
Battery parameters:-
Here we have the battery parameters output for the driving cycle at where our SOC become 93% during the whole cycle. Battery current varies as per the driving of the vehicle same as for battery voltage.
Distance covered:- During this driving cycle for 2474 sec it covers the 18.28Km of distance with maintaing 93% of SOC.
Model link:- https://drive.google.com/file/d/1azNsp5KX_Zr8RI9rmzf_nnZNk4PfC7Dh/view?usp=sharing
Result (2):- Model is as per manual made PID controller.
Here we have our first graph of reference voltage and feedback voltage. So our running velocity is following the reference velocity.
Battery parameters:-
Here we have the battery parameters output for the driving cycle at where our SOC become 93% during the whole cycle. Battery current varies as per the driving of the vehicle same as for battery voltage.
Distance covered:- During this driving cycle for 2474 sec it covers the 18.28Km of distance with maintaing 93% of SOC.
Model link:- https://drive.google.com/file/d/1-GhbX4sJAcDA0xRcPcyzGpg6thN8U54b/view?usp=sharing
Conclusion:-
1)- We have made the model by PID controller by two techniques where the first one is by taking direct PID controller and the second one where we had made the manual pID controoler where we can feed the manual data of the same.
2)- By making this graph i have used the same P,I and D value which i have gotten through the tuning of the PID. So by this method by manual PID will also check that working properly or not.
3)- By both method our distance covered 18.28Km.
4)- In both the cases SOC value is 93% which is ok as per the driving cycle.
Leave a comment
Thanks for choosing to leave a comment. Please keep in mind that all the comments are moderated as per our comment policy, and your email will not be published for privacy reasons. Please leave a personal & meaningful conversation.
Other comments...
Project 2 Adaptive Cruise Control
Objective of Main Project: Developing Adaptive Cruise Control feature as per the Requirement Document using MATLAB Simulink. Follow all the MBD related processes: Requirement Tagging & Traceability, SLDD creation, Configuration Parameter changes, Model Advisor check & Code Generation. In Configuration Parameters:…
16 May 2022 03:12 PM IST
Project 1 (Mini Project on Vehicle Direction Detection
Objective of Mini Project:- Development of MATLAB Simulink model as per requirement. Tag the requirements to the simulink model; tagging requirement 1 & requirement 2 to their corresponding subsystems is fine. MBD compliant changes, Data Dictionary creation & code generation is added advantage, and that is not…
16 May 2022 12:48 PM IST
Project-1: Modelling an electric Car with Li-ion battery
Objective:- Create a MATLAB model of electric car which uses lithium ion battery and suitable motor. Choose suitable blocks from Simscape or Powertrain block set. Implement the vehicle speed control using PI controller and generate brake and accelerator commands. Avoid using readymade driver block for speed control. Prepare…
27 Apr 2022 08:08 AM IST
Final Project: Electric Rickshaw modelling
Objective:- Create a detailed MATLAB model of an electric rickshaw (three wheel passenger vehicle) as per details below: Rear wheels driven by PM brushed type motor Assume efficiency points of motor controller and motor Make an excel sheet of all input and assumed data Results: For any three standard driving…
21 Apr 2022 07:13 AM IST
Related Courses