Failsafe auto leveling.

Post Reply
Chaosdestro0
Posts: 13
Joined: Wed Mar 21, 2012 9:37 pm

Failsafe auto leveling.

Post by Chaosdestro0 »

I think this would be a sensible idea, a lot of people fly in acro mode even if they have an accelerometer. To have the option of auto leveling when failsafe kicks in would be sensible as it will stop moving horizontally and make sure it lands flat.

Sebbi
Posts: 478
Joined: Sun Jul 08, 2012 1:08 am
Location: Germany
Contact:

Re: Failsafe auto leveling.

Post by Sebbi »

Code: Select all

    // note: if FAILSAFE is disable, failsafeCnt > 5*FAILSAVE_DELAY is always false
    if (( rcOptions[BOXACC] || (failsafeCnt > 5*FAILSAVE_DELAY) ) && ACC ) {
      // bumpless transfer to Level mode
      if (!f.ACC_MODE) {
        errorAngleI[ROLL] = 0; errorAngleI[PITCH] = 0;
        f.ACC_MODE = 1;
      } 
    } else {
      // failsafe support
      f.ACC_MODE = 0;
    }


That is already the case ... failsafe activates level mode if accelerometer is present.

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

Re: Failsafe auto leveling.

Post by copterrichie »

Please note: The Failsafe will only work if the RX used stop outputting a signal to the FC when the the signal from the TX is lost.

LenzGr
Posts: 166
Joined: Wed Nov 23, 2011 10:50 am
Location: Hamburg, Germany
Contact:

Re: Failsafe auto leveling.

Post by LenzGr »

copterrichie wrote:Please note: The Failsafe will only work if the RX used stop outputting a signal to the FC when the the signal from the TX is lost.

Does that also apply when using the Spektrum Satellite Receiver? I haven't tried in in flight yet, but my last bench tests showed rather erratic behavour when I switched off my TX while the motors where running.

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

Re: Failsafe auto leveling.

Post by copterrichie »

LenzGr wrote:
copterrichie wrote:Please note: The Failsafe will only work if the RX used stop outputting a signal to the FC when the the signal from the TX is lost.

Does that also apply when using the Spektrum Satellite Receiver? I haven't tried in in flight yet, but my last bench tests showed rather erratic behavour when I switched off my TX while the motors where running.


I wish I could answer this but I don't own a Spektrum system. However sorting through the code, it should work. This code segment is from version 2.0.

Code: Select all

#if defined(SPEKTRUM)
  ISR(SPEK_SERIAL_VECT) {
    uint32_t spekTime;
    static uint32_t spekTimeLast, spekTimeInterval;
    static uint8_t  spekFramePosition;
    spekTime=micros();
    spekTimeInterval = spekTime - spekTimeLast;
    spekTimeLast = spekTime;
    if (spekTimeInterval > 5000) spekFramePosition = 0;
    spekFrame[spekFramePosition] = SPEK_DATA_REG;
    if (spekFramePosition == SPEK_FRAME_SIZE - 1) {
      rcFrameComplete = 1;
      #if defined(FAILSAFE)
        if(failsafeCnt > 20) failsafeCnt -= 20; else failsafeCnt = 0;   // clear FailSafe counter
      #endif
    } else {
      spekFramePosition++;
    }
  }
#endif

User avatar
jevermeister
Posts: 708
Joined: Wed Jul 20, 2011 8:56 am
Contact:

Re: Failsafe auto leveling.

Post by jevermeister »

You say, you fly an object with 3 to 8 spinning sharp blades and do not know what it is doing if , lets say, the batteries of your tx are dead!?
Sorry for saying this, but this is irresponsible...

The behavior of failsafe is always the FIRST thing I check after including a new RX or a new software.
This should be standard operation procedure for every pilot.

My failsafe levels the copter holds position for 5 seconds and lets it crash, I never fly over people or water, so I know that where it crashes it won't hurt anybody.

Guys: These things are no toys...

Nils

Tifani
Posts: 63
Joined: Sun Nov 06, 2011 5:15 pm

Re: Failsafe auto leveling.

Post by Tifani »

Hi !
I tested FailSafe with Spectrum AR6200, AR6110 & HK OrangeRX R610.
After TX off Throttle graph in WinGui drop to 910 and motors drop to MINTHROTTLE value (1120 for SS ESC).
If Yaw stick is hold left during TX power of FC will disarm after little time - this indicate than RX is sending some signal.
I tested all RX's with logic analyzer, all of them send only THROTTLE signal when TX is OFF other lines are flat.

Looks like I can't use FailSafe with Spectrum radios - is this true ???
Can FailSafe procedure check other than throttle channel to be activated ???
Thanks
Tom

User avatar
Hamburger
Posts: 2578
Joined: Tue Mar 01, 2011 2:14 pm
Location: air
Contact:

Re: Failsafe auto leveling.

Post by Hamburger »

Tifani wrote:Looks like I can't use FailSafe with Spectrum radios - is this true ???
Can FailSafe procedure check other than throttle channel to be activated ???

interesting. failsafe currently uses THROTTLE_PIN for testing; will be fun to test against other pin.

User avatar
jevermeister
Posts: 708
Joined: Wed Jul 20, 2011 8:56 am
Contact:

Re: Failsafe auto leveling.

Post by jevermeister »

there are different approaches to test the signal valid status: stick values between boundaries

ppm pulse time valid

heartbeat etc

I tested some receivers and sum signal generators and there are quite some differences.If you have a scope, see what your rx is doing and implement it.
One more option would be a lack of change in the signals but this is quite dangerous if you use gps rth or ph.

just an option though.

nils

User avatar
Hamburger
Posts: 2578
Joined: Tue Mar 01, 2011 2:14 pm
Location: air
Contact:

Re: Failsafe auto leveling.

Post by Hamburger »

Spektrum is known for doing its failsafe on the throttle output. Now if we could get MWii detect a rx failsafe state by monitoring yaw pin instead of throttle pin in rx.ino, then that could greatly enhance the usefulness of current failsafe implementation without further changes required.

User avatar
Th0rsten
Posts: 65
Joined: Mon Oct 31, 2011 10:28 am

Re: Failsafe auto leveling.

Post by Th0rsten »

Hi

I will test (on the weekend) how an Orange Spektrum RX will behave on signal lost - e.g. turn the TX off.
If there is no signal on a pin but Throttle I will write a patch for RX.ino.
My idea is to select an rcChannel in config.h which triggers the failsave.
Shouldn't be that complicated.

Greetings
Thorsten
Last edited by Th0rsten on Sat Jul 21, 2012 9:11 am, edited 1 time in total.

User avatar
Th0rsten
Posts: 65
Joined: Mon Oct 31, 2011 10:28 am

Re: Failsafe auto leveling.

Post by Th0rsten »

Ok, I can confirm that the Orange Spektrum RX switches to sending 1000ns on throttle if the TX is switched off.
All other channels are flat on my DSO.

Option to select a failsavepin is in r998. :)

Please check. It's working fine in the GUI.
Last edited by Th0rsten on Sat Jul 21, 2012 5:27 pm, edited 1 time in total.

User avatar
Hamburger
Posts: 2578
Joined: Tue Mar 01, 2011 2:14 pm
Location: air
Contact:

Re: Failsafe auto leveling.

Post by Hamburger »

comitted a simplification to all that case handling and duplicate code fragments.
Please check. It's working fine with Speltrum and ROLLPIN.
Besides - cannot we change the default pin for failsafe checking from throttlepin to rollpin or yawpin?

User avatar
Th0rsten
Posts: 65
Joined: Mon Oct 31, 2011 10:28 am

Re: Failsafe auto leveling.

Post by Th0rsten »

Hi Hamburger

Yes, it's working and the code looks nicer. :)
IMHO is moving the default to ROLLPIN a good idea.

Grüsse aus der Schweiz.
Thorsten

User avatar
Th0rsten
Posts: 65
Joined: Mon Oct 31, 2011 10:28 am

Re: Failsafe auto leveling.

Post by Th0rsten »

Tested failsave in the field.

Works great except the default throttle value of 1450 was a bit to high - it started gaining height instead of landing.
So i switched the TX back on and got back control to land it.

I think, we should lower the default FAILSAVE_THROTTLE to 1300 (or even lower).

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

Re: Failsafe auto leveling.

Post by copterrichie »

Th0rsten wrote:Tested failsave in the field.

Works great except the default throttle value of 1450 was a bit to high - it started gaining height instead of landing.
So i switched the TX back on and got back control to land it.

I think, we should lower the default FAILSAVE_THROTTLE to 1300 (or even lower).


I agree however this would greatly depend on the individual copter. What is needed is some automatic means of determining the right value to descend quickly but safely.

Sebbi
Posts: 478
Joined: Sun Jul 08, 2012 1:08 am
Location: Germany
Contact:

Re: Failsafe auto leveling.

Post by Sebbi »

Since failsafe auto leveling depends on an accelerometer to be present, MultiWii could use the z-axis measurement to either land with a constant downward acceleration or integrate that value over time to descent with a constant velocity ... ideally using baro and/or sonar, if present ;-)

ajazz76
Posts: 2
Joined: Wed Aug 01, 2012 5:41 pm

Re: Failsafe auto leveling.

Post by ajazz76 »

Hi guys, I just new here but I following your discussion on this matter. I built my quad y4 and using mwii std se, I used HobbyKing AR6110B rx and using the aux1 pin for the throttle to my mwii std se. This evening I test and monitored using GUI and result success.The aux1 pin is not failsafe and it armed the failsafe on multiwii std se. May be, this info can share together. :D :D

frogstarb
Posts: 59
Joined: Wed Jul 25, 2012 10:52 pm

Re: Failsafe auto leveling.

Post by frogstarb »

copterrichie wrote:I agree however this would greatly depend on the individual copter. What is needed is some automatic means of determining the right value to descend quickly but safely.


Not exactly automatic but http://www.multiwii.com/forum/viewtopic.php?f=7&t=2183

Post Reply