Skip to content

Instantly share code, notes, and snippets.

@jbinkleyj
Forked from mick001/balancing_ball_beam.m
Created January 13, 2020 00:36
Show Gist options
  • Save jbinkleyj/a116d87e5a33fe5d0267a9dc10a86ecc to your computer and use it in GitHub Desktop.
Save jbinkleyj/a116d87e5a33fe5d0267a9dc10a86ecc to your computer and use it in GitHub Desktop.
Balancing a ball on a beam article code.
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