I have few doubts regarding Return to home feature if we off the transmitter. I was testing my devboard with Futaba 6channel PCM receiver. i m using Ch1-Aileron, Ch2- elevator, Ch3-Throttle, and CH-5 for Auto/Manual(Two position switch). And the code was Aileronassist V8.0. So i was experimenting with the situations if my plane goes out of range then what happens.
1. I on the setup and initialize all(GPS) and Aileron told me everything is ok. now i keep the throttle zero, Aileron to extreme left and elevator to max up at this position i off the transmitter. Result: : The throttle remain at zero, devboard came to Auto mode and elevator and aileron remain at the same position at which i left(max left and max upward).
2. Next i just explore few options in my transmitter and found a failsafe which can be set to different level at all channels. So i set ch-1 failsafe at 0%, Ch-2 at 0%, Ch-3 at +20%, Ch-5 +90%(already at this value). And perform the same test as above.
As i switched off the transmitter the Elevator and Aileron neutralized and came at 0 position, throttle remain off and imuboard changed mode to Auto.
3. Next change i set the throttle failsafe to 40%. And tried this time. As i switched off the transmitter the throttle gone to full may be achieve the 150m height i set in the code of first waypoint. . The imuboard came into full navigating Auto mode.[This situation may be safe for long range testing]. So my first question is this Lets say if i test my plane for 2km distance with waypoints 500m apart and my receiver range is just 1km in that case with the above settings plane should go safely to 2km and come back to the first waypoint. Is it true.
# My receiver doesnot stop giving signal when i off the receiver. It just provide the failsafe value which iset in it. So if want to engage the return to home feature Will it be possible by setting any faisafe value in my receiver.
i found the variable 'pulsesselin' which value decide the health of radio. so if not by receiver then by any change in code will it be possible to do that. Thanks in advance.
as you surmised, it sounds like your receiver is continuing to send R/C (servo) pulses even when loss of signal has occurred. In the options.h file there are three settings for failsafe, "FAILSAFE_INPUT_CHANNEL", "FAILSAFE_INPUT_MIN", and "FAILSAFE_INPUT_MAX". The UDB uses those values to define when the receiver is in failsafe mode. In your case, it sounds like you should increase FAILSAFE_INPUT_MIN (leaving your receiver set to 0% on whichever channel you've selected) so that the UDB will correctly detect a failsafe condition.
I'm not sure about the status lights in AileronAssist, but with Matrix Pilot (the latest combined firmware for the UDB) the green LED will turn off when the board detects a failsafe condition.
If i want to debug the actual values of pulsesselin variable for my reciever so that exceptional values i can program for failsafe. Then how to print for debugging the real values of pulsesselin . And which channel u r using here to calculate pulsesselin is it channel 5.?
You are right, by changing these three values i can achieve failsafe but these options are not available in aileronassist. I have tested this code and adjusted gains which perform much better for my plane. So want to make some minor change in aileronassist itself to enable failsafe feature..
pwc1 is channel 4, the mode control channel. The threshold limits are two times the pulse widths, in microseconds. So, the code is set up for a range between 0.75 milliseconds and 2.25 milliseconds for valid pulses. This provides a large margin for the normal range of 1 to 2 milliseconds for the usual pulses.
it would be hard to make any sense out of a debugging printout of pulsesselin, because it is a moving target, always changing. what happens is that the ISR that you are looking at increments the count of valid pulses, and that count is checked for radio on condition somewhere else (in the state machine) and reset. The debugging printout is done somewhere else, so if you try to print it, what you will see is random numbers between 0 and about 50.
A better thing to print out is pwc1 itself! It only changes when you change the pulse width. So, the smart thing to do is to print out pwc1 in the debugging output, and examine it as you change the conditions on your failsafe channel, channel 4.
Just to clarify one thing, when I say channel 4, I mean the PWM input channel on the board in the "Radio" section, number 4.
AileronAssist and MatrixNav support 4 input channels and 3 output channels. In both cases, channel 4 is both the mode-control channel and the fail-safe channel.
Ben Levitt figured out how to use the spare pins to implement 5 inputs and 6 outputs, which are now available with MatrixPilot. There are some very nice features in Ben's software, I encourage you to give it a try, I think you would like it.
I got it and print the pwc1 value for debugging , what i got is in manual mode it prints a constant value 1945 , stabilization = 3203, auto = 4136. and failsafe value 4150 from my reciever . so to enable RTL in code i changed this value pwc1<4145 it works as a RTL and i have tested this also the plane landed just 2m away from lauching place. Wonderful landing in auto mode...
Here , In RTL mode throttle get off as it reaches the home location and keep on rounding over that , it descend the height in gliding mode and land safely with in the radius of 25m. It had done two successful landings today also it was so stable...Can use this as a safe landing if flying in a clear open area (without trees / poles disturbance).