bmellink / IBusBM

Arduino library for RC IBUS protocol - servo (receive) and sensors/telemetry (send) using hardware UART
GNU General Public License v3.0
198 stars 50 forks source link

ibus.readChannel fails to detect loss of signal (causes failsafe failure) #35

Open getgray opened 1 year ago

getgray commented 1 year ago

Possibly similar to issue #24, but with a twist. The Flysky controller can have "failsafe" set for it's channels. If you set that on, and then if you cut power to the transmitter to simulate a loss of radio signal, the failsafe works and values return to the set (default) failsafe parameters (set as a percentage signal on transmitter).

HOWEVER: If you disconnect the data wire from the receiver to the Arduino, nothing is sensed and the last value prior to wire disconnect continues to be returned from "ibus.readChannel" In the case of an Arduino controlling a large robot, or any similar device that could easily experience a wiring failure, this behavior results in an unsafe condition where the motors being controlled keep their last known setting after the data wire failure. This would result in an unsafe failure.

Unlike #24 2where a user suggested the code was not at fault, in this case it does appear to be. As there is NO data being sent to the Arduino because the receiver is disconnected.

How can I implement a test of signal for wire disconnect failsafe operation? Need to be able to test for loss of i-Bus signal.

Can I use: uint8_t cnt_rec; // count received number of servo messages from receiver To tes tfor servo messages, contrary to the docs saying you cannot for failsafe? Perhaps this count being stagnat woudl indicate a failed wire?

chupocro commented 5 months ago

In case of disconnecting the wire cnt_rec will stop increasing so you can check if the value stayed the same for a few tenths of a second.

I explained how you can detect if failsafe has occured in the reply to issue #24.