Following this question, I am trying to convert the state-space model from this tutorial back into its transfer-function form. I have tried the
R = 2.0; % Ohms L = 0.5; % Henrys Km = 0.1; % torque constant Kb = 0.1; % back emf constant Kf = 0.2; % Nms J = 0.02; % kg.m^2/s^2 Td = 1; % models load disturbances h1 = tf(Km, [L R]); % armature h2 = tf(1, [J Kf]); % eqn of motion dcm = ss(h2) * [h1 , Td]; % w = h2 * (h1 * Va + Td) [b, a] = ss2tf(dcm.A, dcm.B, dcm.C, dcm.D); dcm_tf = tf(b, a); However, I get the error message:
IU must be specified for systems with more than one input.
1 Answer
According to this comment on Reddit, given the above system is Multiple-Input-Multiple-Output (MIMO), we need to specify the input index ni from the ss2tf()function. In this case the
[b, a] = ss2tf(dcm.A, dcm.B, dcm.C, dcm.D, 1); returns the w / Va transfer function and the
[b, a] = ss2tf(dcm.A, dcm.B, dcm.C, dcm.D, 2); returns the w / Td one.
Alternatively, one could simply use the tf(dcm) to convert the state-space model directly to transfer functions of both inputs.