﻿1
00:00:00,640 --> 00:00:01,420
‫Welcome back.

2
00:00:02,170 --> 00:00:13,780
‫Let's now do the conversion exercise, you had a rotation matrix called R, sub Z, Y, X using the

3
00:00:13,780 --> 00:00:14,730
‫oil or angles.

4
00:00:14,950 --> 00:00:16,630
‫So that was our convention.

5
00:00:17,840 --> 00:00:29,180
‫Or you can write it down like this are sabzi times are sub Y, times are sub X, but for simplicity

6
00:00:29,180 --> 00:00:37,010
‫let's just call it are now each matrix here was a three by three rotation matrix.

7
00:00:37,780 --> 00:00:44,260
‫So if you multiply them together in this sequence, then this would be a result.

8
00:00:45,020 --> 00:00:53,780
‫So you can use this rotation matrix to take measurements in the body frame and convert them into the

9
00:00:53,780 --> 00:00:54,740
‫inertia frame.

10
00:00:55,740 --> 00:01:05,250
‫But careful rotation matrices were only good for translational velocities, not angular velocities for

11
00:01:05,250 --> 00:01:06,670
‫the angle of velocities.

12
00:01:06,960 --> 00:01:15,690
‫You had this special transfer matrix, if you remember, and the reason for that was because when we

13
00:01:15,690 --> 00:01:24,750
‫dealt with the rotations, we had a specific convention and then we had to derive a specific transfer

14
00:01:24,750 --> 00:01:34,530
‫matrix for that specific convention, Zywiec using the oil or angles, meaning that you first rotate

15
00:01:34,830 --> 00:01:41,670
‫about the body from Z axis, then you rotate about the body frame, y axis.

16
00:01:42,270 --> 00:01:48,990
‫So about the moving frame and then you rotate about the body frame or moving frame x axis.

17
00:01:50,180 --> 00:02:01,850
‫So anyway, if you have your you the N.W., which are your translation of the losses in the body frame,

18
00:02:02,540 --> 00:02:11,210
‫what will you get if you take this rotation matrix and you multiply it by this vector, what will you

19
00:02:11,210 --> 00:02:11,480
‫get?

20
00:02:12,380 --> 00:02:20,740
‫You will get X, dot, why dot and Z that in the inertia frame.

21
00:02:21,290 --> 00:02:29,750
‫And now if you have your body frame, angular velocity P, Q and R, then what will you get?

22
00:02:29,750 --> 00:02:40,670
‫If you take the transfer matrix and you multiply it by this vector, you will get five that theta that

23
00:02:41,420 --> 00:02:42,650
‫and upside that.

24
00:02:43,680 --> 00:02:44,740
‫It makes sense, right?

25
00:02:45,210 --> 00:02:53,070
‫Translation of last in the body frame and then you get a translation of velocities in the initial frame.

26
00:02:53,790 --> 00:03:00,870
‫And here you have the angular velocities in the body frame and then you get your angular velocities

27
00:03:01,410 --> 00:03:02,710
‫in the initial frame.

28
00:03:03,660 --> 00:03:06,720
‫We can also rewrite it in a more compact way.

29
00:03:07,810 --> 00:03:14,970
‫This entire vector in the inertia frame equals this matrix times.

30
00:03:16,180 --> 00:03:25,650
‫This vector, so we managed to incorporate the rotation matrix and the transfer matrix in one big matrix

31
00:03:25,930 --> 00:03:35,920
‫and we called it Matrix J and you multiply it by this vector and that's how you convert between body

32
00:03:35,920 --> 00:03:43,480
‫and inertial frames and then you just perform the same kind of integration for the states in the initial

33
00:03:43,480 --> 00:03:43,950
‫frame.

34
00:03:45,080 --> 00:03:53,120
‫So here I have used the oilor method, the easier but more imprecise method, and soon you will learn

35
00:03:53,120 --> 00:03:55,110
‫the wrong Akutan method.

36
00:03:56,000 --> 00:03:57,050
‫So that's how you do it.

37
00:03:57,560 --> 00:03:59,540
‫And let's complete the schematics now.

38
00:04:00,410 --> 00:04:03,860
‫So what you definitely need to have in your plan box.

39
00:04:04,860 --> 00:04:12,870
‫Is this Jay Matrix that was a function of our matrix and transfer matrix?

40
00:04:14,080 --> 00:04:18,910
‫In fact, to be more precise than Jay.

41
00:04:20,060 --> 00:04:27,560
‫Was a function of R.A., but then the rotation matrix itself was a function of.

42
00:04:28,870 --> 00:04:36,700
‫Fi, Seeta and BPCI, so we have here Fi, Seeta and Passi.

43
00:04:37,580 --> 00:04:44,300
‫And the transfer matrix was a function of Phi and Theta.

44
00:04:45,320 --> 00:04:56,780
‫So Phi and theater like this, that means that this box will need values.

45
00:04:58,130 --> 00:05:02,870
‫There are five Seeta and Passi.

46
00:05:03,920 --> 00:05:11,480
‫And of course, since you have your states in your body frame, you just take your state's.

47
00:05:12,650 --> 00:05:21,050
‫And you put them through this Jay box and then what you will get is X dot.

48
00:05:22,040 --> 00:05:35,030
‫Y and Z dot and then find that C to that and upside that, and then you put them through another integrated

49
00:05:35,030 --> 00:05:43,490
‫box, which is now this one in purple, if you use oilor or you can also use around Akutan, which we

50
00:05:43,490 --> 00:05:44,390
‫are going to do soon.

51
00:05:45,590 --> 00:05:50,230
‫So either Oilor or Runga Kuta.

52
00:05:51,260 --> 00:06:02,660
‫And of course what we'll get out of this box will be your X, Y, Z, and then Fifita and Passi.

53
00:06:03,580 --> 00:06:14,200
‫So you're five feet and I can now go into your matrix and one final thing, your integrated box here

54
00:06:14,650 --> 00:06:24,850
‫now will also need your states now so all your six inertial frame states will go into this second integrated

55
00:06:24,850 --> 00:06:25,300
‫box.

56
00:06:26,450 --> 00:06:32,810
‫And then, of course, together with the body frame states, your inertial frame states, they will

57
00:06:32,810 --> 00:06:38,800
‫go into your controller and then the controller will compute your use.

58
00:06:39,740 --> 00:06:48,980
‫And that's how the loop will operate throughout your maneuver or throughout following your trajectory.

59
00:06:50,150 --> 00:06:57,530
‫So I would say that this is a pretty detailed schematics that tells you what's going on in the plan

60
00:06:57,530 --> 00:06:57,940
‫box.

61
00:06:59,000 --> 00:07:05,040
‫And so we only have two things to do before we finish with our plans.

62
00:07:05,630 --> 00:07:15,350
‫I need to teach you Runga quota so that you would only rely on oilor and then I need to teach you and

63
00:07:15,350 --> 00:07:23,060
‫show you what's inside this or megabucks, and then you will be completely done with the planned part.

64
00:07:23,510 --> 00:07:29,770
‫And then we can move to the controller part where we're going to use two types of controllers.

65
00:07:30,740 --> 00:07:36,730
‫One will be the more predictive control which you learned in the previous course in this core series.

66
00:07:37,460 --> 00:07:47,690
‫And so this time the section on model predictive control will be easier and shorter, because now I'm

67
00:07:47,690 --> 00:07:53,720
‫just going to take what I had taught you in the previous course, and I'm just going to brutally apply

68
00:07:53,720 --> 00:07:55,190
‫it to this system.

69
00:07:56,060 --> 00:08:05,810
‫And you see that there are very many similarities between the vehicle case that we had in terms of the

70
00:08:05,810 --> 00:08:15,680
‫lateral control case and this case where we have a USV and then we want to make it follow a 3D trajectory

71
00:08:16,520 --> 00:08:19,280
‫while controlling it states.

72
00:08:20,180 --> 00:08:27,620
‫But in combination with the model predictive control, there will be another controller working with

73
00:08:27,620 --> 00:08:30,760
‫it so they will be synchronized with each other.

74
00:08:31,580 --> 00:08:35,260
‫So we're going to spend a little bit more time with the other controller.

75
00:08:36,170 --> 00:08:40,730
‫But the more primitive controller, you already know what it is and how to apply it.

76
00:08:41,120 --> 00:08:45,100
‫And now you're just going to see how to apply it to a different system.

77
00:08:46,130 --> 00:08:52,730
‫Now, in the next video, I'm going to spend just a little bit of more time on the oilor integration

78
00:08:52,730 --> 00:08:58,820
‫method, and then right away we're going to move into Runga Kutta method.

79
00:08:59,510 --> 00:09:03,080
‫So thank you very much and see you in the next video.

