Closed GoogleCodeExporter closed 9 years ago
Perhaps the simplest option would be to disable magnetometer feedback when the
angle is greater than 45 degrees from vertical then reinitialize the feedback
at the heading when the angle drops back under 45 degrees.
The second problem could then be addressed by updating the desired heading by
the rotation of the copter around the earth Z axis caused by the rotation about
copters X, Y and Z axis instead of just the copters Z axis.
Original comment by LeonardT...@gmail.com
on 29 Jul 2012 at 11:30
I think we need to add something like this to the Yaw_Hold code. Sorry if the
formatting doesn't come out right.
case YAW_HOLD:
if(g.rc_4.control_in != 0){
g.rc_4.servo_out = get_acro_yaw(g.rc_4.control_in);
yaw_stopped = false;
yaw_timer = 150;
}else if (abs(ahrs.roll_sensor) > 4500 || abs(ahrs.pitch_sensor) > 4500 )
g.rc_4.servo_out = get_acro_yaw(0);
yaw_stopped = false;
yaw_timer = 50; // just for some settling time but could be 1
}else if (!yaw_stopped){
g.rc_4.servo_out = get_acro_yaw(0);
yaw_timer--;
if((yaw_timer == 0) || (fabs(omega.z) < .17)){
yaw_stopped = true;
nav_yaw = ahrs.yaw_sensor;
}
}else{
// reset target yaw to current yaw if the motors are disarmed or throttle is zero
// Note: we do not want to reset yaw if failsafe has been triggered even though throttle maybe zero (in fact, normally throttle is zero in failsafe)
if(motors.armed() == false || ((g.rc_3.control_in == 0) && (control_mode <= ACRO) && !failsafe))
nav_yaw = ahrs.yaw_sensor;
g.rc_4.servo_out = get_stabilize_yaw(nav_yaw);
}
return;
break;
Original comment by LeonardT...@gmail.com
on 2 Aug 2012 at 8:46
It's not a compass issue as such, the copter knows what it's heading is but
when it's up-side-down it tries to correct it by rotating the copter in the
wrong direction...so, yes indeed..our yaw control code doesn't not work
properly when you're up-side-down so I've updated the status to Accepted.
Original comment by rmackay...@gmail.com
on 16 Aug 2012 at 4:12
The release note to 2.8.1 says the issue is fixed
"Rate controller targets moved to body frames (yaw control now works properly
when copter is inverted) (Leonard/Randy)"
Original comment by Benny.Si...@gmail.com
on 19 Jan 2013 at 11:39
Issue closed.
If you find this is an error please report it in the new issues list
https://github.com/diydrones/ardupilot/issues?labels=ArduCopter&page=1&state=ope
n
Original comment by Benny.Si...@gmail.com
on 19 Jan 2013 at 11:39
Original issue reported on code.google.com by
LeonardT...@gmail.com
on 29 Jul 2012 at 7:25Attachments: