Help need with the Failsafe 2.6
I lost a gas UAV from what appears to be a failsafe issue.
V2.6 with IMU V2 shield
The transmitter low set point for throttle was 1070ms, #define SET_RADIO_LIMITS 0
Failsafe set point set to 1250ms using a Spectrum AR7000 receiver
I have 5 hrs on this UAV and was in the process of setting up channel 3 throttle. I don’t believe that it was ever out of range as this all happened quite close , Iam using 2.4g.
Sitting on the ground the uav seemed good for flight.
After taking off and switching over to Auto the UAV climbed to high so I switched back to manual and closed the throttle to loses some height. This is when the failsafe started to kick in and out and I lost control ending in a total of UAV. Maybe if i had have opened the throttle ???
As you can see the from the data it switched many many times.
Some of the lower failsafe values where as low as 660ms how could this happen if the lowest set point signal from the transmitter was 1070ms ?? It also switched into failsafe above 1000ms.
Iam not completely sure how the system is meant to work.
Did I get some lower values superimposed on CH3 from the gas ignition?
Replies
//check for failsafe and debounce funky reads
// ------------------------------------------
if ( (ch3_in < ch3_fs) && (speed_or_airspeed > MIN_FAILSAFE_SPEED) ) {
to prevent accidental engine start whilst on the ground ?
There are really two failsafe systems in Ardupilot. If you have a futaba 7C like I do, you can only use the throttle based failsafe. If you have a fancier radio, you can set your control switch to output Return To Launch when failsafe occurs.
The throttle based failsafe has worked quite well for about 9 months. I don't think it's a code problem. And since you didn't set your radio up to trigger the failsafe (by outputting a 100ms lower PWM value than trim at startup), I can tell it wasn't a signal loss problem.
My assumption is that your radio isn't outputting high enough voltage to the pin. Pin 13 is connected to two LEDs. You should clip this pin so it doesn't connect to the shield. If your clipped pin is slightly exposed, a bump or rattle could cause a connection and ruin the signal. This would cause the bad output values and it has happened once to another member.
Jason
I have made many successful flights with the throttle connected directly to the RC receiver. All of my connections from RX to autopilot to servos have a choke to help stop RF feed back. Unfortunely this may or maynot have been the issue. When I made the change from manual throttle control over to autopilot throttle control in the field I did not have a choke to place on the connection between the RX and the Autopilot.
The setup of 1070ms on ch3 radio is engine idle this is the lowest setting the radio can go down to by using the stick. The radio will go lower by use of ether the trim button or adjustment in setup. The Spectrum AR7000 receiver has a failsafe position that can be set on the throttle CH3 this was set to 1250 the reason for this was during the period that I had the throttle servo connected directly to the RX should I have a loss of signal then the engine would still be running at 30% and eventually come home if it was in RTL or Auto. I had restricted the throttle to #define THROTTLE_MAX 45 #define THROTTLE_MIN30 in the code. Jason I was not using it as idle cut-off actually the reverse power up to 30% I are using one set point in radio that is throttle stick low idle= 1070ms. I use a separate channel to switch a microswitch to kill the engine.
What Happened! Iam quite sure that I did not have a loss of RC com to the RX. If this was the case I would have had an engine up situation and autopilot low Pulse width failsafe would not have happened.
The flight started in manual and had two RTL phases then one Auto phase the issues is at the end of the Auto phase when I flipped back to manual with the throttle closed to lose height. The failsafe flipped back and forth quite rapidly all the way to the ground. It looked like a demented butterfly then ended as roadkill. My UAV when flipped to RTL would roll sharply to try and take up the new heading as this was flipping back and forth rapidly nether of us could mantain control. If I had opened the throttle or maybe switched to another mode hindsight.
Suggestion / thought When Failsafe dose take place it needs to hold control for a loner period of time, maybe it should not hand back control when in a turn or in a unestablished situation. If you are close to the home WP then you are most likely always in a turn!
Questions
Looking at the data you can see that the there is 3 FAILSAFE OFF switching without any on switching???
Was this a Nose imposed onto CH3 by the ignition?
Was the PW count low due to interrupts or something maybe a bug when the actual values where good?
How is the switching value set as you can see it has switched at many different values?
How is the system meant to work do we have two systems one in the ATtiny 45 multiplexer and one in the Audupilot code?
A true understanding of the system will help get to the bottom of this. When I are up and running again I might need to put a scope on CH3 to see what’s going on if we cannot make sense of this.
In answer to your questions Chris / Jason did I want Failsafe I possible would have turned it of at this stage as I live in the country and have loads of space. Only after testing and proving it would I reengage its use. At this stage I need to get a better handle on just what went wrong and if the system is a help or a hindrance. Certainly the method of return to a stabilized flight needs to be rethought. The expectation is that it is switching back to a healthy state clearly mine was not as far as the autopilot was concerned. Although Iam quite sure that the min pulse the transmitter was putting out is 1070ms.
Where was it getting the healthy signal from to switch back? Is it the command signal rather than the actual incoming signal?
Hoping that you may have some answers.
Scott
2.6imu5zip.zip
Sorry to hear about your plane!
Could you post your config file? It would help track down the issue if there is one. Like Chris said, if you successfully fly Auto, you shouldn't have a problem with the failsafe. As all it does is flip to the plane into RTL mode. As soon as it sees a control switch change it will jump out of Failsafe, just in case. That's why you see it change so often.
They main theory with failsafe is that your RX will set CH3 to a very low PWM if you loose signal. The startup sequence looks at the throttle value to get the correct set point. But, you are using a gas engine and I'm guessing you have two set points in your radio for idle and cut-off. Is that true? If so that may be the culprit during setup.
Should we either disable it for gas engines or perhaps you could suggest a better alternative?
Jason
So sorry to hear about the loss of your plane! We're going to make Failsafe a default-off option, but I assume in this case you actually wanted it. I have a few questions:
-- I'm not sure how Spektrums work. When you say "Failsafe set point set to 1250ms using a Spectrum AR7000 receiver" could you explain a bit more what you mean?
--Looking at your data, it looks like the AP was correctly going into Failsafe every time the Ch3 signal went below 1070. The question is why it was getting that reading. Can you think of an explanation for that?
--Even if failsafe kicked in, it shouldn't have crashed--it should have just come back to you (RTL). It sounds like it was flying correctly in autonomous mode (albeit climbing). Can you explain what the plane did when it crashed?