Last active
January 13, 2020 00:36
-
-
Save mick001/4965b621a4763ecc809b6670a61b4392 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