Since the Cubli system is underactuated and you seek to use only a PID Controller, you must select which output you would like to control. This is necessary because PID control design generally works for single-input, single-output (SISO) systems.
Once a stabilizing PID controller is successfully designed, it can then be implemented on the multi-input, multi-output (MIMO) system. However, there is no guarantee that the other two outputs will be stable as well. Nevertheless, since the second output depends on the first output, if the first output is stable, the second output will also be stable.
(mb*lb + mw*l)*g/(Ib + mw*l^2), -Cb/(Ib + mw*l^2), Cw/(Ib + mw*l^2)
-(mb*lb + mw*l)*g/(Ib + mw*l^2), Cb/(Ib + mw*l^2), -Cw*(Ib + Iw + mw*l^2)/(Iw*(Ib + mw*l^2))];
Km*(Ib + Iw + mw*l^2)/(Iw*(Ib + mw*l^2))];
sys = ss(A, B, C, 0*C*B);
Gp = tf(sys)
Gp =
-5.214 s + 5.117e-17
--------------------------------
s^3 + 0.31 s^2 - 99.36 s - 8.717
Continuous-time transfer function.
Gc = pidtune(Gp, 'PIDF')
Gc =
1 s
Kp + Ki * --- + Kd * --------
s Tf*s+1
with Kp = -38.1, Ki = -51.7, Kd = -3.95, Tf = 0.00051
Continuous-time PIDF controller in parallel form.
Gcl = minreal(feedback(Gc*Gp, 1))
Gcl =
4.06e04 s^2 + 3.896e05 s + 5.284e05
-----------------------------------------------------
s^4 + 1960 s^3 + 4.111e04 s^2 + 1.949e05 s + 5.113e05
Continuous-time transfer function.
op = findop(sys, y=1)
op =
OperatingPoint with properties:
x: [4x1 double]
u: 0.9677
w: [0x1 double]
dx: [4x1 double]
y: 1
rx: [4x1 double]
ry: 0
Equations: 5
Unknowns: 5
Status: 'Well-posed problem. Successfully computed the unique solution.'
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1726181/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1726186/image.png)