Design a controller using Matlab

1 reply · 2K views · last reply
PhysicoRaj
Gold Member
Messages
538
Reaction score
49

Homework Statement


For the plant:
##G(s)=\frac{1}{s(s+2)(0.4s+1)}##
Design a controller in Matlab such that ##K_v=4## , phase margin = ##60^o## and zero steady state error for step input.

Homework Equations


##e_{ss} = Lim_{s->0} \frac{s R(s)}{1+D(s)G(s)}##
Lead/Lag compensator structure: ##D(s) = K\frac{(\alpha s + 1)}{(\beta s + 1)}##

The Attempt at a Solution


From the data that ##e_{ss}=0## for step input and finite non zero velocity error for ramp reference, the system desired is type-1. The plant already has a pole at ##s=0##, hence the controller need not add poles at ##s=0## .
I chose the lead/lag compensator to tune the phase margin.
Using MATLAB I found the plant has a phase margin of ##65.7499^o## at phase crossover of ##0.4777 rad s^{-1}##.
To find the controller gain K:
using ##R(s) = \frac{1}{s^2}## (for ramp input) and ##e_{ss} = \frac{1}{4}## in the steady state error equation, I got ##K = 8## .
So my compensator becomes:
##D(s) = 8\frac{(\alpha s + 1)}{(\beta s + 1)}##

I loaded the plant in the Matlab sisotool and tried adjusting the phase margin to 60 degrees but its not going beyond 46 degrees:
Screenshot of MATLAB SISO Design Tool showing a root locus plot and open-loop Bode plots for the plant, with the Control and Estimation Tools Manager compensator editor beside it, displaying a lead compensator with gain 8.


While with controller gain K around 2, the pm can be adjusted to 60 degrees:
Screenshot of MATLAB SISO Design Task window showing root locus, open-loop Bode editor with G.M 16.8 dB at 3.48 rad/s and P.M 60.1 deg at 0.938 rad/s, and a Control and Estimation Tools Manager compensator editor with lead compensator C = 2 (1+0.57s)/(1+0.23s).


Is my choice of controller or controller gain wrong? Or have i missed anything in this route? Are other assumptions and calculations right? How do I proceed further?
Also, how would I verify the steady state error of the closed loop system after design (from the ramp response? [attachment3]) .

Thank you.
 
Attachments
  • MATLAB figure titled Ramp response, plotting amplitude against time from 0 to 20 seconds. A solid blue curve starts at zero, bends slightly upward, then becomes nearly linear reaching about 18 at t=20. A thin grey straight line runs from the origin to 20 at t=20 for reference.
    attachment3.JPG
    35.3 KB · Views: 480
I finally solved it. I assumed the controller gain ##K = 8## to be the inherent gain of the plant and for that plant designed a restructured controller of the form:
##D(s) = \frac{(\alpha_1 s+1)(\alpha_2 s+1)}{(\beta_1 s+1)(\beta_2 s+1)}##
leaving with two poles and two zeros.

Screenshot of MATLAB SISO Design Task showing root locus, open-loop Bode plots with gain margin 19.6 dB and phase margin 64.4 deg, and the Control and Estimation Tools Manager compensator editor with zeros and poles listed.


Closed loop characteristics were satisfactory.

MATLAB Figure 4 plot titled Step Response: amplitude against time in seconds from 0 to 1.5, rising smoothly from 0 to a peak near 1.04 around 0.7 s, then settling at 1.0.


Thanks.
 
Attachments
  • MATLAB Figure 5 plot titled Ramp response, time in seconds from 0 to 6 against amplitude from 0 to 5; a straight grey input line and a slightly lagging blue system curve, with two data-tip labels at t = 4.5.
    fig5_ramp.JPG
    28.4 KB · Views: 453