Maintaining C and D matrices when converting state space to discrete-time

20 Ansichten (letzte 30 Tage)
Hi,
I am encountering some confusion when it comes to comparing different types of controllers, as my C and D matrices keep changing with different methods. I know that these are all valid realizations of the transfer functions involved, but I'm unsure about how the outputs compare to each other.
I have a Laplace transfer function G and a pid controller (that I synthesized), connected with negative feedback:
G = 1/(s^2*(0.1*s + 1));
Cpid = 180*( ( s+0.1 )*( s+0.04 ) )/(s*(s+60));
H = feedback(G*Cpid,1);
With the state-space of G being:
sys = ss(G);
A = sys.A;
B = sys.B;
C = sys.C;
D = sys.D;
I am trying to convert the system into discrete-time. I learned that the Tustin method is the best approximation for this. However, I am confused about the physical meaning of the output of the state-space system after converting to discrete-time. With the default zoh method, I can keep the C and D matrices the same by just converting the A and B matrices to Φ and Γ:
Ts = 0.05;
[Phi, Gamma] = c2d(sys.A,sys.B, Ts); % zoh
And then finalize the state-space by including C and D:
ss(Phi, Gamma, C, D, Ts);
The problem I encounter is that this does not work when using the Tustin method, as this results in an error:
[Phi, Gamma] = c2d(sys.A,sys.B, Ts, 'tustin');
Later on, I need to use pole placement to come up with a discrete controller as well, and it would be much easier to compare the controllers when I know the C and D matrices are the same.
Is what I'm trying to do completely wrong or am I on the right track? Do the different C and D matrices sort of 'cancel out' because of the feedback connection with the PID controller or is there something else going on?
I would really appreciate some help.
Thank you in advance!

Antworten (1)

Michael Hubatka
Michael Hubatka am 7 Jan. 2022
I suggest that you use
sysd1 = c2d(sys, Ts); % ZOH
sysd2 = c2d(sys, Ts, 'tustin'); % tustin
instead of extracting A, B, C, D and recombining them after conversion.
The C, D and the state vector are preserved for ZOH, but not for Tustin and other methods, see for example Continuous-Discrete Conversion Methods - MATLAB & Simulink - MathWorks.
If you want to compare the controllers I suggest not to use numerical comparisons of the matrices. Use bode, pzmap or compute Eigenvalues.

Kategorien

Mehr zu Dynamic System Models finden Sie in Help Center und File Exchange

Produkte


Version

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by