How to speed up simscape electrical simulation?

54 views (last 30 days)
Hassan Ali
Hassan Ali on 19 Nov 2024 at 3:33
Commented: Hassan Ali about 11 hours ago
Greetings everyone,
I have been trying to find the way to simulate the simscape electrical model much faster.
  1. I have designed a drivetrain model using simscape electrical, in which the 3-phase inverter contains 6 N-channel MOSFETs which I have parameterized using silicon MOSFETs datasheet.
  2. The PMSM parameters are chosen from the pre-parameterized list of motor.
  3. The speed is controlled through field-oriented control.
  4. At the motor end, the tires and vehicle body is attached to replicate the EV model.
I want to run the simulation over a complete drivecycle, but the simulation time is too slow, it takes around 30-40 minutes to run 1% only depending on the switching frequency and consequently sample time.
Due to longer simulation time, it often crashes after few hours.
Could you please guide if my model has any errors or what possible ways are there to improve it and pace up the simulation time.
The model is hereby attached for your kind reference.
Thank you!

Answers (2)

Antonino Riccobono
Antonino Riccobono on 19 Nov 2024 at 7:28
Dear Hassan Ali,
I had a look at your model and I can notice that margins of improvements are in the direction of
  1. model fidelity -> you chose components and parameterization options way too detailed;
  2. Local Solver settings -> the default settings do not necessarily offer the balance between accuracy and simulation speed you are looking for.
  3. The control algorithm mixes up continuous-time blocks and discrete-time blocks -> the continuous-time blocks in general represent the bottleneck for simulation speed. Typically, setting the sample times correctly helps a lot with simulation speed.
Therefore, I am happy to share with you that in the Power Electronics Control Design training course (see venues and pricing) I authored all these aspects are dedicated chapters and the course model we build in that course is conceptually the same you are working on. In my final model comprising the cascade of a battery, bi-directional DC-DC converter with DC-link voltage controller, DC-AC three-phase inverter and PMSM with torque controller using the FOC principles, simple mechanical load, I have Tstop = 100 s and I can simulate this system within 1 minute clock time! Quite impressive, isn't it?
Hope you see you in class one day.
Cheers,
Antonino
  3 Comments
Antonino Riccobono
Antonino Riccobono about 23 hours ago
Hi Hassan Ali,
If you need to assess losses and efficiency of the inverter (excluding the PMSM) with different power semiconductor devices, you could do the following:
  1. Replace your battery and motor with and ideal voltage source and and series RL load, respectively. Size the RL load exactly as the stator resistance and inductance.
  2. Convert your torque controller using FOC into a standard current controller aiming at controlling the inductor current.
  3. Replace the N-Channel MOSFET {or N-Channel IGBT} blocks with MOSFET {or IGBT} (Ideal, Switching) blocks. The ideal, switching blocks use a piecewise linear approximation (thus fast computation) while being able to characterize both conduction and switching losses.
  4. Pay attention to the anti-parallel diodes. In many practical application, external power diodes are required to be added in anti-parallel to each IGBT (mandatory) or MOSFET (optional if the body diode is high quality).
  5. Use the ee_importDeviceParameters function to automatically parameterize the IGBT or MOSFET (Ideal, Switching) blocks after an XML file downloaded from a vendor ( see https://www.infineon.com/cms/en/product/power/igbt/ and https://www.hitachienergy.com/products-and-solutions/semiconductors/insulated-gate-bipolar-transistor-igbt-and-diode-modules as examples). See documentation for the function.
  6. Use Simscape logging and run your simulation.
  7. Use the ee_getEfficiency function to calculate both the efficiency and the losses (conduction and switching) for all the nonload components. See documentation.
  8. Repeat for other semiconductor devices.
Hope this helps,
Antonino
Hassan Ali
Hassan Ali about 8 hours ago
Thank you so much for detailed explanation.
I will try this.

Sign in to comment.


Rick Hyde
Rick Hyde on 19 Nov 2024 at 9:17
Dear Hassan Ali
plus this one:
For a drive cycle, you're best using a more abstract model as in this second example. This uses our Motor & Drive (System Level) library block which balances electrical power, mechanical power and losses - so no semiconductor switching. For this model to give good predictions over a drive cycle, the losses have to be accurate. For this, you can use a more detailed model like in the first linked example above - the detailed model is used to get motor and power electronic losses at different operating points.
They key here is that you only need a few switching cycles to get losses for a particular operating point (torque, speed, temperature) - so the detailed model doesn't need to simulate a whole drive cycle.
Hope that helps
Rick
Simscape Team
  3 Comments
Rick Hyde
Rick Hyde about 24 hours ago
Suggest looking at the two linked examples to understand how you can get losses from a few switching cycles. It's about initializing your detailed model up in a range of initial condiitons (torque, speed, temperature, DC voltage etc) and recording the on-state and switching losses as lookup tables. You then use these in your system-level drive cycle model.
Hassan Ali
Hassan Ali about 8 hours ago
Thank You Rick,
I will look into it and try.

Sign in to comment.

Communities

More Answers in the  Power Electronics Control

Products


Release

R2024a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!