Failsafe and Sum-PPM

This forum is dedicated to software development related to MultiWii.
It is not the right place to submit a setup problem.
Software download
Post Reply
copterrichie
Posts: 2261
Joined: Sat Feb 19, 2011 8:30 pm

Failsafe and Sum-PPM

Post by copterrichie »

Question, has anyone CHANGED how Failsafe works in connection with Sum-PPM since the Official MWC 2.1 release?

Thank you.

Mis
Posts: 203
Joined: Fri Apr 01, 2011 12:23 am

Re: Failsafe and Sum-PPM

Post by Mis »

Failsafe is triggered after "FAILSAFE_DELAY" time IF:
1 - No valid PPM pulses at ppm input, OR
2 - one or more of first four channels in PPM stream have pulse time bellow 985us.

copterrichie
Posts: 2261
Joined: Sat Feb 19, 2011 8:30 pm

Re: Failsafe and Sum-PPM

Post by copterrichie »

Well, it does not work in all situations. If there is a pulse regardless if it is good or not, the Failsafe does not kick in. Now sure where this started, I am trying to trace back now.

copterrichie
Posts: 2261
Joined: Sat Feb 19, 2011 8:30 pm

Re: Failsafe and Sum-PPM

Post by copterrichie »

I can confirm that if the pulse is complete gone, the Failsafe does activate but if there is a partial pulse regardless of the quality, Failsafe does not activate.

copterrichie
Posts: 2261
Joined: Sat Feb 19, 2011 8:30 pm

Re: Failsafe and Sum-PPM

Post by copterrichie »

Found the freaking problem, on the Turnigy 9xBC version 2, when the RX looses signal, Channels Four and Channels five STILL output a signal. 1400-1500 Channel 4 and 1000-1024 Channel 5. Going to scrap this RX and get something that already have PPM and know to work. Freaking Junk.

doughboy
Posts: 252
Joined: Tue Sep 04, 2012 7:20 am

Failsafe and Sum-PPM

Post by doughboy »

It has to be something else causing the problem. If the RX is only sending out channel 4 and 5 pulse then failsafe will still kick in. I'll check the failsafe code again just to make sure, but I know the code works fine last time I checked it. This is based on stock _shared code with no modification like inverting the ppm logic etc.

copterrichie
Posts: 2261
Joined: Sat Feb 19, 2011 8:30 pm

Re: Failsafe and Sum-PPM

Post by copterrichie »

What is needed in my opinion is a pulse counter in the frame. What I mean about that is, at start up, the FC count the number of pulses in the stream and if that pulse count falls below, then active the failsafe. So if there is eight channels at start up and for some reason that count drops to six for X amount if time, activate failsafe.

postaL
Posts: 36
Joined: Thu Oct 04, 2012 10:08 pm

Re: Failsafe and Sum-PPM

Post by postaL »

copterrichie wrote:Found the freaking problem, on the Turnigy 9xBC version 2, when the RX looses signal, Channels Four and Channels five STILL output a signal. 1400-1500 Channel 4 and 1000-1024 Channel 5. Going to scrap this RX and get something that already have PPM and know to work. Freaking Junk.


was this w/ the stock 2.4ghz setup?

copterrichie
Posts: 2261
Joined: Sat Feb 19, 2011 8:30 pm

Re: Failsafe and Sum-PPM

Post by copterrichie »

postaL wrote:
was this w/ the stock 2.4ghz setup?


Yes, just about as stock as they come.

postaL
Posts: 36
Joined: Thu Oct 04, 2012 10:08 pm

Re: Failsafe and Sum-PPM

Post by postaL »

copterrichie wrote:
postaL wrote:
was this w/ the stock 2.4ghz setup?


Yes, just about as stock as they come.


If you're looking for a PPM setup, but want to keep your 9x... try the FrSky setup. I've made the switch, and I'm lovin' it. You may also try flashing a aftermarket firmware (er9x), and see if you can make sure that upon failure, all channels are 0.

copterrichie
Posts: 2261
Joined: Sat Feb 19, 2011 8:30 pm

Re: Failsafe and Sum-PPM

Post by copterrichie »

postaL wrote:
If you're looking for a PPM setup, but want to keep your 9x... try the FrSky setup. I've made the switch, and I'm lovin' it. You may also try flashing a aftermarket firmware (er9x), and see if you can make sure that upon failure, all channels are 0.


Thank you. I have been watching the FrSky systems closely but just have not make the purchase yet. I have a number of Flysky RXs and would need to replace them all or switch transmitter modular when using them. It was a sad day when Flysky removed the PPM from their cheap 6 channels RX, that was a real dream to work with.

vpb
Posts: 231
Joined: Mon Jul 23, 2012 4:09 pm

Re: Failsafe and Sum-PPM

Post by vpb »

I'm on Turnigy 9X, Frsky + Er9x, but I made switchable RF module, and the stock RF module and 6 other turnigy RX are all still usable :D.

About Failsafe, just curious, anyone here use Frsky failsafe instead of MW code. With Frsky RX failsafe the RX applies all saved channel's states, so we can easily hold POS, RTH... and I think it's more reliable. But still not test yet.

doughboy
Posts: 252
Joined: Tue Sep 04, 2012 7:20 am

Failsafe and Sum-PPM

Post by doughboy »

copterrichie wrote:What is needed in my opinion is a pulse counter in the frame. What I mean about that is, at start up, the FC count the number of pulses in the stream and if that pulse count falls below, then active the failsafe. So if there is eight channels at start up and for some reason that count drops to six for X amount if time, activate failsafe.


That is what the failsafe/RX code does. It counts the pulses and resets after a long pause (I think >3ms). I know turnigy 9x RX will only have the pulse once per frame. So it is unlikely the problem is with the RX (I'd say it is impossible), so maybe it's the ppm sum circuit or if you are using a modified RX code, a bug in that code. The only way failsafe will not work is if the channel pulse is occurring more than once per frame.

scrat
Posts: 925
Joined: Mon Oct 15, 2012 9:47 am
Location: Slovenia

Re: Failsafe and Sum-PPM

Post by scrat »

vpb wrote:I'm on Turnigy 9X, Frsky + Er9x, but I made switchable RF module, and the stock RF module and 6 other turnigy RX are all still usable :D.

About Failsafe, just curious, anyone here use Frsky failsafe instead of MW code. With Frsky RX failsafe the RX applies all saved channel's states, so we can easily hold POS, RTH... and I think it's more reliable. But still not test yet.


I'm using FrSky failsafe instead of MWii code. It works.

copterrichie
Posts: 2261
Joined: Sat Feb 19, 2011 8:30 pm

Re: Failsafe and Sum-PPM

Post by copterrichie »

Correction: The Turnigy 9xBC version 2 maintains the last values received from the Transmitter on Channels 4 and 5 upon signal lost. I was going to just abandon this project however, it has revealed other problems else where. I will try to document this as best I can.

copterrichie
Posts: 2261
Joined: Sat Feb 19, 2011 8:30 pm

Re: Failsafe and Sum-PPM

Post by copterrichie »

Ok, I did some very extensive bench testing and even made a video. Seems the problem was fixed in the newest development version HOWEVER, all previous versions have a run-away copter scenario potentially at-hand. I am editing the video now and will share once done.

doughboy
Posts: 252
Joined: Tue Sep 04, 2012 7:20 am

Failsafe and Sum-PPM

Post by doughboy »

copterrichie wrote:Correction: The Turnigy 9xBC version 2 maintains the last values received from the Transmitter on Channels 4 and 5 upon signal lost. I was going to just abandon this project however, it has revealed other problems else where. I will try to document this as best I can.


Even if it does, it will occur only once per frame and current failsafe code will detect the missing pulses. Can you show the output of the RX channels 4 and 5 after turning TX off with the RX not connected to the ppm circuit? Just to see if it is pulsing more than once per frame.

copterrichie
Posts: 2261
Joined: Sat Feb 19, 2011 8:30 pm

Re: Failsafe and Sum-PPM

Post by copterrichie »

doughboy wrote:
copterrichie wrote:Correction: The Turnigy 9xBC version 2 maintains the last values received from the Transmitter on Channels 4 and 5 upon signal lost. I was going to just abandon this project however, it has revealed other problems else where. I will try to document this as best I can.


Even if it does, it will occur only once per frame and current failsafe code will detect the missing pulses. Can you show the output of the RX channels 4 and 5 after turning TX off with the RX not connected to the ppm circuit? Just to see if it is pulsing more than once per frame.


Correct, channels 4 & 5 only pulses once per frame however, the two pulse plus the stop/end pulse shifts to the left. With the 9X RX, this then becomes the Roll and Throttle Channels.

Video is coming.

crashlander
Posts: 506
Joined: Thu May 05, 2011 8:13 am
Location: Slovenia

Re: Failsafe and Sum-PPM

Post by crashlander »

Slightly off-topic question.
Would it be hard to implement failsafe routine also for RCSERIAL?

Basically we should be looking for timely arrival of MSP_SET_RAW_RC frames and if those are missing for short period (eg. 1 second) MWII should activate failsafe.

Regards
Andrej

copterrichie
Posts: 2261
Joined: Sat Feb 19, 2011 8:30 pm

Re: Failsafe and Sum-PPM

Post by copterrichie »

crashlander wrote:Slightly off-topic question.
Would it be hard to implement failsafe routine also for RCSERIAL?

Basically we should be looking for timely arrival of MSP_SET_RAW_RC frames and if those are missing for short period (eg. 1 second) MWII should activate failsafe.

Regards
Andrej


Good Point because I also hope to implement a serial control link one day.


As promised, here is the video of my findings. In no way am I stating there is a problem with other systems, just what I have observed with the gear that I have. I just do not have the funds to purchase new gear right now, so for the time being, this will have to do or I can spend my days watching TV. Just do not like TV for this is my options. :)

http://youtu.be/I6lVYA7z9NE

While attempting to use a Turnigy 9X Receiver in conjunction with a Servo to PPM encoder, a few problems was noticed in the way the RX handles signal lost. I do not know if other 9X receivers has this same behavior, so I figured it would be best to document my findings and maybe others will come forward.

Mis
Posts: 203
Joined: Fri Apr 01, 2011 12:23 am

Re: Failsafe and Sum-PPM

Post by Mis »

If you can setup failsafe in your RX - program throttle chanel to 980us and memorize this setting in receiver as failsafe.
In this case MWC recognize 980us on throttle as failsafe and start internal failsafe function.

doughboy
Posts: 252
Joined: Tue Sep 04, 2012 7:20 am

Failsafe and Sum-PPM

Post by doughboy »

Your video and your description is all right. The change in failsafe code is in _shared. I don't know if it is in official release version, but apparently it is not. There was a thread that resulted in the change to check for signal on all 4 sticks channels and this is one of the reason for the fix.

Fwiw, the pulse on the oscilloscope will shift because that is the trigger point of the signal, hence it displays the triggering pulse (with the rising edge) on the left margin. And yes, multiwii will take that as channel 1 as well, but as I said before, it is irrelevant because not all 4 sticks pulses are present.

It looks like everything is good now.

copterrichie
Posts: 2261
Joined: Sat Feb 19, 2011 8:30 pm

Re: Failsafe and Sum-PPM

Post by copterrichie »

Awesome and Thank you, Thank you and another Thank you!!!

fpv_downunder
Posts: 23
Joined: Tue Jan 08, 2013 10:05 am

Re: Failsafe and Sum-PPM

Post by fpv_downunder »

Hi guys,

I thought it would add to this thread rather than make a new one. I recently switched to frsky setup on my 9x and am using cppm on my aio pro board. All working OK except that I cannot get the multiwii failsafe to trigger. I am running r1539 and my code is here:

/******** Failsafe settings ********************/

#define FAILSAFE // uncomment to activate the failsafe function
#define FAILSAFE_DELAY 10 // Guard time for failsafe activation after signal lost. 1 step = 0.1sec - 1sec in example
#define FAILSAFE_OFF_DELAY 80 // Time for Landing before motors stop in 0.1sec. 1 step = 0.1sec - 20sec in example
#define FAILSAFE_THROTTLE (MINTHROTTLE + 400) // (*) Throttle level used for landing - may be relative to MINTHROTTLE - as in this case


I have confirmed there is no failsafe configured in my tx/rx. I am not keen to fly till I have a working failsafe..... :lol:

e_lm_70
Posts: 297
Joined: Fri Aug 09, 2013 8:35 pm

Re: Failsafe and Sum-PPM

Post by e_lm_70 »

People forget fail-safe is already in the rx

On FrSky, you have 3 fail save cases:

The rx keep the last know signal (valid for all 8 ch)
The rx change the signal to a configured fail safe signal (again all 8 ch involved)
The rx mute the cppm out, so no more signal send (this is the configuration that you may want to use for activate the failsafe on multiwii)

Post Reply