-
Notifications
You must be signed in to change notification settings - Fork 13.7k
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
Commander/preflight checks: Add monitoring to ESC failures #16704
Conversation
@dagar this was also a suggestion you had back in the time
I think would make sense to do it |
|
||
if (esc_status.esc[index].failures != _last_esc_failure[index]) { | ||
|
||
if (esc_status.esc[index].failures & esc_report_s::FAILURE_OVER_CURRENT_MASK) { |
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.
These aren't really generic failures (not used by UAVCAN, DSHOT, etc), perhaps the error message should be confined to the specific module?
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.
Mh not really, I've seen this as a recurring pattern where people with proprietary ESCs ended up doing the logic in the driver (and the failures ended up to be almost the same). I think that this is a good first step towards supporting such edge cases
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.
Alright, let's see how things continue to evolve.
I'm trying to fine the line where commander is tied in such that it's aware of the components and high level health status, but doesn't have to have specific intimate knowledge unless it's actually going to do something with that information.
src/modules/commander/Commander.cpp
Outdated
} else { | ||
|
||
if (_esc_status_was_updated && !_status_flags.condition_escs_error) { | ||
mavlink_log_critical(&_mavlink_log_pub, "ESCs telemetry timeout"); |
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.
Is this user actionable? If it's not going to block arming or trigger a failsafe in flight then I don't think it's worth sending to a user. You could change it to PX4_WARN to catch in the logs for review later.
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.
agreed
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.
actually now i remember the use case for this:
if you have ESC that are reporting telemetry but the telemetry line is completely disconnected from the vehicle you would be allowed to arm without the telemetry line.
This check guarantees that if this situation happens user is then warned. What i usually do is publishing an esc_status
message right when the driver starts, such that then the logic would kick in if no further statuses are received
src/modules/commander/Commander.cpp
Outdated
mavlink_log_critical(&_mavlink_log_pub, "%soffline", esc_fail_msg); | ||
} else { | ||
|
||
if (_esc_status_was_updated && !_status_flags.condition_escs_error) { |
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.
Isn't _esc_status_was_updated
is always going to be true within esc_status_check()
?
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.
not completely, IIRC i added that condition to guarantee that the check does not trigger a false positive at boot
@cmic0 yes, I think it's simply a matter of only doing the work of |
@cmic0 can you rebase to see if this fits now? |
yep - i am actually trying improve the code to avoid copying the |
69f3266
to
c85ca27
Compare
bd01cd0
to
478cca0
Compare
4551bbd
to
764c977
Compare
Signed-off-by: Claudio Micheli <[email protected]>
Signed-off-by: Claudio Micheli <[email protected]>
419a105
to
b8f304f
Compare
COM_ARM_CHK_ESCS set to 0. The user will need to enable it manually. Co-authored-by: Beat Küng <[email protected]>
9c35196
to
cf2b25d
Compare
FYI: I am not authorized to merge this PR. |
This update to this PR: PX4/PX4-Autopilot#16704
Resurrected version of #14800.
Describe problem solved by this pull request
This PR extends monitoring to failures reported by ESCs with telemetry.
ESC checks are enabled/disabled with the
COM_ARM_CHK_ESCS
parameter.Test data / coverage
I've been flying this exact code with smart ESCs since the first PR was opened.