‫So once we had this witness, our system, it was time to take the general form of our cost function,
‫which was this one, and transform it into this one precise mathematical step by step derivations were
‫treated in applied control systems for engineers, one in the new form.
‫We managed to get rid of the error variables in the cost function, and we only have the system input
‫changes as our independent variables.
‫This new form very conveniently allows us to find the sequence of input changes that will find the optimum
‫combination of minimize errors versus minimize control actions depending on the weights that we choose.
‫Remember, it wasn't just about minimizing the errors.
‫It was finding a good compromise between minimizing the errors and minimizing the control actions which
‫actually where inversely proportional to each other.
‫Meaning if the control action increases, then the error decreases.
‫And if the error increases, then the control action would decrease.
‫So we had to find that compromise and we could regulate that with weights.
‫We simply had to take the gradient of our cost function and make it equal to zero.
‫You would have a linear system in the vector matrix form that you can write like this.
‫H double bar times Delta, Delta, Somji vector equals minus F double bar X to the vector sub K the
‫sample time now and here it would be the reference vector sup g and then you solve for Delta Delta Vector
‫like any other linear system like this that will give you the following solution vector like this in
‫the solution vector looks like this where the system input change goes from sample time K up until K
‫plus four, because our horizon period in our case right now was five samples.
‫Then we only took the first element of it.
‫We forgot about the other ones.
‫We computed the real steering wheel angle delta K vector equals Delta K minus one plus Delta Delta K
‫and we would then apply to the car in the plan model.
‫We would compute the states in the next sample time.
‫t.K equals T minus one plus Ts using the following formula X at K plus one equals X at K plus X dot
‫at K times.
‫The sample time divided by N or N was how thinly which up the T.
‫So if our test was zero point one seconds and then N was five, then that means that we chopped it into
‫five pieces to increase our accuracy.
‫And then the new loop starts, new set of reference and error values and the entire process repeats
‫until the end of the simulation.
‫That concludes the recap of the course.
‫Applied control systems for engineers one.
‫Now we're going to take all this knowledge and we're going to build on that.
‫We're going to apply NPC to a USC quadcopter drone, which is a more complex system with more states,
‫more outputs and more inputs.
‫In this course, you will also learn about something called putting a system in the linear parameter
‫varying or l p the format before applying NPC to it.
‫And you will also learn that LPT NPC control strategy is not enough to make the if follow trajectory
‫in a 3D space, we will have to combine it with another control strategy called State Feedback Lionization.
‫So what you're about to learn is pretty advanced and it might seem challenging.
‫However, it is super interesting and practical, and I'm going to decode everything for you, so no
‫worries.
‫Thank you.
‫And I'll see you in the next video.