The Design Problem
An EV (say Tesla Model 3) has a Vehicle Mass of 1611 kg, wheel radii of 0.35 m, a fixed gear
ratio of 9.734:1 and a front area of 2.16 m 2 . This EV is driven by a PMSM with the following
parameters: pole number 𝑃𝑃 = 8, 𝐿𝐿𝑑𝑑 = 0.42 𝑚𝑚𝑚𝑚, 𝐿𝐿𝑞𝑞 = 0.52 𝑚𝑚𝑚𝑚, 𝑅𝑅𝑝𝑝ℎ = 0.028 𝑜𝑜ℎ𝑚𝑚, and
𝜆𝜆 𝑚𝑚 = 0.23 Wb. It has a MOSFET bridge inverter with a carrier frequency of 50 kHz and a
rated current of 700 A. The battery has a nominal DC bus voltage of 600V.
(i) Consider the EV having: friction coefficient = 0.3, aerodynamic drag coefficient =
0.23, and air density for drag = 1.225 kg/m 3 . The motor inertia can be included by
increasing the referred vehicle inertia to the motor side by a factor km = 1.08. Develop
a Simulink model of the EV mechanical loads with the motor torque Te and road slop
angle slop_deg as inputs. This EV block should be able to calculate the vehicle speed
(km/h), motor speed (rpm), and mechanical load torque applied to the motor (Nm).
The developed model should function as a stand-alone Simulink block, as shown in
Fig. 1 (the red block “EV Model”). After building the block, test it using the following
data – input slope angle as 0, 20 and 40 deg (one at a time) while keeping the input
motor torque fixed at a value calculated using the torque equation:
( )m m q d q d q
3
T p i L L i i
2
λ = + − where i d = -183.7A and i q = 675.5A.
Use a scope to note the acceleration time for each slope angle to reach a speed of
40km/hr. Present your test results in a table and confirm that EV acceleration time is
the fastest on a flat road.
(Hint: You should use the equations and knowledge from the Week 2 Workshop.)
(ii) Develop a simplified EV drivetrain model with a Permanent Magnet Synchronous
Motor supplied from a DC source via a MOSFET full bridge 3-phase inverter. The
motor speed is controlled using the rotor field-oriented control (vector current control).
The EV model block of (i) is the load for the PMSM. An example of the developed
EV + drivetrain model is shown in Fig. 1. Note that the model in Fig. 1 is only an
example to give you a hint on how to connect various blocks. Please do not limit
yourself to the example model. You are more than welcome to build the model using
different blocks or in a different structure if you prefer. The red blocks are models you
must build by yourself using knowledge from this course. Do not use the Simulink
library block for these ones if they exist.
(iii) To test your controllers, accelerate the EV from 0 km/h to two speeds in steps: 1) X
km/h, X is the last two digits of your zID(if the last two digits are 00, use the first two
digit), and 2) 100 km/h. It can be done easily by using the “Step” block to set the speed
reference. For this task, consider a flat road. Include the simulation results in your
report. Your simulation results should show the acceleration process in the following
plots – (1) Current i a , i b , i c , (2) motor speed and speed reference (rpm), (3) motor
torque (Tm), (4) Vdq , (5) i q and reference i q * , (6)i d and reference i d *, (7) EV speed
(km/h), and (8) motor load torque(TmL ). An example of the expected results is
provided in Fig. 2.
To build the EV drivetrain model, you will need knowledge of RFOC, PI controller, VSI,
synchronous motor drive, abc-to-dq transformation (Clarke and Park transformation) and its
inverse forms, MTPA and FW, etc.
MTPA/FW block and a few other key modules with appropriate settings are provided as an
unfinished Simulink model “ELEC4613_Tesla_Blocks”. You may choose to use the model
structure and blocks provided in this file if you do not want to build them from scratch, and
we recommend you to use the mtpa&Fldwkn block from this file. If you use the provided
blocks, you must use the parameter and variables names exactly as they are used in those
blocks. A list of the key parameters/variables that must be defined or calculated using a Matlab
file (.m) before running the Simulink model is provided in Table 1. Please note that a Simulink
model is a discrete-time digital system (even if you run it in the continuous time mode).
Therefore, you must set two sampling times: Ts and Tcs, as listed in Table 1.
Note that ‘powergui’ block must be used when Simulink’s Specialized Power System library
blocks such as PMSM and Universal Bridge are used in a model. This block allows you to set
the simulation either in continuous or discrete mode.
Table 1. Example parameter/variable names
Stator phase resistance R Controller frequency fc
d-axis inductance Ld Controller sampling time Tcs
q-axis inductance Lq Simulink frequency fs
Flux linkage psi Simulink sampling time Ts (1e-6 s)
Total inertia (motor side) J Speed controller gains Kp_spd
Pole number/pair P/p Speed controller gains Ki_spd
Max. current peak Iam Iq controller gains Kp_q/ Ki_q
Max. phase voltage peak Vam Id controller gains Kp_d/ Ki_d
Max. induced voltage peak Vom Base speed up to which
MTPA operates (rad/s)
wb
Vehicle weight Mev Gravity g
Note that Table 1 shows only key parameters. You will need to define other
parameters/variables, and you can name them as per your preference – as long as they do not
conflict with existing names and satisfy the Matlab variable name rules:
https://au.mathworks.com/help/matlab/matlab_prog/variable-names.html
For more information about Simulink and its sampling time, please check:
https://au.mathworks.com/help/simulink/slref/simulink-concepts-
models.html#mw_62dc0547-ecd9-4fbd-bb67-2cda1631f1fe
Equations and Sample Codes
You should find most of the equations from your lecture notes, workshops, and tutorials.
Additional equations that may not be covered are provided below:
3
Vdc
Vam = (1)
Vom Vam Iam R= − ⋅ (2)
2 2
( ) ( )
Vom
wb psi Ld Ida Lq Iqa
= + ⋅ + ⋅ (3)
MTPA current reference calculation:
( ) ( )
2
2
2 2
4 24
psi
Ida psi Iam
Lq Ld Lq Ld
Iqa Iam Ida
=
− − +
−
= −
(4)
You can use the following codes to calculate the controller constants of a discrete system
using the Pole Placement Method, especially if you use the discrete PI controller blocks
[PI(z)] in your simulation. Pole cancellation method with Bode plot that you learnt in Section
7 can also be used when you use PI controllers with continuous time [PI(s)].
%%%%%%%%%%%%%%%%%%%% Controller gains
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
fc =50e+3;% Sampling frequency of discrete controllers
Tcs=1/fc; %Sampling time of discrete controllers
Rs=R;
fcs= fc/10.0;%bandwidth frequency of current controller
%%%%%%PI constants for Current controllers in the discrete system (z-domain) %%%%%%
% https://au.mathworks.com/help/physmod/sps/ug/tune-an-electric-drive.html#bvn81uz-5
zeta=0.9; %Motor efficiency
wn=2.0*pi*fcs; % current controller bandwidth
sigma=exp(-zeta*pi/sqrt(1-zeta*zeta));
tr=6.0*zeta/wn;
Km=1.0/Rs;
Tmd=Ld/Rs;
Tmq=Lq/Rs;
b1d=Km*Tcs/Tmd;
b1q=Km*Tcs/Tmq;
a1d=(Tcs-Tmd)/Tmd;
a1q=(Tcs-Tmq)/Tmq;
Alpha1=-2.0*(1.0-zeta*wn*Tcs+0.5*(-zeta*wn*Tcs)*(-zeta*wn*Tcs)+1.0/6.0*(-zeta*wn*Tcs)*(-
zeta*wn*Tcs)*(-zeta*wn*Tcs))*cos(wn*Tcs*sqrt(1.0-zeta*zeta));
Alpha2=1.0-2.0*zeta*wn*Tcs+0.5*(-2.0*zeta*wn*Tcs)*(-2.0*zeta*wn*Tcs)+1.0/6.0*(-2.0*zeta*wn*Tcs)*(-
2.0*zeta*wn*Tcs)*(-2.0*zeta*wn*Tcs);
q0d=(Alpha1-a1d+1.0)/b1d;
q1d=(Alpha2+a1d)/b1d;
q0q=(Alpha1-a1q+1.0)/b1q;
q1q=(Alpha2+a1q)/b1q;
Kp_d=q0d
Ki_d=(q1d+Kp_d)
Kp_q=q0q
Ki_q=(q1q+Kp_q)
%%%%%%PI Calculation for Speed controller
K= 3*p*psi/(2*J); %% Includes inertial J, Pole pair number p, 3/2(torque/power coefficient of dq equation), PM
flux linkage psi.
f_spd=100; %bandwidth of speed controller in Hz
BW_spd=2*pi*f_spd;
Kp_spd=BW_spd/K;
Ki_spd=B/J; % B: Viscous damping coefficient
Fig. 1 Example Simulink Model of the EV model
Fig. 2 Example Plots of the EV Acceleration
Resources for writing technical reports:
If you have never written a technical report and would like to get some information, the
following link could be a good starting point:
https://www.theiet.org/media/5182/technical-report-writing.pdf
A few other handy ones:
https://www.wikihow.com/Write-a-Technical-Report
https://medium.com/technical-writing-is-easy/how-to-write-technical-report-e935210002c9
https://students.unimelb.edu.au/academic-skills/explore-our-resources/report-
writing/technical-report-writing
https://www.monash.edu/rlo/assignment-samples/engineering/eng-writing-technical-reports
If you want to pursue further, you may refer to these books:
1. Davies J.W. Communication Skills – A Guide for Engineering and Applied Science Students (2nd ed.,
Prentice Hall, 2001)
2. van Emden J. Effective communication for Science and Technology (Palgrave 2001)
3. van Emden J. A Handbook of Writing for Engineers 2nd ed. (Macmillan 1998)
4. van Emden J. and Easteal J. Technical Writing and Speaking, an Introduction (McGraw-Hill 1996)
5. Pfeiffer W.S. Pocket Guide to Technical Writing (Prentice Hall 1998)
6. Eisenberg A. Effective Technical Communication (McGraw-Hill 1992