0:00

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.

Â 6:58

So, I have a new state. Well, what's the dynamics of the new

Â state? Well, delta x tilde dot is x minus delta dot, delta is constant so this is 0

Â so this is just x dot. So, it's Ax+Bu.

Â Well, I can write, I can add a minus delta and add in an A delta at the end

Â because then I have x tilde again here. so, if I do that, I get a new system and

Â here is the lucky part for us. A times delta turns out to be equal to

Â zero because of the structure of A so I get this thing going away.

Â I have x tilde here so my new system dynamics is the same as my old system

Â dynamics. x tilde dot is Ax tilde plus Bu.

Â And now, I want to stabilize this system down to the origin,

Â which means that the velocities are actually going to end up being equal to

Â the desired velocities. So, we have completely control of the

Â system. We wish to stabilize it.

Â We do pole placement. And again, like we talked about last

Â time, it isn't entirely clear how to pick the

Â eigenvalues. So, I played around with the eigenvalues

Â and this seemed to give a good response. I didn't want oscillations, so there are

Â no imaginary parts, and I picked lambda 1 minus 19, lambda 2 minus 7.5, and so

Â forth. This is the smallest eigenvalue, it's

Â going to tell me how quickly, in general, the system responds.

Â So, with this, I'm going to pick u as -K not x but x tilde, which is the, the new

Â system I'm interested in. I get my close look dynamics like this.

Â And, in fact, the way I compute K is to use the, the place command in MatLab.

Â So, I type in my P and K is place A, B, and P.

Â So, this stabilizes the Segway robot. So now, the last thing we have to do is

Â to actually do it. And the reason why I'm okay with

Â neglecting the unicycle base and only controlling v and omega is that the

Â curvature of the path that's being traced by the Segway robot, actually is omega

Â over v. So, what I'm really controlling now is

Â the curvature of the path rather than where the actual robot is.

Â And what I can do in the simulation that I'm about to show you is basically, with

Â buttons, make v bigger or v smaller or omega bigger or omega smaller.

Â And in essence, what I'm doing when I'm changing v and omega is I'm changing v

Â desired and omega desired. So, that's the way I'm going to be giving

Â reference signals or commands to the, the unicycle robot.

Â So, with that, let's move to the actual, actually the simulation of an actual

Â Segway robot. So now, we're ready to see our developed

Â Segway robot controller in action. And I'm here with Greg Droge who is a

Â graduate student at Georgia Tech who will be showing us a simulation of the, the

Â Segway robot, so, Greg, what do you have to show us? Okay.

Â Here, we have a simulation of the Segway robot.

Â On the left, we have a 3D implementation of the graphics.

Â So, you can see that now, I'm able to drive it around changing the velocities.

Â Just as, just as Dr. Egerstedt mentioned with the keypad.

Â and you notice a few interesting things. Right here in the top right corner you

Â see the plot of the translational velocity.

Â The red line is the desired velocity and the blue line is the, the actual

Â velocity. And you see that it converts this very

Â quickly to the inputs that I give it. And on the middle, you see the rotational

Â velocity and you see because of the eigenvalues that we've chosen, that it

Â actually converges really slowly but it still converges.

Â And on the bottom you see that they're, the tilt angle will always keep the, the

Â robot stable. So, I have a question.

Â Are you simulating this on the linearization or on the full nonlinear

Â model? So, the simulation is on the full

Â nonlinear model. Aha, so I actually have a question.

Â So, linearizations are only valid locally.

Â do you have any sense for when this breaks? Meaning, can we make the robot

Â fall over, for instance? Yeah, so if you give it a really big huge step input of

Â the translational velocity you'll see that in the 3D simulation, it goes in a

Â full circle and it actually hit the ground.

Â Do, do that again. That was exciting.

Â Okay. Aha, so there, we actually get a feeling

Â for how good or reasonable the linearizations are.

Â And in this case, it's fairly reasonable, you can drive it around, but if you give

Â it really large desired velocities, it actually falls over.

Â Correct. Alright.

Â Thank you very much, Greg.

Â Yup. You're welcome.

Â