All Courses
All Courses
Courses by Software
Courses by Semester
Courses by Domain
Tool-focused Courses
Machine learning
POPULAR COURSES
Success Stories
Create a MATLAB model of electric car which uses a battery and a DC motor. Choose suitable blocks from Powertrain block set. Prepare a report about your model including following: Objectives: 1. System level configurations 2. Model parameters …
Jiji M
updated on 01 Oct 2022
Create a MATLAB model of electric car which uses a battery and a DC motor. Choose suitable blocks from Powertrain block set. Prepare a report about your model including following:
Objectives:
1. System level configurations
2. Model parameters
3. Results
4. Conclusion
Answer:
We need to prepare a MATLAB model for an electric car which uses battery and a DC motor. We need to illustrate the electric car in a simple block diagram, where the blocks could be Vehicle body, battery, DC motor, power converter and a drive cycle.
This block diagram shows the main blocks needed to design an electric car. We have drive cycle block which gives a series of data representing the speed of vehicle at different time period under different conditions. Drive controller is to manage the motor drive under different conditions. Power converter is the switching circuit which converts the power to desired form to run the motor using switching technology with the help of semiconductor devices and triggering pulse. DC motor converts electrical energy to mechanical energy inorder to rotate the wheel and control the vehicle body. Battery is connected as power source for electric motor which drives the electric car. Using the above block diagram, we need to create a simulink model for the electric car.
System Level Configuration:
Simulink model:
Here we are using, Drive cycle Souce, Longitudinal Driver block, Subsystem with motor and control system, Subsystem with State of Charge, Subsystem of battery, Subsystem with vehicle body, gear and tire, displays and scopes for showing results.
Connections:
The drive cycle source is connected to the longitudinal driver as Reference velocity and also connected to scope. Feeback velocity of longitudinal driver is connected from vehicle body output. Grade port is connected to 0 gain. Info port is connected to terminator and AccelCmd and DecelCmd ports are connected to the acceleration port and deceleration port in the control system and motor subsystem. The current sensor output is connected to battery subsystem and State of charge and motor or rotor output from DC motor is connected to simple gear. Scopes and displays are connected to visualize different results. There are PS-Simulink converters and Simulink-PS converters used inorder to connect the physical signal and simulink signals.
Model Parameters:
Drive cycle Source:
Drive cycle source generates a standard or user-specified longitudinal drive cycle. The block output is the vehicle longitudinal speed. We can import the drive cycles from:
The fault tracking parameters are used to identify the drive cycle faults within specified speed and time tolerances. The drive cycle source we are using is FTP75 drive cycle. he other drive cycles available are WOT (Wide open Throttle), Workspace variables and mat, xls, xlsx or txt files. The RefSpd port of the block is connected to the VelRef port of the longitudinal driver block.
Longitudinal Driver:
Longitudinal driver block is a parametric longitudinal speed tracking controller for generating normalized acceleration and braking commands based on reference and feedback velocities. We can use external actions to input signals that can disable, hold or override the closed loop commands determined by the block. The priority for input commands are disable-hold-override. The control type here we are using is PI controller. The other types available are scheduled PI and predictive.
The VelRef and VelFdbk ports are reference and feedback velocities. AccelCmd and DecelCmd are acceleration and deceleration commands, connected to acceleration and deceleration ports of the control system. Grade will be connected to constant 0 and info port is connected to terminator. Here we have changed the proportional gain to 150 and integral gain to 100.
Control System and Motor block:
In this block, we have used controlled voltage sources, controlled PWM voltage, current sensor, Solver configuration, H-bridge, DC motor, Electrical and Mechanical references. We are using H-bridge as the power converter.
Controlled PWM voltage:
This block creates a PWM voltage across the PWM and REF ports. When the pulse is low, the output voltage will be zero, and when the pulse is high the output voltage is equal to the ouput voltage amplitude parameter. Duty cycle is set using the input value. If meither the pulse delay time is greater than zero nor duty cycle is set to zero, the pulse is initialized as high at time zero. The Simulation mode can be set to PWM or Averaged. In PWM mode, the output is a PWM signal. In Averaged mode, the output is constant with value equal to the averaged PWM signal. A controlled voltage source with input as acceleration, creates the reference input for the PWM block. The output ports PWM and REF are connected to the PWM and REF ports of the H-bridge.
We have changed the simulation mode to Averaged and Input voltage for 100% duty cycle has been changed to 1V. The output voltage amplitude has been changed to 5V.
H-bridge:
Here we are using H-bridge motor drive as a power converter. This is driven using Controlled PWM voltage block. There are 2 modes, PWM mode and Averaged mode. In PWM mode, motor is powered if the PWM port voltage is above the Enable threshold voltage. In Averaged mode, the PWM port voltage divided by the PWM signal amplitude parameter defines the ratio of the on-time to the PWM period. With the help of this ratio and some assumptions, block applies an average voltage to the load that achieves correct average load current. When REV port voltage > Reverse threshold Voltage, ouput voltage polarity is reversed. If BRK port voltage > Braking threshold voltage ouput terminals will get shortcircuited via one bridge arm in series with parallel combination of second bridge arm and freewheeling diode. Voltages at port REF, REV and BRK are defined with respect to REF port. The controlled PWM block provides the input for PWM port, and controlled voltage source with deceleration input produces input for the BRK port. REF is connected to common electrical reference. REF and REV gets short circuited. Solver configuration block is connected in the model. It defines solver settings to use for simulation.
Here, we have changed the simulation mode to Averaged mode and Load current characteristics to Smoothed condition. We have changed the output voltage amplitude in the bridge parameter to 330 V. All the input thresholds are kept at the same default value.
DC Motor:
A DC motor converts electrical energy into mechanical energy. The DC motor block mainly represents electrical and torque characteristics of a DC motor. Here, the block assumes that there is no energy lost, so back emf and torque constants have same numerical value in SI units. DC motor parameters are specified either directly, or derived from no-load speed and stall torque. If no information is available on armature inductance, this parameter can be set to some small non-zero value. When positive current flows from positive to negative terminal, a positive torque acts from mechanical C to R ports. Motor torque direction can be changed by altering the sign of back-emf or torque constants.
Here, we have changed the model to model parameterization by rated load and speed. The No load speed has been changed to 9000 rpm and rated speed at rated load has been changed to 5000 rpm. Rated load is 50 kW and rated DC supply voltage is 330 V.
Controlled Voltage Source:
This is an ideal voltage source used to maintain specified voltage at the output regardless of the current passing through it. The ouput voltage, V will be equal to Vs, where Vs is the amplitude of signal at the output port.
Current sensor:
Ideal current sensor converts current measured in any electrical branch to physical signal proportional to current. Connections positive and negative are conserving electrical ports through which the sensor is inserted into the circuit. Connection I is a physical signal port that outputs current value.
Solver Configuration:
This block defines the solver settings to use for simulation.
Electrical reference:
Electrical reference port of electrical ground, acts as the ground to which all the negative terminals are grounded.
Mechanical Rotational Reference:
This block of mechanical rotational reference port acts as frame or ground, to which mechanical rotational ports are connected to make sure that they are rigidly affix to frame.
Vehicle Body, Gear and Tire subsystem:
This subsystem includes 4 tires, vehicle body, simple gear, 2 PS constants, and PS terminators. The The N port of rear wheels are connected to the NR port of vehicle body, N port of front wheels are connected to the NF port of vehicle body. H port of all the 4 wheels and vehicle body are connected eachother. Here we have connected the gear to the rear wheel-axis. The A port of both front wheels are connected with each other, and S port of both rear wheels are connected to each other and is connected to the F port of simple gear. All the S ports of wheels are connected to PS terminators or physical signal terminators. w port indicates, wind velocity, where we have connected a PS constant and beta represents road angle inclination, where we have connected another PS constant.
Vehicle Body:
This block represents two-axle vehicle body in longitudinal motion.This type of body can have same or different number of wheels on the same axle. The block accounts for body mass, aerodynamic drag, road incline, and weight distribution between axles due to acceleration and road profile. Here we can optionally include pitch and suspension dynamics or additional variable mass and inertia. The vehicle does not move vertically relative to the ground. Port H is mechanical translational conserving port assiciated with horizontal motion of vehicle body. Ports V, NF and NR are physical signal ports for velocity, front and rear wheel normal forces. Wheel forces are considered positive if acting downwards. W and beta are physical signal input ports for headwind speed and road inclination angle. The vehicle body mainly accounts for body mass, aerodynamic drag, road incline and weight distribution between axles due to acceleration and road profile. If the variable mass is modelled, then there will be 2 more physical signal ports exposed, that are CG and M.
Here we are using the default main attributes for the vehicle body and we have changed the drag attributes. We have changed the frontal area to 1 m² and drag coefficient has been changed to 0.02.
Simple Gear:
Simple gear block represents gearbox or fixed-ratio gear. There no no inertia included. We can optionally include, viscous loss and mesh loss if needed. There are 2 ports, Base(B) and Follower(F). These are mechanical rotational conserving ports. We can specify the relation between B and F directions with output shafr rotation parameter. And we can include thermal effects and expose thermal conserving port, H if needed.
Here we have changed the Follower to base teeth ratio to 3.5 and the output shaft rotation direction has been changed to the same direction as input shaft.
Tire:
Tire represents the logintudinal behaviour of a highway tire, characterized by tire Magic Formula. The block is built from Tire-Road interaction, and Simscape Foundation Library Wheel and Axle blocks. The effects of inertia, stiffness and damping can be included. Port A is mechanical rotational conserving port for wheel axle and H port is for wheel Hub through which the thrust developed by tire is applied to vehicle. Port N is a physical signal port that applies normal force acting on tire. The force is considered positive, if it acts downwards as mentioned in the vehicle body explanation. Port S is a physical signal port that reports tire slip. All the tire characteristics are kept at the default values.
PS constant block:
This block gives physical signal constant. It is used to give constant values for road inclination angle and headwind speed. This constant block accepts both positive and negative values. The output port of this block is physical signal port.
The values for road inclination angle and headwind speed has been changed to 0.
Battery Subsystem:
Battery is connected with a controlled current source. The input to the controlled current source is given from the output of the motor and control system. An electrical reference is connected inorder to ground the system.
Battery:
The block represents battery, where we can select both finite or infinite battery charging capacity. If we select the infinite battery charging capacity, then battery becomes, series internal resistance and a constant voltage source. If we select finite battery charging capacity, then battery becomes series internal resistance plus a charge-dependent voltage source, where the voltage is defined by:
V = Vnom*SOC/(1-beta*(1-SOC)), where Vnom is nominal voltage and SOC is the state of charge.
Coefficient beta is calculated to satisfy a user-defined data point [AH1,V1].
Here, we have changed the nominal voltage to 330V and internal resistance to 2ohm. The battery charging cpacity we have selected is finite type, so battery becomes series internal resistance plus a charge-dependent voltage source. The Ampere-Hour rating has been changed to 80 A-hr. and voltage,V1 when charge is AH1 is chnaged to 280V. Charge AH1 when no-load voltage is V1 is kept the default value of 25 A-hr.
Controlled Current Source:
This block represents the ideal current source that is powerful enough to maintain specific current through it regardless of the voltage across it. Output current, I=Is, Is is the numerical value at physical signal port.
State of Charge (SOC):
For getting the State of Charge is percentage, we have used a rate transition block connected to the gain and a discrete time intergrator. We are reducing the current state of charge from the initial state of charge, i.e 1 and then multiply the same with 100 to get the SOC in percentage. Rate transition block handles the data transfer between different rates and tasks. Discrete time integrator block is for the accumulation of the input signal. The input to the rate transition block is the current output from the motor and control system. For the gain we have considered the Ampere-Hr rating given for the battery, the hr rating is converted to seconds by multiplying with 3600.
Distance calculation:
Integrating the velocity in m/s and divide the value with 1000 to get the distance in km.
Results:
We have updated the simulation time to 2474 secs as in the drive cycle source we have selected. Running the model we got the following results:
From the above graph we can say that the maximum velocity reached is 25m/s, with the given parameters. The current reduces to 0 when the vehicle velocity is zero.
This is the current graph, the maximum value of current reached will be nearly 481.23 A.
The above graph shows the state of charge of the battery. It shows that the state of charge was 100% at the initial stage, then it reduced to 10% or 20% when the time isaround 2100 secs. The state of charge varies with time and velocity, whenever the velocity reaches its maximum value, the state of charge reduces to netaive values.
The maximum distance covered is 22.31 km with the given parameters.
Conclusion:
The simulink model for the EV has been created and the results has been plotted. With the rated load and speed, the vehicle travelled 22.31 km. Velocity and current are directly related to each other and velocity is inversely related with state of charge. The state of charge at 2474 secs will be nearly -61%.
The simulink model file has been attached.
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...
Week 5 Challenge
1. Consider a scenario where an aggressive driver is accelerating very rapidly and braking harshly in a city driving. Is battery better a choice to supply power than UC in this scenario? True False Why? Answer: False. In this scenario, battery is not a better choice in the given driving scenario.The drivers driving…
12 Feb 2024 02:39 PM IST
Week 2 Challenge
1. Compare four different types of fuel cells and state their applications. Answer: The four types of fuel cells are: Polymer Electrolyte Membrane Fuel Cell (PEM) Alkaline Fuel Cell (AFC) Direct Methonol Fuel Cell (DMFC) Solid Oxide Fuel Cell (SOFC) PEM AFC DMFC SOFC Power 0.01 - 250 0.1 - 50 0.001…
01 Feb 2024 12:58 PM IST
Week 4 Session 5
1. Explain the various applications of Power converters in an Electric vehicle. For Example what type of converter will you use for Horn which requires DC and less than 10V. Likewise come up with different applications. Application: Here are some examples of power converter applications in an electric vehicle: DC-DC Converter…
24 Jun 2023 06:28 AM IST
Final Project: Electric Rickshaw modelling
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 cycles show…
23 Jun 2023 06:59 AM IST
Related Courses
Skill-Lync offers industry relevant advanced engineering courses for engineering students by partnering with industry experts.
© 2025 Skill-Lync Inc. All Rights Reserved.