Simulink Model Discretization Instability

7 views (last 30 days)
Alexandre
Alexandre on 13 Oct 2020
Commented: Yassine Benomar on 11 Jul 2021
Hi,
I developped a continuous model of a synchronous generator. In a particular simulation, I have initially no speed and no load on the generator. Then, I inject mechanical power to the generator in order to reach nominal speed and finally synchronize the generator on an electrical grid that is modelled by a RL load.
In the continuous domain, it works well if I use the correct solver which is ode-45 in my case. I discretized my model manually by replacing all the integrator by discrete integrators (follow yellow blocks in the joined models). The sampling time is 50 us which should be more then sufficient. As long as the generator is not coupled to the RL load, the discrete model looks exactly the same as the continuous model but as soon as I couple it, everything falls in instability (Nan). If I run my continuous model with different solver, I have the same instability.
I'm pretty sure that my discrete model instability has something to do with the 1/z blocks I had to put to break algebraic loops.
Intuitively, I would have put a "Memory" block in my continuous model so the RL load feedbacks is delayed before being read by the my generator but the simulation do not require it to run. Even worse, if I put the "Memory" block, I get the same instability that I have in my discrete model. In this discrete model, I have no choice but to put a 1/z so I'm in some kind of catch-22.
I tried to find the source of the error by opening feedback loops in the model but couldn't figure out the origin of the problem. Is there any good practice I could perform on my discrete problem to troubleshoot?
Please find my two models and their shared initialization in joined piece.
Thank you!

Answers (1)

Alexandre
Alexandre on 14 Oct 2020
I figured it out looking at other community answer. By putting a lowpass filter on the feedback looping from the RL load to the generator with a time constant twice the sampling time of my discrete model, the instability problem is completely fixed!
I would appreciate some theoritical explanation though.
Thank you.
  1 Comment
Yassine Benomar
Yassine Benomar on 11 Jul 2021
Hello Alex,
Did you find an explanation in the meanwhile?
Thanks!

Sign in to comment.

Categories

Find more on General Applications in Help Center and File Exchange

Products


Release

R2015b

Community Treasure Hunt

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

Start Hunting!