






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!







Example 2: Lead Compensator Design A unit feedback system
with KG ( s )= (^) s ( s + 4 K )( s + 6 ) is operating with 30% overshoot ( ζ = 0. 358 ).
(a) Design a compensator that will reduce the settling time by a factor of 2. (b) Use control toolkit to simulate the uncompensated and compensated systems. Solution: (a)
/***************************
#include <control.h>
int main() { double k = 1; array double complex p[3] = {complex(0, 0), complex(-4, 0), complex(-6, 0)}; array double zeta[1] = {0.358}; array double omega[1] = {10}; CControl sys; CPlot plot; sys.model("zpk", NULL, p, k); sys.sgrid(1, zeta, omega); sys.rlocus(&plot, NULL, NULL); return 0; }
_
K
R ( s ) E ( s ) G(s)
C ( s )
Gain Plant
Output:
Ts ′^ = T 2 s =^3.^9722 = 1. 986 sec.
The real part of the dominant poles is − =−^4 ′=− 2. 014 T s
The compensated plant is L ( s ) = (^) ( s + p )( ss (^ + s + z 4 ))( s + 6 ) c
c (^).
(^5) −. (^252 2). 014 =tan( pc ) =tan( 7. 31 o ) pc
#include <control.h> int main() { double k = 1; array double complex z[1] = {complex(-5, 0)}; array double complex p[4] = {complex(-42.96, 0), complex(0, 0), complex(-4, 0), complex(-6, 0)}; array double zeta[1] = {0.358}; array double omega[1] = {50}; CControl sys; CPlot plot; sys.model("zpk", z, p, k); sys.sgrid(1, zeta, omega); sys.rlocus(&plot, NULL, NULL); return 0; }
/****************************
int main() { // default system gain double dk = 1; // compensated system zero array double complex cz[1] = {complex(-5, 0)}; // compensated system poles array double complex cp[4] = {complex(-42.96, 0), complex(0, 0), complex(-4, 0), complex(-6, 0)}; // dominant pole selected from the root locus array double complex dp[1] = {complex(-2.014, 5.252)}; // closed-loop poles when one of the dominant poles is selected array double complex p[4]; // system gain when one of the dominant poles is selected array double k[1]; CControl sys; sys.model("zpk", cz, cp, dk); sys.rlocfind(k, p, dp); printf("k: %f\n", k); printf("poles: %f\n", p); return 0; } Output:
k: 1422.
poles: complex(-43.797920,0.000000) complex(-2.014025,5.252003) complex(-5.134029,0.000000) complex(-2.014025,-5.252003)
(b)
int main() { // system gain double k = 63; // uncompensated system poles array double complex up[3] = {complex(0, 0), complex(-4, 0), complex(-6, 0)}; array double num[1] = {1}; array double den[1] = {1}; double tf = 6; CControl sys1, sys2, *sys3; CPlot plot; sys1.model("zpk", NULL, up, k); sys2.model("tf", num, den); sys3 = sys1.feedback(&sys2); sys3->grid(1); sys3->step(&plot, NULL, NULL, NULL, tf); return 0; }
#include <control.h> int main() { // system gain double k = 1423; // compensated system zero array double complex cz[1] = {complex(-5, 0)}; // compensated system poles array double complex cp[4] = {complex(-42.96, 0), complex(0, 0), complex(-4, 0), complex(-6, 0)}; array double num[1] = {1}; array double den[1] = {1}; double tf = 6; CControl sys1, sys2, *sys3; CPlot plot; sys1.model("zpk", cz, cp, k); sys2.model("tf", num, den); sys3 = sys1.feedback(&sys2); sys3->grid(1); sys3->step(&plot, NULL, NULL, NULL, tf); return 0; }
Output: