ardupilot icon indicating copy to clipboard operation
ardupilot copied to clipboard

Bug in 25sec Auto-Disarm feature

Open SirAlex opened this issue 13 years ago • 3 comments

ArduCopter has safety feature which Auto-Disarm copter if you not increased Throttle, but:

  1. If you not increase Throttle for 25+sec after ArduCopter loaded and initialized, this feature will not work, since counter reached 25 sec and stay there event you ARM.

2a. Wait less than 25sec after init (after "READY TO FLY" message) 2b. ARM, do not increase Throttle - after ~5sec (instead of 25sec) it will Auto-Disarm.

If you guru in copter and do all operations fast - it's not problem. But if you novice, you wait too long before increase Throttle, and copter audo-disarm. This confusing some people.

Ok, possible solutions:

  1. auto_disarming_counter = 0 in motors.pde, at the end of init_arm_motors()
  2. increase auto_disarming_counter only if motors Armed.

We encountered this problem in MegaPirateNG project and I'm fixed it by 1. solution, but still not hard tested it.

SirAlex avatar Mar 21 '13 13:03 SirAlex

Excellent. thanks for the report. I had the feeling there was something a little off in the disarm code 'cuz occasionally I've seen it disarm faster than i expected.

rmackay9 avatar Mar 21 '13 14:03 rmackay9

Welcome :)

Looks like I'm found one possible bug with another failsafe routine: Main loop hang detection. The problem in mainLoop_count variable, it declared as static, but failsafe routine called from ISR, so it can be corrupted or have wrong value. Changing variable to "static volatile" solves problem in MegaPirateNG (Some users reports: Copter Auto-Disarmed in the middle of the air).

bool failsafe_check(uint32_t tnow)
{
    if (mainLoop_count != failsafe_last_mainLoop_count) {
        // the main loop is running, all is OK
        failsafe_last_mainLoop_count = mainLoop_count;
        failsafe_last_timestamp = tnow;
        in_failsafe = false;
        return true;
    }
....

UPD: Volatile variable won't help. Never mind.

SirAlex avatar Mar 21 '13 23:03 SirAlex

The original issue has been fixed in master. thanks! https://github.com/diydrones/ardupilot/commit/a185fa950c9a2495f8b69008e3d97b2463e20bbc

I've never heard of this failsafe occurring while users are flying. I'll check into it further if you think the issue is real though.

rmackay9 avatar Apr 15 '13 15:04 rmackay9