Let's start talking about momentum device control loss. We've finished arriving the variable speed CMG. We've shown how you can break down this variable speed CMG into reaction wheel part, CMG part, or variable speed and CMG, which is that equation, is almost the same as a CMG, does that one extra term that you have to drop. That was it. Now we're going to start to talk about how we use this to turn this into a feedback control law. We're going to start out with essentially a 50-10 material where we're talking about just attitude control, tracking some reference. It's what you just derived for the widest homeworks. But there you just assumed there's an external control you and we solve for you and implement it. What if we now have a series of reaction wheels? That's what we'll do today. There's won't take very long. Then we do see CMG's. That'll take more than one lecture. That's where it gets a little bit more complicated. But it's actually really interesting. Let's look at reaction will control devices. We derived one of these expressions here as a way people often do it. They back substitute the motor torque equation. You have angular momentum then the motor torque is directly in my angular acceleration expression. We have this decoupling and you still of course have motor torque equations to integrate and figure out what happens to my wheel speeds. You still have to solve two, but it's two decoupled equations instead of two coupled equations. That's typically what people do with reaction wheels. Don't have to. Remember in here, the way we did this back substitution is that we would end up with the spacecraft hobby inertia. But then only the transverse and gimbal axis, the inertia of the wheel system, not the spin axis one, because that was required to pull out to get this decoupling. That was how this one that was defined. Now we have new equations of motion where we had a single rigid body, we have this term, we have this gyroscopic term, we have the torque and we've just had you not GS times U. That was it. Now we have an extra gyroscopic term and there's a projection matrix times all our possible control inputs that we have. How does that impact it? We're going to use the very same Lyapunov functions that we were doing earlier. This is really what I've described as the outer loop and says, "Okay, I am pointing here. I want to point at Boulder. As I'm flying around Boulder, I want to keep pointing at Boulder." That's your time-varying reference orientation. We're assuming we have all our reference. Sigma here would be sigma B relative to R from our shorthand, I'm just going to write it as sigma and del omega from a angular velocity tracking error is omega BN minus omega RN. But just as a shorthand notation, just what we did before. We create a Lyapunov function. This looks almost identical. What's the only difference, Josh?Instead of just I, we're writing IRW. This is not the inertia tensor of the full system, but with that one spin axis, we'll stuff turned out because this is how we got the two coupled equation. Don't have to do it. If you had two coupled, you could have written with I as well. We'll see that in a moment. We do all that. We take a derivative, we're setting it equal to a negative semidefinite function. Same arguments before attitude is not appearing. That's why it's semidefinite and instead of negative definite. Then you solve for this. This is the closed loop dynamics that must be achieved. Now it becomes apparent because del omega is going to be at the body frame derivative del omega is the body frame derivative of omega, which is the same as the inertial derivative of omega. Omega is omega B relative to N. So that'll give you IRW omega dot, which will allow you to plug in without inverting any inertia tensor directly the equations of motion. Then the rest of it just has to equal to this, equal to sum up to zero. You do that and you end up with, and I solve for the control input, which here will be G_s' times U_s. Before we just had you, there was an external 3D control vector that had to be applied with thrusters or something. Now we have a set of motor torques. And the G_s is the projection matrix of G_s1, G_s2, G_S up to N. About which axes are the spin axis aligned. As we discussed before, hopefully, you didn't just align them all up into one axis because that would be not full rank. We want to make sure this is full rank. But then on the right-hand side, we have this and I'm calling that minus L_r because these are the motor torques. A positive torque on the wheel will do what to the body? It will give you negative onto the body and equations of motion we have minus G_s U_s for that reason. There's a required torque that we have to generate them calling this minus L_r. Because without the reaction wheels with just external torque, we had L_R. The required control torque was literally minus k Sigma minus P Del Omega and all this other stuff. That gives you the consistency. The right-hand side is essentially what is the external torque, that we have to produce onto the spacecraft in that sense. But we had reaction meals in here. How did this get more complicated? Well, you have this extra gyroscopic term we have to account for, and that's about it on the right-hand side. But the left-hand side we haven't actually solved for u_s. We've just solved for G_s times u_s. That's the only difference. If you have other actuation systems instead of just spinning wheels, maybe some people at Georgia Tech are looking at shape varying wheels. What if you have spherical wheels with magnetic suspension? Japan has some of those really cool-looking things. One of my former master's students did a thesis on spherical magnetically floating wheels that we can spin up, and not wheels really just seers. You could change it. You can just plug in the new dynamics using the same outer control law, and you solve for the same closed-loop dynamics. Your response, if you pick gains, this should be critically damped, under damped should be exactly the same. We're just achieving that control by not putting an external torque on it directly, but twisting, wiggling, jiggling, reshaping whatever's causing gyroscopics to give me that torque. That's going to be a pattern also to the CMGs and the VSCMGs. The outer loop should always behave the same. It's all a question of how are you remanipulating your momentum devices, to achieve these control torques? That's the only difference. Now, this part pretty straightforward. You have all the states, you can compute it. The question now becomes, I have to solve this. Again, if you line up your three reaction wheels with b1, b2, and b3, and you only have three. Then this G_s just becomes an identity matrix. That's easy. Because then if you have the required control torque minus 8 is equal to the motor torques. That's what each motor has to produce to do that. Or we had some discussion about this is the minimum norm inverse. This will give you the least norm across the n wheels. That's good, typically. That's a very much preferred way of doing that inverse because, reaction wheels will often be torque limited. It's not hard to saturate your reaction wheels. The torques that they can produce tends to be rather small. While they may absorb a lot of momentum, the torque they can produce is maybe 0.2-newton meters. If you have a really big wheel, often 10 millinewton meters, pretty small numbers. Getting the solution that gives you the least motor torque to implement this is the best, typically. Now, this is just instantaneous torque optimization of the motor torques. You could also have other inverses. There's a big null space if you have eight of these wheels lined up in arbitrary ways. There's also papers looking at energy, power usage, optimal ones. For small sets, that's become more interesting, because small sites tend to be less torque limited. It's the same motor essentially that can produce tens of millinewtons of torque. But the energy that it's required, or the heat that it generates, it's tougher for smallsets to dissipate it out, and that needs surface area to radiate out that heat. Versus a space station which has dedicated big radiators, and active cooling. Much different. You will find papers on different one. This is one opt, a very practical one, a very good one. Most of the people will use that. But there if there's more than three wheels, there's a null space. There's an infinity of ways you could spin up and spin down those wheels, and generate this motor torque. That make sense? This is a feedback control strategy that's typically what you would fly. Now we're taking our MRP feedback control, or you could change MRP is the quaternions if you want to. On the outer loop, it's easy to plug in and that, and inside we get this and the rest of the stability arguments really hold. We now have global stability of this one. You can look at v double dot, v triple dot, and prove asymptotic stability. It's basically the same math that would follow as before kinematically once you put it in. Because the closed-loop equations haven't really changed. It's exactly the same steps you just did, actually, when you derive this by hand. Make sense? This is why I had you redo this again because, all that work you did, you get to use over and over now without having to redo it every single time, which is cool. We have global asymptotic stability with n reaction wheels. We just require this to be full rank. Energy rate, if you wanted to you could always compute it. This is what this system. There's the wheel speed relative to the body, and that's a torque on the wheel relative to the body. This would be a work-energy principle if you wanted to validate that. Good.