From 80993acc47a357f5fbd96f9189d011e6232f4ede Mon Sep 17 00:00:00 2001 From: jasonshort Date: Wed, 11 May 2011 06:14:15 +0000 Subject: [PATCH] HEXA_P frame support git-svn-id: https://arducopter.googlecode.com/svn/trunk@2243 f9c3cf11-9bcb-44bc-f272-b75c42450872 --- ArduCopterMega/motors.pde | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/ArduCopterMega/motors.pde b/ArduCopterMega/motors.pde index 38b8e1bbdc..0b1ab67d5a 100644 --- a/ArduCopterMega/motors.pde +++ b/ArduCopterMega/motors.pde @@ -157,6 +157,29 @@ set_servos_4() motor_out[CH_1] -= g.rc_4.pwm_out; // CW motor_out[CH_8] -= g.rc_4.pwm_out; // CW + }else if (g.frame_type == HEXAP_FRAME) { + //Serial.println("HEXAP_FRAME"); + int roll_out = g.rc_1.pwm_out; + int pitch_out = (float)g.rc_2.pwm_out * .5; + + //Back side + motor_out[CH_8] = g.rc_3.radio_out - g.rc_2.pwm_out; // CCW + motor_out[CH_1] = g.rc_3.radio_out + roll_out - pitch_out; // CW + motor_out[CH_3] = g.rc_3.radio_out - roll_out - pitch_out; // CW + + //Front side + motor_out[CH_7] = g.rc_3.radio_out + g.rc_2.pwm_out; // CW + motor_out[CH_2] = g.rc_3.radio_out + roll_out + pitch_out; // CCW + motor_out[CH_4] = g.rc_3.radio_out - roll_out + pitch_out; // CCW + + motor_out[CH_8] += g.rc_4.pwm_out; // CCW + motor_out[CH_2] += g.rc_4.pwm_out; // CCW + motor_out[CH_4] += g.rc_4.pwm_out; // CCW + + motor_out[CH_1] -= g.rc_4.pwm_out; // CW + motor_out[CH_7] -= g.rc_4.pwm_out; // CW + motor_out[CH_3] -= g.rc_4.pwm_out; // CW + }else if (g.frame_type == Y6_FRAME) { //Serial.println("Y6_FRAME");