﻿1
00:00:00,730 --> 00:00:09,760
‫Welcome back in this video, I would like to expand on the LPV concept, we ended up with this formulation

2
00:00:10,390 --> 00:00:19,900
‫that allowed us to predict our four future states x one x two x three and X four in one go.

3
00:00:20,500 --> 00:00:25,360
‫However, when it comes to LP V, then this is a simplified approach.

4
00:00:26,020 --> 00:00:28,480
‫This is your global control schematics.

5
00:00:29,140 --> 00:00:36,940
‫You have your plant, the planner feedback organization, and in this box you have LP and PC.

6
00:00:37,570 --> 00:00:45,550
‫You already know that you have four inner loops through one outer loop, so the Feedback Loop unionization

7
00:00:45,550 --> 00:00:53,740
‫controller gives you a new five R and Theta R every 0.4 seconds that you have to track.

8
00:00:54,340 --> 00:01:04,990
‫And then NPC using the LP formulation tries to track fire and thetr together with CI R that comes out

9
00:01:04,990 --> 00:01:13,510
‫of the planner and it tries to finish tracking it during four inner loops and each inner loop lasts

10
00:01:13,510 --> 00:01:15,130
‫for 0.1 second.

11
00:01:15,700 --> 00:01:21,550
‫So 0.4 seconds when outer loop 0.1 second one inner loop.

12
00:01:22,090 --> 00:01:31,150
‫Therefore, you have four inner loops in one outer loop, so every 0.1 second, the LP v NPC controller

13
00:01:31,780 --> 00:01:41,170
‫gives you a new U2, Q3 and Q4 control inputs that go into the plant together with you, one that comes

14
00:01:41,170 --> 00:01:43,330
‫out of this feedback linear Asian box.

15
00:01:43,990 --> 00:01:52,870
‫And then the plant gives you new states every 0.1 seconds, every in the Loop LP, the NPC gives you

16
00:01:53,530 --> 00:01:58,570
‫new U2, Q3 and Q4 control inputs and every inner loop.

17
00:01:59,020 --> 00:02:00,670
‫The plan gives you new states.

18
00:02:01,360 --> 00:02:10,840
‫Of course, you one stays the same during all the four inner loops you want changes every outlook.

19
00:02:11,470 --> 00:02:21,390
‫And now remember that our continuous a matrix in our LP formulation depends on the variables fi that

20
00:02:21,810 --> 00:02:25,810
‫standard and also the omega.

21
00:02:26,380 --> 00:02:34,930
‫And so because of that, the continuous a matrix changes every 0.1 second, every inner loop, not the

22
00:02:34,930 --> 00:02:43,620
‫B matrix, though the B matrix remains unchanged because it does not have any changing variables there.

23
00:02:44,170 --> 00:02:48,340
‫Only I double x, I double Y and I double Z.

24
00:02:49,000 --> 00:02:55,450
‫These are your mass moments of inertia about the body from X, Y and z axis.

25
00:02:56,050 --> 00:03:02,110
‫And because of the fact that they are measured with respect to your body frame, they stay constant.

26
00:03:02,680 --> 00:03:07,380
‫But the matrix changes every 0.1 second, every inner loop.

27
00:03:08,020 --> 00:03:15,640
‫But that also means that in the prediction formula, both of these gigantic matrices.

28
00:03:16,210 --> 00:03:25,960
‫This one here and this one here, they would also change every 0.1 second because the matrix is inside

29
00:03:25,960 --> 00:03:29,170
‫them would change every 0.1 second.

30
00:03:29,740 --> 00:03:36,880
‫Now, if your horizon period is very short, like in our case, Horizon period equals four, then it's

31
00:03:36,880 --> 00:03:37,360
‫OK.

32
00:03:37,960 --> 00:03:42,640
‫You can use this formulation, which is what we will do in this course.

33
00:03:43,240 --> 00:03:50,800
‫However, if the horizon period is longer, which was the case in the previous course in this control

34
00:03:50,800 --> 00:03:59,140
‫system series called Applied Control Systems, two autonomous cars 360 tracking where the horizon appeared

35
00:03:59,140 --> 00:04:03,640
‫equal 10, then you have to do it in a more advanced way.

36
00:04:04,210 --> 00:04:09,130
‫You also have to update your A matrices in your predictions.

37
00:04:10,340 --> 00:04:14,780
‫So I'm going to draw here, my LPV and BusyBox, my plants.

38
00:04:15,380 --> 00:04:20,030
‫For now, let's still consider that our Horizon period equals four.

39
00:04:20,630 --> 00:04:30,650
‫So let's say that your MPAC controller finds this vector of control inputs you global that looks like

40
00:04:30,650 --> 00:04:30,950
‫this.

41
00:04:31,640 --> 00:04:38,210
‫Note that this U0 it contains your first you to use three and you four control inputs.

42
00:04:38,900 --> 00:04:40,160
‫Then you one.

43
00:04:40,850 --> 00:04:46,130
‫It contains your second to Q3 and Q4 inputs and et cetera.

44
00:04:46,160 --> 00:04:49,160
‫You two, it would contain your third.

45
00:04:49,160 --> 00:04:52,760
‫You two use three and you four inputs and then you three.

46
00:04:52,760 --> 00:04:57,290
‫It would continue to force you to Q3 and Q4 inputs.

47
00:04:57,950 --> 00:05:08,210
‫And so you already know that NPC only takes the first sub vector and gives it to the plant and it discards

48
00:05:08,390 --> 00:05:09,140
‫the rest.

49
00:05:09,920 --> 00:05:13,430
‫These are your leftovers that you're not going to use for your plant.

50
00:05:13,970 --> 00:05:20,940
‫Then your plant will compute a new state vector that's called X1, and then you're going to start with

51
00:05:20,940 --> 00:05:21,680
‫the new loop.

52
00:05:22,280 --> 00:05:28,580
‫So what I will do now, I'm going to put here a red line, and I'm going to say that everything that

53
00:05:28,580 --> 00:05:35,390
‫crosses this red line, it means that for that variable, a new loop has started.

54
00:05:35,990 --> 00:05:39,770
‫So for example, this is your new state vector X1.

55
00:05:40,430 --> 00:05:46,610
‫But once it crosses this red line, then you are in your new loop already.

56
00:05:47,180 --> 00:05:53,330
‫So this x1 the same vector here it will be X0.

57
00:05:53,450 --> 00:06:01,250
‫So your present state, it's exactly the same vector is just because it has crossed this red line.

58
00:06:01,730 --> 00:06:10,880
‫Now I consider this vector to be a present state vector because now I'm in my new loop and I'm concerned

59
00:06:10,880 --> 00:06:17,150
‫with finding new control inputs in order to calculate a new state vector.

60
00:06:17,720 --> 00:06:23,240
‫And by the way, this present state vector, it will also enter into your plant.

61
00:06:23,870 --> 00:06:31,610
‫In other words, once you cross this red line, your new state becomes your present state because you're

62
00:06:31,610 --> 00:06:32,750
‫in a new loop now.

63
00:06:33,290 --> 00:06:41,000
‫And then if we look at these control input leftovers, you won you two and you three the ones that you

64
00:06:41,000 --> 00:06:45,940
‫did not use for your plants, the ones that you discarded.

65
00:06:46,520 --> 00:06:50,570
‫Well, at the beginning, they are you one, you two and three.

66
00:06:51,200 --> 00:06:59,950
‫But then once you start with your new loop, once you cross this red line, they become you zero, you

67
00:07:00,020 --> 00:07:02,000
‫one and you two.

68
00:07:02,630 --> 00:07:05,990
‫So this one here is this one here.

69
00:07:06,650 --> 00:07:12,530
‫But in the next loop, then this one here, it's this one here, but in the next loop.

70
00:07:13,130 --> 00:07:17,870
‫And then this one here, that's this one here in the next loop.

71
00:07:18,500 --> 00:07:25,370
‫And actually, the same thing happens with this you zero the sum vector that you did apply to your plant.

72
00:07:26,030 --> 00:07:27,950
‫At the beginning, it was you zero.

73
00:07:28,280 --> 00:07:38,300
‫But then once you go and enter a new loop, this you zero in the new loop, it will be you minus one.

74
00:07:38,900 --> 00:07:43,430
‫Since you're in a new loop, everything shifts one step back.

75
00:07:44,900 --> 00:07:52,760
‫And so as you go through your new loop, you enter into your PC box and inside your LPV, the NPC box,

76
00:07:53,390 --> 00:08:05,330
‫you have to predict your Future State Vector X1 with this formula, A0 times your present state vector,

77
00:08:05,960 --> 00:08:08,780
‫plus B times use zero.

78
00:08:09,380 --> 00:08:15,380
‫So this X1, this is your predicted state vector one time step into the future.

79
00:08:16,010 --> 00:08:20,150
‫Now, keep in mind that this use zero here.

80
00:08:20,840 --> 00:08:24,110
‫That's not the one that you had applied to your plans.

81
00:08:24,740 --> 00:08:25,940
‫One loop before.

82
00:08:26,540 --> 00:08:28,400
‫Remember, you're in a new loop now.

83
00:08:28,940 --> 00:08:31,730
‫So this you zero here four.

84
00:08:31,730 --> 00:08:35,840
‫Which is better if I use green, it's this one here.

85
00:08:36,440 --> 00:08:42,020
‫Or in other words, in the previous loop, it was your first leftover.

86
00:08:42,590 --> 00:08:43,700
‫Is this one here?

87
00:08:44,300 --> 00:08:44,960
‫You won?

88
00:08:45,560 --> 00:08:50,330
‫But now, since you're in your new loop, this new one became you zero.

89
00:08:50,930 --> 00:08:56,980
‫And since you're predicting your future state vectors in your new loop, this use zero here.

90
00:08:57,620 --> 00:09:02,420
‫It's this one here or your first left over from the previous loop.

91
00:09:02,960 --> 00:09:04,680
‫Then this vector X0.

92
00:09:04,680 --> 00:09:07,490
‫And that's your present state vector.

93
00:09:07,490 --> 00:09:10,370
‫In the previous loop, it was your new state vector.

94
00:09:10,670 --> 00:09:18,990
‫But now in this loop, it's your present state vector, and it looks like this transposed because actually

95
00:09:18,990 --> 00:09:20,120
‫it's your column vector.

96
00:09:20,690 --> 00:09:31,070
‫And so from this present state vector, you take 5.0 and citadels zero and you put them inside your

97
00:09:31,070 --> 00:09:32,300
‫A0 matrix.

98
00:09:32,960 --> 00:09:37,880
‫You see, this was your continuous a matrix in the LPT format.

99
00:09:38,450 --> 00:09:40,700
‫But remember that this is zero here.

100
00:09:41,390 --> 00:09:43,880
‫This is your discrete A0.

101
00:09:44,450 --> 00:09:48,260
‫So actually, it's like this this aid zero.

102
00:09:48,500 --> 00:09:53,360
‫It's this one here, and it equals the identity matrix.

103
00:09:53,360 --> 00:10:02,360
‫Plus the continuous a matrix times the sample time interval and this one here.

104
00:10:03,020 --> 00:10:04,490
‫That's this one here.

105
00:10:05,090 --> 00:10:09,020
‫And quite frankly, you don't need these notations here.

106
00:10:09,560 --> 00:10:13,550
‫You can automatically see that this is a discrete a matrix.

107
00:10:13,940 --> 00:10:14,510
‫Why?

108
00:10:15,140 --> 00:10:25,670
‫Because if you look at this form, then it's X at K plus one equals eight times x at the K plus b times

109
00:10:26,330 --> 00:10:27,350
‫use up K.

110
00:10:27,950 --> 00:10:29,750
‫This is a discrete form.

111
00:10:30,380 --> 00:10:39,380
‫A continuous form would be like this x dot equals eight times x plus b times you.

112
00:10:39,980 --> 00:10:47,300
‫If you have x dot here, then that means that you're A and B matrices are continuous.

113
00:10:47,840 --> 00:10:57,560
‫If you have X at Kate plus one here and exit K here and you add K here, then your A and B matrices

114
00:10:57,560 --> 00:10:58,430
‫are discrete.

115
00:10:59,060 --> 00:11:06,320
‫So I don't have to specify whether my A matrix is discrete or continuous.

116
00:11:06,980 --> 00:11:11,390
‫You can see from this form this one, it's like your Capa's one.

117
00:11:11,810 --> 00:11:15,200
‫And this zero, it's like your K and also the zero.

118
00:11:15,200 --> 00:11:16,520
‫It's like your K here.

119
00:11:17,120 --> 00:11:23,660
‫But if you look at this form here, then you can see that here you have your ex dot, you have your

120
00:11:23,840 --> 00:11:29,960
‫five dot fi double down theater dot to double dot signed on side double dot.

121
00:11:30,500 --> 00:11:33,890
‫So this is clearly in the continuous format.

122
00:11:34,370 --> 00:11:38,480
‫Therefore, these matrices here, they're continuous.

123
00:11:39,080 --> 00:11:47,570
‫And so obviously this B matrix here, it's also your discrete P matrix, which is your continuous B

124
00:11:47,570 --> 00:11:49,790
‫matrix times t.

125
00:11:50,690 --> 00:11:51,840
‫So that's the formula.

126
00:11:52,370 --> 00:11:57,650
‫We covered the derivations in the first part in this control system series.

127
00:11:58,280 --> 00:12:01,040
‫You see, that's how you obtain your disk with a matrix.

128
00:12:01,400 --> 00:12:04,400
‫And this could be matrix and then you're discrete.

129
00:12:04,550 --> 00:12:08,510
‫See, Matrix was equal to your continuous see matrix.

130
00:12:09,140 --> 00:12:19,140
‫And now, once you have put your 5.0 and 10.0 inside your discrete A0 matrix, you take your latest

131
00:12:19,140 --> 00:12:23,870
‫omega that you have calculated inside your plant.

132
00:12:24,500 --> 00:12:25,640
‫It's right here.

133
00:12:26,270 --> 00:12:32,180
‫First, you calculated your omega one omega to omega three and omega four, and then you calculated

134
00:12:32,210 --> 00:12:33,650
‫your global omega.

135
00:12:34,280 --> 00:12:36,680
‫It happened here inside the plant.

136
00:12:37,250 --> 00:12:43,940
‫You see you had your you want you to use three and you four, and you used them to compute your global

137
00:12:43,940 --> 00:12:44,090
‫or.

138
00:12:45,130 --> 00:12:50,560
‫And so you take the global Omega that you had calculated in your plant in the previous loop.

139
00:12:51,280 --> 00:13:00,280
‫And you also put it inside your A0 matrix here because as you can see that in the continuous LP, a

140
00:13:00,310 --> 00:13:03,040
‫matrix, you also have omega here.

141
00:13:03,610 --> 00:13:09,790
‫And that's why you also have to put it inside your discrete a matrix in the previous loop this omega

142
00:13:09,790 --> 00:13:10,300
‫zero.

143
00:13:10,930 --> 00:13:16,540
‫It was actually omega one because it was your new omega that you had calculated inside your plant.

144
00:13:16,840 --> 00:13:21,460
‫But now, since you started with a new loop, it became your present omega.

