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
AP_Hal_Linux: PCA9685: do not shutdown #19772
Conversation
Shutting down causes the pulses to be cut short, often causing ESCs to interpret this pulse
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would said that keep it alive will just consum some current and not set the ESC in no signal mode ?
Can't you just said it to set 0 PWM before going to sleep instead of removing sleep ?
@khancyr
|
@khancyr the current consumed by the pca9685 is on the order of 10 uA and is insignificant. This change sets the pwm in no signal mode predictably. Prior to this patch, the behavior of the esc or servo is unpredictable |
@Williangalvani |
@HefnySco we hardly have that issue, if ardusub quits cleanly (either mavlink or sigterm), it disables the PCA (check #18635). The issue in this PR is that the PCA can abruptly shutdown mid-pulse, so that the last pulse received by the ESC is 1100us instead of 1500us, for example, which causes some thrusters to (briefly but scaringly) spin at full power in reverse. |
Yep, it seems like solving a real issue. So I don't think we should keep the old behavior. Can you bring this to a devcall for a last review ? @lucasdemarchi any experience on this that we may be missing ? |
Sleeping causes the current pulses to be cut short, often causing ESCs to interpret this pulse and briefly spin thrusters (often pretty violently) when Ardupilot is stopped.
We can alternatively add a delay to wait until all the pulses are over, but that will delay the shutdown and depends on the current PWM frequency. Is there an issue in keeping the PCA running?
Before:
After:
credits to @jaxxzer for digging into this