- model fidelity -> you chose components and parameterization options way too detailed;
- Local Solver settings -> the default settings do not necessarily offer the balance between accuracy and simulation speed you are looking for.
- 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.
How to speed up simscape electrical simulation?
25 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Hassan Ali
il 19 Nov 2024
Commentato: Hassan Ali
il 20 Nov 2024
Greetings everyone,
I have been trying to find the way to simulate the simscape electrical model much faster.
- 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.
- The PMSM parameters are chosen from the pre-parameterized list of motor.
- The speed is controlled through field-oriented control.
- 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!
0 Commenti
Risposta accettata
Antonino Riccobono
il 19 Nov 2024
Dear Hassan Ali,
I had a look at your model and I can notice that margins of improvements are in the direction of
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 Commenti
Antonino Riccobono
il 19 Nov 2024
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:
- 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.
- Convert your torque controller using FOC into a standard current controller aiming at controlling the inductor current.
- 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.
- 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).
- 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.
- Use Simscape logging and run your simulation.
- Use the ee_getEfficiency function to calculate both the efficiency and the losses (conduction and switching) for all the nonload components. See documentation.
- Repeat for other semiconductor devices.
Hope this helps,
Antonino
Più risposte (1)
Rick Hyde
il 19 Nov 2024
Dear Hassan Ali
You might want to take a look at this example on MATLAB Central: https://www.mathworks.com/matlabcentral/fileexchange/104840-motor-efficiency-improvements-with-tuned-control-parameters?s_tid=srchtitle
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 Commenti
Rick Hyde
il 19 Nov 2024
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.
Community
Più risposte nel Power Electronics Control
Vedere anche
Categorie
Scopri di più su Switches and Breakers in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!