Matlab and simulink giving different results - FOPID controller (Files attached)

Please find attached the simulink and matlab files, wherein a simple FOPID controller is designed for a system. Both the files find the closed loop response of the same system but give different results. The simulink file leads to an unstable system, whereas the matlab file leads to a stable system. Ideally speaking, this should not be possible. Both the matlab and simulink files should give a same step response as the system is same. Can someone please tell as in why I am getting entirely different results.

Respuestas (1)

Birdman
Birdman el 28 de Mzo. de 2018
It should be happening due to the solver selection and sampling time issue. You need to discretize the system and make your calculations accordingly. Since I do not have library for fractional PID, this will be a trivial answer:
1-When the Bode is plotted for your plant, it can be seen that the sampling time must be selected at least 0.02 seconds. To make things sure and guaranteed, let's choose it 0.001 seconds.
2-Afterwards, go to your Simulink model, open Configuration Parameters->Solver and change your solver type to fixed step and your solver to ode5. Set your sampling time as 0.001.
After doing these things, run the model and observe the results. Let me know if it works.

9 comentarios

Rakesh Jain
Rakesh Jain el 28 de Mzo. de 2018
Editada: Rakesh Jain el 28 de Mzo. de 2018
No, it doesn't work. The simulink system is still unstable.
Can you attach figures for both the MATLAB output and Simulink output?
Attach them in a zip file. It is hard to see this way.
I finally get it done. You will know have the same plot for your MATLAB code for 0.00012 seconds in Simulink. I just put one simple Fractional Order TF which is the open loop transfer function, sysnew. I then discretized the system with 1e-6 seconds, but your system is very sensitive, so I suggest you to not to play with it. Also, reset the simulation time to 0.292 seconds and see the results.
Hope this helps.
Yes, but ideally both the toolbox and simulink should give similar results for all time. I agree that the system is very sensitive, a slight change somewhere leads to the system becoming unstable
Probably it has to do something with Simulink's solver engine differs from MATLAB's.
Dear Birdman ,
can you help me optimize the parameters of the regulator PID by PSO

Iniciar sesión para comentar.

Etiquetas

Preguntada:

el 28 de Mzo. de 2018

Comentada:

el 26 de Mayo de 2019

Community Treasure Hunt

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

Start Hunting!

Translated by