Simulation Crash Issue with Current Limiter and Motor Drive System

3 views (last 30 days)
Hello MATLAB Community,
I am currently working on a Simscape model where a battery is connected to a current limiter and subsequently to a "motor and drive" system block. I am experiencing an issue where the simulation crashes as soon as the current limiter attempts to limit the current.
Error Details:
Error:An error occurred during simulation and the simulation was terminated
Caused by:
['Model_Name/Solver']: Transient initialization at time 0.04421663720467431, solving for consistent states and modes, failed to converge.
Nonlinear solver: failed to converge, residual norm too large.
Here is the set of components with unconverged equations:
'Model_Name/Current Limiter'
Equation location is:
'/Applications/MATLAB_R2024a.app/toolbox/physmod/elec/library/m/+ee/+semiconductors/current_limiter_base.sscp'(no line number info)
What I Have Tried
  1. Solver Configuration: I have tried using stiff solvers such as ode15s and ode23t, and adjusted the tolerances.
  2. Initialization: Ensured that all initial conditions are set correctly for the battery, current limiter, and motor system.
  3. Current Limiter Settings: Reviewed and adjusted the current limiter parameters to avoid abrupt changes.
  4. Simulation Step Size: Reduced the step size to capture transient behaviors more accurately.
  5. Zero-Crossing Detection: Enabled zero-crossing detection to handle state changes more smoothly.
  6. Component Parameters: Verified that all component parameters are realistic and consistent.
  7. Protective Measures: Tried introducing capacitors and resistors to smooth out voltage drops and dampen sudden changes.
Despite these efforts, the simulation still crashes. I believe the issue might be related to the current limiter's interaction with the motor and drive system.
Reference Model
I am using the model configuration similar to the one available here: Battery Electric Vehicle with Motor Cooling in Simscape.
Request for Assistance
I am seeking advice on how to effectively limit the current to the motor and drive system without causing the simulation to crash. Any insights or suggestions on how to resolve this issue would be greatly appreciated.
Thank you in advance for your help!
Best regards, Alex

Answers (1)

Satwik
Satwik on 2 Aug 2024
Hi Alex,
I understand that you are encountering a transient initialization error during the simulation of your Simscape model. This is a very generic error and could have occurred due to several reasons. This error commonly occurs when a model is excessively idealized, resulting in abrupt transitions that prevent the solver from converging. In such cases, the solver may attempt transient initialization. Assuming that you have correctly tried the things which you have mentioned and achieved no positive result, here are a few more things you can check for:
  1. Avoid Using Memory Block to Break Algebraic Loops: One of the reasons for this behaviour may be the use of a memory block to break algebraic loops in a continuous model. This is not recommended, as it can cause numerical problems. Refer to this blog post for more information: https://blogs.mathworks.com/simulink/2015/07/18/why-you-should-never-break-an-algebraic-loop-with-with-a-memory-block. You can replace the memory block with a transfer function with a time constant of X seconds (you can adjust as needed). It is generally better to drive a continuous Simscape model with continuous input signals, as is the case with the aforementioned transfer function.
  2. Simplify the Model: This includes removing unnecessary sensors since these add extra equations. You can get the plots after running the simulation using the MATLAB file exchange command `ssc_explore`, without using sensors. To get more information on this submission, please refer to the following link on MATLAB Central: http://www.mathworks.com/matlabcentral/fileexchange/28184 Additionally, instances of multiple resistors in series could be combined into one, and combining other components, etc.
  3. Incremental Building and Testing: You are encouraged to start with a simpler version and gradually build up before it gets to this level. After confirming that it gives expected results at smaller levels (including looking for correct initial states) you could then start to combine the pieces. This is because debugging small models is always easier.
  4. Use the Solver Profiler: Use the Solver Profiler to determine what the solver is doing just before you receive the error. In the step size tab, you should see a graph showing the step spike down as it approaches the time of the error occurring. If you zoom in on that spike, there should be more information, such as an indication that there is a zero crossing. The following link contains more information on the Solver Profiler: https://www.mathworks.com/help/releases/R2020b/simulink/slref/solverprofiler.html
You may refer to the following documentation to learn more about troubleshooting simulation errors:
Feel free to share your model and other associated files to help debug better in case the issue persists.
I hope these suggestions help you resolve the issue with your Simscape model.

Categories

Find more on Electrical Systems in Help Center and File Exchange

Products


Release

R2024a

Community Treasure Hunt

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

Start Hunting!