Safety alarm!!!Copter want to take off immediately after arm

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

Safety alarm!!!Copter want to take off immediately after arm

Post by fryefryefrye »

For FPV in altitude hold mode, I set MWC like this:

//#define ALTHOLD_FAST_THROTTLE_CHANGE (disabled)

=========================

Today, copter is flying with altitude hold, then it crash on to thick grass. So I disarm immediately after crash

When I found that the copter have no damage, I just put it into ground and arm it.

But the motor start running fast after arm, and copter turn over and damage a propeller.

I think it because the altitude hold is on when arm.

Also in the air, the motor will not stop in MINTHROTTLE.
=========================

The motor should stop when the MINTHROTTLE is set.

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

Re: Safety alarm!!!Copter want to take off immediately after

Post by fryefryefrye »

My own solution is :

Code: Select all

if (conf.activate[BOXARM] == 0 && rcSticks == THR_LO + YAW_HI + PIT_CE + ROL_CE && f.BARO_MODE == 0) go_arm();


Do not allowed arm when BARO_MODE is on.

-ralf-
Posts: 215
Joined: Mon Dec 03, 2012 7:08 pm

Re: Safety alarm!!!Copter want to take off immediately after

Post by -ralf- »

fryefryefrye wrote:My own solution is :

Code: Select all

if (conf.activate[BOXARM] == 0 && rcSticks == THR_LO + YAW_HI + PIT_CE + ROL_CE && f.BARO_MODE == 0) go_arm();


Do not allowed arm when BARO_MODE is on.


Maybe this will work for all activation options (Roll, Yaw, Box) ?

Line 705

Code: Select all

    if(!f.ARMED && f.BARO_MODE == 0) { // arm now!
      f.ARMED = 1;

-ralf-
Posts: 215
Joined: Mon Dec 03, 2012 7:08 pm

Re: Safety alarm!!!Copter want to take off immediately after

Post by -ralf- »

Just tested .... with

if(!f.ARMED && f.BARO_MODE == 0) { // arm now!
f.ARMED = 1;


the copter only arms when baro is off (using Crius AIOP). I don't know what my code-snippet will do
with boards that have no baro. So use with care.

Alexinparis
Posts: 1630
Joined: Wed Jan 19, 2011 9:07 pm

Re: Safety alarm!!!Copter want to take off immediately after

Post by Alexinparis »

Hi,

And just included in dev ;)
It's effectively something that shouldn't happen as baro is supposed to be activated only in flight.

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

Re: Safety alarm!!!Copter want to take off immediately after

Post by fryefryefrye »

-ralf- wrote:
Maybe this will work for all activation options (Roll, Yaw, Box) ?

Line 705

Code: Select all

    if(!f.ARMED && f.BARO_MODE == 0) { // arm now!
      f.ARMED = 1;


Your solution is better.

Can any one add this fix into Google Code ?

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

Re: Safety alarm!!!Copter want to take off immediately after

Post by fryefryefrye »

Alexinparis wrote:Hi,

And just included in dev ;)
It's effectively something that shouldn't happen as baro is supposed to be activated only in flight.


Thanks, my broken propeller worth it value.

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

Re: Safety alarm!!!Copter want to take off immediately after

Post by jevermeister »

Hi,

I don't know if this problem has been adressed befor:

the same goes to the compasshold function.
If the mag mode is enabled in 2.2 the copter tries to turn into that direction as soon as you throttle high enough to let the governor to kick in.


it this intended?

headfree mode is reset correctly btw

Code: Select all

 if(!f.ARMED) { // arm now!
      f.ARMED = 1;
      headFreeModeHold = heading;


hmm...

Nils

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

Re: Safety alarm!!!Copter want to take off immediately after

Post by Hamburger »

same thing as jevermeister describes happens when carrying copter around unarmed with mag activated - yaw tries to force copter orientation back to power-up orientation. On a tri this will easily drive the yaw prop into the ground once you arm. Countermeasure: twiggle yaw stick half way left and right before arming, this will reset the copter's memory of yaw orientation.

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

AW: Safety alarm!!!Copter want to take off immediately after

Post by jevermeister »

Thats what I tried to say. ;-)
I think it is an easy fix if this behavior is not intended. Maybe there is a situation in which this is needed.

Btw I think the failsafe that prevents the copter to arm if it is tilted to kuch should be optional or at least only if acc mode is on. I like to start the copter out of my hand. Perhaps a define DONOTARMIFTILTED that is default on?

Nils

-ralf-
Posts: 215
Joined: Mon Dec 03, 2012 7:08 pm

Re: Safety alarm!!!Copter want to take off immediately after

Post by -ralf- »

Line 705

Code: Select all

    if(!f.ARMED && !f.BARO_MODE && !f.MAG_MODE) { // arm now!
      f.ARMED = 1;


Better?

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

AW: Safety alarm!!!Copter want to take off immediately after

Post by jevermeister »

No, i have mag and acc on same aux. This will prevent me from starting in stable Mode maybe a reset of the headibg would be enough.

-ralf-
Posts: 215
Joined: Mon Dec 03, 2012 7:08 pm

Re: AW: Safety alarm!!!Copter want to take off immediately a

Post by -ralf- »

jevermeister wrote:No, i have mag and acc on same aux. This will prevent me from starting in stable Mode maybe a reset of the headibg would be enough.

You can activate whatever you want after arming .... and before takeoff

BTW: 4 Bytes more :mrgreen:

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

AW: Safety alarm!!!Copter want to take off immediately after

Post by jevermeister »

I know just wanted to point out a problem. A lot of people would spam the boards and ask why their copter does not fly. An there will by a lot of RTFM answers. ;-). I met a lot of people that fly "superstable" all the time. They have mag baro and acc always enabled and not bound to an aux channel. I am pretty sure this will lead to serious trouble.


Just sayin...

-ralf-
Posts: 215
Joined: Mon Dec 03, 2012 7:08 pm

Re: Safety alarm!!!Copter want to take off immediately after

Post by -ralf- »

BARO_ON may result in unwanted takeoff at arm,
MAG_ON may result in damaged props at arm;

we are talking about security at arm ......

-ralf-
Posts: 215
Joined: Mon Dec 03, 2012 7:08 pm

Re: AW: Safety alarm!!!Copter want to take off immediately a

Post by -ralf- »

jevermeister wrote:I know just wanted to point out a problem. A lot of people would spam the boards and ask why their copter does not fly. An there will by a lot of RTFM answers. ;-). I met a lot of people that fly "superstable" all the time. They have mag baro and acc always enabled and not bound to an aux channel. I am pretty sure this will lead to serious trouble.
Just sayin...


Maybe this can solve the problem ....
(only compiled with AIOP, not yet tested)

Code: Select all

    if(!f.ARMED && !f.BARO_MODE) { // arm now!
      f.ARMED = 1;
      headFreeModeHold = att.heading;
      #if MAG
        magHold = att.heading;
      #endif

Alexinparis
Posts: 1630
Joined: Wed Jan 19, 2011 9:07 pm

Re: AW: Safety alarm!!!Copter want to take off immediately a

Post by Alexinparis »

-ralf- wrote:Maybe this can solve the problem ....
(only compiled with AIOP, not yet tested)

Code: Select all

    if(!f.ARMED && !f.BARO_MODE) { // arm now!
      f.ARMED = 1;
      headFreeModeHold = att.heading;
      #if MAG
        magHold = att.heading;
      #endif


ok, I think it's fine like this.
just corrected in r1553

User avatar
JoVo
Posts: 3
Joined: Sun Oct 14, 2012 11:13 am

Re: Safety alarm!!!Copter want to take off immediately after

Post by JoVo »

Alexinparis wrote:
-ralf- wrote:Maybe this can solve the problem ....
(only compiled with AIOP, not yet tested)

Code: Select all

    if(!f.ARMED && !f.BARO_MODE) { // arm now!
      f.ARMED = 1;
      headFreeModeHold = att.heading;
      #if MAG
        magHold = att.heading;
      #endif


ok, I think it's fine like this.
just corrected in r1553


nop, in 1555 it doesn't work well - AIOP v1!!
- BARO_ON may result in unwanted takeoff at arm, -
Motors spin up .....

JoVo

User avatar
AlouetteIII
Posts: 27
Joined: Tue Jan 25, 2011 2:34 pm
Location: AU Australia
Contact:

Re: Safety alarm!!!Copter want to take off immediately after

Post by AlouetteIII »

MultiWii is already considered/rumoured to be "too complex" and too hard by noobs/photographers thinking about which autopilot system to use. We get a huge number of people who cannot arm already. Its a great idea to have this such extra DEFEAT code available to turn on / comment in - if you want it. It should be comment out by default.

.... Nothing will stop people who dont/wont read safety warnings from operating equipment they don't understand - if they dont know what mode they are in or wont test your craft with Props-off first; they are not ready or responsible enough to be a pilot. An aircraft is never going to be a toaster consumer device - we got people who won't read phantom instructions either and cannot arm a phantom or a naza - so i make this comment from direct daily experience - MultiWii is loosing ground because its too complex - and still has poor PHold.

Please take AlexinParis's request/suggestion and if you're a coder and really want to help multiWii - then transfer the recent APM3.0.1 PHold advances over to MultiWii. Same goes for BARO mode - better integration to the Z axiz (like naza) would mean it does not matter what mode you have it in before take off. Same goes for MAG - the MAG position should only be recorded after props first spin up - not arm alone.

User avatar
JoVo
Posts: 3
Joined: Sun Oct 14, 2012 11:13 am

Re: Safety alarm!!!Copter want to take off immediately after

Post by JoVo »

I've testet and up r1554 I have the trouble that, after I arm and then switch the BARO_MODE to on the motors spin up!
and I can not override with throttlestick anymore.
If I make a diff between r1553 and r1554 I can see that a lot of code from MultiWii.cpp was removed.
Now, it seems that we have no or wrong info about throttle stick position when we switch to BARO_MODE.
In my opion it makes no sense if throttleosition <= MINTHROTTLE that ALT_HOLD will work.

JoVo

User avatar
linuxslate
Posts: 91
Joined: Mon May 13, 2013 3:55 pm

Re: Safety alarm!!!Copter want to take off immediately after

Post by linuxslate »

I added

Code: Select all

&& !f.BARO_MODE


To my 2.2, and have been flying for several weekends.
I confirmed that it will not arm in GPS_HOLD or GPS_HOME (my only uses of baro)

My Quad still arms/flies/HOLDs/RTHs fine, and I still have a face, 2 eyeballs, and 10 fingers. ;)

User avatar
skypup
Posts: 7
Joined: Mon Sep 01, 2014 3:15 pm

Re: Safety alarm!!!Copter want to take off immediately after

Post by skypup »

I try to take off in the BARO mode, and I have a new classmate help test, his first flight can

complete the takeoff and landing relaxed.

Modified a few code.

1st, MWC.cpp
ORIGINAL:
if(!f.ARMED && !f.BARO_MODE) { // arm now!


CHANGED TO:
#if defined(ALT_HOLD_THROTTLE_MIDPOINT)
if(!f.ARMED) { // arm now!
#else
if(!f.ARMED && !f.BARO_MODE) { // arm now!
#endif


2nd, after "f.ARMED = 1;" in go_arm function.
ADD:
#if BARO
AltHold = alt.EstAlt;
errorAltitudeI = 0;
BaroPID = 0;
#endif


3rd, config.h
ADD:
#define ALT_HOLD_SPEED_RATE 4 // (ALT_HOLD_SPEED / 8)


4th: after "AltHoldCorr+= rcCommand[THROTTLE] - initialThrottleHold;" in file MWC.cpp
ADD:
#if defined(ALT_HOLD_THROTTLE_MIDPOINT)
AltHoldCorr *= 8;
AltHoldCorr /= ALT_HOLD_SPEED_RATE;
#endif


5th: set ALTITUDE P value to 100 or another large numerical.

Post Reply