I recently built a quadcopter and programmed a code to stabilise itself. The copter takes the hight from a distancesensors and the angle from a MPU 6050 gyro and accelerometer with a complementary filter. I currently face two Problems:
Altough the MPU 6050 is mounted to a vibrationabsorbing platform the angle is really bad. Some ideas to lessen the vibrations would be good.
The program never worked satisfactionally: I check every Milisecond, if the Copter is stabilised and at the right height or not. If not it spinns up the motors to correct. This should start the drone and let it hover at a certain height.
However, is the drone starting up well but shortly before take-off one side tilts up at an angle of apprximately 45° and the drone drifts of. The program could never compensate this. Have you an idea? Or some other thoughts. (This is my first electrical Project so very basic stuff could be wrong)
Thanks for your help.