MATLAB Answers

How to implement an RST controller in Simulink?

27 views (last 30 days)
Bill Tubbs
Bill Tubbs on 21 Aug 2020
Edited: Bill Tubbs on 21 Aug 2020
Every time I search for help on this I am taken to the following page:
But I don't have access to the Simscape Electrical library!
In any case I would like to implement the equivalent controller using standard Simulink blocks. I'm surprised I haven't found an example or tutorial on this but I did look. If you know of one, please point me to it.
I tried implementing it myself but I'm not sure I did it right since I'm very new to Simulink. Here is my attempt:
Update: I replaced the previous example image with the one above where I am quite confident the polynomials are correct. Since it doesn't produce the desired results (unstable in closed loop even with zero process noise) I suspect there is something wrong with my simulation setup or implementation.
For example, I used the 'Discrete Filter' blocks for T(z), and S(z), and 1/R(z) transfer functions but 'Discrete Transfer Fcn' blocks for the 'B(z)/A(z)' and 'C(z)/D(z)' blocks. Not sure if that was the right choice.
Also I used the 'DiscreteIntegrator' block for the 1/Delta (1/(1-z^-1)) block.
I'm not looking for someone to confirm if my polynomials are correct (but feel free to let me know if you see a problem!). What I'm looking for is an authoritative implementation that I can compare my results to.
  1 Comment
Bill Tubbs
Bill Tubbs on 21 Aug 2020
Okay, well after comparing the output of this model with a hand-coded RST in closed loop with the same process I discovered that the Simulink model above produces identical reslults if I set the discrete delay block in the process to zero timesteps.
I don't understand this as the controller parameters were designed for a process with a delay of 1 timestep (z^-1). Would would it work if I remove this delay? Is there maybe already a delay built in somewhere else?
Any insights appreciated.

Sign in to comment.

Answers (1)

Bill Tubbs
Bill Tubbs on 21 Aug 2020
Edited: Bill Tubbs on 21 Aug 2020
After some further diagnosis, I think I have solved the problem. The default setting of the Discrete-Time Integrator block is 'Integration: Forward Euler'.
I think the method I need for is 'Backward Euler' and I set it to accumulate, not integrate. From the documentation it seems this is the equivalent of 1/(1-z^-1) or z/(z-1) which is what I want.
Now I get exactly the results expected with the delay set to 1 timestep as it should be.
I guess the learning is don't just copy paste blocks into your model without understanding the defaults!

Community Treasure Hunt

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

Start Hunting!