‫Welcome back.
‫So let's now play around a little bit with our omega men and omega max variables and see what we get.
‫So let's start with these values.
‫This is approximately 115 radians per second.
‫And this is approximately 900 radians per second.
‫We're going to work with this trajectory here.
‫As you can see, tracking is pretty good.
‫But what we are interested in is this one here.
‫These are your Omega's Omega one, Omega two, Omega three and Omega four.
‫So you can see that you go from more or less 115 radians per second at the very beginning.
‫Because remember our initial four omega 3s, they were omega men.
‫So no matter what you do at the very beginning, they have your minimum values that you define right
‫here.
‫And you can see that all these omega as they go until 800 radians per second, so they don't even reach
‫our upper limit.
‫And you can see that at the very beginning, they start rotating very fast and then their rotational
‫velocities, they slow down and they start oscillating like that.
‫It makes sense because at the beginning you start from your ground and you have to go up in order to
‫reach your trajectory.
‫And then once you have reached your trajectory, then you have to go up and down, up and down in waves.
‫And that's why the omega 3s, they also behave like that as a function of time when you need to go up.
‫They rotate a bit faster when you need to go down.
‫They rotate a bit slower.
‫And so here I've taken my omega one and I've zoomed in this wavy behavior.
‫And so you can see that this rotational speed, it varies more or less between 540 and 460 gradients
‫per second.
‫So I have simply taken one wave here and I've zoomed it in.
‫But OK, now let's leave omega men alone.
‫But for omega max, let's put here times zero plus 700 that will make this term zero.
‫And then I had 700 here, so my omega max, it will be 700 gradients per second.
‫If I run the code, then I will get this result.
‫You don't see the number here, but if I zoom in, then you can see that once the rotational velocities
‫reach 700 radians per second for each motor, then they don't go up any further.
‫So that's very good.
‫How about if instead of 700, I put here 600 now my omega max, it's 600 radians per second because
‫this term here it's zero.
‫Well, this is the result.
‫You can see that all your omega 3s.
‫They don't go above 600 radians per second, so that's very good as well.
‫But if you remember then a couple of pictures ago this oscillation here, it happened more or less between
‫540 and 460 radians per second.
‫Well, how about for my omega men?
‫I'm going to put time zero plus 400 and 80, and then for my omega max, I'm going to put 520.
‫What will happen then?
‫Remember, normally the Omega has oscillated between more or less 540 and 460 irradiance per second.
‫Now I have 520 and 480 radians per second.
‫So the interval is very tight.
‫Well, this is the result.
‫As you can see, your tracking is not very good now, and it makes sense if you look at your omega is
‫now.
‫Then you can see that they stay between 520 and 400 and 80 radians per second.
‫So all your four motors, they obey your constraints.
‫But of course, because of these narrow constraints, your drone simply cannot follow the trajectory
‫in order to follow this trajectory.
‫You cannot restrict the rotation of your omega is like that.
‫This is too restrictive.
‫You have to give your amigas more freedom.
‫But in conclusion, you can see that your constraints are working.
‫Now, of course, you might wonder why aren't they working perfectly?
‫Why do I go slightly over 520 radians per second and why do I go slightly below 480 radians per second?
‫And also here I go, slightly above 600 radians per second.
‫And the same thing.
‫Here I go slightly over 700 radians per second.
‫Why is it like that?
‫Well, the explanation is very straightforward.
‫This is our global control architecture.
‫But now let's zoom in and only consider our inner loop.
‫So this is your plant and this is your NPC.
‫Remember that your plant and your NPC had two very similar but still different models.
‫If you remember, then in the plant box, we had a transfer matrix that depended on two angles Fei and
‫Seta.
‫But for the NPC controller, we approximated this transfer matrix to be an identity matrix because we
‫said that the drone flies close to the hovering position.
‫And so we simply made this assumption that Y equals zero and C equals zero because in reality, they
‫were close to zero.
‫And because of that assumption, this transfer matrix became an identity matrix.
‫And so we used this assumption inside our HPC model.
‫The planned model was more realistic, but the NPC model was easier to deal with and put in the LP format.
‫And while the differences are small, this assumption still introduces some differences here.
‫It makes the plan model and the NPC model slightly different.
‫Another thing here is that in this course, we used simplified LP.
‫This was our simplified LP V that we used in this course, but I also showed you what your C double
‫bar and a double circuit flex matrices would be if you had used the non simplified version.
‫It would have been slightly more correct, but since our horizon period was very short, it didn't really
‫matter.
‫We were able to achieve good tracking with this simplified LP V as well, where you had your simplified
‫C double bar and simplified a double circle flex.
‫So that was another thing.
‫And then in both cases, we described our model, but we used forward Euler discontinuation in the NPC
‫box and wrong acuta.
‫This crystallization in the plan box using two different methods.
‫They further increased the differences between the models used in the NPC controller and in the plan
‫box.
‫The thing with NPC is that the more similar the NPC model is to the planned model, the better your
‫controller works.
‫But of course, the closer you want to get to your planned model, the more complicated your NPC model
‫becomes.
‫So there's always a tradeoff.
‫You obviously want to simplify your model for your NPC controller as much as possible, and for as long
‫as tracking is good enough, you can use your simplified model and then you should not go closer to
‫your plan model.
‫Because if your NPC controller is able to achieve its tasks, then you should not complicate your life
‫more than necessary.
‫And with the simplifications that we have made, the NPC controller is able to track the trajectories
‫that require the drone to fly close to the hovering position, which was our goal to begin with.
‫Nevertheless, you have to be aware of these differences and you have to understand that when you design
‫for your NPC constraints, then the design process uses this model here.
‫This simplified one, not the one in the plan box.
‫So the inputs that your NPC controller gives you, they take into account your NPC constraints, but
‫your matrix and each vector they were generated using this model here and these control inputs.
‫They were calculated.
‫Considering your matrix and h vector, but again, they were created using this simplified model, and
‫so when you get your control inputs and you apply it to your planned model, which is closer to reality,
‫which is more realistic and more complex, then because of the fact that these two models in these two
‫boxes are slightly different.
‫Because of that, the real Omegas that you get from your planned box, they end up being slightly different
‫compared to the boundaries that you had set for your omega max and omega men.
‫And so at the beginning, when the drone needs to lift off and catch up with the trajectory, then you
‫can see that these differences in those two models, they might cause your real Omegas to violate the
‫constraints quite a lot.
‫Therefore, it's important to have safety factors.
‫So if you know that the real limit of omega 3s ranges between 150 irradiance per second and 900 radians
‫per second, then the constraints that you give to your MPAC controller, the values that you set for
‫omega men and omega max, they should be more conservative.
‫So maybe your omega men could be 200 radians per second in omega max 800 radians per second.
‫That way, you will have some space to violate your constraints.
‫You should not break the red limit, but at least you can break the orange limit for as long as you
‫stay in this corridor here and in this corridor here.
‫So that's what I wanted to tell you about HPC constraints.
‫Thank you very much.