Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug in 25sec Auto-Disarm feature #166

Closed
SirAlex opened this issue Mar 21, 2013 · 3 comments
Closed

Bug in 25sec Auto-Disarm feature #166

SirAlex opened this issue Mar 21, 2013 · 3 comments

Comments

@SirAlex
Copy link

SirAlex commented Mar 21, 2013

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.

@rmackay9
Copy link
Contributor

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.

@SirAlex
Copy link
Author

SirAlex commented Mar 21, 2013

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.

@rmackay9
Copy link
Contributor

The original issue has been fixed in master. thanks!
a185fa9

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.

lthall pushed a commit to lthall/Leonard_ardupilot that referenced this issue Aug 22, 2021
* Terrain failsafe land instead of RTL in events.cpp
shellixyz added a commit to shellixyz/ardupilot that referenced this issue Jul 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants