0:20

And you have some quadratic parts in there, not too bad, over 4.

Â So this B matrix, we typically pull out the scalar in my book, so

Â you will see it's this B matrix over 4.

Â So when you linearize, this B matrix basically vanishes to identity, and

Â you get again MRP rates relate to omega as simply being omega over 4.

Â So this'll be important when we do feedback control, and linearize,

Â and so forth.

Â So that's why the 1/4 is outside of the B matrix.

Â So in your mind, you remember, angles over 4.

Â But this is a convenient form, it's very nice to program.

Â You've got a scalar times identity operator.

Â You could cross product operator and vector out of product operator.

Â So when you have to do algebra, I'll show you one of them.

Â Don't do it in the matrix component form again really look to use this formula.

Â And you can do these properties, derivations and proofs very,

Â very quickly, very, very compactly.

Â 2:05

Orthogonal right, which is very nice so it's easy to invert and

Â bring it over that's why this buffered form was convenient.

Â If just integrating MRPs you don't need this first column because this first

Â column times 0 is always going to vanish.

Â So you typically see a four by three version of this but

Â if you have to do an analysis, this buffered form is very, very convenient.

Â So a nice property people go well, quaternions, differential kinematic

Â equations, that B matrix can be orthogonal, that's beautiful, very handy.

Â Well, let's see what MRPs do.

Â 2:37

So, with the MRPs,

Â if you have to invert it while you can always invert the matrix booth force.

Â And there was a fact there were 4 that comes over, so

Â it's 4 times B inverse times the MRP rates.

Â Now, this matrix is not orthogonal but

Â it's called near-orthogonal by this definition.

Â The inverse of a B if it were equal to B transpose it would be orthogonal.

Â But here it's equal to B transpose times a scalar, that's it.

Â 3:10

So, it's almost orthogonal,

Â you just have that one scalar parameter you have to account for.

Â And if you're doing analysis,

Â especially there was some papers we wrote on perfectly linear, closely dynamics.

Â Another thing is where we have to do these things analytically.

Â And you have to take B inverse everywhere, only happen to do with transpose times

Â the scalar, saves you weeks of life of having to this stuff.

Â So, it's a very convenient formula.

Â You end up having to prove this,

Â this is something I'd expect you to be able to do it in the exam.

Â 3:40

So the way you prove this property is you look at B times B transpose.

Â If this was orthogonal, this would give you identity matrix, right?

Â But if you just carry out the math of B times B transpose,

Â you will get identity matrix times a scalar, right?

Â And so, if you bring the scalar over and matrix times something giving you identity

Â that's something has to be matrix inverse, that's the only way

Â matrix can something gives you identity at least for general matrices.

Â And that's how you could then argue that something has to be the inverse so

Â therefore it's a transpose times scalar.

Â But to do this B times B transpose, don't use this, use this definition.

Â because when you need to carry out there's chain rules,

Â you have identity times identity.

Â You will have identity times tilde, identity times this.

Â You will have sigma tilde times sigma sigma transpose.

Â What's going to happen with those products?

Â Sigma tilde times sigma sigma transpose.

Â Tony, what do you think?

Â Do we have to carry this math out?

Â Sigma tilde times sigma sigma transpose.

Â 4:51

>> Zero.

Â >> Zero, right?

Â because sigma tilde sigma is basically sigma cross with sigma.

Â Whatever else you do with that math it's zero times something it's all going to be

Â zero in this case in simplistic terms, right?

Â But you can see this is without doing all this stuff and

Â things have to cancel, you can do it in this form, carry out the components, and

Â you will quickly end up with something that gives you the answer.

Â So that's how you should solve that kind of a problem and

Â you'll be done in a fraction of the time.

Â 5:31

Talked about integrators just a little bit earlier.

Â I'm just going to get a new fresh page.

Â So we have, sigma dot = 1/4,

Â this B matrix times omega it's basically what you have.

Â We've done a problem where you have to integrate Euler angles basically of

Â this form.

Â You assume for now that omega is something known, right, that's back there.

Â 6:26

And in that time loop let's do a 4, 5.

Â Easy, well then, you have to compute the k1 term,

Â k2, k3, k4, right?

Â And if this is in state vector form, x = sigma,

Â x dot = f(x) which in this case is just

Â 1/4 B omega, well, omega matrix.

Â So that's your equation that you're that you're solving,

Â you call this thing 4 times with different inputs, right?

Â And then at the end the new state, you would say, okay, so

Â we say, x = sigma naught.

Â But then I say, xn+1 = xn + all these k's are in here,

Â they get blended together, right?

Â And that gives you your step and you're done.

Â 7:57

>> At each time step you have to check, the denominator is close to zero?

Â >> You don't check the denominator, that's the addition part you are thinking.

Â >> Okay.

Â >> How do we know we have to switch MRPs?

Â How do we know an MRP describes a 180 degree or more rotation, [INAUDIBLE]?

Â >> Back it's magnitude?

Â >> It has to be what value?

Â >> Above 1.

Â >> 1, right?

Â So for MRPs, think of the one surface.

Â It's what describes something being completely upside down,

Â that's it about any access, right?

Â So we are checking for the norm of MRPs being greater than 1,

Â that means I'm describing a.

Â Do you do that here?

Â Do you do it inside of this f function?

Â 8:54

>> Do you want to do it here?

Â >> [INAUDIBLE] >> Or here?

Â >> Can you do it up above before you [INAUDIBLE], Yeah.

Â >> Your voice is fading off, I can't hear a thing.

Â >> [LAUGH] I think, I'm trying to think of how you will do it,

Â but if you can do it before you feed the inputs into the integrator then you could

Â keep your integrator stand [INAUDIBLE], >> Okay.

Â >> Problems.

Â >> Okay, so you're saying here, basically.

Â This is the integrator part.

Â Let me just circle that with color.

Â 9:47

>> Average.

Â >> You could, right?

Â If your input is 190 degrees.

Â And hope infinity because there's a 360.

Â Otherwise you're just being cruel, you go smack him a few times, okay?

Â But assuming it's finite, you could check here if you wanted to and

Â say, upfront, am I close to 180?

Â If yes, I simply switch that.

Â 10:17

Same thing with the quaternions.

Â We had one set of quaternion, beta naught equal to this 4x3 matrix times omega.

Â It didn't matter if it's a long or

Â short rotation, they had the same differential kinematic equation.

Â The same thing holds here.

Â So we don't have to switch our equations that we're integrating.

Â I just have to switch, hey, I'm not at 190, I'm actually at minus 170.

Â And then, the same math holds.

Â So, you could do that here, that would work or

Â very often I assume this is a good input.

Â I do it at the end of the integration steps.

Â So, if I feed it back to the other routines, different things,

Â I tend to put it right here.

Â And this is as if I'm checking if the norm of sigma > 1,

Â then I'm simply saying sigma ends up being minus sigma/sigma squared

Â has basically, whatever sigma measure you're having your code,

Â I'm reversing the sign and dividing by the norm squared.

Â 11:16

because I'm not counting on being precisely on 1.

Â So if you have really time step, you're tumbling quickly,

Â you may have jumped 285 degrees, quite a bit past 180, no problem.

Â Nothing bad happens at 180, it's purely a choice to switch there.

Â In fact, there's some papers who talk about switching at general surfaces

Â another kind of stuff,

Â but there's no practical benefits that I've seen, it's just nice mathematics.

Â 11:58

David.

Â >> Daniel.

Â >> Daniel, Bobby, this is not my day for names.

Â >> You might get different k's, one of the functions might decide to flip, it might,

Â and the other won't.

Â >> Yeah, so what can happen is you're right around 180, right?

Â And with this you're doing some at the current time step, the rates,

Â then half a time step forward, then a full time step forward.

Â And you're blending them, and in that time step you might be switching through 180.

Â And then so some answers are around 180, the other answers

Â are around minus 180, and I blend them together and I get 0.

Â And that's not more precise, it's plain wrong, okay?

Â So here, just one of the things, people always to this,

Â I'm just going to highlight it again.

Â That switching has to happen outside.

Â So, Trevor, you had a good idea.

Â You don't want to do it inside the integrator block.

Â Let it do it's thing, we're not operating around, bad things happen.

Â Nothing, just let it do it's thing, and

Â just make sure you put it in a sensible place.

Â You could put it up top, I tend to put it on the bottom, either works, right?

Â That's where you want to do the switching, and

Â then you just keep in chugging along, that's it.

Â So with that one little if statement, I can do with the three parameter set,

Â I'm not introducing quarternian constraints.

Â Otherwise, my attitude control problem of something tumbling freely in space becomes

Â immediately a constrained integration problem, is in fact with the quaternions

Â after you've integrated, you probably have to go and renormalize your quaternions.

Â because with integration errors they don't stay at unit norm, they become 1.000001 or

Â something, right?

Â And if checked, it would grow unbounded.

Â So with quaternions you have to do something at every integration time step

Â to renormalized it to keep on that surface.

Â MRPs I simply have to check, do I need to switch or not?

Â And that's it, so there's no more complexity in the code but

Â I can do complete non-singular 3D description with only three

Â parameters using the combined MRP and shadow set.

Â Cool, that's the integration stuff.

Â