Term Project Gain Calculations
Authors: Damond Li, Christopher Or
Date Created: 12/4/2021
Date Modified: 12/6/2021
Found here are the steps used, based on lecture, to determine the gains for the Full State Feedback (FSFB) controller used for the ball balancing project.
Establish gain variables
A matrix from HW 0x03
B matrix from HW 0x03
Identity matrix
K matrix of gain values
Closed-loop system
Characteristic polynomial matching
C = C'
C =

Gain calculation using chosen parameters
w_n = 8.2; % Natural frequency
zeta = 0.8; % Damping ratio
Closed-loop polynomial
P = expand((s - lamda3) * (s - lamda4) * (s^2 + 2 * zeta * w_n * s + w_n^2))
P =

[M, f] = equationsToMatrix([T1; T2; T3; T4], [K1; K2; K3; K4]);
Solve for values for gain matrix
K_matrix = vpa(inv(M) * f, 5)
K_matrix =
