﻿1
00:00:00,720 --> 00:00:01,530
‫Welcome back.

2
00:00:02,160 --> 00:00:10,440
‫So let's now play around a little bit with our omega men and omega max variables and see what we get.

3
00:00:11,010 --> 00:00:12,810
‫So let's start with these values.

4
00:00:13,500 --> 00:00:17,730
‫This is approximately 115 radians per second.

5
00:00:18,330 --> 00:00:21,930
‫And this is approximately 900 radians per second.

6
00:00:22,530 --> 00:00:25,170
‫We're going to work with this trajectory here.

7
00:00:25,800 --> 00:00:27,720
‫As you can see, tracking is pretty good.

8
00:00:28,350 --> 00:00:31,350
‫But what we are interested in is this one here.

9
00:00:31,830 --> 00:00:38,280
‫These are your Omega's Omega one, Omega two, Omega three and Omega four.

10
00:00:38,880 --> 00:00:46,940
‫So you can see that you go from more or less 115 radians per second at the very beginning.

11
00:00:47,610 --> 00:00:54,510
‫Because remember our initial four omega 3s, they were omega men.

12
00:00:55,170 --> 00:01:02,910
‫So no matter what you do at the very beginning, they have your minimum values that you define right

13
00:01:02,910 --> 00:01:03,330
‫here.

14
00:01:03,900 --> 00:01:12,630
‫And you can see that all these omega as they go until 800 radians per second, so they don't even reach

15
00:01:13,200 --> 00:01:14,370
‫our upper limit.

16
00:01:15,000 --> 00:01:21,810
‫And you can see that at the very beginning, they start rotating very fast and then their rotational

17
00:01:21,810 --> 00:01:26,670
‫velocities, they slow down and they start oscillating like that.

18
00:01:27,240 --> 00:01:33,120
‫It makes sense because at the beginning you start from your ground and you have to go up in order to

19
00:01:33,120 --> 00:01:34,380
‫reach your trajectory.

20
00:01:34,830 --> 00:01:42,570
‫And then once you have reached your trajectory, then you have to go up and down, up and down in waves.

21
00:01:43,170 --> 00:01:50,400
‫And that's why the omega 3s, they also behave like that as a function of time when you need to go up.

22
00:01:50,700 --> 00:01:53,970
‫They rotate a bit faster when you need to go down.

23
00:01:54,240 --> 00:01:55,770
‫They rotate a bit slower.

24
00:01:56,340 --> 00:02:03,720
‫And so here I've taken my omega one and I've zoomed in this wavy behavior.

25
00:02:04,020 --> 00:02:14,730
‫And so you can see that this rotational speed, it varies more or less between 540 and 460 gradients

26
00:02:14,730 --> 00:02:15,360
‫per second.

27
00:02:15,930 --> 00:02:20,850
‫So I have simply taken one wave here and I've zoomed it in.

28
00:02:21,480 --> 00:02:25,920
‫But OK, now let's leave omega men alone.

29
00:02:26,580 --> 00:02:36,030
‫But for omega max, let's put here times zero plus 700 that will make this term zero.

30
00:02:36,660 --> 00:02:43,620
‫And then I had 700 here, so my omega max, it will be 700 gradients per second.

31
00:02:44,220 --> 00:02:47,460
‫If I run the code, then I will get this result.

32
00:02:48,090 --> 00:02:56,370
‫You don't see the number here, but if I zoom in, then you can see that once the rotational velocities

33
00:02:56,970 --> 00:03:04,860
‫reach 700 radians per second for each motor, then they don't go up any further.

34
00:03:05,400 --> 00:03:06,390
‫So that's very good.

35
00:03:07,020 --> 00:03:18,180
‫How about if instead of 700, I put here 600 now my omega max, it's 600 radians per second because

36
00:03:18,180 --> 00:03:19,830
‫this term here it's zero.

37
00:03:20,430 --> 00:03:21,780
‫Well, this is the result.

38
00:03:22,290 --> 00:03:25,140
‫You can see that all your omega 3s.

39
00:03:25,800 --> 00:03:30,840
‫They don't go above 600 radians per second, so that's very good as well.

40
00:03:31,410 --> 00:03:38,820
‫But if you remember then a couple of pictures ago this oscillation here, it happened more or less between

41
00:03:39,300 --> 00:03:44,190
‫540 and 460 radians per second.

42
00:03:44,850 --> 00:03:47,760
‫Well, how about for my omega men?

43
00:03:48,420 --> 00:03:59,340
‫I'm going to put time zero plus 400 and 80, and then for my omega max, I'm going to put 520.

44
00:03:59,910 --> 00:04:01,140
‫What will happen then?

45
00:04:01,770 --> 00:04:10,950
‫Remember, normally the Omega has oscillated between more or less 540 and 460 irradiance per second.

46
00:04:11,550 --> 00:04:17,430
‫Now I have 520 and 480 radians per second.

47
00:04:18,030 --> 00:04:19,890
‫So the interval is very tight.

48
00:04:20,430 --> 00:04:22,140
‫Well, this is the result.

49
00:04:22,320 --> 00:04:29,060
‫As you can see, your tracking is not very good now, and it makes sense if you look at your omega is

50
00:04:29,070 --> 00:04:29,530
‫now.

51
00:04:29,970 --> 00:04:37,950
‫Then you can see that they stay between 520 and 400 and 80 radians per second.

52
00:04:38,580 --> 00:04:42,390
‫So all your four motors, they obey your constraints.

53
00:04:43,020 --> 00:04:50,520
‫But of course, because of these narrow constraints, your drone simply cannot follow the trajectory

54
00:04:51,120 --> 00:04:53,130
‫in order to follow this trajectory.

55
00:04:53,760 --> 00:04:57,450
‫You cannot restrict the rotation of your omega is like that.

56
00:04:58,050 --> 00:04:59,460
‫This is too restrictive.

57
00:05:00,070 --> 00:05:02,440
‫You have to give your amigas more freedom.

58
00:05:03,040 --> 00:05:06,880
‫But in conclusion, you can see that your constraints are working.

59
00:05:07,450 --> 00:05:13,720
‫Now, of course, you might wonder why aren't they working perfectly?

60
00:05:14,320 --> 00:05:24,400
‫Why do I go slightly over 520 radians per second and why do I go slightly below 480 radians per second?

61
00:05:25,000 --> 00:05:30,310
‫And also here I go, slightly above 600 radians per second.

62
00:05:30,910 --> 00:05:31,750
‫And the same thing.

63
00:05:31,750 --> 00:05:35,950
‫Here I go slightly over 700 radians per second.

64
00:05:36,550 --> 00:05:37,690
‫Why is it like that?

65
00:05:38,140 --> 00:05:40,330
‫Well, the explanation is very straightforward.

66
00:05:40,990 --> 00:05:43,420
‫This is our global control architecture.

67
00:05:43,870 --> 00:05:48,880
‫But now let's zoom in and only consider our inner loop.

68
00:05:49,540 --> 00:05:52,840
‫So this is your plant and this is your NPC.

69
00:05:53,470 --> 00:06:01,060
‫Remember that your plant and your NPC had two very similar but still different models.

70
00:06:01,690 --> 00:06:11,680
‫If you remember, then in the plant box, we had a transfer matrix that depended on two angles Fei and

71
00:06:11,680 --> 00:06:12,160
‫Seta.

72
00:06:12,760 --> 00:06:21,190
‫But for the NPC controller, we approximated this transfer matrix to be an identity matrix because we

73
00:06:21,190 --> 00:06:24,760
‫said that the drone flies close to the hovering position.

74
00:06:25,390 --> 00:06:33,850
‫And so we simply made this assumption that Y equals zero and C equals zero because in reality, they

75
00:06:33,850 --> 00:06:35,080
‫were close to zero.

76
00:06:35,680 --> 00:06:40,660
‫And because of that assumption, this transfer matrix became an identity matrix.

77
00:06:41,320 --> 00:06:46,420
‫And so we used this assumption inside our HPC model.

78
00:06:47,080 --> 00:06:56,020
‫The planned model was more realistic, but the NPC model was easier to deal with and put in the LP format.

79
00:06:56,440 --> 00:07:02,530
‫And while the differences are small, this assumption still introduces some differences here.

80
00:07:03,100 --> 00:07:07,630
‫It makes the plan model and the NPC model slightly different.

81
00:07:08,170 --> 00:07:13,500
‫Another thing here is that in this course, we used simplified LP.

82
00:07:14,170 --> 00:07:22,360
‫This was our simplified LP V that we used in this course, but I also showed you what your C double

83
00:07:22,360 --> 00:07:29,560
‫bar and a double circuit flex matrices would be if you had used the non simplified version.

84
00:07:30,160 --> 00:07:36,460
‫It would have been slightly more correct, but since our horizon period was very short, it didn't really

85
00:07:36,460 --> 00:07:36,880
‫matter.

86
00:07:37,270 --> 00:07:44,530
‫We were able to achieve good tracking with this simplified LP V as well, where you had your simplified

87
00:07:44,530 --> 00:07:48,100
‫C double bar and simplified a double circle flex.

88
00:07:48,760 --> 00:07:50,140
‫So that was another thing.

89
00:07:50,710 --> 00:08:00,430
‫And then in both cases, we described our model, but we used forward Euler discontinuation in the NPC

90
00:08:00,430 --> 00:08:02,500
‫box and wrong acuta.

91
00:08:02,500 --> 00:08:07,120
‫This crystallization in the plan box using two different methods.

92
00:08:07,780 --> 00:08:15,100
‫They further increased the differences between the models used in the NPC controller and in the plan

93
00:08:15,100 --> 00:08:15,490
‫box.

94
00:08:16,120 --> 00:08:25,090
‫The thing with NPC is that the more similar the NPC model is to the planned model, the better your

95
00:08:25,090 --> 00:08:26,050
‫controller works.

96
00:08:26,680 --> 00:08:33,610
‫But of course, the closer you want to get to your planned model, the more complicated your NPC model

97
00:08:33,610 --> 00:08:34,240
‫becomes.

98
00:08:34,900 --> 00:08:36,760
‫So there's always a tradeoff.

99
00:08:37,450 --> 00:08:44,800
‫You obviously want to simplify your model for your NPC controller as much as possible, and for as long

100
00:08:44,800 --> 00:08:53,440
‫as tracking is good enough, you can use your simplified model and then you should not go closer to

101
00:08:53,440 --> 00:08:54,700
‫your plan model.

102
00:08:55,210 --> 00:09:01,450
‫Because if your NPC controller is able to achieve its tasks, then you should not complicate your life

103
00:09:01,450 --> 00:09:02,590
‫more than necessary.

104
00:09:03,190 --> 00:09:10,810
‫And with the simplifications that we have made, the NPC controller is able to track the trajectories

105
00:09:11,440 --> 00:09:17,530
‫that require the drone to fly close to the hovering position, which was our goal to begin with.

106
00:09:18,100 --> 00:09:26,260
‫Nevertheless, you have to be aware of these differences and you have to understand that when you design

107
00:09:26,260 --> 00:09:33,520
‫for your NPC constraints, then the design process uses this model here.

108
00:09:34,210 --> 00:09:37,930
‫This simplified one, not the one in the plan box.

109
00:09:38,560 --> 00:09:46,810
‫So the inputs that your NPC controller gives you, they take into account your NPC constraints, but

110
00:09:46,810 --> 00:09:57,040
‫your matrix and each vector they were generated using this model here and these control inputs.

111
00:09:57,730 --> 00:09:59,020
‫They were calculated.

112
00:09:59,790 --> 00:10:09,330
‫Considering your matrix and h vector, but again, they were created using this simplified model, and

113
00:10:09,330 --> 00:10:16,710
‫so when you get your control inputs and you apply it to your planned model, which is closer to reality,

114
00:10:16,740 --> 00:10:23,970
‫which is more realistic and more complex, then because of the fact that these two models in these two

115
00:10:23,970 --> 00:10:25,950
‫boxes are slightly different.

116
00:10:26,400 --> 00:10:32,880
‫Because of that, the real Omegas that you get from your planned box, they end up being slightly different

117
00:10:33,510 --> 00:10:39,210
‫compared to the boundaries that you had set for your omega max and omega men.

118
00:10:39,840 --> 00:10:47,340
‫And so at the beginning, when the drone needs to lift off and catch up with the trajectory, then you

119
00:10:47,340 --> 00:10:55,290
‫can see that these differences in those two models, they might cause your real Omegas to violate the

120
00:10:55,290 --> 00:10:56,790
‫constraints quite a lot.

121
00:10:57,480 --> 00:11:00,510
‫Therefore, it's important to have safety factors.

122
00:11:01,110 --> 00:11:11,970
‫So if you know that the real limit of omega 3s ranges between 150 irradiance per second and 900 radians

123
00:11:11,970 --> 00:11:20,520
‫per second, then the constraints that you give to your MPAC controller, the values that you set for

124
00:11:20,520 --> 00:11:24,750
‫omega men and omega max, they should be more conservative.

125
00:11:25,260 --> 00:11:34,110
‫So maybe your omega men could be 200 radians per second in omega max 800 radians per second.

126
00:11:34,710 --> 00:11:40,530
‫That way, you will have some space to violate your constraints.

127
00:11:41,190 --> 00:11:48,690
‫You should not break the red limit, but at least you can break the orange limit for as long as you

128
00:11:48,690 --> 00:11:53,490
‫stay in this corridor here and in this corridor here.

129
00:11:54,060 --> 00:11:57,600
‫So that's what I wanted to tell you about HPC constraints.

130
00:11:58,020 --> 00:11:58,950
‫Thank you very much.

