-
-
Save jbinkleyj/a116d87e5a33fe5d0267a9dc10a86ecc to your computer and use it in GitHub Desktop.
Balancing a ball on a beam article code.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
k = -7.0071; | |
s = tf('s'); | |
G = k/s^2; | |
% PD controller | |
R = -(0.38 + 0.5*50/(1+50/s)); | |
% Design a PD controller for the unit feedback loop | |
L = series(R,G); | |
sys = feedback(L, 1); | |
% Phase margin | |
margin(L) | |
% Step response | |
step(sys) | |
% Root locus | |
rlocus(L) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment