# How to move root locus to the left?

I'm trying to control system that has 3 poles (2 in the right half plane)

I sketched root-locus but the two positive poles are going right and never be in the left half plane at any value of k

The state space of system is following

A =
0   1   0
-3.20205979037663e-08   0   -31.1556786564355
83333.3331597258    0   -173598.323255178

B =
0
-3.11556786564355e-08
83333.3331597350

C =
-0.999999999999890  0   0

D =
0


How can I control system like this?

Note: I'm using matlab

• You should show what have you done in Matlab and your system representation. Oct 12 '16 at 8:37
• By system representation you mean state space or what? Oct 12 '16 at 9:48
• Yes, state space for example, or a transfer function. Oct 12 '16 at 10:07
• Edited the question Oct 12 '16 at 11:12

Brief process for pole placement in Matlab:

1. Check that the system is actually controllable.

.

nStates = size(A,1);
R = zeros(nStates,0);
for n = 1:nStates
R(:,n) = (A^(n-1))*B;
end
if rank(R) == nStates
disp('Controllable');
else
disp('Not controllable');
end

1. Find the open-loop poles. Get their natural frequencies.

.

olPoles = eig(A);
wns = sqrt(sum(abs(olPoles).^2,2));


In your case, the first pole is huge and negative, the other two are purely imaginary. I'm assuming you want to get rid of this oscillation and keep everything else the same. In any event, whatever you choose:

1. Pick new poles. There's a lot of guidance available online about how to pick "good" poles, so I'm not going to go into any detail here. Like I said, at least to start with, I'd just change (create) damping on the two undamped poles and iterate from there. Whatever you choose, get your closed loop poles by doing the following for each pole:

clPole = - (dampingRatio*wn) +/- 1i*wn*sqrt(1-dampingRatio);

Do this for each pole. If you don't want to change a particular pole, then just set clPole(n) = olPole(n);.

1. Setup the equations to be solved to insert your new poles.

.

syms P1 P2 P3;
syms s;
syms g1 g2 g3;

G = [g1 g2 g3];
desiredPoleEquation = (s-P1)*(s-P2)*(s-P3);
currentPoleEquation = det([s*eye(nStates) - (A - B*G)]);

[desiredCoeffs,desiredSValues] = coeffs(expand(desiredPoleEquation),s);
[currentCoeffs,currentSValues] = coeffs(expand(currentPoleEquation),s);

equationSetup = sym(zeros(nStates+1,2));
controllerGainEquations = sym(zeros(nStates+1,1));
for i = 0:nStates
desiredIndex = find(desiredSValues == s^i);
if ~isempty(desiredIndex)
equationSetup(i+1,1) = desiredCoeffs(desiredIndex);
else
equationSetup(i+1,1) = 0;
end
currentIndex = find(currentSValues == s^i);
if ~isempty(currentIndex)
equationSetup(i+1,2) = currentCoeffs(currentIndex);
else
equationSetup(i+1,2) = 0;
end
controllerGainEquations(i+1) = equationSetup(i+1,1) == equationSetup(i+1,2);
end


The end of the block of code above is controllerGainEquations, which has a function of P1,P2,...,PN on the left and g1,g2,...,gN on the right.

1. Solve the equation controllerGainEquations for [g1,g2,...,gN]. The result here will be gains as a function of poles P1,P2,...,PN.

.

controllerGains = sym(zeros(nStates,1));
controllerGainsStruct = solve(controllerGainEquations,[g1,g2,g3]);
controllerGains(1) = controllerGainsStruct.g1;
controllerGains(2) = controllerGainsStruct.g2;
controllerGains(3) = controllerGainsStruct.g3;

1. Almost done - now plug in the values you picked for the poles.

.

controllerSolvedGains = controllerGains;
controllerSolvedGains = subs(controllerSolvedGains,P1,clPoles(1));
controllerSolvedGains = subs(controllerSolvedGains,P2,clPoles(2));
controllerSolvedGains = subs(controllerSolvedGains,P3,clPoles(3));

1. Use the gains correctly. Your control signal is now $u = -G*x$, where $x$ is the vector of states. It is not whatever you originally had. You don't add anything to it. It's not anything other than $u = -G*x$.

Finally, a couple notes on the method I've given:

1. I wrote this myself because this method will solve for gains with a symbolic state matrix. Pole placement is a method for linear, time-invariant (LTI) systems, so in theory you shouldn't be using a symbolic state matrix, but it's handy for scenarios where you have configurable/variable parameters and want one calculation for gains.
2. The gains calculated this way aren't necessarily "robust". Matlab's place() command is supposed to create "better" gains.
3. Protip - if you're getting huge number fractions as a result, it's because controllerSolvedGains is still a symbolic. Use double(controllerSolvedGains) to get a succinct number to use.
4. Finally, this just works to drive the states to zero. If you want to do reference tracking, you should look into integral control, which requires adding a state (integral error) to the system $A$ matrix. That's beyond the scope of what I wrote here.

## :EDIT:

Every step I wrote is the long way to do it. If you have a non-symbolic state matrix and you have the Control System toolbox, then you can do each step as follows:

1. Check that the system is actually controllable.

.

nStates = size(A,1);
olSys = ss(A,B,C,D);
R = ctrb(olSys);
if rank(R) == nStates
disp('Controllable');
else
disp('Not controllable');
end

1. Find the open-loop poles. Get their natural frequencies.

[wns, dampingRatios, olPoles] = damp(olSys);

2. Pick new poles. You have to do this on your own.

4 to 6. Setup, solve, and substitute the closed loop poles to find the gains. All of this is done in one command:

G = place(A,B,clPoles);

1. Use the gains correctly. This is still up to you to do.
• can I replace first code snip with ctrb function? Oct 12 '16 at 16:35
• @AmmarAtef - Yes, you can use the built-in functions if you have the Control Systems toolbox and don't have a symbolic state matrix. I'll edit the answer to reflect those commands. Oct 12 '16 at 18:08
• I think picking new pole is not easy to predict, but I did it using sisotool, it is very helpful toll Oct 14 '16 at 12:19
• @AmmarAtef - Generally, the further left you go on the real/imaginary axes, the faster the system responds. This comes at the cost of requiring more actuator authority. If you setup the controller to respond faster than the system is actually capable of responding, you wind up with actuator saturation and this causes nonlinearities. Remember that the state feedback controller is for linear time-invariant systems. You can generally get a little faster response, as far as rise time and settling times are concerned, by allowing a little oscillation. This is done by altering the damping ratio. Oct 14 '16 at 12:37
• I will take care with that, I'm reading ogata's book for modern control and I will learn more about all of that Oct 14 '16 at 12:48

You want to study "state space pole placement design." It is a very powerful technique. In Matlab the steps are for you to create a vector of poles that you want the system to have, and then use the place function. Matlab's help for this command is nicely specific.

• Here is a nice reference: me.umn.edu/courses/me8281/notes/statefeedback.pdf Oct 12 '16 at 11:53
• Isn't root locus a classical control approach which uses frequency domain to manipulate the signal? On the other hand, state space is a modern control approach to target the system in the time domain? Oct 12 '16 at 11:57
• Pole placement can be done with either classical or state space techniques. Both result in changing the system's characteristic equation when the control gains are incorporated. The question included the system's state space model, so that is what the answer addresses. Compensator design using root locus techniques is also valid. Even though state space is a time domain technique, the frequency characteristics of the system are still valid since the matrices model the differential equations. You just never need to work with the Laplace transforms directly. Oct 12 '16 at 12:12
• pole placement? I think we need zeros not poles ... not sure, so I will read documentation and try it. Oct 12 '16 at 16:39
• I think we need zeros not poles It is normally poles that decide on stability, not zeros. Poles of the transfer function, that is. Oct 14 '16 at 5:03