﻿1
00:00:00,480 --> 00:00:01,350
‫Welcome back.

2
00:00:01,980 --> 00:00:04,830
‫And so let's go back to our cost function.

3
00:00:05,610 --> 00:00:08,820
‫This was the initial version for the vehicle.

4
00:00:09,300 --> 00:00:13,500
‫This was the cost function that we had in the previous course.

5
00:00:13,680 --> 00:00:21,390
‫The initial version and of course, now in our case, instead of these deltas here, we're going to

6
00:00:21,390 --> 00:00:26,490
‫have the you control input vectors like this, right?

7
00:00:27,060 --> 00:00:34,170
‫And obviously because of that and because of the different dimensions of the error vectors, we will

8
00:00:34,170 --> 00:00:38,700
‫have different dimensions in the weight matrix here.

9
00:00:38,710 --> 00:00:46,710
‫So the S Q and our weight matrices, these three, you will have different dimensions.

10
00:00:47,610 --> 00:00:58,470
‫However, since we started treating the input increments as our control inputs, we replace the use

11
00:00:58,470 --> 00:01:01,980
‫of Cape Plus I vectors here with.

12
00:01:03,010 --> 00:01:09,580
‫Delta use up, Kate, plus I vectors like this next.

13
00:01:10,060 --> 00:01:15,190
‫Just like in the previous course, we start manipulating the cost function.

14
00:01:15,520 --> 00:01:19,180
‫We can replace the error variables like this.

15
00:01:19,990 --> 00:01:25,690
‫So this is our error at K Plus End, which is this vector here.

16
00:01:26,470 --> 00:01:40,630
‫And that would be the reference value vector at K plus and minus C till they're times X tilde vector

17
00:01:41,440 --> 00:01:42,940
‫at K plus end.

18
00:01:43,810 --> 00:01:49,630
‫And so if we also take this vector here, then we can rewrite it like this.

19
00:01:49,630 --> 00:02:01,210
‫The reference value vector at K plus ie minus C till that times x till the vector at K plus i.

20
00:02:02,200 --> 00:02:05,650
‫The reference vector simply contain your reference values.

21
00:02:06,720 --> 00:02:21,690
‫So the reference factor at Cape Plus RN equals Phi are at Cape Plus N Seta are at Cape Plus NW and PSI

22
00:02:21,690 --> 00:02:24,120
‫are at Cape Plus and.

23
00:02:25,120 --> 00:02:38,080
‫And then right, Kate, plus eye equals fire at Capas Eye Theatre are at Kate plus I as well and I are

24
00:02:38,080 --> 00:02:38,890
‫at Kate.

25
00:02:38,890 --> 00:02:50,140
‫Plus I now remember since your input increments the deltas, since they are your control inputs, now

26
00:02:50,380 --> 00:02:58,750
‫you need to have your augmented matrices and vectors, so you need to have your seat still there and

27
00:02:58,750 --> 00:03:00,880
‫then your ex there.

28
00:03:01,960 --> 00:03:03,540
‫Not C.

29
00:03:03,880 --> 00:03:05,290
‫And X.

30
00:03:05,480 --> 00:03:11,590
‫So now this would be wrong, because now you have delta use in your cost function.

31
00:03:12,550 --> 00:03:21,280
‫And so now you take the cost function that you have here and then you will very simply replace the error

32
00:03:21,280 --> 00:03:25,630
‫vectors with these expressions here.

33
00:03:26,500 --> 00:03:33,730
‫And if you do that, then this is how your cost function will look like this one here in the parentheses.

34
00:03:34,300 --> 00:03:42,430
‫That's your e sub K plus n, and then this one here is the same thing, but transposed.

35
00:03:43,300 --> 00:03:48,160
‫And then this expression here, that's this vector.

36
00:03:48,550 --> 00:03:52,120
‫And then here, it's just the same thing, but transposed as well.

37
00:03:53,020 --> 00:03:57,740
‫And here you have your control input increments.

38
00:03:58,420 --> 00:03:59,950
‫Here you have the column vector.

39
00:03:59,950 --> 00:04:06,610
‫And then here you have the roll vector because you have this transposed here and then you have to open

40
00:04:06,610 --> 00:04:12,040
‫up the parentheses in the exact same way, like we did it in the previous course.

41
00:04:12,910 --> 00:04:15,670
‫In fact, now I would like to challenge you.

42
00:04:16,480 --> 00:04:24,520
‫I would like to give you a big exercise, and if you do then exercise, then you will for sure, solidify

43
00:04:24,520 --> 00:04:27,370
‫your knowledge about the controller.

44
00:04:28,120 --> 00:04:36,070
‫In the previous course, I showed you how you can go from this original form, this original cost function

45
00:04:36,310 --> 00:04:41,980
‫that you had until this final form of the cost function.

46
00:04:42,850 --> 00:04:52,000
‫In this final cost function form, you had huge matrices like H Double Bar and then F Double Bar transposed.

47
00:04:52,720 --> 00:04:55,420
‫That was the final cost function form here.

48
00:04:56,260 --> 00:05:02,560
‫And you can see that you have a constant value here, which is your present state.

49
00:05:02,590 --> 00:05:09,070
‫It's not a variable because you know this value already, it's a specific number, your present state

50
00:05:09,070 --> 00:05:13,240
‫now and then also your reference vectors.

51
00:05:13,870 --> 00:05:18,040
‫They are also known, so they are constant values.

52
00:05:18,040 --> 00:05:19,510
‫They are not variables.

53
00:05:20,200 --> 00:05:27,520
‫So in this final cost function form, the only independent variables that you had was the delta deltas.

54
00:05:28,450 --> 00:05:30,310
‫And then you took the gradient of it.

55
00:05:31,310 --> 00:05:38,900
‫And then once you had your gradient, you were able to use this linear algebra technique where you just

56
00:05:38,900 --> 00:05:47,540
‫take the inverse of your h double bar matrix and then you compute your control inputs sequence like

57
00:05:47,540 --> 00:05:47,990
‫this.

58
00:05:48,890 --> 00:05:51,770
‫So then was the stuff from the previous course.

59
00:05:52,820 --> 00:05:58,490
‫So my exercise for you is this I've already done the first step.

60
00:05:58,490 --> 00:06:05,990
‫I have replaced the deltas with the two vectors, and then I've also made them increment you vectors.

61
00:06:06,650 --> 00:06:14,060
‫So I've put deltas here and I've also rewritten the cost function like this where I have replaced the

62
00:06:14,060 --> 00:06:15,200
‫error variables.

63
00:06:16,010 --> 00:06:23,320
‫So from this point on trying to achieve this form only for the UAV.

64
00:06:24,290 --> 00:06:32,810
‫So instead of Delta Delta equals something you would have Delta, you equals something.

65
00:06:33,650 --> 00:06:36,320
‫But don't just write this expression, go through.

66
00:06:36,320 --> 00:06:45,650
‫The entire derivation that we had in the previous course used the material from the previous course

67
00:06:46,160 --> 00:06:56,230
‫as much as needed and go through the entire derivation process until you reach this form only for the

68
00:06:56,240 --> 00:06:57,500
‫US case now.

69
00:06:58,400 --> 00:07:05,330
‫So you would start by opening up the parentheses and you do it exactly like you did it in the previous

70
00:07:05,330 --> 00:07:05,810
‫course.

71
00:07:06,320 --> 00:07:11,060
‫And again, you don't have to have it all memorized if you don't remember it.

72
00:07:11,240 --> 00:07:17,720
‫Then just look it up from the previous course and go through the exact same steps like you went through

73
00:07:17,720 --> 00:07:23,630
‫in the previous course and then try to get this final form for the UAV.

74
00:07:24,470 --> 00:07:28,400
‫And then in the next two videos, I will show you how it should be done.

75
00:07:29,240 --> 00:07:36,920
‫It really will be like a recap of the previous course when it comes to the embassy controller derivation.

76
00:07:37,400 --> 00:07:40,610
‫So thank you very much and see you in the next video.

