PID setpoint problem

Hi,
for my bachelor project I'm designing a controller for an inverted pendulum problem. The first simulation I have created in Labview but after purchasing MATLAB R2012a I wanted to try to 'translate' my simulation into simulink. It all works nicely except of one big problem. When I use a normal continues PID controller, the control works fine and it is controlled to the zero (equilibrium) point. Hence, the automatic set point of the PID(s) block seems to be zero (?). I have used the following values: P: 500, I:0.01, D:1, N:1. The form is ideal. Now, since I need to be able to set my setpoint myself I replaced the PID(s) block by the PID(s) 2DOF block (is this right?). Here I used: P: 500, I:0.01, D:1, N:1, b:1, c:1. I set the form to ideal and connected a 0 constant to the reference input. This (to my judgment) should be the same controller as the PID(s) was. However, the system now is highly unstable. What am I doing wrong? Where have I gone wrong? I only want the PID(s) block and set my own setpoint.
I hope this all makes sense!
Thank you so much in advance!
Regards

 Risposta accettata

Arkadiy Turevskiy
Arkadiy Turevskiy il 17 Apr 2012
Modificato: Arkadiy Turevskiy il 2 Ott 2017

1 voto

PID Controller block does not assume anything about the setpoint value, it operates on the error signal which is the difference between the setpoint and measured output.
If you want to control your pendulum around some non-zero angle, you do not need 2DOF PID. All you have to do is have a block for your setpoint (constant, for example). Set the value of this constant as you wish. Then substract measured angle to form the error signal, and feed this error signal to the PID Controller.
Take a look at this demo to see how to do this in a Simulink model.
More demos and other relevant info is available on PID Control with MATLAB and Simulink page.
HTH.
Arkadiy

5 Commenti

Moritz
Moritz il 18 Apr 2012
Thank you so much! This has helped me a lot! I might want to add that by right clicking the block and selected 'Look under Mask' you can see the whole structure of the block, which helps a lot to understand what you are dealing with.
OSAMA YOUNAS
OSAMA YOUNAS il 21 Nov 2017
Thanks alot! I was wasting my time finding a Setpoint block but couldn't find it
ojonugwa adukwu
ojonugwa adukwu il 16 Set 2022
This question is almost similar to what I nwant but mine is done using codes not simulink. In simulink, it is easy to get thr control output or input to the actuator by connecting a scope to the controller output. How do you get the output of the controller in MATLAB codes? I need the output to apply to another system.
Thanks.
Sam Chak
Sam Chak il 16 Set 2022
Perhaps, you can make a new post on your query with the model of the system that you want to control.
ojonugwa adukwu
ojonugwa adukwu il 16 Set 2022
Yes. I have made one.
Thanks so much

Accedi per commentare.

Più risposte (0)

Prodotti

Release

R2012a

Community Treasure Hunt

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

Start Hunting!

Translated by