Overshoot problem with P-controller

Hi, I have a simulink model for a p-controller. I have a microcontroller in the loop which acts as the p-controller. It gets the error(between setpoint and output) encoded in ASCII, which i decode in mikroPascal, multiply with the gain K, and send back to simulink. If i use a small gain and there is no overshoot, then it works fine. If there is overshoot, the output value will decrease until minus infinity. I used the discrete transfer function of (1/s^2+2s+1)
This is how it looks like: http://i46.tinypic.com/k1tmr6.png
The 2 gain blocks before and after the main block are valued *1000 and 1/1000 A model which works: http://i50.tinypic.com/r8wopd.png Any ideas why it has a problem with overshoot?

댓글 수: 7

Zoltan
Zoltan 2013년 3월 26일
Kp=1,9 in the model which doesn't work(first pic), and Kp=1 in the model which is OK. For Kp = 1,5...1,6 i get the max value without overshoot. The setpoint value is 1.
Arkadiy Turevskiy
Arkadiy Turevskiy 2013년 3월 26일
Your images do not open up. Can you update the links so they work?
Ryan G
Ryan G 2013년 3월 26일
Have you tried lowering the gain? The thing about a proportional only controller is it's going to simply output the error*gain (obvious, I know). So if your gain is to high you will add excess control power to the system, it will overshoot and this will be reflected in the feedback.
Zoltan
Zoltan 2013년 3월 27일
Yes, with low gains it works because there is no overshoot, but it has to work with overshoot too...It gives me errors even with VERY LITTLE overshoot. Btw, the links are working now
Ryan G
Ryan G 2013년 3월 27일
It sounds like it's just unstable at that gain value. That 'main' subsystem (is this where the mikroPascal comes in?) may be introducing some delay or numerical differences. Can you scope the input/output of that block in the same scope (hint: use mux block) so we can see what it does?
Zoltan
Zoltan 2013년 4월 11일
So here is the scope with 3 signals:
input_main -> the input signal of the 'main' block(yes, the mikroPascal comes in here), and in fact, its the error (error = actual value - setpoint)
output_main -> outputs the error signal multiplied by Kp (mikroPascal program does this)
final -> plant output
Zoltan
Zoltan 2013년 4월 12일
This problem has been solved. Anyways, thanks for the help.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

도움말 센터File Exchange에서 Simulink에 대해 자세히 알아보기

제품

질문:

2013년 3월 26일

Community Treasure Hunt

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

Start Hunting!

Translated by