‫Welcome back.
‫So in the previous course, I explained to you that this cost function form is a very good one because
‫you only have one independent variable there, and that is Delta, you vector, and this is what you're
‫after.
‫You want to find the optimum delta, you global that looks like this Delta U at K, Delta U at Cape
‫plus one Delta you K plus two and Delta you at Cape plus three and transposed.
‫So you want the NPC to find that so that you could take this first element here and add it to the previous
‫you.
‫So that was your previous you and then you add this delta, you add key to the previous you and you
‫will get your you at K and this is what goes into the plant.
‫Alternatively, you can expand this expression and write it out like this.
‫And again, this one will go into your plant like this, this vector here and the other Delta use here
‫will they will be neglected.
‫And so this cost function form is very good because you don't have your future augmented state vectors
‫like X till the global.
‫You don't have it as a variable here in this cost function.
‫For since your double prime does not have those global state vectors as an independent variable, you
‫only have this X still that K transposed, which is your present known state and therefore a constant.
‫But since there is no X still the global that contains future state vectors, augmented ones finding
‫this delta you global vector is super easy.
‫You simply take the gradient of g the prime that looks like this h double ba delta u g plus f double
‫ba times this vector your present augmented state vector and then your global reference vector.
‫So that's your gradient and then you make it equal to zero.
‫In the previous course I explained extensively why the gradient is like that.
‫So since it is a positive quadratic function, when you make the gradient of G double primes zero,
‫it allows you to find values for Delta U global that would minimize this G double prime.
‫And if you remember, that was the whole point, finding the Delta U global values that minimize your
‫cost function, because through it you will find control inputs that will minimize your error while
‫also keeping the change of your control actions as small as possible.
‫That's why your original cost function started with two types of variables the error variables and then
‫the delta you variables.
‫You want to minimize your errors, but you don't want your you to use three and you for change like
‫crazy.
‫And so finding this delta, you global is very easy.
‫You have this h double ba delta, you global and then the other term you put it on the other side minus
‫F double ba.
‫Your present augment is state vector and then your global reference vector like this.
‫And then what you do you want to eliminate this double bar here so that you would only be left with
‫this one here, which is this one here.
‫So for that you're going to put h a double bar inverse here and also you have to put it here h double
‫bar inverse.
‫Then this thing here will become an identity matrix or one in the scale of world.
‫And so your delta, you global equals minus H double bar inverse times F double bar times this vector
‫and there you go.
‫You have your formula for your delta you globe.
‫Now, there is one important distinction that you have to make this part here.
‫It was constant in the autonomous vehicle case.
‫If you look at the entire cost function derivation, then H double bar and F double bar matrices ultimately
‫contain discrete Amy ptosis in them.
‫And in the previous course we really had an LTI system, meaning that our discrete A never changed throughout
‫the entire maneuver.
‫And this is why your H double bar and then your F double bar or in this case F double bar transposed.
‫This is why they always remained unchanged.
‫That's not the case with the US, though.
‫Every time you send you to Q3 and Q4 to the plant, the plant will give you new states and it will also
‫give you a new Omega.
‫So your new P, Q R states will produce new PHY that to that and say that after you put them through
‫the transfer matrix and then your new FY that theta that and Omega will change your continues APV a
‫matrix and then after you democratize it you will have a different discrete a matrix, you know a different
‫a sub D and that means that you're H double bar and F double bar transposed.
‫And because of that your H double bar inverse and your F double bar, that means that they will also
‫change.
‫Remember, we don't have an LTI system here.
‫We have a nonlinear system, but we used a linear parameter varying or Lopevi approach.
‫Essentially we squeezed a nonlinear system into a linear system format.
‫And inside the A matrix, we kept some of its elements as variables that we would update.
‫Every D equals zero point one second.
‫Every time we had an inner loop, we updated our A matrix and for smooth trajectories that we have,
‫this approach works very well.
‫HPV is a highly researched topic in robust control.
‫Their entire books written about it.
‫One book that I know is this one robust control and linear parameter varying approach by Ollivier cinema.
‫Patrick Gasparini was Chef Bocker and that's it for this section.
‫You have seen that there are many similarities in using NPC in the autonomous vehicle, lateral control
‫and the use of adequate control.
‫Of course, you have to make some adaptations, but at its core, the logic of the technique is the
‫same.
‫NPC is a very powerful control technique.
‫In the next section, we will take a look at another nonlinear control technique called feedback polymerization,
‫and that will be for the position control.
‫Thank you very much.
‫And I see you in the next section.