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!