0:06

The next thing we're going to do now is talk about how you pick the right gains.

Â And this is where MRP's actually shine as well.

Â It makes it quite simple to predict what the close loop performant is going to

Â be because the MRP's linearize very, very well.

Â They're not perfectly linear but they're easy to linearize.

Â So we're going to go back to our classic PDE with the feet fold feedback parts.

Â because this especially with the full quadratic

Â omega measure leads to these closed loop kinetics equations.

Â Then associated with this you also have the sigma dot equations, right?

Â So we still end up with six differential equations.

Â Now we want to figure out what k do I pick and that's a scalar with this control.

Â P could be a fully populated matrix because that's going to impact,

Â is it going to be overshooting, undershooting.

Â Is it over damp, is it critically damp,

Â what's the decay time, all those classic linear control measures.

Â We want to see how we can apply that.

Â So this right now is linear here but

Â the differential equations themselves are going to be non-linear.

Â So what we're going to do next to linearize this gets dead simple.

Â 1:45

>> Identity >> Identity.

Â The one minus sigma term.

Â There's this tilde thing that drops everything out as quadratic and

Â then there's another one that was an outer product.

Â Sigma, trans-sigma, sigma transpose, also quadratic terms.

Â So it's just proxy, so really if you remember MRP's linearized to angles over

Â four, it's also true for the rates.

Â So the sigma-dot first over approximation is just equal to del mega over four,

Â that's it.

Â So this is the full equation but

Â now you have a nonlinear dynamical closed loop system.

Â We know it's stable and everything, but we want to linearize it so

Â we can use classic linear control, rise time, settling time, all those principles.

Â So I'm going to approximate this b now as being basically

Â identity over four and that's it.

Â And if you go back and look at your MRP notes you will remember that tangent phi

Â over four function it's very flat,

Â very straight right up to well past 100 degrees.

Â 3:36

And if you go, I'm just going to keep this here.

Â This is a diagonal.

Â This is a diagonal, this is already a diagonal identity.

Â P, let's write P also as a diagonal just as a fully populated matrix.

Â I'm just going to use the same gain p for all the different states.

Â Omega one, omega two, omega three, it just becomes a p scalar times identity.

Â And that times I inverse is the same.

Â So if you that you can actually rewrite this six-by-six

Â as three decoupled, into three different two-by-twos.

Â You just have to look at the sigma1 omega1's that's how they couple.

Â And this sigma2 with omega2's coupled the same way.

Â Sigma3, delta omega3's coupled the same way.

Â So it's a nice way to look at, it's pretty common.

Â I've seen rare implementations where they pick a fully populated p.

Â You could do it, but I'm using the same,

Â no actually this form I'm using different p's, that's right, sorry.

Â I'm using a diagonal p one, two and three, so I'm still losing some generality, but

Â I'm getting this decoupling.

Â So I can look at two-by-two systems.

Â Two-by-two is great because it tends to out to be exactly spring mass damper like

Â systems.

Â And you can pretty much look up now what the closed loop stuff is.

Â In fact I just solved this for the characteristic equation.

Â This is where my roots will lie.

Â These are the two roots.

Â So if you want to pick these gain you could do a root locus plot and

Â study change in p.

Â How does that impact my roots, change in k, how does it impact the roots?

Â And you can go back and forth.

Â And if you have different inertia, what happens here?

Â 5:31

This is how you get from the roots, also to the, what's this?

Â This is the decay time when you've dropped to half the value essentially.

Â That's what you're looking at and the damped natural frequency.

Â So how do we pick gains?

Â You can start here.

Â There's a lot of competing arguments.

Â You only have one k and I have three p's.

Â [LAUGH] That gives me four parameters.

Â And so you can pick some of them.

Â But once you pick, if you have inertia and you want a certain decay time

Â per axis that's going to dictate the three P's right away, right.

Â Then you still get to pick a k.

Â And you can see you can pick here with the coefficient.

Â Maybe you want to make the damping ratio one making it critically damped

Â less than one, slightly underdamped.

Â That's a popular choice.

Â But there's only four gains you get to pick.

Â So once you've dictated enough conditions the rest of the conditions

Â come out of this.

Â So you have to pick the right conditions to pick it.

Â 6:24

But does this make sense?

Â At least a little bit?

Â It's this classic linear control which I'm assuming you've seen at some point or

Â at least familiar with the spring mast ampere system.

Â Or something like this you get the characteristic equation.

Â These are the roots.

Â And once you have the roots of a system you can look up on Wiki.

Â You can pull out all these standard form factors.

Â So that's really cool.

Â So we can now start with, I have this decay time.

Â I don't what this actually when I write code I often do it this way.

Â I don't say just pick a p(1) but I'm looking at my inertia and saying.

Â You know what this craft I should settle but within 20 seconds,

Â 30 seconds it should be at least half as close, right?

Â I think that as a starting value and

Â then whatever the inertia is it sets the right gain.

Â And this could be done even in a self tuning way.

Â So I'm going to show you some examples here where we compare how linear or

Â how well we can predict the response.

Â Got my interias, got some large initial altitude errors and rates,

Â it's going to tumble.

Â I've got my games that I've picked and with the system and

Â you saw we decoupled the one access stuff.

Â The access stuff and the three access stuff but

Â making some diagonalizing assumptions on the p matrix and the i matrix.

Â So we can look at them individually and just got a sum squared, the F's along

Â is the mean route errors, root mean squares of sigma i's and omega i's.

Â That's what I'll be plotting here.

Â So the control, you can see it's a large maneuver it actually goes past

Â 128 where it switches to the other one and then stabilizes.

Â I picked gains on purpose to have different kind of expected decay times.

Â Some of the axes decayed their errors very quickly.

Â This other axis which is sigma 2 it looks like is getting there but

Â it takes much longer.

Â So I'll give this different frequencies that should match up with my linearized

Â predictions.

Â The omega's same thing, as your sigma's settled the omegas, that's omega ones,

Â omega twos,

Â delta omega two's going to take longer control you get all your access.

Â Now here I can show,

Â you can see that that second axis is decaying at a much slower rate.

Â And the one and twos are decaying at a much faster rate.

Â From this figure plotting these epson on a log scale, I can extract out,

Â you can do kind of a curve fit and figure out what the mean trend is.

Â That's your exponential decay time and

Â I can compare it to my linearized predictions.

Â And keep in mind I'm doing a very large tumbling maneuver here,

Â this is not a small maneuver.

Â So what I get out of this is decay times what came out of my linearized

Â predictions was 15, 75, and 15 seconds, the half life.

Â The actual ones come out of the four non linear simulations are pretty darn

Â close to that.

Â That's kind of a nice it doesn't take much post tuning of the parameters to get those

Â decay times close to what you wanted.

Â So the differences here only a few percent.

Â And this is a down natural frequency.

Â That's why I'm looking at these oscillations.

Â So you get about ten of them.

Â And then divide by ten that gives you a good mean.

Â What is that to damp frequency?

Â And what my linearized predictions were were here.

Â And the actual response is here.

Â And you can see we've only got a few percent errors out of this stuff.

Â So this is kind of a nice thing then right.

Â So we've got some good feedback in selection technique that we can use.

Â Now dispute this wonderful lecture I just gave, I can promise you in the home works.

Â The last homework you do, you do a lot of controls.

Â And there's always people that comes to me going well I think everything's working

Â but and this is what their plot looks like.

Â 10:42

Is your stiffness K going to be large?

Â With a stiff system do you have a fast oscillation or

Â with a stiff system do you have slow oscillations?

Â >> Fast.

Â >> Fast, right?

Â So if you have fast oscillations that must means you must have a really

Â stiff system and the issue here is the most popular gain in the world is one.

Â [LAUGH] Doesn't matter what the inertia is.

Â Cube said or hog worth that's star.

Â I can promise you at some point some control engineer threw in

Â one just to help it, to see what would happen.

Â That's where people start.

Â What I hope to show you is with the other analysis you can quickly throw in that one

Â there at least tells you, hey this is the k time part if you want 20

Â seconds response with this inertia this is roughly where the game should be, right.

Â So you need to back off on the proportional part.

Â What you want to have is something that's hopefully close to critically damped maybe

Â it comes in.

Â And you know it slightly overshoots and then it settles.

Â People like slightly under done systems because you get close

Â to the target quickly.

Â And overall settling time to get within a certain tolerance is faster

Â than a critically done system that adds a little bit more lag to the system.

Â But that means back off in those gains.

Â Don't just start with one, we'll maybe start with one just for the hell of it.

Â And then bring it down or use this analysis that I gave you and

Â you can quickly plug in numbers.

Â And go okay, I should have a value of .001 or this should be .5, you know?

Â Some other value.

Â But that's a common thing that happens with gain selections.

Â And this really is hard to see or

Â they're going well, I think it's I think it's getting smaller.

Â I'm really hopeful.

Â I do think so.

Â I just took six hours to compute that equation but

Â I think it's getting this blip is smaller than this.

Â It probably means you picked some crazy gains.

Â Maybe your rates are way too big, your rate feedback part, and

Â that's going to actually prevent you from converging.

Â If you have a huge rate, you might be way over depth.

Â And in that case it's just kind of doing this and

Â then you're saying hey that proves it's data destabilizing.

Â And I go bullshit.

Â This doesn't prove anything.

Â It may have gotten closer but

Â how do I know it's all getting closer to a fixed offset, right?

Â If it's logger unstable, it's taking a long time and

Â you just haven't run out long enough Enough.

Â So these games are important.

Â Play with them a little bit and you can see.

Â Okay, if I'm guaranteeing as some product stability

Â show me as some product stability on the system.

Â And so this one cutted the homework when you do this.

Â It should go to zero.

Â Show me something that goes to zero.

Â Pick the right games one not long enough.

Â That's all about games there.

Â Good, any question on gain selection?

Â This is the one part of a class that I have a little a bit of a prerequisite I

Â don't go through all system.

Â I don't explain what natural frequencies are, damped natural frequencies.

Â I assume you've seen this or I swear there's probably several Wiki pages.

Â So you can just go read the concepts, this is all you need.

Â Then you're ready to go.

Â Okay.

Â