[PATCH] Disable HORIZON mode if ANGLE is active

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
Tommie
Posts: 438
Joined: Sun Apr 08, 2012 9:50 am

[PATCH] Disable HORIZON mode if ANGLE is active

Post by Tommie »

While playing around with HORIZON and HEADFREE mode, I noticed that combining HEADFREE/HORIZON as well as HORIZON/ANGLE/HEADFREE can wreak havoc; I therefore added this patch to make the stricter ANGLE mode supersede the less rigid HORIZON mode.

https://github.com/wertarbyte/multiwii- ... 52962f736f

Please merge.

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

Re: [PATCH] Disable HORIZON mode if ANGLE is active

Post by shikra »

I agree...

I mentioned this before - if in horizon mode on one switch and trigger RTH on another - is better to be in angle/level

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

Re: [PATCH] Disable HORIZON mode if ANGLE is active

Post by copterrichie »

Personally, I have not used the Headfree or the Horizon modes but I like this idea. RTH should be the Highest on the agenda if not Failsafe.

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

Re: [PATCH] Disable HORIZON mode if ANGLE is active

Post by Alexinparis »

There was a problem before r1143 with both activation of ANGLE and HORIZON.
it was corrected but in the other way: HORIZON mode supersedes the ANGLE mode

Tommie
Posts: 438
Joined: Sun Apr 08, 2012 9:50 am

Re: [PATCH] Disable HORIZON mode if ANGLE is active

Post by Tommie »

I am using a switch to change between three states: HORIZON, ANGLE, ANGLE+MAG.
Another switch enables HEADFREE mode. Engaging HEADFREE mode while in HORIZON wreaks havoc. So I made the switch enable ANGLE mode as well, but this has to disable HORIZON mode as well (since all switch positions are ORd).

I'm not sure what distinguishes HORIZON and ANGLE modes actually, since there is actually no documentation anywhere, but I'd assume that the stricter ANGLE mode should supersede the less rigid HORIZON one.

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

Re: [PATCH] Disable HORIZON mode if ANGLE is active

Post by Hamburger »

Alexinparis wrote:it was corrected but in the other way: HORIZON mode supersedes the ANGLE mode

I use 2 separate switches to activate either one. I prefer the current superseding over the inverted alternative.

Tommie
Posts: 438
Joined: Sun Apr 08, 2012 9:50 am

Re: [PATCH] Disable HORIZON mode if ANGLE is active

Post by Tommie »

Hamburger wrote:
Alexinparis wrote:it was corrected but in the other way: HORIZON mode supersedes the ANGLE mode

I use 2 separate switches to activate either one. I prefer the current superseding over the inverted alternative.

Can you explain why? I'd argue that the conservative approach of using ANGLE instead of HORIZON is the right way to go.

HORIZON mode can (and will) crash your copter in certain situations where ANGLE does not. So ANGLE should be preferred.

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

Re: [PATCH] Disable HORIZON mode if ANGLE is active

Post by Hamburger »

When acc assisted flight is desired it acts as safety net.
So start in aNgle mode - gives full support.
Become adventurous switch over to horizon by also activating horizon - goes into semi supportive horizon
Get into trouble - disable horizon - automatically back in angle mode.

For failsafe I want it to uze anvle regardless of last inputs.

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

Re: [PATCH] Disable HORIZON mode if ANGLE is active

Post by Sebbi »

Isn't that also possible when ANGLE has higher priority than HORIZON? Start in ANGLE mode (with HORIZON active too), switch off ANGLE and be adventurous. Get in trouble switch back to ANGLE.

When Failsafe needs to be ANGLE mode and HORIZON does supersede ANGLE, than Failsafe needs to turn off HORIZON, right?

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

Re: [PATCH] Disable HORIZON mode if ANGLE is active

Post by copterrichie »

ANGLE in my opinion should have the highest priority and supersedes everything else when activated, but I guess that does not compute.

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

Re: [PATCH] Disable HORIZON mode if ANGLE is active

Post by Hamburger »

Sebbi wrote:Isn't that also possible when ANGLE has higher priority than HORIZON?

May be possible. It was not what was asked. So there really is no reason to debate further if everones desired result can be achieved regardless of precedence.
A d faisafe requires an explicit setting of angle mode independa t of current settings and precedence.

Tommie
Posts: 438
Joined: Sun Apr 08, 2012 9:50 am

Re: [PATCH] Disable HORIZON mode if ANGLE is active

Post by Tommie »

Hamburger wrote:So there really is no reason to debate further if everones desired result can be achieved regardless of precedence.

Which is clearly not the case. If you have a switch that enables HEADFREE, that same switch has to disenage HORIZON mode if it has a higher priority.

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

Re: [PATCH] Disable HORIZON mode if ANGLE is active

Post by crashlander »

Hello!
@Tommie:
What do you exactly meant by "havoc"?
- uncontrollable behavior of copter (SW crash) or
- behavior that is unexpected by user (that expects instant and hard recovery of angle mode)

Regards
Andrej

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

Re: [PATCH] Disable HORIZON mode if ANGLE is active

Post by Alexinparis »

When sticks are centered, HORIZON mode = ANGLE mode.
I don't consider ANGLE mode to be safer than HORIZON mode.
If you release the sticks, it's the same,
and if the sticks are out of control, a crash is expected in both cases.

HORIZON mode can be used with headfree / GPS / or even failsafe.
Is there a technical reason for superseding HORIZON by ANGLE ?

Anyway, I think it's a bad practice to active both HORIZON and ANGLE mode at the same time.

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

Re: [PATCH] Disable HORIZON mode if ANGLE is active

Post by copterrichie »

I guess I should look myself but when in HORIZON mode and there is a RX signal failure, will the MWC return the stick position to center?

Tommie
Posts: 438
Joined: Sun Apr 08, 2012 9:50 am

Re: [PATCH] Disable HORIZON mode if ANGLE is active

Post by Tommie »

crashlander wrote:Hello!
@Tommie:
What do you exactly meant by "havoc"?
- uncontrollable behavior of copter (SW crash) or
- behavior that is unexpected by user (that expects instant and hard recovery of angle mode)

Copter flipped on its head and crashed with HORIZON + HEADFREE, probably because the MAG could not handle the angle made possible by HORIZON mode.

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

Re: [PATCH] Disable HORIZON mode if ANGLE is active

Post by shikra »

Mine flipped too when in horizon and I activated GPS hold. I believe it was due to the bug Alex corrected rather than horizon mode. It should make no difference. Having looked at code I think it is fine either way. Actually I've probably changed my mind in that I would prefer Horizon over level.......

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

Re: [PATCH] Disable HORIZON mode if ANGLE is active

Post by vpb »

I like horizon mode, easy to fly than level mode, and without any stick input, it's really level/angle mode. But is the horizon mode stable now? My Y6 crashed 2 times today for no reason, r1177 new alt-holding + horizon. I've flied horizon mode without any problem for more than 10 packs before. It was too weird, one or two motors become crazy then I lose control.

User avatar
diyboy
Posts: 28
Joined: Sun Sep 30, 2012 7:12 pm

Re: [PATCH] Disable HORIZON mode if ANGLE is active

Post by diyboy »

vpb wrote:I like horizon mode, easy to fly than level mode, and without any stick input, it's really level/angle mode. But is the horizon mode stable now? My Y6 crashed 2 times today for no reason, r1177 new alt-holding + horizon. I've flied horizon mode without any problem for more than 10 packs before. It was too weird, one or two motors become crazy then I lose control.



My X4 crashed least week, also one or two motors become crazy.
r1177 alt-holding + horizon.

DIY Boy

Post Reply