EE422

Experiment #1 (Counts as HW#14 and #15)

 

Note: Exam II will occur on Thursday, March 25!!!

 

Objective:

The objective of the first experiment is to acquaint you with a real-life application of state variables and state variable feedback!

 

Prelab (Counts as HW#14):

Due Thursday, March 11 (Complete the prelab and turn-in on Thursday. Keep a copy so that you can then do the actual lab on Thursday afternoon or Friday. You'll need a lab partner for the actual In-Lab portion):

 

In our Control Systems Laboratory (559 Anderson Hall) we have two MOTOMATIC DC servo systems. Figure 1 shows a schematic diagram for the MOTOMATIC (see HW#6 for the explanation of parameters).

 

Figure 1.

Schematic of MOTOMATIC DC servo motor system.

 

The MOTOMATIC is simply a DC servo with a voltage input (Vin) and two voltage outputs (the potentiometer voltage Vout which is proportional to the angular displacement, q out, and the generator or tachometer voltage Vg which is proportional to the speed of the motor, w m). The students in EE571 (like our own James Roller and Chris Brockman) have a lot of fun finding values for all the parameters in Figure 1 from which they can obtain the following state variable model for the MOTOMATIC:





 

where w=Vin and x1=Vout and x2=Vg. The output is directly proportional to the angular position of the motor shaft such that y=Vout=Kpq m/Na=0.5719q m. (Please use MATLAB to help you!!!)

1. a) Find a similarity transformation, x=Pz, which will decouple the state variable model (1). Write the new decoupled state variable model in the form:







b) Draw a block diagram for \the decoupled system. What are the eigenvalues of the system? Is the system completely controllable (i.e., both eigenvalues are controllable)? Is the system completely observable? Is it asymptotically stable, marginally stable, or unstable?

 

c) We can use MATLAB's lsim() command to simulate the response of a given state variable model (type help lsim to find out more information). Over the time period 0 to 2 seconds, simulate the zero-input response for the original state variable model (equation (1)) due to the initial condition Vout = 5 volts and Vg = 5 volts and Vin=0 (note that this is equivalent to giving the motor an initial angular displacement of about 160 degrees and an initial speed of 1500 deg/sec). Obtain a plot of Vout and Vg vs. time. Is the system marginally stable? Hint: You may want to use the Matlab code below to help you:

 

%Matlab code for finding the zero input response of xdot=Ax+Bw, x0 with output y-Cx+Dw

x0=[5;5]; %Set initial state to Vout=5 and Vg=5

t=[0:.01:2]; %Set time for 0 to 2 seconds with increments of 0.01 seconds

w=zeros(1,length(t)); %Zero out the input w (lsim requires w and t to be the same length)

[y,x]=lsim(A,B,C,D,w,t,x0); %lsim will return x and y (be sure to set A,B,C and D beforehand!)

plot(t,x);grid; %Make a nice plot

title('EE422- Prelab 1: Vout and Vg due to initial state of [5;5]')

ylabel('Vout and Vg (volts)');xlabel('time (sec)')

 

 

2. From problem 1c) you should have obtained the following plot:

Figure 2.

Zero Input Response of Motomatic due to initial state [5;5]

 

Note that while Vg does decay to zero, Vout actually increases from an initial value of 5 to a final value of 8 volts! Obviously, the system is marginally stable and it is our duty to make it asymptotically stable using state feedback!

 

a) Find the characteristic equation of the form, s2+a1s1+a0s0=0, for the original A matrix in equation (1) (You may use the MATLAB poly() command if you wish). Next, find the phase variable form of the original system:



b) Find the controllability matrix M=[B AB] from the original system then find the rank of M using Matlab's rank() command. The rank of M equals the number of controllable eigenvalues. Does your answer agree with your answer to problem 1b)? If the system is completely controllable, we can find a valid similarity transformation, Tpv, which will put the system in phase variable form. To this end, find Mpv=[Bpv ApvBpv] then find Tpv =M× Mpv-1

 

c) Using the system in phase variable form (equation (3)), find a state feedback control w=-Kpvzpv such that the closed-loop system satisfies the following specifications:

 

i) asymptotically stable

ii) all real eigenvalues (no oscillation)

iii) Vout decays to within 2% of its initial value by 0.3 seconds

 

Finally, find w in terms of the original state vector using w=-KpvTpv-1x=-Kx

 

d) Simulate your feedback control over the time period 0 to 1 second using lsim() and the initial condition, Vout=5 and Vg=0. (Hint: make sure you replace A by A-B*K in the MATLAB code for problem 1). Make a plot of x vs. t. Does Vout decay to 2% of its initial values by 0.3 seconds? Why not (remember that the settling time ts is a measure of how long the decoupled states take to decay to within 2% of their initial values!!)

 

e) Make a plot of the decoupled modes using the MATLAB commands:

 

[P,S]=eig(A-B*K); %Find P for new closed-loop matrix, A-b*K

z=inv(P)*x'; %Set z equal to the inverse of P times x (' means transpose)

plot(t,z,[0 1],0.02*z(1,1)*[1 1],'--'); %Make a nice plot showing the 2% level

 

From your plot, verify that the decoupled states decay to 2% by 0.3 seconds then go back and redo parts c) and d) using eigenvalues which are deeper in the LHP than your original design so that Vout and Vg meet the specifications (if you are really stuck, try setting the eigenvalues to {-20,-22}). Make a plot of the working design and go on to part f)

 

f) You now have a feedback control design, w=Vin=-Kx=-K0Vout-K1Vg which meets specs. Complete the following op-amp circuit which implements your control design (i.e., find values for Rf, R1 and R2):

 

In Lab:

Due Tuesday, March 23 (This will take about 15-20 minutes on Thursday or Friday afternoon with a lab partner. The lab is located in Anderson Hall 559)

 

1. Note: USE THE F10 KEY TO OBTAIN A HARD COPY OF A PLOT! Obtain an open loop response of the MOTOMATIC with the initial condition Vout=5 and Vg=5 (you can do this by turning the motor flywheel until 5 volts appears on the test meter. The software will try to simulate the initial velocity of Vg = 5). Is the system truly marginally stable?

 

2. Instead of using the above op-amp to implement are design, we will let a PC equipped with an A-to-D D-to-A card implement our control design. Use your feedback control design to obtain a closed-loop response with the initial condition Vout=5 and Vg=0 (you can do this by turning the motor flywheel until 5 volts appears on the test meter). Does this agree with your final MATLAB plot?

 

3. Making all the states decay to the origin is BORING! In EE571 you learn how to enhance your feedback control design so that the output TRACKS a desired reference signal. To whet your appetite, run the step, ramp, and sinusoidal response options using your value for K and Nx(0,0)=1, Nx(1,0)=0, and Nu=0. Does your enhanced feedback design do a good job of tracking a desired reference signal? If you are interested in learning how to do this, take EE571!!