‫Welcome back.
‫Let's now find our Omega's in terms of use, you have this equation here and you can rewrite it like
‫this.
‫You can write these Omega squared here and then on the other side of the equation, sine you will have
‫you won, but now I'm going to divide it by the trust factor.
‫So this trust factor goes to the other side of the equation.
‫Sine so divided by C sub T, the second row would be like this.
‫Note that this cty times L will go to the other side of the equation sine where the denominator is just
‫like in the previous case only.
‫Now you also have this l here.
‫And since we don't have Omega one squared and omega three squared here, we can put zeroes here.
‫You can write the third wrote in a similar way, only now you have zeros for Omega two squared and Omega
‫four squared and then your seat times is here in the denominator.
‫And finally, your fourth row would be like this.
‫And now this torque factor would be on the other side of the equation.
‫Sign here in the denominator.
‫Next, you can rewrite this entire system in the vector matrix form, it will look like this.
‫And if you rewrite this vector matrix form, if you multiply this matrix by this vector, then you will
‫get the exact same form like it it is here.
‫It makes sense, right?
‫So here in the first row, you have all the positive signs, all the plus signs, and therefore you
‫have all ones here and then in the vector, you have the Omega squared values.
‫And then wherever you have a zero here, then that means you also have a zero here in The Matrix and
‫then whenever you have a negative sign, that means that here in The Matrix, you will have minus one,
‫because, for example, if you multiply minus one by omegle, one squared, then you will have this
‫term here like this.
‫So let's call this matrix as let's call this vector.
‫Omega squared vector, and let's call this vector, you vector and let's put an asterisk here just to
‫let you know that this vector contains these concerns in the denominator.
‫Not only you want you to use three and four, but also it has things in the denominator.
‫And that's why I'm putting an asterisk here.
‫So what you have then is as times omega squared, which is a vector, equals you vector asterisk.
‫To find this omega squared vector, you have to put an inverse of the matrix here.
‫And here, this will become your identity matrix then.
‫And so your omega squared vector equals the inverse matrix.
‫Times this, you asterisk, Victor.
‫And now you need to have this inverse matrix, which equals.
‫This this is your inverse matrix.
‫I used an inverse matrix online calculator, there are a lot of them online, so you just Google inverse
‫matrix calculator and then you take the first one there.
‫You just put this matrix in and it will automatically give you this inverse matrix.
‫So your omega squared vector will then equal this inverse matrix times this, your vector asterisk,
‫which now is in this form.
‫So if you write it all out, then this is what you will get in green.
‫And now what you want to do, you want to get rid of these squared powers here.
‫And in order to do that, you just take the square root of these equations or these equations to the
‫power of one half, which is the same thing like taking the square root of it.
‫So this one as well.
‫This one as well.
‫And also this one.
‫And there you go.
‫Now you have your omega one, omega two, omega three and Omega four.
‫All of them are in terms of you want you to Q3 and Q4.
‫So the controller will give you the control inputs and you can right away compute the Omega's for the
‫drone motors.
‫And then once you have all your for us, you will just some them all up like we have seen before.
‫It will be like this omega one, minus omega two, plus omega three and minus omega four because Omega
‫two and Omega four had negative rotation's, according to the right hand rule.
‫And that's it, you've got everything you need.
‫Not that the numbers here cannot be negative because this is square root, right?
‫A to the power of one over half equals square root of a and so you cannot have a negative A in this
‫square root if you're dealing with real numbers.
‫You could if you allowed complex numbers, however, you cannot give a complex number to an angular
‫rotor velocity, the complex number was, for example, A plus eight times B, where A was the real
‫number and then items B was the imaginary part.
‫And then this I that was square root minus one.
‫You can allow these kind of things, for example, in electronics.
‫However, not in this case, you cannot give something like that to Omega's.
‫And if you have a negative number here, then the simulation would fail.
‫And that can happen if your sample time interval, your teeth becomes too big or too small, then this
‫thing happens.
‫In the code, your sample time interval equals zero point one seconds, and with this value, it works
‫well.
‫And also this negative value problem can arise if the trajectory is very extreme.
‫Meaning that the trajectory has sudden big turns, the controller that we are building for our drone
‫is suitable for smooth 3D trajectories and we have several of them in the code.
‫And that's it, you've got your plan muscle, you now know exactly what's going on there.
‫You have your state base equations.
‫You can integrate these states using the oil or Akutan method.
‫You can move between the inertial and body frames using the rotation and transfer matrices.
‫And then integrate your inertial frame states as well, using the oilor and wrong Akutan method.
‫And now you can also convert the control inputs into the more angular velocities.
‫We are now done with the planned box and starting from the next section, we will start unpacking the
‫control box to make sure that our drone is able to follow the trajectories that are given to it.
‫Thank you very much and see you in the next section.