﻿1
00:00:00,440 --> 00:00:10,640
‫And so now let's make our Drak switch one again, let's include drag and also let's choose trajectory

2
00:00:10,640 --> 00:00:11,330
‫six.

3
00:00:12,380 --> 00:00:20,990
‫And so this is the animation, however, now I want to look at the fire and see two angles separately.

4
00:00:22,010 --> 00:00:26,150
‫So here you have it, you have your fire angle and then you have your angle.

5
00:00:27,130 --> 00:00:33,940
‫So the fire angle, as you can see here, becomes negative over time, that's the angle that causes

6
00:00:34,060 --> 00:00:40,600
‫centripetal acceleration and then the third angle becomes positive over time.

7
00:00:41,200 --> 00:00:48,930
‫That's the red beam tilting down to produce force in the direction of the forward flight.

8
00:00:49,930 --> 00:00:51,760
‫So let's check the conventions.

9
00:00:52,800 --> 00:01:01,050
‫So this is your drone here, the top of you, that's your body frame, X-axis here, that's your body

10
00:01:01,050 --> 00:01:02,280
‫frame, Y-axis.

11
00:01:03,090 --> 00:01:10,440
‫So this is your model one and then this is your model, too, and this is your trajectory on the X Y

12
00:01:10,440 --> 00:01:10,920
‫plane.

13
00:01:10,920 --> 00:01:11,250
‫Right.

14
00:01:11,280 --> 00:01:13,310
‫So this is your spiral.

15
00:01:14,130 --> 00:01:22,290
‫So the X Y plane, you move like this, so you're following this turning trajectory and so you get the

16
00:01:22,650 --> 00:01:26,850
‫angle if you rotate about the body frame x axis.

17
00:01:27,900 --> 00:01:31,980
‫So if you want to tilt this side down.

18
00:01:33,010 --> 00:01:41,380
‫You're looking at the drone from the top, so if you want this site to go down this M2, then you have

19
00:01:41,380 --> 00:01:45,100
‫to rotate about the negative body frame x axis.

20
00:01:46,070 --> 00:01:52,640
‫So this is your hand, these are your knuckles and your thumb points in this direction, in the negative

21
00:01:52,640 --> 00:02:01,900
‫body from X direction, and then your M to side tilts down, giving you that centripetal acceleration.

22
00:02:02,600 --> 00:02:11,870
‫And since you are some points down, which is the negative body from X direction, your fi angle becomes

23
00:02:12,050 --> 00:02:12,770
‫negative.

24
00:02:13,580 --> 00:02:16,400
‫And that's what you see here in the graph.

25
00:02:17,210 --> 00:02:24,860
‫Your angle becomes more and more negative, which means that this side tilts down more and more, giving

26
00:02:24,860 --> 00:02:31,670
‫you more and more centripetal acceleration because your radius here increases in time.

27
00:02:32,550 --> 00:02:41,940
‫And that means that this part of the equation here increases faster than this part of the equation overall,

28
00:02:41,940 --> 00:02:44,760
‫giving you greater centripetal acceleration.

29
00:02:45,690 --> 00:02:54,570
‫However, if you want to take this side down this more one side, you want this side to go down, then

30
00:02:54,570 --> 00:03:00,450
‫that means that you have to rotate about the positive body frame y axis.

31
00:03:01,230 --> 00:03:10,560
‫Your side now is in the positive body frame y axis, and so your angle becomes positive as you tilt

32
00:03:10,560 --> 00:03:12,660
‫your end one down.

33
00:03:13,690 --> 00:03:19,300
‫And you can also see it here in this graph, you can see that your theater becomes more and more positive

34
00:03:19,300 --> 00:03:20,110
‫over time.

35
00:03:21,040 --> 00:03:25,360
‫So that means that our conventions match and that's very good.

36
00:03:26,530 --> 00:03:35,920
‫So here you can see that your fire angle reaches around minus zero point one radiance in the end and

37
00:03:35,920 --> 00:03:42,240
‫your FITA angle reaches about zero point zero four radians in the end.

38
00:03:42,760 --> 00:03:44,260
‫But let's go crazy now.

39
00:03:45,250 --> 00:03:54,790
‫Let's make this drag coefficient CDs of you ten point five, and let's do the same with C, D, sub

40
00:03:54,800 --> 00:03:57,050
‫V also let's make it ten point five.

41
00:03:58,000 --> 00:04:01,180
‫So now these drag coefficients are 10 times higher.

42
00:04:02,110 --> 00:04:03,580
‫That's the animation.

43
00:04:04,610 --> 00:04:12,020
‫As you can see, your fire angle is still around minus zero point one radians in the end, and it makes

44
00:04:12,020 --> 00:04:12,530
‫sense.

45
00:04:13,640 --> 00:04:18,620
‫Let's bring to our velocity, that's the velocity in the body frame, Y-axis.

46
00:04:19,660 --> 00:04:23,300
‫So these are the values for the velocity, as you can see.

47
00:04:23,320 --> 00:04:29,890
‫They range from zero point three to zero point five to again zero point three meters per second.

48
00:04:30,760 --> 00:04:33,950
‫So it's not zero, but it is quite small.

49
00:04:34,990 --> 00:04:43,660
‫So the 10 times higher force in the V direction almost plays no role and therefore Angle is not affected

50
00:04:43,660 --> 00:04:44,890
‫by that almost at all.

51
00:04:45,790 --> 00:04:52,870
‫So if I make my drag coefficients one point five again and put my velocity again.

52
00:04:54,050 --> 00:05:00,170
‫Then you can see that the velocities become bigger, which makes sense because now you have less drag.

53
00:05:01,170 --> 00:05:09,300
‫But the change is very small, and so if I make it ten point five again, that means that your angle

54
00:05:09,300 --> 00:05:14,630
‫is not affected by this increase in drag almost at all.

55
00:05:15,660 --> 00:05:22,670
‫This angle here is affected by the fact that the radius of the spiral is increasing.

56
00:05:23,670 --> 00:05:31,980
‫So the radius of your spiral gets bigger and bigger, which means that every second you have to cover

57
00:05:31,980 --> 00:05:33,300
‫more distance.

58
00:05:34,080 --> 00:05:39,870
‫At the beginning, maybe you had to cover this distance in one second.

59
00:05:40,800 --> 00:05:51,840
‫And now you have to cover maybe this distance in one second, which means that your velocity here must

60
00:05:51,840 --> 00:05:54,090
‫be bigger than here.

61
00:05:54,630 --> 00:05:55,230
‫All right.

62
00:05:56,320 --> 00:06:02,140
‫This will last and needs to be bigger than here, because here in one second, you need to cover more

63
00:06:02,140 --> 00:06:07,140
‫distance than here, and that plays itself out here.

64
00:06:08,170 --> 00:06:10,990
‫And that makes your centripetal acceleration bigger.

65
00:06:11,770 --> 00:06:16,480
‫Of course, your radius also increases and that makes your centripetal acceleration smaller.

66
00:06:16,660 --> 00:06:24,970
‫But in this case, this thing becomes bigger, faster than this thing here.

67
00:06:25,850 --> 00:06:32,620
‫So we conclude that the triangle is not very much affected by the increase in drag.

68
00:06:33,640 --> 00:06:41,610
‫However, due to 10 times higher drag force in the new direction, you using this more?

69
00:06:41,620 --> 00:06:49,930
‫One needs to tilt down a lot more to produce the horizontal force to overcome that massive drag.

70
00:06:50,890 --> 00:06:56,410
‫And it does tilt more now instead of zero point zero four radians.

71
00:06:56,410 --> 00:07:02,650
‫In the end, you finish the maneuver with a three to four zero point twenty one radians approximately.

72
00:07:03,550 --> 00:07:07,510
‫And now I'm going to go back to my one point five drag coefficients.

73
00:07:08,380 --> 00:07:13,960
‫And now I want to show you trajectory three here.

74
00:07:13,960 --> 00:07:22,560
‫You have a bit of spiral and then you go up exponentially until like 700 meters.

75
00:07:23,470 --> 00:07:32,050
‫So now you mostly go in the body frame axis and so your W velocity becomes pretty large.

76
00:07:32,590 --> 00:07:41,140
‫So you can see that on the X Y plane, you move from minus two to eight meters and then in the Z dimension

77
00:07:41,500 --> 00:07:45,550
‫you go from zero meters to almost seven hundred meters.

78
00:07:46,570 --> 00:07:54,480
‫And by the way, if you look at the length of these beams here, the red beam and then the green beam,

79
00:07:55,300 --> 00:08:00,120
‫then again, they don't represent the real length of the drone.

80
00:08:01,030 --> 00:08:03,580
‫They just help you visualize the drone.

81
00:08:04,360 --> 00:08:12,220
‫If I had put here the drone with its real dimensions, then it would be a very small drone here and

82
00:08:12,220 --> 00:08:14,080
‫it would be very hard for you to see it.

83
00:08:14,830 --> 00:08:23,050
‫And so since your upward velocity is pretty large now, that means that you have a drag force in the

84
00:08:23,050 --> 00:08:27,030
‫downward direction, mainly to overcome that.

85
00:08:27,070 --> 00:08:34,380
‫You see that you're you want control, you put your control force becomes pretty huge at some point.

86
00:08:35,340 --> 00:08:42,630
‫And also, all your Omega's that give you that you want control force, they become pretty large at

87
00:08:42,630 --> 00:08:51,540
‫some point and it makes sense because they have to produce this massive thrust up to accelerate you

88
00:08:51,540 --> 00:08:59,520
‫up force and to overcome this massive drag that increases as a function of time because you go up faster

89
00:08:59,520 --> 00:09:00,210
‫and faster.

90
00:09:01,080 --> 00:09:08,570
‫And so this has been trajectory three and in total, you have nine trajectories here to choose from,

91
00:09:09,420 --> 00:09:11,310
‫and that's the place where you choose them.

92
00:09:12,240 --> 00:09:17,820
‫You just pick a number from one to nine and it cannot be anything else.

93
00:09:17,820 --> 00:09:19,350
‫It has to be from one to nine.

94
00:09:20,070 --> 00:09:24,390
‫And then you run your program and then you have one more valuable here.

95
00:09:24,720 --> 00:09:27,010
‫No plots equals zero.

96
00:09:27,810 --> 00:09:34,470
‫So if you only want to see the animation and you don't want to see the plots that come after that,

97
00:09:35,280 --> 00:09:37,910
‫then you make this variable one like this.

98
00:09:38,880 --> 00:09:44,240
‫So here you have your animation and then if you close it, it's going to be the end of the program.

99
00:09:44,940 --> 00:09:51,420
‫But if you do want to see the plots afterwards, then you're going to put here zero and then you run

100
00:09:51,420 --> 00:09:52,070
‫the program.

101
00:09:52,830 --> 00:09:54,680
‫So you have your animation here.

102
00:09:54,870 --> 00:10:03,030
‫And then if you close it, then you will have a plot, then another plot in the next dimension and then

103
00:10:03,060 --> 00:10:11,160
‫another one in the Y dimension, in the Z dimension, then the angles and then the control inputs.

104
00:10:12,120 --> 00:10:21,120
‫Along with their Omega's, and if you close that, then your program finishes and so all these variables

105
00:10:21,120 --> 00:10:26,570
‫here in this init function are stored in this self that constants variable.

106
00:10:27,390 --> 00:10:32,800
‫And so this list, this vector is then sent to the main file.

107
00:10:33,690 --> 00:10:35,300
‫So this is your main file here.

108
00:10:35,310 --> 00:10:45,000
‫And if the main file calls this function from the support file class, then the main file gets this

109
00:10:45,150 --> 00:10:46,510
‫list in return.

110
00:10:47,100 --> 00:10:50,670
‫OK, and now let's go back to our main file.

