﻿1
00:00:00,300 --> 00:00:07,290
‫So once we had this witness, our system, it was time to take the general form of our cost function,

2
00:00:07,620 --> 00:00:17,460
‫which was this one, and transform it into this one precise mathematical step by step derivations were

3
00:00:17,460 --> 00:00:22,110
‫treated in applied control systems for engineers, one in the new form.

4
00:00:22,650 --> 00:00:31,110
‫We managed to get rid of the error variables in the cost function, and we only have the system input

5
00:00:31,110 --> 00:00:35,720
‫changes as our independent variables.

6
00:00:36,240 --> 00:00:44,940
‫This new form very conveniently allows us to find the sequence of input changes that will find the optimum

7
00:00:44,940 --> 00:00:53,820
‫combination of minimize errors versus minimize control actions depending on the weights that we choose.

8
00:00:54,070 --> 00:00:57,810
‫Remember, it wasn't just about minimizing the errors.

9
00:00:58,230 --> 00:01:08,700
‫It was finding a good compromise between minimizing the errors and minimizing the control actions which

10
00:01:08,730 --> 00:01:13,050
‫actually where inversely proportional to each other.

11
00:01:13,080 --> 00:01:19,080
‫Meaning if the control action increases, then the error decreases.

12
00:01:19,080 --> 00:01:24,000
‫And if the error increases, then the control action would decrease.

13
00:01:24,030 --> 00:01:29,360
‫So we had to find that compromise and we could regulate that with weights.

14
00:01:29,910 --> 00:01:35,870
‫We simply had to take the gradient of our cost function and make it equal to zero.

15
00:01:36,510 --> 00:01:42,420
‫You would have a linear system in the vector matrix form that you can write like this.

16
00:01:42,750 --> 00:01:58,230
‫H double bar times Delta, Delta, Somji vector equals minus F double bar X to the vector sub K the

17
00:01:58,230 --> 00:02:07,710
‫sample time now and here it would be the reference vector sup g and then you solve for Delta Delta Vector

18
00:02:07,920 --> 00:02:17,340
‫like any other linear system like this that will give you the following solution vector like this in

19
00:02:17,340 --> 00:02:27,330
‫the solution vector looks like this where the system input change goes from sample time K up until K

20
00:02:27,330 --> 00:02:33,570
‫plus four, because our horizon period in our case right now was five samples.

21
00:02:33,990 --> 00:02:37,560
‫Then we only took the first element of it.

22
00:02:37,920 --> 00:02:40,320
‫We forgot about the other ones.

23
00:02:40,680 --> 00:02:53,220
‫We computed the real steering wheel angle delta K vector equals Delta K minus one plus Delta Delta K

24
00:02:53,430 --> 00:02:57,450
‫and we would then apply to the car in the plan model.

25
00:02:57,780 --> 00:03:01,500
‫We would compute the states in the next sample time.

26
00:03:01,950 --> 00:03:20,040
‫t.K equals T minus one plus Ts using the following formula X at K plus one equals X at K plus X dot

27
00:03:20,580 --> 00:03:22,680
‫at K times.

28
00:03:22,890 --> 00:03:30,890
‫The sample time divided by N or N was how thinly which up the T.

29
00:03:31,710 --> 00:03:42,870
‫So if our test was zero point one seconds and then N was five, then that means that we chopped it into

30
00:03:42,870 --> 00:03:46,110
‫five pieces to increase our accuracy.

31
00:03:46,590 --> 00:03:54,540
‫And then the new loop starts, new set of reference and error values and the entire process repeats

32
00:03:54,780 --> 00:03:56,930
‫until the end of the simulation.

33
00:03:57,480 --> 00:04:00,600
‫That concludes the recap of the course.

34
00:04:00,600 --> 00:04:03,170
‫Applied control systems for engineers one.

35
00:04:03,540 --> 00:04:09,120
‫Now we're going to take all this knowledge and we're going to build on that.

36
00:04:09,510 --> 00:04:17,700
‫We're going to apply NPC to a USC quadcopter drone, which is a more complex system with more states,

37
00:04:17,970 --> 00:04:20,610
‫more outputs and more inputs.

38
00:04:20,970 --> 00:04:28,500
‫In this course, you will also learn about something called putting a system in the linear parameter

39
00:04:28,500 --> 00:04:36,420
‫varying or l p the format before applying NPC to it.

40
00:04:37,260 --> 00:04:45,270
‫And you will also learn that LPT NPC control strategy is not enough to make the if follow trajectory

41
00:04:45,270 --> 00:04:53,210
‫in a 3D space, we will have to combine it with another control strategy called State Feedback Lionization.

42
00:04:53,460 --> 00:04:58,800
‫So what you're about to learn is pretty advanced and it might seem challenging.

43
00:04:59,310 --> 00:05:06,930
‫However, it is super interesting and practical, and I'm going to decode everything for you, so no

44
00:05:06,930 --> 00:05:07,470
‫worries.

45
00:05:07,710 --> 00:05:08,370
‫Thank you.

46
00:05:08,370 --> 00:05:10,020
‫And I'll see you in the next video.

