# Where next?

Phoebe has pretty much answered the question: she took off from as good an approximation of a horizontal surface as I could come up with, and yet, once airborne, she drifted backwards. This is the polar-opposite of being able to control her flight in a desired direction; if I can stop this drift for a vertical take-off, then I can apply the opposite logic to apply drift for horizontal movement.

First step as always is to have a nosey through Phoebe’s stats from the flight, in particular the x-axis accelerometer output (plus integral for speed), and engage the outer horizontal-speed PIDs to produce the targets for the inner angular PID (which actually drives lateral speed); the unwarranted horizontal movement is stopped by a managed tilt upwards the same direction (i.e. a backwards drift will be stopped by raising Phoebe’s rear blades, and tilting down her forward ones).

But before I get too engrossed, I think Phoebe and I are due some free-play time together!

One last thing – some stats from a separate flight that day showing two things:

First how much effort is required to maintain stable yaw – about 17% more power is applied to the CW blades than to the ACW blades – that surprised me given that in theory at least, the motors and blades are nigh on identical, and the body is well balanced.  I’ll have to have a think:

YAW stats

Secondly, a plot of acceleration, speed, and height, all derived from the accelerometer; I’m particularly impressed with the speed and height results, particularly as they are just integrated from the acceleration, and the fact that as the applied power drops, you can see the controlled drop in height as expected.  Bodes well for a more automated takeoff.  Units on the left at meters per second per second, meters per second or meters for acceleration, speed and height respectively.  Units on the right are the motor power between 0 and 1000 (PWM pulse width in microseconds)

Vertical Height, Speed and Acceleration

## 9 thoughts on “Where next?”

1. Reik, I’ve just watched the video – you have a great place for your testing! I couldn’t see yaw in the flight, but the quad is very small in the picture.

Is your code based on mine? If so, make sure you have the latest from https://github.com/PiStuffing/Quadcopter. From the flight, you have stability which is great, but drift needs work. I’ve spend a year getting drift down. E-mail me for any help:: andy at pistuffing dot co dot uk.

• Hi Andy,

Yes, it’s good place for evaluation.
And i based on your code. But i changed architecture and replaced some function based my understand.
At first i think the drift because the yaw too large, so i try to fix yaw issue first.
I’m plan more evaluation flight on the weekend, and i also try to mail you introduce my quad ,my code which different with you.

2. Hi Andy,

Nice to meet you!
Now i builded to quadcopter,both can fly. but yaw issue trouble me more than one month.
It can fly more stable if i manually add 20 to cw motor in updateEsc function.
Could you kindly share some idea how to fix CW blades need more power issue?

• You need to use the gyro Z axis to measure the yaw rate, and feed that into a PID with target set to zero yaw, so that the code itself dynamically chooses the balance of power between CW and CCW props.

But i have use the gyro Z axis to measure the yaw rate, and feed that into a PID with target set to zero yaw.

For log 1, you can see quadcopter yaw change slowly when yout aroud 40.
but yaw continue add, you can guess quadcopter will drop down when yout suddenly change to nagetive.