Project-1: Modelling an electric Car with Li-ion battery
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.
(Note- The simulink model file should be compulsorily attached)
Sol:
Aim: To develop a matlab model of EV which uses lithium ion battery along with a DC Motor and PID controller.
Also To verify actual velocity must be coincide with a Drive cycle velocity.
Electric vehicle:
It consists of Battery, Motor, Gear, and vehicle body. To run the motor,a battery with power electronic equipment is used.


In this project, we are going to design an electric vehicle. Here, we are using a DC motor along with H bridge to move the vehicle. Also, we are going to consider the drive cycle source. In this drive cycle source, there are various types of drive cycle sources are available. We can use 3 different drive cycles and here it should be observed whether the actual velocity is following the drive cycle or not. The blocks used in this model are
- Vehicle body.
- Tire.
- Gear.
- Motor.
- H-bridge.
- PWM Block.
- Battery.
- Drive cycle source.


Figure 1. Block diagram and MATLAB Model
Here the drive cycles are connected to the longitudinal driver and the acceleration and deceleration is connected to the PWM reference block. The H bridge converter will drive the DC motor. For this motor, the battery is the source.The output of the motor is connected to the gear with a value of 10. The vehicle body block is will gives the actual velocity and in the last block wheels also presented. The SOC block will provides actual AH and maximum AH also. The maximum AH is considered as 50.

Figure 2. Vehicle along with tires.
The above block consists of vehicle body and four tires. Here NR is connected N terminal of the two tires and NF is connected to another two terminals of tires. All H terminals of the tire are connected together and the common point are connected to the vehicle body. The ‘S’ terminals of the each tire are terminated here. The ‘W’(wind velocity) terminal is not considered and also the road angle beta is also not considered.
The vehicle body consists of Main, drag, pitch and variables. The corresponding values are shown below figures. Here the mass m is equal to 1200kg and gravitational force is 9.81 and the remaining parameters are kept default values.

Figure 3. Main Parameters of the vehicle body.

Figure 4. Drag parameters of the vehicle body.

Figure 5. Pitch parameters of the vehicle body.

Figure 6. variables of the vehicle body.
Tyre parameters:
In the tire block parameters block there are 5 parameters
- Main.
- Geometry.
- Dynamics.
- Rolling resistance.
- Advanced.
The corresponding parameters are shown below:

Figure 7. Tyre main parameters of the vehicle.
There are 4 variations in the main parameters
- Peak longitudinal force and corresponding slip.
- Constant magic formula coefficients.
- Load-dependent magic formula coefficients.
- Physical signal magic formula coefficients.
Out of all these parameters, I have considered Peak longitudinal force and corresponding slip.

Figure 8. Tyre Geometry of the vehicle.
The rolling radius can be varied as per the requirement of the torque.

Figure 9. Tyre Dynamics.

Figure 10. Rolling resistance of the tire.

Figure 11. Advanced parameters of the tire.
Simple gear parameters:
The gear parameters here I considered as 10. This is based on the actual velocity and reference velocity variation. To get perfect matching I have taken the teeth ratio as 10.

Figure 12. Simple Gear main parameters.

Figure 13. Meshing losses of the simple gear.

Figure 14. Viscous losses of the simple gear.

Figure 15. DC MOTOR.
In the DC motor, there are two types of field are available
- Permanent magnet.
- Wound.
Here, I have selected a permanent magnet only instead of a wound. Coming to the model parameterization there are different types. The first one is
- By Equivalent circuit parameters.
- By rated load and speed.
- By stalling torque and no-load speed.
Among all these things, I have used rated load and speed. Generally, the voltage for DC motor is 220V. To meet the required power I have chosen as 300V.

Figure 16. Electrical torque parameters.

Figure 17.Mechanical parameters of DC Motor.

Figure 18. Faults tab in Electrical motor.
H Bridge and PWM block:
These blocks are related to power electronics. Here the acceleration port and deceleration ports are connected to dependent voltage sources. The controlled PWM blocks will send PWM signals to the H- bridge. The H-Bridge will give the voltage to the motor. For this H bridge, the voltage is taken from the battery. The PWM frequency here I have considered as 1000Hz and if we increase the PWM frequency the switching losses will increase. Therefore based on the requirement we have to choose the switching frequency. Also, it is observed that the controlled PWM voltage magnitude is 300V. For PWM pulse generation to the power electronics, a voltage of 5V is required. Hence the input scaling block consists of 5V.

Figure 19. H bridge configaration.

Figure 20. Internal view of H-bridge configuration.

Figure 21. PWM Frequency of the H bridge.

Figure 22. Input Scaling of the controlled PWM Voltage.

Figure 23. Output Voltage of the Controlled PWM Voltage.
H bridge: Here in H bridge, I considered the average simulation mode instead of PWM mode. In this mode it will take Ton/T only. Also it is observed that Regenerative braking is enabled. When the drive cycle is in deceleration mode then regenerative braking is obtained.

Figure 24.Simulation Mode and Load assumptions.

Figure 25. Input Thresholds of the H-Bridge.
Battery: Here, the main function of the battery is to give the voltage to the H bridge. In this battery already SOC is mentioned. The value of the internal resistance is considered as 0.1ohm. Coming to the charge value the default value is taken i.e 50hr*A.

Figure 26. Battery of the Electric vehicle.

Figure 27. Battery Parameters
PID CONTROLLER:

Figure 28. PID Controller and addition of transfer functions.

Figure 29. PID Controller Values.
Battery SOC:

Figure 30 Battery SOC.
To get the charge the current is integrated and the value of the 3600 is to get interms of AH. The maximum AH is considered as 50 and the resultant is subtracted with constant block and produces the value of SOC.
Results: FTP75 Drive Cycle:

Figure 31. FTP75 Drive Cycle.

Figure 32. FTP75 CURRENT AND SOC.
UDDS DRIVE CYCLE:

Figure 33. UDDS Drive Cycle.

Figure 34. UDDS DC CURRENT AND SOC.
HWFET:

Figure 35. HWFET Drive Cycle.

Figure 36. HWFET CURRENT AND SOC.
Conclusion:
1. From the above three drive cycles it is observed that the actual velocity is following reference drive cycle velocity.
2. In all the cases SOC is decreasing and finally it reaches 70% only. Here Li-Ion battery is considered as per the question.
3. PID controller is used instead of longitudinal driver control. This PID controller is working perfectly for all the drive cycles.
4.MATLAB FILE is attached as per the instructions.