PID controller design: How to plot control signal?

I'm using the Control System Toolbox in Matlab.
I have a plant P (an object of class idproc) and a PID controller C (class pid).
I can connect them using T = feedback(C*P, 1).
Now, I can use commands like step(T) to plot the response of the whole system to a step input.
What I would like to know is how to get access to the control signal that the PID controller came up with. So, given a particular input to the system in T, what is the control signal that the PID part of the system generated to yield the output plotted by step(T)?
Thanks, Matt

4 comentarios

It will be useful if you post an example
Matthias
Matthias el 14 de Jul. de 2016
Editada: Matthias el 14 de Jul. de 2016
I basically gave all the code that I'd be using in my original question. This is the workflow that I use to get the plant and controller objects: I use the PID Tuner tool to identify a plant from input/output data, and to design a PID controller to drive that plant. I then click "export" in the PID Tuner tool, which creates a Plant object (called P in my original post) and a controller object (C) in my base workspace. My question is how to extract the control signal that the PID controller generates for a given input signal.
I'm using the Control System Toolbox for the first time and this is the best problem specification I can come up with. I looked through the documentation but it is very dense and confusing because these objects are so general, and do not have methods that I can interpret in the PID controller context.
The transfer function from reference to controller effort is C/(1+CP), so you simply do: >>step(C/(1+C*P))
Also note that if you use PID Tuner app, it lets you plot all signals of interest in your loop by selecting options in drop down menus.
Yes, @Arkadiy Turevskiy is right, I have tried it, thank you. But for matching the time vector, I think you should use the same timelenght,
y=step(C*P,1,t_final); mv=step(C,P,t_final);
or [y,t1]=step(C*P,1,t_final); [mv,t2]=step(C,P,t_final); if you want to get the time vector as well.

Iniciar sesión para comentar.

Respuestas (1)

Mischa Kim
Mischa Kim el 14 de Jul. de 2016
Matthias, for this simple configuration with C and P in the feed-forward path and unity feedback you can do the following:
The error signal in this configuration is the same as the output signal of a system that has C in the feed-forward path and P in the feedback path. In other words,
T1 = feedback(C,P)
e = step(T1)

2 comentarios

Matthias
Matthias el 14 de Jul. de 2016
Editada: Matthias el 14 de Jul. de 2016
Thanks for your answer! Unfortunately, I get the error:
Error using DynamicSystem/step (line 95)
Cannot simulate the time response of models with more zeros than poles.
As far as I understand, this may be because I use a complicated model for the Plant which cannot be inverted (I'm just piecing this together from an incomplete understanding of control theory, so please correct me if I misunderstood). I have real data that I'm trying to fit and the fit is best when I choose "underdamped pair + real pole" in the Plant Identification part of the PID Tuner.
However, there should, of course, be a well-defined control signal when driving the system forward even if the plant model is complicated and non-invertible. Is there another way to extract the control signal?
T1 = feedback(C,P) e = step(T1)
The code should work well. The error you got comes from your total transfer function has more zero than pole, which is not casual, can not be implemented, try another controller structure.

Iniciar sesión para comentar.

Etiquetas

Preguntada:

el 14 de Jul. de 2016

Comentada:

el 9 de Ag. de 2016

Community Treasure Hunt

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

Start Hunting!

Translated by