﻿1
00:00:00,710 --> 00:00:08,480
‫But now, in the previous videos, I told you that we're going to derive something called a transfer

2
00:00:08,480 --> 00:00:18,020
‫matrix, and I've also told you that if you use a convention are X, Y, Z for your rotation matrix,

3
00:00:18,560 --> 00:00:23,300
‫then it has the same rotation matrix like this convention.

4
00:00:23,880 --> 00:00:30,740
‫In this case, you rotate about the inertial frame axis and then here you rotate about the moving frame

5
00:00:30,740 --> 00:00:31,250
‫axis.

6
00:00:31,760 --> 00:00:40,780
‫Both of them use this rotation matrix consisting of these three matrices in this order.

7
00:00:41,360 --> 00:00:45,500
‫But then I said that the transfer matrix is different for them.

8
00:00:46,070 --> 00:00:50,800
‫The transfer matrix for this one is different from this one.

9
00:00:51,380 --> 00:00:53,150
‫But what is a transfer matrix?

10
00:00:53,780 --> 00:01:02,660
‫Well, the purpose of a transfer matrix is to connect the angle of velocities in the body frame to the

11
00:01:02,660 --> 00:01:05,810
‫angular velocities in the inertia frame.

12
00:01:06,320 --> 00:01:11,420
‫In other words, these are my angular velocities in the body frame.

13
00:01:11,690 --> 00:01:16,230
‫PKU are what I want, however, is this.

14
00:01:16,730 --> 00:01:25,370
‫And so if I take my transfer matrix and then I multiply it by peak, you are, then I will get my final

15
00:01:25,400 --> 00:01:26,980
‫theater and play that.

16
00:01:27,500 --> 00:01:36,110
‫But now if you think about it, then if we use this convention where we rotate about the inertial frame

17
00:01:36,110 --> 00:01:42,320
‫axis, then your transfer matrix should be your rotation matrix.

18
00:01:42,980 --> 00:01:50,000
‫Because remember what the rotation matrix did you have your inertial axis, then you have your body

19
00:01:50,000 --> 00:01:54,450
‫frame axis somehow oriented with respect to the inertial frame.

20
00:01:55,040 --> 00:02:01,820
‫And so when you had your angular velocity vector, then it had three components in the body frame.

21
00:02:02,420 --> 00:02:11,000
‫Here you had P here you had Q, and then here you had R and then what this rotation matrix did.

22
00:02:11,630 --> 00:02:14,750
‫It expressed this vector in the inertia frame.

23
00:02:15,260 --> 00:02:20,240
‫It showed you the coordinates of this purple vector in the inertia frame.

24
00:02:20,570 --> 00:02:29,960
‫It showed you what your inertial X was, what's your inertial Y was and then what your inertial Z was.

25
00:02:30,470 --> 00:02:32,990
‫That's what this rotation matrix did.

26
00:02:33,530 --> 00:02:41,570
‫But now we are so used to thinking that the axis here, X, Y, Z, that they have to be in meters,

27
00:02:42,140 --> 00:02:46,520
‫that it's easy to forget, that they don't have to be in meters.

28
00:02:47,150 --> 00:02:50,660
‫It depends on what you use your axis for.

29
00:02:51,230 --> 00:02:57,530
‫If you use it to measure distance, then these axes are in meters like this.

30
00:02:58,130 --> 00:03:06,440
‫But if you use them to measure your velocities, then your axes, they represent meters per second.

31
00:03:07,010 --> 00:03:09,010
‫Their units measure velocities.

32
00:03:09,500 --> 00:03:18,080
‫If your objective is to measure angular velocities in some kind of frame, then the units of that frame

33
00:03:18,080 --> 00:03:20,780
‫are radians per second.

34
00:03:21,290 --> 00:03:24,260
‫And that is our case right here.

35
00:03:24,800 --> 00:03:35,900
‫If we use this convention, then that means that we first rotate about the inertial x axis, which really

36
00:03:35,900 --> 00:03:46,850
‫means that our rotation vector in the direction of X is Ashrafi, that then we rotate about the inertial

37
00:03:46,850 --> 00:03:47,900
‫y axis.

38
00:03:48,620 --> 00:03:55,850
‫Then that means that the angular velocity vector in the Y direction is called theta dots.

39
00:03:56,270 --> 00:04:04,790
‫And then the same thing when we rotate about the inertia Z axis, our side, that it's a rotation vector

40
00:04:05,420 --> 00:04:10,940
‫and each direction is in the direction of the inertia axis.

41
00:04:11,360 --> 00:04:21,650
‫That means that if in this green frame I measure my angle velocities, in other words, I measure my

42
00:04:21,650 --> 00:04:23,780
‫angular velocity in the body frame.

43
00:04:24,140 --> 00:04:32,990
‫SPQR If I want to know this vector in the inertia frame, if I want to know my FIDA theatergoer and

44
00:04:32,990 --> 00:04:38,000
‫BPCI that, then I should use my rotation matrix to find it right.

45
00:04:38,570 --> 00:04:47,300
‫I multiply my rotation matrix by EQR and then I get this, which means that for this convention they

46
00:04:47,300 --> 00:04:48,230
‫should be equal.

47
00:04:48,830 --> 00:04:55,380
‫When I rotate about the inertial axis, then my rotation matrix is my transfer matrix.

48
00:04:55,790 --> 00:05:00,190
‫However, if I use this convention here, we.

49
00:05:00,260 --> 00:05:06,980
‫Which is what we will use then we have a different transfer matrix and here is why.

50
00:05:07,670 --> 00:05:13,870
‫So you have an inertia frame here and you also have a body frame that is attached to a drone.

51
00:05:14,360 --> 00:05:23,120
‫We first rotate about the body frame, the Z axis, and we do it by BPCI Radiance.

52
00:05:23,580 --> 00:05:32,330
‫And so here the body frame Z equals the inertial frame Z because both vectors are in the same direction.

53
00:05:32,750 --> 00:05:35,790
‫And we're going to call this configuration like this.

54
00:05:36,290 --> 00:05:45,860
‫So this will be small X sub one, small Y sub one and small Z sub one.

55
00:05:46,400 --> 00:05:49,300
‫Because remember, this is still not a body frame.

56
00:05:49,580 --> 00:05:53,000
‫We haven't reached our body frame orientation yet.

57
00:05:53,390 --> 00:05:58,820
‫We're trying to reach it by rotating about three moving frame axis.

58
00:05:59,360 --> 00:06:03,350
‫And so I've drawn this intermediate configuration here.

59
00:06:03,680 --> 00:06:07,190
‫And now we're going to rotate about the body frame.

60
00:06:07,460 --> 00:06:11,360
‫Why sub one axis like this?

61
00:06:11,750 --> 00:06:19,400
‫If you rotated like this, then your thumb will point towards this small y sub one and that will be

62
00:06:19,400 --> 00:06:21,170
‫the direction of your rotation.

63
00:06:21,890 --> 00:06:28,790
‫And so if you rotate about this axis by theta radians, then your new configuration will be here in

64
00:06:28,790 --> 00:06:29,270
‫green.

65
00:06:29,570 --> 00:06:40,310
‫So this will be your small X up to this would be your small Y sop to and this will be your small rises

66
00:06:40,310 --> 00:06:40,970
‫up to.

67
00:06:41,270 --> 00:06:48,560
‫And in this case your small y sub one equals small Y up to.

68
00:06:48,830 --> 00:06:52,640
‫As you can see, both vectors overlap with each other.

69
00:06:53,090 --> 00:06:54,680
‫They're in the same direction.

70
00:06:55,800 --> 00:07:03,510
‫And so this is your second intermediate configuration, and now finally, if you rotate about this axis

71
00:07:03,510 --> 00:07:13,800
‫here, it's up to like this as shown in red, and if you do it by five radians, then you will finally

72
00:07:13,980 --> 00:07:17,580
‫reach your original body frame orientation.

73
00:07:17,910 --> 00:07:22,500
‫Now, this is the body frame that is attached to the drone.

74
00:07:22,920 --> 00:07:24,200
‫This one in red.

75
00:07:24,540 --> 00:07:32,940
‫So that's the orientation of the drone, which means that this axis here will be small X and let's put

76
00:07:32,940 --> 00:07:40,340
‫it be then this will be small Y Subi and this will be small Z Subi.

77
00:07:40,830 --> 00:07:44,070
‫So that's the body frame that is attached to the drone.

78
00:07:44,400 --> 00:07:52,740
‫And in order to reach this orientation from your inertial frame, we went through this sequence of rotations.

79
00:07:53,350 --> 00:07:56,720
‫And so I have redrawn this final configuration here.

80
00:07:57,150 --> 00:08:05,610
‫And by the way, here, these two directions are the same, so small except two equals small like Subi.

81
00:08:06,530 --> 00:08:17,030
‫Now, if you rotate about the body frame, X, Y and Z axis, then it happens at some kind of radians

82
00:08:17,030 --> 00:08:18,430
‫per second rate.

83
00:08:18,830 --> 00:08:23,140
‫So you have some kind of angular velocity with respect to the body frame.

84
00:08:23,420 --> 00:08:26,720
‫And we define that with this vector.

85
00:08:27,350 --> 00:08:35,390
‫Smaller, mega superscript B in the body frame equals P, Q are radians per second.

86
00:08:35,750 --> 00:08:41,870
‫And as you already know, P is the angular velocity about the body frame x axis.

87
00:08:42,290 --> 00:08:48,590
‫Q about the body frame y axis and are about the body frame Z axis.

88
00:08:49,070 --> 00:08:56,330
‫However, if you have angular velocity about the body frame axis, then that also means that you're

89
00:08:56,630 --> 00:08:59,760
‫oilor angles will change with respect to time.

90
00:09:00,170 --> 00:09:09,020
‫In other words, you will have five that Seeta that imply that it means that we can also define the

91
00:09:09,020 --> 00:09:10,090
‫following vector.

92
00:09:10,490 --> 00:09:22,800
‫Let's call it theta dot arrow superscript e and it equals phi that theta that and that radians per second.

93
00:09:23,120 --> 00:09:27,470
‫And don't confuse these two cetus here this theta that.

94
00:09:27,470 --> 00:09:30,740
‫Here is how fast this angle changes.

95
00:09:31,040 --> 00:09:35,600
‫And this one here is just how we call this entire vector.

96
00:09:35,960 --> 00:09:43,850
‫So I will always write this vector like this with a superscript E, but remember it's still the same

97
00:09:44,150 --> 00:09:44,830
‫vector.

98
00:09:45,380 --> 00:09:47,560
‫It's your angular velocity vector.

99
00:09:48,140 --> 00:09:57,620
‫If you take your R, X, Y, Z convention using fixed axis, then you take that vector and you decompose

100
00:09:57,620 --> 00:10:03,170
‫it into three components that point in the inertial X, Y, Z axis.

101
00:10:03,560 --> 00:10:06,590
‫And that's your file, that theta that implied that.

102
00:10:07,100 --> 00:10:15,320
‫But when you take the other convention are Zwi X, then you take the same angular velocity vector,

103
00:10:15,320 --> 00:10:17,060
‫but you decompose it differently.

104
00:10:17,690 --> 00:10:24,830
‫Now the three components of that vector that you will obtain, they will point in the directions of

105
00:10:24,830 --> 00:10:33,640
‫those intermediate moving frames and then these components will be your FIDA Theta that imply that.

106
00:10:34,040 --> 00:10:42,200
‫So it's the same vector, but you simply decompose it differently and then you call those other components

107
00:10:42,770 --> 00:10:44,470
‫as your father thought.

108
00:10:44,480 --> 00:10:45,310
‫And that.

109
00:10:45,860 --> 00:10:53,120
‫And so these three vector elements here are the change of your oilor angles with respect to time.

110
00:10:53,570 --> 00:10:58,150
‫And the transfer matrix is the matrix that connects those two.

111
00:10:58,580 --> 00:11:00,080
‫And so it looks like this.

112
00:11:00,470 --> 00:11:08,030
‫And if instead you have the time derivative of the oilor angles and you want to find the angular velocities

113
00:11:08,030 --> 00:11:14,450
‫in the body frame, then you simply need to take the inverse of your transfer matrix and then you can

114
00:11:14,450 --> 00:11:17,090
‫find your angular velocity is in the body frame.

115
00:11:17,510 --> 00:11:21,190
‫And now you might ask me, why would I do that?

116
00:11:21,680 --> 00:11:29,900
‫Why would I choose a convention in which I'm forced to derive some kind of extra matrix?

117
00:11:30,290 --> 00:11:39,950
‫Why can't I just choose this convention where I rotate about the inertial X, Y, Z axis and just use

118
00:11:39,950 --> 00:11:41,350
‫my rotation matrices?

119
00:11:41,750 --> 00:11:43,880
‫Why do all this extra work?

120
00:11:44,420 --> 00:11:46,370
‫And that would be a great question.

121
00:11:46,880 --> 00:11:52,670
‫And the answer is that there is a hidden value in this transfer matrix.

122
00:11:53,300 --> 00:11:58,850
‫You see your rotation matrix, it has three angles in it.

123
00:11:59,270 --> 00:11:59,810
‫Right?

124
00:12:00,350 --> 00:12:09,830
‫Either you think in terms of Fifita and Passi or Gambetta and Alpha, you see that in this matrix you

125
00:12:09,830 --> 00:12:10,790
‫have three angles.

126
00:12:11,150 --> 00:12:16,700
‫So you're our Z times are Y, times are X that we can just call R.

127
00:12:17,360 --> 00:12:21,050
‫It depends on Phi Theta and BPCI.

128
00:12:21,500 --> 00:12:24,710
‫So you have to worry about three angles.

129
00:12:25,070 --> 00:12:35,390
‫However, very soon we will derive this transfer matrix and this transfer matrix is valid for our convention,

130
00:12:35,630 --> 00:12:38,480
‫our Zwick's movie frame axis.

131
00:12:39,050 --> 00:12:45,410
‫And don't worry, I will show you exactly step by step how you will obtain this matrix.

132
00:12:46,010 --> 00:12:47,570
‫But this is how it looks like.

133
00:12:48,140 --> 00:12:52,640
‫And this one in blue, it's this transfer matrix inverse.

134
00:12:53,210 --> 00:13:01,220
‫And by the way, this transfer matrix, it's not ortho normal, which means that if you want to find

135
00:13:01,220 --> 00:13:05,930
‫the inverse of your transfer matrix, you cannot just take the transpose of it.

136
00:13:06,520 --> 00:13:14,410
‫You either have to use those classical linear algebra techniques or some kind of symbolic mathematical

137
00:13:14,410 --> 00:13:22,500
‫tool like Mathematica, or perhaps you have something in Matlab or in sci fi in Python.

138
00:13:23,110 --> 00:13:31,110
‫But finding an inverse is just a well specified procedure that you learn in linear algebra.

139
00:13:31,660 --> 00:13:33,660
‫But now this is your transfer matrix.

140
00:13:34,060 --> 00:13:36,790
‫And if you look at it more closely, what do you see?

141
00:13:37,360 --> 00:13:41,170
‫How many angles do you see in this transfer matrix?

142
00:13:41,770 --> 00:13:44,370
‫You only see two angles, right?

143
00:13:44,890 --> 00:13:47,280
‫You only see PHY and Seeta.

144
00:13:47,800 --> 00:13:54,940
‫So your transfer matrix for this convention only depends on fire and Theta, which is already a good

145
00:13:54,940 --> 00:14:03,760
‫news because now you are able to make a connection between your body frame, angular velocities and

146
00:14:03,760 --> 00:14:05,950
‫inertial frame angular velocities.

147
00:14:05,950 --> 00:14:13,870
‫Vidal theatergoer and decide that by only dealing with two angles so you can skip sci and the reason

148
00:14:13,870 --> 00:14:21,910
‫why you only have two angles there is because, as you can see, the P component of your angular velocity

149
00:14:21,910 --> 00:14:28,810
‫vector, which is the component in the body frame X direction, points in the same direction, like

150
00:14:29,500 --> 00:14:31,860
‫the fire, that rotation vector.

151
00:14:32,380 --> 00:14:40,750
‫And since P equals five dot, then that means that you only need angles to connect the other components

152
00:14:41,380 --> 00:14:45,790
‫cu with Theta Dot and then R with side that.

153
00:14:46,300 --> 00:14:51,610
‫And that's why using this convention you can get away with only two angles.

154
00:14:52,040 --> 00:14:56,050
‫However, wait for it because it will get even better.

155
00:14:56,650 --> 00:15:05,020
‫Not only you have two angles here, but these two angles are Fi and Seeta and that makes a big difference

156
00:15:05,410 --> 00:15:08,290
‫when we design our NPC controller.

