﻿1
00:00:00,570 --> 00:00:01,350
‫Welcome back.

2
00:00:01,830 --> 00:00:08,010
‫So I hope that you have tried the exercise and now I will show you how it is done.

3
00:00:08,640 --> 00:00:16,620
‫So to derive a mathematical model for a system from the first principles of physics, you should start

4
00:00:16,620 --> 00:00:26,640
‫from the Newton's second law, which is the net force vector equals the time derivative of the translational

5
00:00:26,820 --> 00:00:30,390
‫momentum and times the velocity vector.

6
00:00:31,140 --> 00:00:37,710
‫And so from calculus, you know that you first take the derivative of the mass with respect to time

7
00:00:38,190 --> 00:00:45,480
‫and you leave the velocity vector alone and then you leave the mass alone and you take the time derivative

8
00:00:45,480 --> 00:00:57,150
‫of the velocity vector like this, since the change of mass with respect to time equals the zero kilograms

9
00:00:57,150 --> 00:01:00,650
‫per second, which means that the mass is constant.

10
00:01:00,660 --> 00:01:02,850
‫It doesn't change with time.

11
00:01:03,780 --> 00:01:14,130
‫It means that this term here becomes a zero and that means that F net equals mass times acceleration,

12
00:01:14,130 --> 00:01:15,680
‫which is DVD t.

13
00:01:16,570 --> 00:01:25,410
‫Next, we have to find the second time derivative of our position vector Gummo in the inertial frame,

14
00:01:25,950 --> 00:01:33,240
‫which was X, Y and then Z transposed because it was a column vector.

15
00:01:34,080 --> 00:01:40,680
‫And the reason for why we need to find the second time derivative of this position vector is because

16
00:01:40,920 --> 00:01:45,960
‫Gunma doubled that in the inertia frame as a vector.

17
00:01:46,530 --> 00:01:51,270
‫It is our divi deti.

18
00:01:51,600 --> 00:01:54,240
‫All right, so let's do that.

19
00:01:54,780 --> 00:02:06,090
‫We can rewrite Gummo in the inertia frame like this X then the unit vector ie plus why the unit vector

20
00:02:06,090 --> 00:02:20,250
‫J and plus Z, the unit vector K and remember the unit vectors I, J and K are now along the inertial

21
00:02:20,250 --> 00:02:25,770
‫frame axis, not the body frame axis, but the inertia frame axis.

22
00:02:26,640 --> 00:02:37,200
‫And so gamma dot in the inertia frame equals x dot and then you have this unit vector and then you have

23
00:02:37,200 --> 00:02:43,320
‫X and then the derivative of the unit vector, the same for Y.

24
00:02:43,590 --> 00:02:54,030
‫So first of all you have Y daytime's J and then plus Y times Jadot and then plus the Z dot times the

25
00:02:54,030 --> 00:03:02,250
‫unit vector K and then plus the Z times the time derivative of the unit vector K.

26
00:03:02,490 --> 00:03:16,050
‫So like this since now we are in the initial frame, then that means that I dot j dot and k dot they

27
00:03:16,050 --> 00:03:18,000
‫are all zero.

28
00:03:18,510 --> 00:03:19,020
‫All right.

29
00:03:19,140 --> 00:03:20,780
‫Zero units per second.

30
00:03:21,690 --> 00:03:29,370
‫That means that this term here becomes zero, this term here becomes zero and also this term here becomes

31
00:03:29,400 --> 00:03:29,940
‫zero.

32
00:03:30,870 --> 00:03:37,710
‫And that means that your final gamma dot vector looks like this.

33
00:03:38,550 --> 00:03:42,710
‫And now we'll take another time derivative of this vector here.

34
00:03:43,350 --> 00:03:50,550
‫So gamma double dot in the initial frame equals these two terms.

35
00:03:50,550 --> 00:03:56,430
‫First of all, you have X double dot times I plus X dot times.

36
00:03:56,430 --> 00:04:03,300
‫I dot the same thing for the Y dimension and for the Z dimension.

37
00:04:04,170 --> 00:04:11,970
‫Again, this term here becomes zero, then this term here becomes zero and this term here becomes zero

38
00:04:12,000 --> 00:04:14,700
‫y because we are in the inertia frame.

39
00:04:14,970 --> 00:04:22,230
‫So that means that the axis of an inertial frame, they are fixed.

40
00:04:22,350 --> 00:04:22,800
‫All right.

41
00:04:22,800 --> 00:04:25,860
‫They don't rotate, they don't move anywhere.

42
00:04:25,860 --> 00:04:26,880
‫They are fixed.

43
00:04:27,600 --> 00:04:36,210
‫And if they are fixed, then that means that these unit vectors here, they cannot move.

44
00:04:36,450 --> 00:04:39,260
‫So their time derivatives must be zero.

45
00:04:39,930 --> 00:04:47,400
‫And so you can rewrite this vector like this gunman double dot in the initial frame equals.

46
00:04:47,700 --> 00:04:57,360
‫And then you have here X double dot, y double dot and then Z double dot like this.

47
00:04:58,020 --> 00:04:59,450
‫And then of course E.

48
00:04:59,840 --> 00:05:10,100
‫Your D.V. deti, all right, and that also means that in the inertia frame, the equations of motion

49
00:05:10,610 --> 00:05:11,660
‫look like this.

50
00:05:12,500 --> 00:05:22,060
‫This is the net force vector and it equals mass times, X, Y and Z double dot.

51
00:05:23,150 --> 00:05:31,730
‫And now we need to express our F net vector in terms of the individual relevant forces that the drone

52
00:05:31,730 --> 00:05:32,900
‫is exposed to.

53
00:05:33,380 --> 00:05:38,360
‫If you remember, then we have three force moment vectors for that.

54
00:05:39,050 --> 00:05:48,950
‫We had Londa in the body frame for the gravity, then also lambda in the body frame for the gyroscopic

55
00:05:48,950 --> 00:05:55,580
‫effect and lambda in the body frame for the inputs, control inputs.

56
00:05:55,580 --> 00:05:57,740
‫You want you to use three and you four.

57
00:05:58,710 --> 00:06:07,350
‫So that was the gravity here in the body frame and you had this inverse rotation matrix here that was

58
00:06:07,380 --> 00:06:15,210
‫Lunda in the body frame for the gyroscopic effect and that was Lunda in the body frame for the control

59
00:06:15,210 --> 00:06:15,880
‫inputs.

60
00:06:16,800 --> 00:06:24,390
‫In our case, though, we only need the first three elements from these vectors so we can forget about

61
00:06:24,390 --> 00:06:33,390
‫this one and then we can forget about this one and then also this one, because we only need the force

62
00:06:33,390 --> 00:06:37,320
‫elements and we can neglect the moment elements.

63
00:06:37,980 --> 00:06:44,400
‫And in addition, our force vectors have to be in the initial frame, not in the body frame.

64
00:06:44,550 --> 00:06:48,810
‫Here they are in the body frame, but we need them in the initial frame.

65
00:06:49,530 --> 00:07:01,520
‫So this one here, that was our force of gravity, but in the body frame then we had no gyroscopic force.

66
00:07:01,530 --> 00:07:03,960
‫We only had gyroscopic moments.

67
00:07:04,140 --> 00:07:09,230
‫That gyroscopic effect had to do with moments, not with force.

68
00:07:09,510 --> 00:07:12,360
‫So that's even irrelevant here.

69
00:07:12,360 --> 00:07:18,210
‫So we don't have to worry about this entire vector at all, not even in the initial frame.

70
00:07:18,960 --> 00:07:26,880
‫But you could say that this is your gyroscopic force in the body frame, which is a zero zero zero.

71
00:07:27,030 --> 00:07:28,200
‫So it's a zero vector.

72
00:07:28,980 --> 00:07:30,540
‫And then this one here.

73
00:07:30,750 --> 00:07:37,860
‫Well, that was your input vector in the body frame, this one here.

74
00:07:38,640 --> 00:07:45,120
‫But in the initial frame, those vectors, those force vectors here, they would look like this.

75
00:07:46,080 --> 00:07:49,230
‫The force of gravity in the initial frame looks like this.

76
00:07:50,290 --> 00:07:57,010
‫The gyroscopic force in the initial frame is like this, so zero zero zero, meaning that it doesn't

77
00:07:57,010 --> 00:07:57,640
‫exist.

78
00:07:58,480 --> 00:08:05,230
‫And now remember that this force vector here is in the body frame.

79
00:08:05,230 --> 00:08:10,020
‫This is zero zero and you one that's in the body frame.

80
00:08:10,090 --> 00:08:14,260
‫So if you want to put it in the initial frame, well, then.

81
00:08:15,210 --> 00:08:23,700
‫You have to take your rotation matrix and multiplied by this vector here, which is your force vector

82
00:08:23,700 --> 00:08:25,330
‫in the body frame.

83
00:08:25,350 --> 00:08:33,180
‫So if you multiply the rotation matrix by this body frame, input force vector, then you will get the

84
00:08:33,180 --> 00:08:35,410
‫input force vector in the inertia frame.

85
00:08:36,390 --> 00:08:43,400
‫So this element here, you one that was in the body frame Z direction.

86
00:08:44,400 --> 00:08:47,770
‫So I guess you need the rotation matrix after all.

87
00:08:48,270 --> 00:08:52,370
‫And so this is your rotation matrix here.

88
00:08:52,680 --> 00:08:59,190
‫And if you multiply this rotation matrix by this vector zero zero, you one.

89
00:09:00,210 --> 00:09:10,920
‫Then you can extract this element here for the X dimension, this element here for the Y dimension and

90
00:09:10,920 --> 00:09:15,640
‫this element here for the Z dimension, it makes sense, right?

91
00:09:15,900 --> 00:09:26,730
‫So if you take this vector here, F input and in the inertial frame and then you say that this is your

92
00:09:26,730 --> 00:09:37,110
‫rotation matrix times this vector zero zero, you one, then remember this rotation matrix is a three

93
00:09:37,110 --> 00:09:40,220
‫by three matrix with those huge elements there.

94
00:09:41,130 --> 00:09:48,990
‫And since the first two elements here are zeros, that means that when you multiply this rotation matrix

95
00:09:48,990 --> 00:09:51,600
‫by this vector, then.

96
00:09:52,840 --> 00:09:59,650
‫This one gets multiplied by this one for the X dimension.

97
00:10:00,620 --> 00:10:10,640
‫Then this one gets multiplied by this one for the Y dimension and this one gets multiplied by this one

98
00:10:11,000 --> 00:10:16,530
‫for the Z dimension, and that's why you extract these elements here.

99
00:10:17,360 --> 00:10:22,300
‫So in the end, the input force vector in the initial frame looks like this.

100
00:10:22,520 --> 00:10:32,520
‫You see, these are the elements from this rotation matrix and then you multiply them by you one.

101
00:10:33,410 --> 00:10:35,870
‫And now let's put it all together.

102
00:10:36,740 --> 00:10:48,560
‫Mass Times, Gunma, double dot in the inertia frame equals and then your net force vector in the inertia

103
00:10:48,560 --> 00:10:55,940
‫frame and then you rewrite this net force vector in terms of the three individual force vectors like

104
00:10:55,940 --> 00:10:56,420
‫this.

105
00:10:57,230 --> 00:11:05,810
‫Or you can rewrite it like this where you show what those individual force vectors are and then instead

106
00:11:05,810 --> 00:11:14,930
‫of Gummo double that, you rewrite it like this equals and if you rewrite your input vector in the initial

107
00:11:14,930 --> 00:11:18,850
‫frame, then the entire thing looks like this.

108
00:11:19,370 --> 00:11:23,970
‫And now what you can do, you can simply cancel out the masses.

109
00:11:23,980 --> 00:11:32,690
‫So if I cancel out the mass here, then that means that I will have a mass here you want divided by

110
00:11:32,690 --> 00:11:33,170
‫mass.

111
00:11:33,530 --> 00:11:40,490
‫And also here you one divided by mass and also here you one divided by mass.

112
00:11:41,210 --> 00:11:44,720
‫And I will have it here in the denominator as well.

113
00:11:44,720 --> 00:11:47,780
‫But then I can cancel them out.

114
00:11:48,800 --> 00:11:51,440
‫And that's your final answer.

115
00:11:52,250 --> 00:11:53,080
‫And there you go.

116
00:11:53,690 --> 00:12:00,100
‫That's how you get the equations of motion for position control in the inertial frame.

117
00:12:00,770 --> 00:12:04,550
‫Not that they are not states based equations.

118
00:12:05,090 --> 00:12:10,130
‫You simply relate the accelerations x double date.

119
00:12:10,130 --> 00:12:12,600
‫Why double date and Z double that.

120
00:12:12,620 --> 00:12:19,360
‫And now these accelerations are in the inertial X, Y and Z direction.

121
00:12:19,820 --> 00:12:29,960
‫You simply relate them with Phi Theta and Passi angles and you want control input.

122
00:12:30,710 --> 00:12:35,110
‫And in this section you don't need to put them in the state's space form.

123
00:12:35,630 --> 00:12:43,400
‫We're going to use these equations directly for position control and we will start with that in the

124
00:12:43,400 --> 00:12:44,030
‫next video.

125
00:12:44,330 --> 00:12:44,840
‫Thank you.

