The receiver with lost control setting & RTH with altitude

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
fryefryefrye
Posts: 57
Joined: Thu Apr 11, 2013 7:19 am

The receiver with lost control setting & RTH with altitude

Post by fryefryefrye »

My receiver on quart has lost control setting. So the FAILSAFE in MWC will never be active unless there is wire broken on the copter.

To let the copter come back to home position when lost control single, I set receiver give out a AUX single to active RTH and Baro. PITCH, ROLL and YAW are centered and THROTTLE are keep hold.

The copter will go home at current altitude when out of control range.

But the problem is: if copter lost control when climbing, the copter will continue climbing until out of power.

My suggestion is add a define called “KEEP_ALTITUDE_RTH”, when this is truned on, do not change the Baro altitude when GPS_HOME is on. Code will be like this:

Code: Select all

        if ((abs(rcCommand[THROTTLE]-initialThrottleHold)>ALT_HOLD_THROTTLE_NEUTRAL_ZONE)&& !f.GPS_HOME_MODE ) {
          // Slowly increase/decrease AltHold proportional to stick movement ( +100 throttle gives ~ +50 cm in 1 second with cycle time about 3-4ms)
          AltHoldCorr+= rcCommand[THROTTLE] - initialThrottleHold;
          if(abs(AltHoldCorr) > 500) {
            AltHold += AltHoldCorr/500;
            AltHoldCorr %= 500;
          }


To get the RTH more safe, we can have two define:

Code: Select all

RTH_ALTITUDE
HOME_HOLD_ALTITUDE


When RTH is active , the baro altitude can be slowly increase/decrease to RTH_ALTITUDE.
When HOME is reached, the baro altitude can be slowly increase/decrease to HOME_HOLD_ALTITUDE.

I have tried to upload some code on google code, but I always got some problems. So, If I have these idears, can someone write the code into google code?

felixrising
Posts: 244
Joined: Sat Mar 23, 2013 12:34 am
Location: Australia

Re: The receiver with lost control setting & RTH with altitu

Post by felixrising »

Good idea.. already done: viewtopic.php?f=8&t=2965

Would you like to port the Altitude Hold/Advanced Failsafe solutions by NHA stuff to current multiwii_shared?

fryefryefrye
Posts: 57
Joined: Thu Apr 11, 2013 7:19 am

Re: The receiver with lost control setting & RTH with altitu

Post by fryefryefrye »

felixrising wrote:Good idea.. already done: viewtopic.php?f=8&t=2965

Would you like to port the Altitude Hold/Advanced Failsafe solutions by NHA stuff to current multiwii_shared?


As I have read the post, NHA have stoped working on MWC.

I do now know which function will be appear in MWC 2.3.

I will start to modify the code and test it on my copter. But I do not know how to update it to google code.

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

Re: The receiver with lost control setting & RTH with altitu

Post by Mis »

Instead your poor method, set the failsafe in receiver to 980us pulse on throttle channel (extern endpoint and subtrim for get 980us on throttle then save this value in receiver). Now the FC will be informed about signal lost, and internal MWC failsafe procedure should work.

fryefryefrye
Posts: 57
Joined: Thu Apr 11, 2013 7:19 am

Re: The receiver with lost control setting & RTH with altitu

Post by fryefryefrye »

Mis wrote:Instead your poor method, set the failsafe in receiver to 980us pulse on throttle channel (extern endpoint and subtrim for get 980us on throttle then save this value in receiver). Now the FC will be informed about signal lost, and internal MWC failsafe procedure should work.


As I know that internal MWC 2.2 failsafe can not RTH. Only landing at current position.

My method can let copter come back to home when lost control. with out any MOD.

1: If it's out of range, come back will let you get control again.
2: If there is something wrong with the controller, you can have time to fix. The wortest case is the copter will star over home until power off. You can clear the people on the ground, and got your copter's dead body.

fryefryefrye
Posts: 57
Joined: Thu Apr 11, 2013 7:19 am

Re: The receiver with lost control setting & RTH with altitu

Post by fryefryefrye »

felixrising wrote:Good idea.. already done: viewtopic.php?f=8&t=2965

Would you like to port the Altitude Hold/Advanced Failsafe solutions by NHA stuff to current multiwii_shared?


Have got NHA's mod with the functions I need. May be test it later.

User avatar
shikra
Posts: 783
Joined: Wed Mar 30, 2011 7:58 pm

Re: The receiver with lost control setting & RTH with altitu

Post by shikra »

Stock 2.2 can do RTH
I tested RTH from 650 meters last night. Worked fine on default BARO and GPS settings.

In failsafe I make sure GUI displays:
GPS HOME
LEVEL or
BARO
MAG
Throttle at 50%

I believe some are not needed, but activate all as can never remember



I liked NHA - think some bits should be included as option

fryefryefrye wrote:
Mis wrote:Instead your poor method, set the failsafe in receiver to 980us pulse on throttle channel (extern endpoint and subtrim for get 980us on throttle then save this value in receiver). Now the FC will be informed about signal lost, and internal MWC failsafe procedure should work.


As I know that internal MWC 2.2 failsafe can not RTH. Only landing at current position.

My method can let copter come back to home when lost control. with out any MOD.

1: If it's out of range, come back will let you get control again.
2: If there is something wrong with the controller, you can have time to fix. The wortest case is the copter will star over home until power off. You can clear the people on the ground, and got your copter's dead body.

fryefryefrye
Posts: 57
Joined: Thu Apr 11, 2013 7:19 am

Re: The receiver with lost control setting & RTH with altitu

Post by fryefryefrye »

shikra wrote:Stock 2.2 can do RTH
I tested RTH from 650 meters last night. Worked fine on default BARO and GPS settings.

In failsafe I make sure GUI displays:
GPS HOME
LEVEL or
BARO
MAG
Throttle at 50%



You have risk on Throttle setting. Why 50% ? How do you know every time, your hover throttle is same.

I think set it "Keep Original Value" is better.

User avatar
shikra
Posts: 783
Joined: Wed Mar 30, 2011 7:58 pm

Re: The receiver with lost control setting & RTH with altitu

Post by shikra »

Maybe BARO enabled keeps altitude correct ;)

Try it and see - or what MIS suggest (I have not tried that method yet)

With last known setting - what happens if throttle is at 25% or 75% when climbing/descending and loose link at that time? What is the difference?

I have tested RTH many times with switch and turning tx off - so far it has been 100% reliable. More so that the DJI Naza from what I read.


I only used for real once when flying and lost orientation at distance with sun in my eye. I was flying manual and fairly low so it probably saved me a crash.

Try it and see for yourself.

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

Re: The receiver with lost control setting & RTH with altitu

Post by scrat »

shikra wrote:Stock 2.2 can do RTH
I tested RTH from 650 meters last night. Worked fine on default BARO and GPS settings.

In failsafe I make sure GUI displays:
GPS HOME
LEVEL or
BARO
MAG
Throttle at 50%

I believe some are not needed, but activate all as can never remember



I liked NHA - think some bits should be included as option


@shikra:

how to set GPS_HOME when failsafe kicks in with stock MWii v2.2? Thanks.

fryefryefrye
Posts: 57
Joined: Thu Apr 11, 2013 7:19 am

Re: The receiver with lost control setting & RTH with altitu

Post by fryefryefrye »

shikra wrote:Maybe BARO enabled keeps altitude correct ;)

Try it and see - or what MIS suggest (I have not tried that method yet)

With last known setting - what happens if throttle is at 25% or 75% when climbing/descending and loose link at that time? What is the difference?

I have tested RTH many times with switch and turning tx off - so far it has been 100% reliable. More so that the DJI Naza from what I read.


I only used for real once when flying and lost orientation at distance with sun in my eye. I was flying manual and fairly low so it probably saved me a crash.

Try it and see for yourself.


Thank you for your share.

I’m just wondering “when climbing/descending and loose link”

After Baro is on, the throttle can not change, other wise, the copter will climbing or descending.

Your experience indicate when lose control, Your recover give the 50% throttle first to the MWC, then the AUX turn on the Baro. The throttle was keeping after baro is on, So you can keep attitude and go home.

But all these were happened in a short time. If my recover give AUX first and apply 50% throttle after. That was dangers. So change code make me satisfied

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

Re: The receiver with lost control setting & RTH with altitu

Post by scrat »

Hi guys...is this new method from fryefryefrye?

- use alt.EstAlt instead of BaroAlt

http://code.google.com/p/multiwii/source/detail?r=1567

fryefryefrye
Posts: 57
Joined: Thu Apr 11, 2013 7:19 am

Re: The receiver with lost control setting & RTH with altitu

Post by fryefryefrye »

scrat wrote:Hi guys...is this new method from fryefryefrye?

- use alt.EstAlt instead of BaroAlt

http://code.google.com/p/multiwii/source/detail?r=1567


No.

I think it from Alex.

Post Reply