added a bit of kI term for Yaw hold.

git-svn-id: https://arducopter.googlecode.com/svn/trunk@1918 f9c3cf11-9bcb-44bc-f272-b75c42450872
This commit is contained in:
jasonshort 2011-04-22 21:15:17 +00:00
parent 69b0ae329e
commit 16412abbde
3 changed files with 10 additions and 6 deletions

View File

@ -276,7 +276,9 @@ void output_manual_yaw()
clear_yaw_control();
did_clear_yaw_control = true;
}
}else{
}else{ // motors running
// Yaw control
if(g.rc_4.control_in == 0){
output_yaw_with_hold(true); // hold yaw

View File

@ -20,9 +20,6 @@ static int8_t select_logs(uint8_t argc, const Menu::arg *argv);
// printf_P is a version of print_f that reads from flash memory
static int8_t help_log(uint8_t argc, const Menu::arg *argv)
{
// log hack
//Serial.begin(115200, 128, 128);
Serial.printf_P(PSTR("\n"
"Commands:\n"
" dump <n>"
@ -527,7 +524,10 @@ void Log_Write_Control_Tuning()
DataFlash.WriteInt((int)(g.rc_3.servo_out));
DataFlash.WriteInt((int)(g.rc_4.control_in));
DataFlash.WriteInt((int)(g.rc_4.servo_out));
// yaw
DataFlash.WriteInt((int)yaw_error);
DataFlash.WriteInt((int)(dcm.yaw_sensor/100));
// Yaw mode
DataFlash.WriteByte(yaw_debug);
@ -553,13 +553,15 @@ void Log_Write_Control_Tuning()
// Read an control tuning packet
void Log_Read_Control_Tuning()
{
Serial.printf_P(PSTR("CTUN, %d, %d, %d, %d, %d, %d, %1.4f, %1.4f, %1.4f, %d, %d, %d\n"),
Serial.printf_P(PSTR("CTUN, %d, %d, %d, %d, %d, %d, %d, %1.4f, %1.4f, %1.4f, %d, %d, %d\n"),
// Control
DataFlash.ReadInt(),
DataFlash.ReadInt(),
DataFlash.ReadInt(),
DataFlash.ReadInt(),
// yaw
DataFlash.ReadInt(),
DataFlash.ReadInt(),
// Yaw Mode

View File

@ -346,7 +346,7 @@
# define YAW_P 0.4 // increase for more aggressive Yaw Hold, decrease if it's bouncy
#endif
#ifndef YAW_I
# define YAW_I 0.0 // Always 0
# define YAW_I 0.1 // increased to .1 to try and get over user's steady state error caused by poor balance
#endif
#ifndef YAW_D
# define YAW_D 0.13 // Trying a lower value to prevent odd behavior