You are on page 1of 7

From the main problem, the dynamic equations in state-space form are given below.

(1) (2) he above has the form of a standard set of state-space equations as described below. (!) (") For the original problem setup and the derivation of the above equations, please refer to the #$ %otor &osition' (ystem %odeling) page *ith a 1-radian step reference, the design criteria are the following. • (ettling time less than +.+"+ seconds • ,vershoot less than 1-. • /o steady-state error, even in the presence of a step disturbance input First create a new m-file) and type in the following commands (refer to main problem for the details of getting these commands). 0 1 !.222"3--4 b 1 !.5+663--4 7 1 +.+26"4 8 1 "4 9 1 2.653--4 : 1 ;+ 1 + + -b<0 7<0 + -7<9 -8<9=4 > 1 ;+ 4 + 4 1<9=4 $ 1 ;1 + +=4 # 1 +4 motor?ss 1 ss(:,>,$,#)4

Designing the full state-feedback controller
(ince all of the state variables in our problem are very easy to measure (simply add an ammeter for current, a tachometer for speed, and a potentiometer for position), we can design a full-state feedbac@ controller for the system without worrying about having to add an observer. he control law for a fullstate feedbac@ system has the form u 1 r - Kc x. he associated bloc@ diagram is given below. 8ecall that the characteristic polynomial for this closed-loop system is the determinant of sI(A-B*Kc) where s is the 9aplace variable. (ince the matrices A and B*Kc are both !A! matrices, there should be ! poles for the system. his fact can be verified with the %: 9:> command order. Bf the given system is controllable, then by designing a full state-feedbac@ controller we can move these three poles anywhere weCd li@e. *hether the given system is controllable or not can be determined by chec@ing

+"+ seconds. though it can be numerically unreliable.+26" -!. . :dd the following code to the end of your m-file.#)4 step(sys?cl.>)) sys?order 1 ! determinant 1 -!.++1! -+.. *e will use the command place since it is numerically better conditioned than ac@er. B AB A^2B . then we would have to use the command ac@er. the dominant poles correspond to a second-order system with zeta 1 +. he following commands eAecuted at the command line will verify the systemCs order and whether or not it is controllable. p1 1 -1++E1++i4 p2 1 -1++-1++i4 p! 1 -2++4 7c 1 place(:. *e will first place the poles at -2++. he %: 9:> command ctrb constructs the controllability matriA given A and B. if we wished to place a pole with multiplicity greater than the ran@ of the matriA B. overshoot and sigma 1 1++ which corresponding to a settling time of +.5 corresponding to +. Fowever.Kc x. sys?order 1 order(motor?ss) determinant 1 det(ctrb(:.$. :dditionally. to achieve these poles. the command ran@ determines the ran@ of a given matriA. -1++E1++i and -1++-1++i.+54 sys?cl 1 ss(:->H7c.GG2G 8eferring bac@ to the equations and schematic at the top of the page. the state-space equations become the following.>. Kc.=.t) .>.p1. t 1 +'+. p!=) 7c 1 +.++1'+. we @now that our system is controllable since the determinant of the controllability matriA is not Dero and hence we can place the systemCs closed-loop poles anywhere in the s-plane.. >y ignoring the effect of the first pole (since it is faster than the other two poles). we will use the command det to calculate the determinant of the controllability matriA where a full ran@ matriA has a non-Dero determinant. herefore.1-. we can use the %: 9:> commands place or ac@er to determine the controller gain matriA.nce we have determined the pole locations we desire.the ran@ of the controllability matriA . (5) (-) *e can generate the closed-loop response to a step reference by adding the following lines to the end of your m-file.. we see that employing a statefeedbac@ law u 1 r . p2."-!-eE2" From the above. 8un your m-file in the command window and you should generate a plot li@e the one shown below.

t) . $. >efore we address this. the steady-state error is much too large. #)4 step(dist?cl./ote that our given requirements are not met. letCs first loo@ at the systemCs disturbance response. Disturbance response Bn order to observe the systemCs disturbance response. *e can simulate this simply by modifying our closed-loop input matriA. dist?cl 1 ss(:->H7c. as do all the other terms in this equation).. his load torque acts as an additive term in the second state equation (which gets divided by J. we must provide the proper input to the system. :dd the following lines to your m-file and re-run. Bn this case. specifically. a disturbance is physically a load torque that acts on the inertia of the motor. B.+4 1<0 4 +=. to have a 1 < J in the second row assuming that our current input is only the disturbance.

he reference r.r where y = theta. it will also cancel a step disturbance input in steady state. his equation will be placed at the bottom of our matrices. Bf the integrator comes before the inIection of the disturbance./otice that the error due to the step disturbance is non-Dero. *e can model the addition of this integrator by augmenting our state equations with an eAtra state for the integral of the error which we will identify with the variable w. now appears as an additional input to our system. his adds an eAtra state equation. e = y . Adding integral action From prior eAamples. (6) (2) (G) . therefore. this will also need to be compensated for. herefore. we @now that if we put an eAtra integrator in series with the plant it can remove the steady-state error due to a step reference. where the derivative of this state is then Iust the error. he output of the system remains the same. his changes our control structure so that it now resembles the bloc@ diagram shown in the following figure.

does not affect the states (eAcept the integrator state) or the output of the plant. /ote that the reference.+=4 p" 1 -!++4 7a 1 place(:a.1 + + +=4 #a 1 .>r.+ 4 + 4 +4 -1=4 $a 1 .. we will place the pole associated with the additional integrator state at -!++. *e can also rewrite this in terms of our augmented state as u 1 -Ka xa where Ka 1 . Bn order to find the closed-loop equations. r. :dd the following lines to your m-file which reflect the closed-loop equations presented above. affects the plant. without implementing the state-feedbac@ gain matriA Kc.hese equations represent the dynamics of the system before the loop is closed. it affects the system in eAactly the same manner as in the unaugmented equations eAcept now u 1 -Kc x . we have to loo@ at how the input. it will be used in the place command rather than Br.$a. Ba. :a 1 . his is eApected since there is no path from the reference to the plant input. u. (1+) (11) Bn the above.p"=)4 t 1 +'+. *e will refer to the state vector of the augmented system as xa. and Da.p1.+ 1 + + + -b<0 7<0 + + -7<9 -8<9 + 1 + + +=4 >a 1 . (ince we need to place each pole of the system.p!. /ote that since the closed-loop transition matriA Aa-Ba*Ka depends on Ba.+54 sys?cl 1 ss(:a->aH7a. *e will refer to the system matrices in this equation that are augmented with the additional integrator state as Aa.>a. /ow we must redesign our controller to account for the augmented state vector.#a)4 step(sys?cl. and will result in the steady-state error being reduced to Dero.t) . 8unning your m-file will then produce the plot shown below. which will be faster than the other poles. Kc Ki =.+ 4 + 4 1<9 4 + =4 >r 1 . u. the integral of the error will be fed bac@.p2. Bn this case.++1'.Ki w. (ubstituting this u into the equations above provides the following closed-loop equations. he vector multiplying the reference input r will be referred to as Br. Ca.

we use a similar approach to that used without the integral action. dist?cl 1 ss(:a->aH7a.o observe the disturbance response.#a)4 step(dist?cl.+ 4 1<0 4 +4 +=.$a..t) .

this requirement can also be met. but by placing the closed-loop poles a little farther to the left in the compleA splane.*e can see that all of the design specifications are close to being met by this controller. he settle time may be a little large. .