﻿1
00:00:00,740 --> 00:00:01,490
‫Welcome back.

2
00:00:02,210 --> 00:00:10,070
‫Let's now find our Omega's in terms of use, you have this equation here and you can rewrite it like

3
00:00:10,070 --> 00:00:10,570
‫this.

4
00:00:11,450 --> 00:00:18,350
‫You can write these Omega squared here and then on the other side of the equation, sine you will have

5
00:00:18,740 --> 00:00:23,750
‫you won, but now I'm going to divide it by the trust factor.

6
00:00:23,750 --> 00:00:27,950
‫So this trust factor goes to the other side of the equation.

7
00:00:27,950 --> 00:00:34,040
‫Sine so divided by C sub T, the second row would be like this.

8
00:00:34,970 --> 00:00:42,050
‫Note that this cty times L will go to the other side of the equation sine where the denominator is just

9
00:00:42,050 --> 00:00:44,550
‫like in the previous case only.

10
00:00:44,570 --> 00:00:46,510
‫Now you also have this l here.

11
00:00:47,540 --> 00:00:54,050
‫And since we don't have Omega one squared and omega three squared here, we can put zeroes here.

12
00:00:55,120 --> 00:01:02,560
‫You can write the third wrote in a similar way, only now you have zeros for Omega two squared and Omega

13
00:01:02,560 --> 00:01:08,370
‫four squared and then your seat times is here in the denominator.

14
00:01:09,340 --> 00:01:12,630
‫And finally, your fourth row would be like this.

15
00:01:12,640 --> 00:01:16,440
‫And now this torque factor would be on the other side of the equation.

16
00:01:16,450 --> 00:01:18,820
‫Sign here in the denominator.

17
00:01:20,100 --> 00:01:26,970
‫Next, you can rewrite this entire system in the vector matrix form, it will look like this.

18
00:01:27,480 --> 00:01:36,930
‫And if you rewrite this vector matrix form, if you multiply this matrix by this vector, then you will

19
00:01:36,930 --> 00:01:40,470
‫get the exact same form like it it is here.

20
00:01:41,660 --> 00:01:42,840
‫It makes sense, right?

21
00:01:43,100 --> 00:01:49,640
‫So here in the first row, you have all the positive signs, all the plus signs, and therefore you

22
00:01:49,640 --> 00:01:56,390
‫have all ones here and then in the vector, you have the Omega squared values.

23
00:01:57,480 --> 00:02:04,260
‫And then wherever you have a zero here, then that means you also have a zero here in The Matrix and

24
00:02:04,260 --> 00:02:10,680
‫then whenever you have a negative sign, that means that here in The Matrix, you will have minus one,

25
00:02:11,610 --> 00:02:19,350
‫because, for example, if you multiply minus one by omegle, one squared, then you will have this

26
00:02:19,350 --> 00:02:21,940
‫term here like this.

27
00:02:22,860 --> 00:02:30,450
‫So let's call this matrix as let's call this vector.

28
00:02:31,470 --> 00:02:44,670
‫Omega squared vector, and let's call this vector, you vector and let's put an asterisk here just to

29
00:02:44,670 --> 00:02:51,390
‫let you know that this vector contains these concerns in the denominator.

30
00:02:51,720 --> 00:02:58,320
‫Not only you want you to use three and four, but also it has things in the denominator.

31
00:02:58,320 --> 00:03:00,870
‫And that's why I'm putting an asterisk here.

32
00:03:01,880 --> 00:03:15,290
‫So what you have then is as times omega squared, which is a vector, equals you vector asterisk.

33
00:03:16,530 --> 00:03:23,040
‫To find this omega squared vector, you have to put an inverse of the matrix here.

34
00:03:24,030 --> 00:03:29,130
‫And here, this will become your identity matrix then.

35
00:03:30,300 --> 00:03:36,210
‫And so your omega squared vector equals the inverse matrix.

36
00:03:37,220 --> 00:03:39,890
‫Times this, you asterisk, Victor.

37
00:03:40,980 --> 00:03:44,940
‫And now you need to have this inverse matrix, which equals.

38
00:03:46,170 --> 00:03:50,340
‫This this is your inverse matrix.

39
00:03:51,410 --> 00:03:59,630
‫I used an inverse matrix online calculator, there are a lot of them online, so you just Google inverse

40
00:03:59,630 --> 00:04:02,840
‫matrix calculator and then you take the first one there.

41
00:04:03,290 --> 00:04:08,540
‫You just put this matrix in and it will automatically give you this inverse matrix.

42
00:04:09,570 --> 00:04:18,870
‫So your omega squared vector will then equal this inverse matrix times this, your vector asterisk,

43
00:04:19,410 --> 00:04:21,640
‫which now is in this form.

44
00:04:22,710 --> 00:04:27,400
‫So if you write it all out, then this is what you will get in green.

45
00:04:28,500 --> 00:04:33,900
‫And now what you want to do, you want to get rid of these squared powers here.

46
00:04:34,740 --> 00:04:42,540
‫And in order to do that, you just take the square root of these equations or these equations to the

47
00:04:42,540 --> 00:04:48,370
‫power of one half, which is the same thing like taking the square root of it.

48
00:04:49,140 --> 00:04:51,110
‫So this one as well.

49
00:04:52,020 --> 00:04:53,240
‫This one as well.

50
00:04:54,180 --> 00:04:55,790
‫And also this one.

51
00:04:57,000 --> 00:04:57,980
‫And there you go.

52
00:04:58,050 --> 00:05:02,670
‫Now you have your omega one, omega two, omega three and Omega four.

53
00:05:03,480 --> 00:05:10,230
‫All of them are in terms of you want you to Q3 and Q4.

54
00:05:11,210 --> 00:05:17,990
‫So the controller will give you the control inputs and you can right away compute the Omega's for the

55
00:05:17,990 --> 00:05:19,020
‫drone motors.

56
00:05:19,880 --> 00:05:30,050
‫And then once you have all your for us, you will just some them all up like we have seen before.

57
00:05:31,150 --> 00:05:41,440
‫It will be like this omega one, minus omega two, plus omega three and minus omega four because Omega

58
00:05:41,440 --> 00:05:46,420
‫two and Omega four had negative rotation's, according to the right hand rule.

59
00:05:47,460 --> 00:05:49,660
‫And that's it, you've got everything you need.

60
00:05:50,580 --> 00:05:56,480
‫Not that the numbers here cannot be negative because this is square root, right?

61
00:05:57,300 --> 00:06:08,360
‫A to the power of one over half equals square root of a and so you cannot have a negative A in this

62
00:06:08,550 --> 00:06:11,520
‫square root if you're dealing with real numbers.

63
00:06:12,520 --> 00:06:22,330
‫You could if you allowed complex numbers, however, you cannot give a complex number to an angular

64
00:06:22,630 --> 00:06:33,310
‫rotor velocity, the complex number was, for example, A plus eight times B, where A was the real

65
00:06:33,310 --> 00:06:37,510
‫number and then items B was the imaginary part.

66
00:06:37,930 --> 00:06:44,680
‫And then this I that was square root minus one.

67
00:06:45,640 --> 00:06:49,720
‫You can allow these kind of things, for example, in electronics.

68
00:06:50,240 --> 00:06:56,740
‫However, not in this case, you cannot give something like that to Omega's.

69
00:06:58,000 --> 00:07:02,250
‫And if you have a negative number here, then the simulation would fail.

70
00:07:03,150 --> 00:07:11,670
‫And that can happen if your sample time interval, your teeth becomes too big or too small, then this

71
00:07:11,670 --> 00:07:12,720
‫thing happens.

72
00:07:13,790 --> 00:07:22,730
‫In the code, your sample time interval equals zero point one seconds, and with this value, it works

73
00:07:22,730 --> 00:07:23,170
‫well.

74
00:07:23,930 --> 00:07:29,840
‫And also this negative value problem can arise if the trajectory is very extreme.

75
00:07:30,870 --> 00:07:38,520
‫Meaning that the trajectory has sudden big turns, the controller that we are building for our drone

76
00:07:38,520 --> 00:07:44,880
‫is suitable for smooth 3D trajectories and we have several of them in the code.

77
00:07:46,110 --> 00:07:52,890
‫And that's it, you've got your plan muscle, you now know exactly what's going on there.

78
00:07:53,640 --> 00:07:56,520
‫You have your state base equations.

79
00:07:57,660 --> 00:08:02,250
‫You can integrate these states using the oil or Akutan method.

80
00:08:03,300 --> 00:08:11,280
‫You can move between the inertial and body frames using the rotation and transfer matrices.

81
00:08:12,340 --> 00:08:18,760
‫And then integrate your inertial frame states as well, using the oilor and wrong Akutan method.

82
00:08:19,850 --> 00:08:27,890
‫And now you can also convert the control inputs into the more angular velocities.

83
00:08:28,960 --> 00:08:38,020
‫We are now done with the planned box and starting from the next section, we will start unpacking the

84
00:08:38,020 --> 00:08:46,390
‫control box to make sure that our drone is able to follow the trajectories that are given to it.

85
00:08:47,490 --> 00:08:50,760
‫Thank you very much and see you in the next section.

