StateFeedbackClosedLoop - MapleSim Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.
Our website is currently undergoing maintenance, which may result in occasional errors while browsing. We apologize for any inconvenience this may cause and are working swiftly to restore full functionality. Thank you for your patience.

Online Help

ControlDesign

  

StateFeedbackClosedLoop

  

determine the closed-loop equations of a system with state feedback controller

 

Calling Sequence

Parameters

Options

Description

Examples

Calling Sequence

StateFeedbackClosedLoop(sys, Kc, opts)

Parameters

sys

-

System; system object

Kc

-

Matrix; state feedback gain

opts

-

(optional) equation(s) of the form option = value; specify options for the StateFeedbackClosedLoop command

Options

• 

Kr = Matrix or 0

  

Specify a feedforward gain Kr (reference input). If Kr = 0, there are no reference inputs r and the returned closed-loop system is autonomous. The default value is 0.

• 

augment_output = true or false

  

True means append the sys inputs to the output vector of the closed-loop system. The default is false.

• 

outputtype = tf, coeff, zpk, ss, or de

  

Determines the subtype of the returned system object.  The default return type is based on the type of the system object specified in the sys parameter.

• 

parameters = {list, set}(name = complexcons)

  

Specifies numeric values for the parameters of sys. These values override any parameters previously specified for sys. The numeric value on the right-hand side of each equation is substituted for the name on the left-hand side in the sys equations. The default is the value of sys given by DynamicSystems:-SystemOptions(parameters).

Description

• 

The StateFeedbackClosedLoop command calculates the closed-loop system equations of the state feedback controller with Kc gain and plant sys.

• 

When the option Kr is specified, the state feedback controller is governed by the control law uc=Kc·x+Kr·r, where x is the state vector of sys, r is the reference vector, Kc is the feedback gain and Kr is the direct or feedforward gain.

• 

The sys is a SISO (single input, single output) or MIMO (multiple input, multiple output) linear system object created using the DynamicSystems package. The system object can be of types: transfer function (TF), zero-pole-gain (ZPK), coefficients (Coeff), state-space (SS), and diff-equation (DE). It is assumed that the state feedback controller gains are obtained using the sys representation obtained by DynamicSystems[StateSpace].

• 

The StateFeedbackClosedLoop command returns a system object whose type is the same as the type of sys, unless the option outputtype is specified.

• 

The closed-loop system inputs are

– 

the reference inputs r=y_ref (when a non-zero Kr Matrix is specified)

  

The reference vector r contains a reference signal for each sys output y.

• 

The closed-loop system outputs are

– 

the outputs y of sys

– 

the controller outputs uc (if augment_output = true)

Examples

withControlDesign:

withDynamicSystems:

A DC motor with stator inductance L, stator resistance R, electromotive force (emf) constant K, rotor moment of inertia J, and damping ratio b is modeled using the following differential equations.

eqsLdiffit,t+Rit=VtKwt,Jdiffwt,t+bwt=KitTt:

The input variables are the source voltage Vt and the torque load Tt, and the output variables are the rotor angular speed wt and the stator current it.

sysdeDiffEquationeqs,:-inputvariable=Vt,Tt,:-outputvariable=wt,it:

In state-space form:

sysStateSpacesysde:

PrintSystemsys

State Spacecontinuous2 output(s); 2 input(s); 2 state(s)inputvariable=Vt,Ttoutputvariable=wt,itstatevariable=x1t,x2ta=RLKLKJbJb=1L001Jc=0110d=0000

(1)

For control, the controlled input is the voltage Vt and the controlled output is the DC motor speed wt. The corresponding subsystem is obtained.

sysSubsystemsys,1,1:

PrintSystemsys

State Spacecontinuous1 output(s); 1 input(s); 2 state(s)inputvariable=Vtoutputvariable=wtstatevariable=x1t,x2ta=RLKLKJbJb=1L0c=01d=0

(2)

Designing the state feedback controller with gains Kc and Kr (u=Kc·x+Krr) by  pole placement with desired poles p1 and p2.

Obtaining the feedback gain Kc:

Kc,KrStateFeedback:-PolePlacementsys,p1,p2,return_Kr

Kc,KrJLp1+JLp2+JR+LbJJ2Lp1p2+JLbp1+JLbp2JK2+Lb2JK,LJp1p2K

(3)

The closed-loop equations of the state feedback control system are obtained next.

clsysStateFeedbackClosedLoopsys,Kc,:-Kr=Kr:

PrintSystemclsys

State Spacecontinuous1 output(s); 1 input(s); 2 state(s)inputvariable=w_reftoutputvariable=wtstatevariable=x1t,x2ta=RL+JLp1+JLp2+JR+LbLJKLJ2Lp1p2+JLbp1+JLbp2JK2+Lb2LJKKJbJb=Jp1p2K0c=01d=0

(4)

Using outputtype and augment_output, the transfer function of closed-loop system is obtained.  The output vector will contain the controller output Vt.

clsys1StateFeedbackClosedLoopsys,Kc,:-Kr=Kr,:-outputtype=tf,:-augment_output=true:

PrintSystemclsys1

Transfer Functioncontinuous2 output(s); 1 input(s)inputvariable=w_refsoutputvariable=ws,Vstf1,1=p1p2s2+p1p2s+p1p2tf2,1=LJp1p2s2+p1p2JR+Lbs+p1p2K2+RbKs2+Kp1p2s+Kp1p2

(5)

Assign numerical values for the parameters:

paramsJ=0.01,K=0.01,L=0.5,R=1,b=0.1:

Next, the numeric values for the desired poles are obtained. For 0.1% overshoot, settling time of about 1 sec, the damping ratio Z  and the natural frequency ω are defined as follows:

Z0.98:ω5Z:

polessolves2+2Zωs+ω2,s:

p1poles1;p2poles2

p1−4.999999998+1.015293305I

p2−4.9999999981.015293305I

(6)

Then, the numeric values for the feedback gain Kc and the feed-forward gain Kr are:

Kcmapsimplify,evalKc,params,zero

Kc−1.00000000213.00541026

(7)

Krmapsimplify,evalKr,params,zero

Kr13.01541024

(8)

clsysStateFeedbackClosedLoopsys,Kc,:-Kr=Kr,:-parameters=params:

PrintSystemclsys

Plotting the closed-loop system step response:

ResponsePlotclsys,8Step,duration=10,numpoints=200,labels=t,DC Motor Rotational Speed,labeldirections=horizontal,vertical,gridlines=true,view=0..10,0..10

Obtain the properties of the step response such as steady-state value and settling-point.

propStepPropertiesclsys

prop1.,0.103866687817983,0.100000000000000,0.231175892242102,0.333333333333333,0.441908334624695,0.666666666666667,0.742737847117827,0.900000000000000,undefined,undefined,1.09872655595021,0.980000000000000

(9)

plots:-displayplotprop2..7,style=point,symbol=cross,color=blue,symbolsize=30,plot0,prop1,10,prop1,color=gray,ResponsePlotclsys,Step,duration=10,numpoints=200,gridlines=true,title=Step response,labels=t,DC Motor Rotational Speed,labeldirections=horizontal,vertical,view=0..10,0..1.2

See Also

ControlDesign

ControlDesign[LQR]

ControlDesign[StateFeedback]

ControlDesign[StateFeedback][Ackermann]

ControlDesign[StateFeedback][PolePlacement]

 


Download Help Document