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

SAFETY issue -- servos.c: Correct servo throttle *off* when disarmed (not full throttle at disarm) #9330

Merged

Conversation

sensei-hacker
Copy link
Collaborator

@sensei-hacker sensei-hacker commented Oct 1, 2023

When disarmed, the existing code is intended to set "servo" outputs that use throttle to minimum:

servo[target] = motorConfig()->mincommand;

Which was expected to set the value to 1000.

However, the range at that point is intended to be -500 to +500.
servoParams(target)->middle is added a few lines later.
Therefore this ended up setting them to minimum + middle = 2500. Ie full throttle when disarmed.

PR subtracts servoParams(target)->middle, to offset the fact it's added a few lines later.

Tested by me and by INAV Discord user "driftingS13".

@sensei-hacker sensei-hacker changed the title servos.c: Correct servo throttle *off* when disarmed (not full throttle at disarm) SAFETY issue -- servos.c: Correct servo throttle *off* when disarmed (not full throttle at disarm) Oct 9, 2023
@MrD-RC MrD-RC added this to the 7.0 milestone Oct 23, 2023
@DzikuVx
Copy link
Member

DzikuVx commented Oct 26, 2023

@sensei-hacker this might be a better solution #9413

@DzikuVx
Copy link
Member

DzikuVx commented Oct 26, 2023

what do you think?

@DzikuVx DzikuVx merged commit e4bd847 into iNavFlight:master Oct 27, 2023
14 checks passed
@sensei-hacker
Copy link
Collaborator Author

what do you think?

Looks good and tests good.

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

Successfully merging this pull request may close these issues.

None yet

3 participants