PID a control of a simple plant- Code issue

Sep 09, 2006 2 Replies

Greetings all,



I am trying to simulate a simple plant by verifying the out of the plant when controlled with a PID controller The plant is 1/s(s+1). I converted it in the z-domain. Then, designed a Gc(z) as



9.15*(z-.9802)/(z-.8187). The closeloop step response of the system gives satisfactory results. But when I run it in simulink with my s-function, I don't get the same results. I tryed looking over every line of my code, but I am not able to the discrepancy.

I'd appreciate your help, thanks in advace.



Your problem may be , when you discretizing the continuouse-time PID controller to a discrete-time controller, the approximation is too bigger.

In fact, you have designed a Sampled-data control system where the continous-time plant controlled by a digital controller, a lots of paper have pointed out the so called analog design method which you adopted may a poor method. So you can design the controller using another method ,and you may be get the desired result.

Alternative method: You can adjust the sampling period in the matlab MDL file, perhaps, you can derive the right result.

Good luck to you !

How did you convert it to the z domain?

What was your result?

What sampling rate are you using?

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required