How to disable RX-inputs? (to stop servo from jittering if weak or no RX-signal)

My receivers (35MHz) usually go nuts when they loose radio signal.

If I turn OFF the TX the RX can turn the servos off limits and strip their gears, the motor can suddenly start...

 

Even in Waypoint mode I see that this happens, since you always have control over the servos from the IN-signal pins.

 

For testing purposes, and maybe in a situation were you loose signal, I want to programmatically turn ON the autopilot (WP-mode) and SHUT DOWN IN-signal 1-3.

 

I created a FORCE-WP-MODE flag which runs this in the main loop:

    pinMode(1, OUTPUT); //CTRL

    pinMode(4, OUTPUT); //MUX

    digitalWrite(1, LOW);  //CTRL - Shut down CTRL signal

    digitalWrite(4, HIGH); //MUX - Turn on WP-mode

 

Also, In the read_Ch1() and read_Ch2() I return "0" if FORCE-WP-MODE flag is set to reject any random inputs.

 

Need to do some more testing, but It seems to work.

But I think I still saw some random noise when I connected the GPS. Need to check that again...

 

- Is there a better approach?

 

/Tommy

Views: 6

Reply to This

Replies to This Discussion

Update:
If I turn off the transmitter (or if the signals are weak) I can force the program in WP-mode with this code:
pinMode(4, OUTPUT); //MUX
digitalWrite(4, HIGH); //MUX - Turn on WP-mode

But I'm, still having problem to reject any random signal to the CTRL-pin. These signals sometimes reboot the program!
If I disconnect the CTRL-cable (ch#5) from the receiver - it works.

But, is there a way to code - so the (random) signals don’t affect the ardupilot?

/Tommy

RSS

Social Networking

Contests

Season Two of the Trust Time Trial (T3) Contest has now begun. The fourth round is an accuracy round for multicopters, which requires contestants to fly a cube. The deadline is April 14th.

A list of all T3 contests is here

Advertisement

© 2013   Created by Chris Anderson.   Powered by

Badges  |  Report an Issue  |  Terms of Service