﻿1
00:00:00,450 --> 00:00:01,260
‫Welcome back.

2
00:00:01,770 --> 00:00:08,640
‫So how would you write this G in the body frame as a six by one vector?

3
00:00:09,180 --> 00:00:20,660
‫Well, first, you know, the force of gravity equals minus the mass of the drone times G.

4
00:00:20,820 --> 00:00:21,270
‫Right.

5
00:00:22,080 --> 00:00:25,060
‫And it's minus because it points down.

6
00:00:26,010 --> 00:00:31,940
‫Now, you have to be careful here because this force of gravity is in the inertia frame.

7
00:00:32,880 --> 00:00:41,160
‫So even if your drone is tilted like this is the case here where your body frame Z axis does not align

8
00:00:41,160 --> 00:00:50,400
‫with the inertia frame Z axis, then this force of gravity still points down in the negative inertial

9
00:00:50,400 --> 00:00:52,230
‫frame Z axis.

10
00:00:53,140 --> 00:00:59,740
‫But since we work in the body frame, we have to represent the force of gravity in the body frame as

11
00:00:59,740 --> 00:01:00,090
‫well.

12
00:01:01,220 --> 00:01:09,140
‫So this here, this is our inertial frame, and then in red, you have the body frame and then you see

13
00:01:09,240 --> 00:01:14,340
‫the force of gravity goes in the negative inertial frame Z direction.

14
00:01:15,410 --> 00:01:23,690
‫Therefore, if your initial reaction was to write something like this, then I'm afraid it's not quite

15
00:01:23,690 --> 00:01:30,430
‫correct because this is in the body frame, but this would be in the inertia frame.

16
00:01:30,680 --> 00:01:38,510
‫So we have to convert that into the body frame, but we already have the tools to do that, right.

17
00:01:39,050 --> 00:01:41,290
‫We built it in the previous section.

18
00:01:41,600 --> 00:01:43,750
‫It's called rotation matrices.

19
00:01:44,030 --> 00:01:50,090
‫So the force of gravity in the inertia frame equals.

20
00:01:50,900 --> 00:02:00,770
‫And then we had our rotation matrix that had the convention body frame, Z, Y, X, so the oilor angles

21
00:02:01,370 --> 00:02:06,710
‫and then you would multiply that by the force vector.

22
00:02:07,750 --> 00:02:17,420
‫That would be the gravity force vector, but in the body frame and that would be your equation, right?

23
00:02:18,280 --> 00:02:24,030
‫By the way, let me put a lower case G here, because that's how we know that here.

24
00:02:25,030 --> 00:02:29,520
‫But the thing is that we already have our force of gravity in the inertia frame.

25
00:02:30,130 --> 00:02:34,270
‫So what we need is our force of gravity in the body frame.

26
00:02:34,930 --> 00:02:37,440
‫So we really need the opposite equation.

27
00:02:37,840 --> 00:02:39,390
‫So we inverse it.

28
00:02:40,300 --> 00:02:44,470
‫We say that our F g in the body frame equals.

29
00:02:45,480 --> 00:02:56,400
‫The inverse of our rotation matrix times the force of gravity in the inertia frame so you can rewrite

30
00:02:56,400 --> 00:03:02,820
‫our Lambda G in the body frame in this way, lambda G in the body frame equals.

31
00:03:03,860 --> 00:03:12,350
‫Force of gravity vector in the body frame, and then this zero three by one vector for the moments.

32
00:03:13,450 --> 00:03:20,710
‫And now we replace the body from gravity force with this expression here that comes from here.

33
00:03:21,900 --> 00:03:30,050
‫And so the final answer would be like this, this would be your force of gravity in the inertia frame,

34
00:03:30,750 --> 00:03:38,060
‫but then you multiply your inverse rotation matrix by this inertia frame force of gravity.

35
00:03:38,820 --> 00:03:46,260
‫And here you will have three elements then and then here you would have three zeros as well.

36
00:03:47,270 --> 00:03:56,480
‫So if you perform this vector matrix operation, then you will have a three by one force of gravity

37
00:03:56,480 --> 00:03:57,060
‫vector.

38
00:03:57,080 --> 00:04:03,680
‫But then in the body frame, because this would give you the force of gravity in the body frame.

39
00:04:04,250 --> 00:04:08,760
‫This expression here, and this is where I wanted you to stop.

40
00:04:08,930 --> 00:04:12,510
‫So I wanted you to get something like this.

41
00:04:13,400 --> 00:04:21,200
‫However, if you make the real calculations, then you will end up with this kind of expression.

42
00:04:22,180 --> 00:04:32,350
‫You will have many times sine theta here, minus M.G. Times cosine theta times sine phi here as the

43
00:04:32,350 --> 00:04:42,970
‫second element and the third element is minus M times G times cosine theta times cosine phi.

44
00:04:44,020 --> 00:04:51,070
‫So if you multiply together the three year rotation matrices that we had, according to our convention,

45
00:04:51,850 --> 00:04:54,910
‫then this is what you would get.

46
00:04:55,570 --> 00:04:58,810
‫So this answer is when you.

47
00:05:00,040 --> 00:05:08,490
‫Multiply these three matrices together like this in this order, because, first of all, you rotate

48
00:05:08,500 --> 00:05:13,780
‫about the moving from the axis, then moving from y axis and then moving from x axis.

49
00:05:14,170 --> 00:05:21,750
‫And so as a result, your rotation matrix is a product of these three rotation matrices here.

50
00:05:22,450 --> 00:05:24,910
‫And if you multiply them together like this.

51
00:05:25,870 --> 00:05:33,610
‫Well, then you get this as a result, and so if you take the inverse of it, if you want to find this

52
00:05:33,850 --> 00:05:41,380
‫where you have the product of your three matrices and then you take the inverse of it, then you will

53
00:05:41,380 --> 00:05:48,840
‫get the inverse of the rotation matrix, which is simply the transpose of this.

54
00:05:49,090 --> 00:05:56,080
‫Remember the rotation matrices you could get there in versus if you just take their transposes because

55
00:05:56,080 --> 00:05:57,850
‫they are also normal matrices.

56
00:05:58,890 --> 00:06:05,610
‫So this here, this would be the inverse of your rotation matrix.

57
00:06:05,640 --> 00:06:06,240
‫All right.

58
00:06:06,720 --> 00:06:10,530
‫And this would be the force of gravity in the inertial frame.

59
00:06:10,710 --> 00:06:11,240
‫All right.

60
00:06:11,250 --> 00:06:14,820
‫So F g in the inertial frame.

61
00:06:15,330 --> 00:06:22,080
‫And so if you multiply this matrix by this vector, then since these are zeroes here, then the only

62
00:06:22,080 --> 00:06:29,280
‫thing that's going to happen is that in each row, only this column matters here.

63
00:06:29,730 --> 00:06:30,410
‫All right.

64
00:06:31,170 --> 00:06:34,970
‫Because if you take this element, then you have to multiply it by zero.

65
00:06:34,980 --> 00:06:38,700
‫And then if you take this element, you have to multiply it by zero.

66
00:06:38,880 --> 00:06:47,070
‫And the same thing here and here and also here and here you would be multiplying them by zero so they

67
00:06:47,070 --> 00:06:47,640
‫don't matter.

68
00:06:48,270 --> 00:06:57,780
‫However, here you would multiply minus sine theta times, minus M.G. and you would get plus M.G. times

69
00:06:58,050 --> 00:07:07,740
‫sine theta that here you would multiply sine five times cosine theta times minus M.G. and that would

70
00:07:07,740 --> 00:07:13,740
‫be minus M.G. times sine five times cosine theta.

71
00:07:14,520 --> 00:07:22,200
‫And lastly, this element here, you would multiply it by minus M.G. So it would be minus Meji times

72
00:07:22,860 --> 00:07:25,680
‫cosine, five times cosine theta.

73
00:07:26,190 --> 00:07:31,950
‫And so that would be your force of gravity in the body frame.

74
00:07:32,760 --> 00:07:35,090
‫This would be the body frame X direction.

75
00:07:35,100 --> 00:07:41,100
‫This would be the body frame Y direction, and this would be the body frame Z direction.

76
00:07:41,490 --> 00:07:44,960
‫And here I've simply rearranged the multiplication order.

77
00:07:45,210 --> 00:07:53,420
‫So here now it's cosine theta times sine phi and then cosine theta times cosine phi and that's it.

78
00:07:53,760 --> 00:08:01,800
‫And then you will have three zeros for the moments here and that's how your vector would look like.

79
00:08:01,800 --> 00:08:05,580
‫As you can see, it's a six by one vector.

80
00:08:06,660 --> 00:08:10,440
‫Now in many cases I'm going to use some abbreviations.

81
00:08:11,190 --> 00:08:21,390
‫So in order to write less, I'm going to sometimes write s sub theta, which would be sine Seeta.

82
00:08:22,240 --> 00:08:27,630
‫As flying would be signed, fly Essi would be signed.

83
00:08:29,140 --> 00:08:36,520
‫So these will be the abbreviations for the cosine, cosine PHI cosine theta cosine BPCI.

84
00:08:37,480 --> 00:08:43,300
‫And these will be for the tangent, so tension, fi, tangency, c10 tangent.

85
00:08:44,770 --> 00:08:45,780
‫And there you go.

86
00:08:45,820 --> 00:08:53,780
‫You have your first force and moment vector lambda g in the body frame.

87
00:08:54,940 --> 00:08:58,360
‫And now let's look at other forces in moments now.

88
00:08:59,320 --> 00:09:00,250
‫Thank you very much.

89
00:09:00,260 --> 00:09:01,810
‫And see you in the next video.

