Adding a current sensor to my Simscape Electrical model results in large current oscillations

15 views (last 30 days)
I have a Simscape electrical model in release R2017b, where a step input is connected to a controlled voltage source. The voltage source is connected in series to a "DC Motor" block and a "Current Limiter" block.
With no "Current Sensor" block in series with the circuit, I see my expected simulation results in the "Simscape Results Explorer". However, when I add in a Current Sensor block in series with the rest of my circuit, I see unexpected transient behavior in the form of large current oscillations that do not match what the Simscape Results Explorer shows for the exact same model with no current sensor.
Why is adding a current sensor affecting the dynamics of my circuit?

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 6 Feb 2023
Edited: MathWorks Support Team on 6 Feb 2023
A step change in voltage implies an infinite impulse current. The current sensor dynamics cannot handle this, which is why you see incorrect simulation results.
Add an "Inductor" block with a very minor inductance in series with the circuit. This will force a continuous change in current that the sensor dynamics can handle.
Andres Adam
Andres Adam on 6 Feb 2023
That I do not know exactly at the moment. I could some good information about the battery model at its documentation page:
It is based on a paper from 2009:
Tremblay, O.; Dessaint, L.-A. Experimental Validation of a Battery Dynamic Model for EV Applications. World Electr. Veh. J. 2009, 3, 289-298.
You can consider posting it as a question in MATLAB Central or emailing support :)

Sign in to comment.

More Answers (0)


Find more on Electrical Systems in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by