‫Welcome back.
‫So now you know, the logic behind the control law, e double dot equals K one times E, which error
‫plus key two times the E dot, which is the time derivative of the error.
‫The same control law is applied for controlling and driving the error to zero in the X, Y and Z dimension,
‫essentially by choosing the right pulls.
‫So in our case, Lunda one equals minus one and Lunda two equals minus two, and in our case for all
‫X, Y, Z dimensions.
‫By choosing those polls, we computed our key values.
‫So our K one ended up being minus two and key two was minus three.
‫And so that means that our control law became like this error double dot equals now K one was minus
‫two, so minus two times the error plus and then Katou was minus three, so minus three times the error
‫dot.
‫So in the end you can write it down like this.
‫And so through this control law, you found an E double that that drives the error and the error dot
‫to zero as time goes to infinity.
‫So whatever your E and E dot are, the E double that that you find with your K one and K two values.
‫This error double derivative with respect to time will drive your error and the first derivative of
‫your error with respect to time to zero in this error, double that, it can do it because it influences
‫both.
‫Remember, it's a chain, the E double that influences the IDOT and then the E that influences the error
‫itself.
‫If your error is zero and then error that is zero and then error double dot is zero, then if you're
‫error double that goes up, then also your error that goes up and then because of that your error will
‫go up as well.
‫So they are linked with each other like a chain because error that is a change of error with respect
‫to time and error.
‫Double that is a change of error dot with respect to time.
‫And that's what you want, right?
‫You want your error and error does not go to zero and you want it for your X, Y and Z dimensions,
‫because then that actually means that your drone is tracking the trajectory.
‫If the errors for all dimensions go to zero, then that means that you're doing very well in tracking
‫what you need to track.
‫And by the way, you need both error and error dot to go to zero, because if your error is zero but
‫your error dot is not zero, then you are not going to stop at zero error.
‫You will overshoot.
‫You see, this is your reference line and then you're trying to track it.
‫And right now your error is zero, but your error dot is not zero.
‫So you will overshoot like this.
‫You are not going to be able to steadily approach zero error if your so-called error velocity does not
‫jump out as well.
‫However, if both of your polls are negative, then your error and error that will both damp out.
‫So is the problem solved now?
‫Well, not quite.
‫So far, the feedback lionization comptroller has produced error, double that in the X dimension,
‫in the Y dimension and in the Z dimension.
‫However, in order to actually physically achieve that, you need to have certain control, input values.
‫You won you two, you three and you four, it's very cool to compute the necessary E double dots that
‫would make your dream track the trajectory.
‫However, now we need to find the necessary control inputs that will actually make it happen.
‫And when you find your actual control inputs, then ultimately you also need to find the corresponding
‫omega one, Omega to Omega three and Omega four, because ultimately these are the things that will
‫physically move your drone and ultimately the Omega's, they will give you the necessary double dots.
‫And so we already know how to compute our Omega's from our control inputs.
‫And our feedback immunization controller computes you won.
‫But you, too, you three and you four are computed by the model predictive controller, but for that,
‫the NPC needs to get a reference your wangel.
‫This is what it will get from the planner and then it also needs to get fi are and to are.
‫And that will come from the feedback lionization controller.
‫So in our controller, the E double dots, they are the intermediate variables, the end products of
‫our feedback lionization controller.
‫Are you one fi, r and Theta are.
‫And that means that we have to find a relationship between our erodable dots and you one fire and see
‫to r and so how to do that, how to find this relationship.
‫Well we know that E double dot X equals X double dot the reference values.
‫So the second derivative of our reference X values minus the true X double dot, which is the acceleration
‫in the X dimension in the inertial frame, then e double that in the wider mentioned equals Y double
‫dot reference values minus the true Y double dot and then E double dot in the Z dimension equals Z double
‫that reference values minus the true Z double dot values.
‫Remember these reference value, double derivatives, they come from the planner.
‫We computed them in the planner and so we can rearrange these equations like this X double dot equals
‫X double that R minus the error double dot in the X dimension then Y double dot equals Y double dot
‫subha minus E double dot in the Y dimension and then Z double dot equals z double dot sub R minus E
‫double dot in the Z dimension.
‫So these terms here, they come from our control and these terms here, they come from our planner.
‫So you automatically know what's your X double dot, y double date and Z double dot.
‫But if you remember at the beginning of the section you derived some equations that related these X,
‫Y and Z double dots with the variables that you need.
‫You want fire and theta are so x double dot equals cosine five times sine theta times cosine psi and
‫then plus sine five times sine psi and then all that you multiplied by you, one divided by the mass
‫of the drone.
‫So this equation was for the X dimension.
‫This equation was your X double dot, your acceleration in the X dimension in the inertial frame.
‫So this equation was your Y double dot, your acceleration in the Y dimension in the initial frame,
‫and this was your acceleration in the Z dimension in the initial frame since you know, the double derivative
‫of the reference values and the arrow double dots that were computed using the controller, this one
‫here, thanks to that, you know, your X double that, Y double that and Z double that.
‫In addition, you know what your CI is as well.
‫That's your reference value from the planner.
‫So here as well, you get this number from the planner.
‫And so what you have is three equations and three unknowns and your unknowns are you one fire are and
‫seats are.
‫So from this equation, you need to find your you one, then you also need to find your files like this
‫and you need to find your Cetus that are here.
‫And using algebra, you can find them once you have found them, then your new one will go to the plant
‫and then your Fi and Seeta, they will go to your NPC controller.
‫And for the NPC controller, they will be your reference values, fire and Sittar, and that will be
‫your exercise.
‫Try to manipulate these equations in order to find your Fifita and you one, try to find them in terms
‫of other variables.
‫I'll give you a hint to get started.
‫Put the equations in this form X double dot divided by Z, double dot plus G.
‫So take this G and put it on the other side of the equation sine and then take this X, double that
‫equation, this entire equation, and then divided by this equation.
‫So if you're Z double dot plus G equals this cosine five times cosine theta times you one over the mass
‫then you would take this entire equation here and then you would divide it by this thing here and then
‫do the same thing with y double dot divided by Z, double dot plus G.
‫So put your equations in this form here and then go from there.
‫We're going to discuss the solutions in the next video, however, I first want to finish our schematics.
‫OK, so this is our schematics and now let's finish it so you know how you get your error double dots
‫in the X, Y and Z dimension.
‫And now when we're going to do we're going to take our reference value second time derivatives out of
‫our planner.
‫So this here will be your Z double dot sub are this here will be your Y double dot subha and this here
‫will be your X double dot subha.
‫And remember we had to subtract our error double dots from our reference value double dots.
‫So we're going to have plus here and plus here and plus here and then we're going to have minus here,
‫minus here and minus here.
‫Because essentially what you need, you need X double dot sub R minus E double dot sub X.
‫Right.
‫That's what you need.
‫And the same thing for the Y and Z dimension.
‫And so here in this box, you have these three equations that we had X, double dot Y and Z double dot.
‫So these equations here.
‫These are the equations that you have in this box here.
‫And so if you have your X double dot sub R minus E, double dot, sub X, then you will have your X
‫double dot here that will go into this box.
‫And the same thing happens here.
‫You get your Y double dot, if you take your Y double dose of R and then you subtract E double Dunstable
‫Y from it.
‫And then the same thing happens here as well.
‫You get your Z double dot in the same way, Z double dot, sub R minus E, double dot subs Z.
‫And then as an exercise you will find your fi, r and fita r that will go into your NPC controller and
‫then you will also find the you want control inputs that will go directly into your plant.
‫So that's your exercise, these are your equations, and just try doing it yourself.
‫Try doing some algebra and then we'll see the solutions in the next video.
‫Thank you very much.