Why does c2d changes the structure of the C matrix in the ss representation?
13 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Hi, I have a pretty simple plant that I am discretising and then realising into its State-Space representation
Ix = 4.85e-3 % Intertia
Ts = 1/4e3 %sampling time, sec
P_tf = tf([1], [Ix,0,0]) %P_tf(s) = 1/(Ix * s^2) ,
ss(P_tf) % ss in continue time
P_tfd = c2d(P_tf, Ts, 'zoh')
ss(P_tfd) % ss in discrete time
The State Space representation of P_tf gives me a C matrix as such :
C =
x1 x2
y1 0 12.89
However, the State Space representation of P_tfd gives me a C matrix as such :
C =
x1 x2
y1 0.001649 0.001649
In my opinion, it doesn't make mush sense that the C matrix changes substantially: when I connect this plant to the controller, I'm only interested in observing the second value of the state ot the plant (like in continous time) so that I may compare it with the input to obtain the error. The new C obtained by the realisation of the discretised function instead gives me a weighted sum of the value and its derivative.
This happens also with other methods (I tried FOH and Tustin).
Does anyone know why this happens, and if there is a physical reason for it to happen, or how to correct it if not? I feel like it's not physically accurate, but I'm not very knowledgeable on such discretisation methods.
Thanks in advance!
0 Commenti
Risposta accettata
Paul
il 5 Mag 2025
Hi Elia,
When working with transfer functions, the only thing that's considered is the input/output relationship. The Control Systems Toolbox does not guarantee that the state variables of any realization of a transfer function have any physical meaning. We can see this in the system in the question, where it sounds like the input to the system is a torque, the first state is angular rate, and the second state is angular position (which is what you want to feed back to form an error signal.
Start with the transfer function representation of the double integrator scaled by the inertia
Ix = 4.85e-3; % Intertia
Ts = 1/4e3;
%sampling time, sec
P_tf = tf([1], [Ix,0,0]) %P_tf(s) = 1/(Ix * s^2) ,
Now check the output of ss
ss(P_tf)
The fact that the C-matrix is not [0,1] indicates that the state variables do not represent position and its derivative. However, the input/output relationship represented by that ss model is still the input/output relationship of our physical system
tf(ans) % 1/Ix = 206.18
It sounds like what you really want is for the state space model to represent they physics, in which case we have to write out the state space model explicitly ourselves to ensure the state variables have the meaning we want: x1 = rate, x2 = position, input = torque
P_ss = ss([0 0;1 0],[1/Ix;0],[0 1],0)
Verify the input/output relationship
tf(P_ss)
Now, when we apply c2d to a ss model, the state definitions are preserved
c2d(P_ss,Ts,'zoh')
In your original formulation, the output of P_tfd or ss(P_tfd) would still be position, so you could use the output as your feedback signal.
Più risposte (0)
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!