Browse Source

Copter: add pre-arm board voltage check

Copter will not arm unless board voltage is over 4.5V
mission-4.1.18
Randy Mackay 12 years ago
parent
commit
c3d21a457f
  1. 4
      ArduCopter/config.h
  2. 8
      ArduCopter/motors.pde

4
ArduCopter/config.h

@ -382,6 +382,10 @@
# define HIGH_DISCHARGE 1760 # define HIGH_DISCHARGE 1760
#endif #endif
#ifndef BOARD_VOLTAGE_MIN
# define BOARD_VOLTAGE_MIN 4500 // min board voltage in milli volts for pre-arm checks
#endif
// Battery failsafe // Battery failsafe
#ifndef FS_BATTERY #ifndef FS_BATTERY
# define FS_BATTERY DISABLED # define FS_BATTERY DISABLED

8
ArduCopter/motors.pde

@ -264,6 +264,14 @@ static void pre_arm_checks(bool display_failure)
} }
#endif #endif
// check board voltage
if(board_voltage() < BOARD_VOLTAGE_MIN) {
if (display_failure) {
gcs_send_text_P(SEVERITY_HIGH,PSTR("PreArm: Low Board Voltage"));
}
return;
}
// if we've gotten this far then pre arm checks have completed // if we've gotten this far then pre arm checks have completed
ap.pre_arm_check = true; ap.pre_arm_check = true;
} }

Loading…
Cancel
Save