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

Failsafe detection #31

Closed
Typ17b opened this issue May 29, 2024 · 7 comments
Closed

Failsafe detection #31

Typ17b opened this issue May 29, 2024 · 7 comments

Comments

@Typ17b
Copy link

Typ17b commented May 29, 2024

Hi,
Is it possible, to detect the absence of a valid receiver signal within a given resolution? This way it would be possible to realize a Failsafe detection.

Regards
Stefan

@dmadison
Copy link
Owner

Hi Stefan! Could you clarify what "within a given resolution" means?

@Typ17b
Copy link
Author

Typ17b commented May 29, 2024 via email

@dmadison
Copy link
Owner

I think I'm understanding you, feel free to correct me if I'm not.

If the RC receiver is still connected to the board but the RC controller isn't sending it signals, it's up to the RC receiver how to handle that. Some receivers will repeat the last known position (pulse duration), some will send a default position, some will stop sending pulses entirely.

If the controller isn't sending signals and the RC receiver is still sending pulses (whatever they are), there is nothing the library can do one way or the other. It just sees the pulses, and as far as it knows the pulses are valid.

If the controller isn't sending signals and the RC receiver is not sending pulses, the library will report the last known good value it received. If it hasn't ever received a valid signal the initial value is at the bottom of the range (500 in your example) because, well, we have no idea what the initial position is. Some motors (e.g. steering) are 'idle' at center, some motors (e.g. throttle) are 'idle' at low. There's no way of knowing.

The library does have a feature to check if there is a new signal, which is the available() function. If your receivers are of the latter type where they shut off signals when the RC controller drops out of range, you can check if a signal is available() before acting on it, rather than reading continuously:

if(servo.available()) {
    // do something with the data
}

Does that help?

@Typ17b
Copy link
Author

Typ17b commented May 30, 2024 via email

@dmadison
Copy link
Owner

Hi Stefan, following up on this. Were you able to solve your problem?

@Typ17b
Copy link
Author

Typ17b commented Aug 20, 2024

Hi Dave,
this solved my problem. Sorry, i forgot to inform you.
I am new to this github stuff, do i have to mark something as solved?

Thanks again for the perfect support!

@dmadison
Copy link
Owner

If your problem is solved you can close the issue as completed. I can do that for you.

Thanks for following up!

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