So, we now have a general procedure for designing controllers which is pole

placement. And the whole idea there is, we pick our

k such that the desired eigenvalues line up.

We also, in the last lecture, learned when it works and when it doesn't and the

key characteristic there was controlability or complete

controlability. We can do pole placement when we have

complete controlability. If we don't, we can't.

Simple as that. And in fact, it's not just pole

placement. If we don't have complete controlability,

we can't make the system do what we want meaning, we have to buy a new one, bigger

b matrix. There's nothing else we can do.

Today, in this lecture, I would like to unleash these awesome powers that we have

on a complicated robotic system, namely a Segway robot.

And in fact, this is a robot that's balancing on these two wheels, and in

fact, here at Georgia Tech, we have a Segway robot, known as the

golem crane in Professor Mike Stillman's lab.

And basically, the way a Segway robot works is that it's a unicycle, roughly a

unicycle, on top of which there is an inverted pendulum.

And luckily for us, we know how to model unicycles and inverted pendulas.

Now, I'm writing +... there because there's a little bit more

going on, but basically we're going to be moving while balancing this thing.

so, let's start with the base. The base is a unicycle,

x1 and x2, that's the x and y position of the base.

And it's v cosine psi, where psi is the heading.

And psi dot is still omega. We've seen this repeatedly.

So, this is the dynamics of the base, almost.

And then, on top of that, we have this inverted pendulum.

And as we've seen, we need phi, which is the angle by which the pendulum is

deviating from upright position and we also need the angular velocity to

describe what is going on here. Now, the inputs to a Segway robot are

torques, wheel torques. So, the left wheel torque and the right

wheel torque. And torques translates into forces, or

torques and forces translate into accelerations, but here in the unicycle,

these are, are old control inputs. The velocities now, since we have inputs

that acts as torques, we need to actually add v dot and omega dot into the

equation. So, v and omega are going to be extra

states, that's where the +... comes from because, what I have done is I

have added v and omega as states to my, my model.

So, what I really have in terms of the state of the system, well, it's the

position of the unicycle, the translational velocity, its orientation,

the angular velocity, and then phi and phi dot associated with the upright face.

And my inputs are these wheel torques, left and right wheel torques.

And in fact, if I write down the dynamics of this thing.

Well here, I just have the unicycle dynamics.

That's all that I'm saying here, this is unicycle dynamics.

And then, I have all these other derivatives that I need to solve and

compute. And if you sit down and do the math very

carefully or you look in a book or something, you got this mess here.

Wooh, this looks kind of horrible. Well, the first thing we do, of course,

when we have something like this is we linearize it.

This looks absolutely miserable. But if we linearize it, what we end up

with is a, an LTI system and, in fact, it's x dot is Ax+Bu, and I should point

out that what I've done, is I've linearized this around (x,u)=(0,0), which

means that I have zero torques and the position of the robot is at zero.

It's looking at the x direction and the pendulum is looking straight up.

So, I'm linearizing it around 0,0. And if you do that, you get the following

A and B matrices. Obviously, I'm not going to ask anyone to

[LAUGH] memorize this. I'm just showing you.

This is where the A and B matrices came from.

Now, before we even attempt pole placement, let's make sure that we can

indeed do it. So, the first thing we have to check now

for this system is controllability. And this is too big, right? So, I'm going

to go to MatLab right away and write, here's the controllability matrix of my A

and B, here's the rank, and out comes 6. Does anyone remember what n was in this

case? Well, I do. n was equal to 7, which means that the

rank of the controlability matrix was not equal to 7.

So, this is not a completely controllable system.

And the problem here is the unicycle. We've already seen that when we linearize

the unicycle, the dynamics gets messed up, we can't move in the y direction.

I don't know if you remember that but if you say an x and y is the position of the

unicycle, then we had y dot equal to 0. What that means is we have no way of

moving sideways basically. So, the unicycle is what's making life

hard for us here, so what I'm going to do is I'm just going to ignore the unicycle.

Say, that the position and orientation of the base, I don't care about that, but

what I care about is, the velocities, how quickly it's moving and how quickly it's

turning. So, I'm going to shave off x, y, or x1,

y, x1, x2 and psi from the state space and get a smaller system that has s

states, the velocity, translational velocity, angular velocity and these phi

and phi dot associated with the pendulum. If I do that, I get a 4 by 4 system with

the following A and B matrices, again, the actual numbers aren't that, that

important. Well, I go to MatLab, I write rank

controllability matrix, I get the answer being 4.

In this case, n was equal to 4. So, if I shave off the unicycle base from

my system, I get the completely controllable system.

Now, I can start controlling it. The last twist though before I do that

is, I want my system to actually move. So, I'm not going to stabilize it to v

and omega equal to zero, because that's not what I want.

Instead, I'm going to say, I would like it to go to v desired and omega desired.

So, let's just subtract away v desired and omega desired,

and then I have a 0 here because you want to stabilize it to phi and phi dot being

zero, meaning, the pendulum being upright.

I'm going to find a new state, x tilde, which is my old state minus this

delta which is the thing I would like to stabilize it to. So, this is my delta.