‫And so now let's make our Drak switch one again, let's include drag and also let's choose trajectory
‫six.
‫And so this is the animation, however, now I want to look at the fire and see two angles separately.
‫So here you have it, you have your fire angle and then you have your angle.
‫So the fire angle, as you can see here, becomes negative over time, that's the angle that causes
‫centripetal acceleration and then the third angle becomes positive over time.
‫That's the red beam tilting down to produce force in the direction of the forward flight.
‫So let's check the conventions.
‫So this is your drone here, the top of you, that's your body frame, X-axis here, that's your body
‫frame, Y-axis.
‫So this is your model one and then this is your model, too, and this is your trajectory on the X Y
‫plane.
‫Right.
‫So this is your spiral.
‫So the X Y plane, you move like this, so you're following this turning trajectory and so you get the
‫angle if you rotate about the body frame x axis.
‫So if you want to tilt this side down.
‫You're looking at the drone from the top, so if you want this site to go down this M2, then you have
‫to rotate about the negative body frame x axis.
‫So this is your hand, these are your knuckles and your thumb points in this direction, in the negative
‫body from X direction, and then your M to side tilts down, giving you that centripetal acceleration.
‫And since you are some points down, which is the negative body from X direction, your fi angle becomes
‫negative.
‫And that's what you see here in the graph.
‫Your angle becomes more and more negative, which means that this side tilts down more and more, giving
‫you more and more centripetal acceleration because your radius here increases in time.
‫And that means that this part of the equation here increases faster than this part of the equation overall,
‫giving you greater centripetal acceleration.
‫However, if you want to take this side down this more one side, you want this side to go down, then
‫that means that you have to rotate about the positive body frame y axis.
‫Your side now is in the positive body frame y axis, and so your angle becomes positive as you tilt
‫your end one down.
‫And you can also see it here in this graph, you can see that your theater becomes more and more positive
‫over time.
‫So that means that our conventions match and that's very good.
‫So here you can see that your fire angle reaches around minus zero point one radiance in the end and
‫your FITA angle reaches about zero point zero four radians in the end.
‫But let's go crazy now.
‫Let's make this drag coefficient CDs of you ten point five, and let's do the same with C, D, sub
‫V also let's make it ten point five.
‫So now these drag coefficients are 10 times higher.
‫That's the animation.
‫As you can see, your fire angle is still around minus zero point one radians in the end, and it makes
‫sense.
‫Let's bring to our velocity, that's the velocity in the body frame, Y-axis.
‫So these are the values for the velocity, as you can see.
‫They range from zero point three to zero point five to again zero point three meters per second.
‫So it's not zero, but it is quite small.
‫So the 10 times higher force in the V direction almost plays no role and therefore Angle is not affected
‫by that almost at all.
‫So if I make my drag coefficients one point five again and put my velocity again.
‫Then you can see that the velocities become bigger, which makes sense because now you have less drag.
‫But the change is very small, and so if I make it ten point five again, that means that your angle
‫is not affected by this increase in drag almost at all.
‫This angle here is affected by the fact that the radius of the spiral is increasing.
‫So the radius of your spiral gets bigger and bigger, which means that every second you have to cover
‫more distance.
‫At the beginning, maybe you had to cover this distance in one second.
‫And now you have to cover maybe this distance in one second, which means that your velocity here must
‫be bigger than here.
‫All right.
‫This will last and needs to be bigger than here, because here in one second, you need to cover more
‫distance than here, and that plays itself out here.
‫And that makes your centripetal acceleration bigger.
‫Of course, your radius also increases and that makes your centripetal acceleration smaller.
‫But in this case, this thing becomes bigger, faster than this thing here.
‫So we conclude that the triangle is not very much affected by the increase in drag.
‫However, due to 10 times higher drag force in the new direction, you using this more?
‫One needs to tilt down a lot more to produce the horizontal force to overcome that massive drag.
‫And it does tilt more now instead of zero point zero four radians.
‫In the end, you finish the maneuver with a three to four zero point twenty one radians approximately.
‫And now I'm going to go back to my one point five drag coefficients.
‫And now I want to show you trajectory three here.
‫You have a bit of spiral and then you go up exponentially until like 700 meters.
‫So now you mostly go in the body frame axis and so your W velocity becomes pretty large.
‫So you can see that on the X Y plane, you move from minus two to eight meters and then in the Z dimension
‫you go from zero meters to almost seven hundred meters.
‫And by the way, if you look at the length of these beams here, the red beam and then the green beam,
‫then again, they don't represent the real length of the drone.
‫They just help you visualize the drone.
‫If I had put here the drone with its real dimensions, then it would be a very small drone here and
‫it would be very hard for you to see it.
‫And so since your upward velocity is pretty large now, that means that you have a drag force in the
‫downward direction, mainly to overcome that.
‫You see that you're you want control, you put your control force becomes pretty huge at some point.
‫And also, all your Omega's that give you that you want control force, they become pretty large at
‫some point and it makes sense because they have to produce this massive thrust up to accelerate you
‫up force and to overcome this massive drag that increases as a function of time because you go up faster
‫and faster.
‫And so this has been trajectory three and in total, you have nine trajectories here to choose from,
‫and that's the place where you choose them.
‫You just pick a number from one to nine and it cannot be anything else.
‫It has to be from one to nine.
‫And then you run your program and then you have one more valuable here.
‫No plots equals zero.
‫So if you only want to see the animation and you don't want to see the plots that come after that,
‫then you make this variable one like this.
‫So here you have your animation and then if you close it, it's going to be the end of the program.
‫But if you do want to see the plots afterwards, then you're going to put here zero and then you run
‫the program.
‫So you have your animation here.
‫And then if you close it, then you will have a plot, then another plot in the next dimension and then
‫another one in the Y dimension, in the Z dimension, then the angles and then the control inputs.
‫Along with their Omega's, and if you close that, then your program finishes and so all these variables
‫here in this init function are stored in this self that constants variable.
‫And so this list, this vector is then sent to the main file.
‫So this is your main file here.
‫And if the main file calls this function from the support file class, then the main file gets this
‫list in return.
‫OK, and now let's go back to our main file.