Fence Action Changed in Loiter mode

Current firmware using is AC4.3.7

Fence enabled
Fence_max_alt = 52
Fence_radius = 2002
Fence_margin = 2
Fence _Action = 1 ( RTL or Land)

Aa per above parameter setting i have tried in loiter mode altitude increase to 50m and above it went above 50m altitude amd triggered RTL. similarly for max range also went above 2000 m and triggered RTL.

But i remember that in manual mode previous firmwares it will not cross the limit and stops before 2 meter as fence parameters configured.

Auto flight mode only trigger RTL in old firmware if fence breached.

But in this latest firmware loiter mode also gets breached instead of stop before the configured fence parameters.
Your thoughts @rmackay9 @xfacta

Sounds liek you might have had “Brake or Land” set.
As far as I can see the fence actions havent changed in a long time, nor have the defaults. In 2019 SmartRTL and Brake were added. There’s been some code clean-up and some minor fixes and clarifications, but no changes of action or methodology.
Rover can do Hold.

Here is the same topic has been tested

Here he was tried increase the altitude by increasing the RC3 channel but due to fence enabled and fence action set to 1 its not climbing beyond the fence_alt_max height.
But in my case it doing RTL instead of hold.

Even i too tested this function in previous old firmwares it was not like what now happening!

Best if you can supply a .bin log

here the log file

Checking your log, and I see you were in Loiter…
And what you are saying is correct according to the documentation

So far the only difference to older firmware is the addition of Polygon as one of the defaults in Fence Type

image

I’ll let you know what I come up with.

1 Like

Are you going to test it real time or via SITL?

@xfacta any solution on this problem you find?

@rmackay9 your suggestion please?

I was just testing this in SITL (stable) with these settings:

FENCE_ENABLE,1
FENCE_ACTION,1
FENCE_ALT_MAX,50
FENCE_ALT_MIN,-10
FENCE_MARGIN,2
FENCE_RADIUS,150
FENCE_TOTAL,0
FENCE_TYPE,7

In Loiter mode I could NOT make it do an RTL or breach just by pushing against the fence radius or altitude. I just could not exceed the fence boundary.

In AltHold mode I could breach the fence radius which caused RTL, but could NOT breach Altitude.

In Stabilise mode I could breach altitude and radius, which initiated RTL in each case.

That is the behaviour I’ve experienced in the physical world when testing RTL and Fences.

Thank you for your time @xfacta randy have helped me in this but not yet tested in real time.

I was missed this parameter

Avoid_Enable = 3 ( was missed use fence)

I just checked a stay-out fence and OA too.
I used OA_TYPE,2 and OA_TYPE,3
and in Loiter mode I could not enter the zone, the copter tried to slide along the side.
I had previously made corridors with altitudes too, and from memory that all worked as planned too.