Browse Source

added a bit of kI term for Yaw hold.

git-svn-id: https://arducopter.googlecode.com/svn/trunk@1918 f9c3cf11-9bcb-44bc-f272-b75c42450872
mission-4.1.18
jasonshort 14 years ago
parent
commit
16412abbde
  1. 4
      ArduCopterMega/Attitude.pde
  2. 10
      ArduCopterMega/Log.pde
  3. 2
      ArduCopterMega/config.h

4
ArduCopterMega/Attitude.pde

@ -276,7 +276,9 @@ void output_manual_yaw() @@ -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

10
ArduCopterMega/Log.pde

@ -20,9 +20,6 @@ static int8_t select_logs(uint8_t argc, const Menu::arg *argv); @@ -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() @@ -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() @@ -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

2
ArduCopterMega/config.h

@ -346,7 +346,7 @@ @@ -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

Loading…
Cancel
Save