Hi all!
my quadcopter is in such configuration:
m0 - CCW m1 - CW
m2 - CW m3 - CCW
it is set up in an X configuration
now, my PID algorithm returns values from -10 to 10 (still has to be adjusted)
the main problem is the algorithm which will apply the new PWM values to the motors
currently, I have something like this:
motor_speed[0] = (int)output_gy + (int)output_gx + (int)output_gyaw;
motor_speed[1] = (int)output_gy - (int)output_gx - (int)output_gyaw;
motor_speed[2] = (int)output_gy(-1) + (int)output_gx - (int)output_gyaw;
motor_speed[3] = (int)output_gy(-1) - (int)output_gx + (int)output_gyaw;
motor_speed[0] += throttle;
motor_speed[1] += throttle;
motor_speed[2] += throttle;
motor_speed[3] += throttle;
this produces fine results when i told the quadcopter in the x or y axis but when i tilt it in both the X and Y axis simultaneously I get a sum (for example if throttle is 0, I get 20; output_gx + output_gy)
I could not get the right PID values no matter how hard i tried, I believe it could be due to this bug.
Now, the real question is, can someone point me in the right direction with an algorithm which will add the PID output to the motors in a correct manner?
Thanks,
Damian