TradHeli - fix to allow tail servo to be reversed. Also increase max movement of tail servo to 45 degrees.
This commit is contained in:
parent
3aee902be1
commit
12f5f3f96e
@ -72,15 +72,19 @@ get_stabilize_yaw(long target_angle)
|
||||
error = rate - (long)(degrees(omega.z) * 100.0);
|
||||
rate = g.pi_rate_yaw.get_pi(error, G_Dt);
|
||||
}
|
||||
|
||||
// output control:
|
||||
return (int)constrain(rate, -4500, 4500);
|
||||
#else
|
||||
// Rate P:
|
||||
error = rate - (long)(degrees(omega.z) * 100.0);
|
||||
rate = g.pi_rate_yaw.get_pi(error, G_Dt);
|
||||
//Serial.printf("%d\t%d\n", (int)error, (int)rate);
|
||||
#endif
|
||||
|
||||
|
||||
// output control:
|
||||
return (int)constrain(rate, -2500, 2500);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
#define ALT_ERROR_MAX 300
|
||||
|
@ -100,10 +100,7 @@ static void heli_move_swash(int roll_out, int pitch_out, int coll_out, int yaw_o
|
||||
if( g.heli_servo_3.get_reverse() )
|
||||
g.heli_servo_3.servo_out = 3000 - g.heli_servo_3.servo_out;
|
||||
|
||||
if( g.heli_servo_4.get_reverse() )
|
||||
g.heli_servo_4.servo_out = -yaw_out; // should probably just use rc_4 directly like we do for a tricopter
|
||||
else
|
||||
g.heli_servo_4.servo_out = yaw_out;
|
||||
g.heli_servo_4.servo_out = yaw_out;
|
||||
|
||||
// use servo_out to calculate pwm_out and radio_out
|
||||
g.heli_servo_1.calc_pwm();
|
||||
|
Loading…
Reference in New Issue
Block a user