Distorted circles in Loiter mode


why are my circles distorted in the Loiter mode? I’ve marked the non-ideal fragments with triangles.

The version used here is an ArduPlane 4.0.6, called BetaPlane as it is tailored by OlliW (the developer of the STorM32 gimbal) for generating extra information for the gimbal. But I hope the problem is not related to this issue, as otherwise the plane seems to fly fully normally. The plane is X-Clouds, flying rather fast.

log file

without being a pro log examiner, i’d say you get those kidney-shapes because you’re maxing out your LIM_ROLL_CD of 37° when asking for WP_LOITER_RAD = 40 at 22 m/s mean airspeed.

formula for turn radius vs airspeed vs bank angle is r = v**2 / g * tan φ

where r = turn radius [m], v = TAS [m/s], φ= turn radius [deg]

so banking 37° at ~22 m/s will result in a ~65 m turn radius.
hard to guess what actual windspeed you had on that flight, but i’d say your throttle demand is pretty generous at times, trying to keep altitude, while your pitch integrator is constantly negative, so adding down elevator. maybe check your level flight attitude / cruise speed, V-tail layout and trim pitch levels for room to optimize.

on a sidenote, you’ve got all arming checks disabled. it seems you haven’t performed any RC calibration (all RCn_ params on default) and you launched with what i’d call a marginal GPS fix.

If this is “not a pro” answer, I wonder how the one from a pro would look like :slight_smile: Many thanks for the great analysis. As the plane had a tendency to stalls (including accelerated stalls), I’ve done everything possible to have a wide safety margin. It seems to work, maybe the bigger radius of the turns is a price to pay. Good that it still flies circles, even if not ideal.

I’ll replace the GPS receiver with one upgraded for GLONASS. I’ll calibrate the RC channels. But I still have the following questions:

-what is the air speed maintained in the loiter mode, and the control over the thrust? I can’t find this in the docs.
-you suggest that my plane has a tendency for lifting the nose up, and the elevators need to counteract this. Does it apply only to the powered flight, or maybe it is for example due to the fact that I fly without the canopies/covers on the top, or it’s just the feature of this model. How can this be compensated?

not exactly, it’s just that in your loiter turns you’re likely speeding up too much, so your pitch loop adds down elevator constantly. mind there’s a single trim attitude for a given elevator trim and trim airspeed - change one of those and the others need to compensate.
i personally would suggest to optimize your pitch control loop by calibrating level trim with something like 2° nose up, check what throttle setting ýou need to apply in FBWA to maintain level flight at that attitude, set trim throttle respectively and then check what servo_auto_trim applies to your elevator on a longer straight leg in CRUISE (or FBWB). maybe also check your CG is ok.
on an airframe like the xuav clouds with a standard drivetrain i’d expect a trim throttle around 35% for level flight, rather than the 50% you’re using, but that vastly depends on your actual hardware setup obviously.
with a cruise speed of ~17 m/s you’ll achieve a 40 m turn radius on 37° bank angle. i’m quite positive this is well within the aerodynamic specs of your airframe.

and thanks for the kudos, someone more knowledgeable might come to different conclusions though…

I think I have enough thrust as the takeoffs are usually successful. I’ve set it up for safety margin, it flies faster than it could. Many thanks for your suggestions, need to go through it all. Auto-trim is tricky… the CG is as recommended, but the fact was that the plane was hardly controllable in manual mode, still ended up in stalls and spins and survived only because of flying over dense weeds. In FBWA mode at least it flies safely. I’ve seen similar reports in the internet. I’ve never had such problems with conventional planes (not V-tail)

I’ve added the arming checks to the airplane, configured RC channels but haven’t increased the loiter radius in order to better understand what causes those speed excursions. I’ve flown today, the loiter part with the throttle at 0. Fairly weak wind (maybe 2-3 m/s). Do I understand correctly the following sequence?

-the aircraft starts to turn and roll, the controller commands around 75% throttle
-the speed drops (why? because of the turn? it’s just 38 deg. Or because the controller throttles back in the next point? But the speed seems to decrease even before this.)
-at the downwind section the speed drops so much that the controller cancels the roll, and adds high throttle (why? because the FBWA envelope must be preserved?)
-new roll is commanded

The screenshot of the log display:

The circles are even more distorted. Now I see that should I fly with throttle at ~70%, it would look better. How to fly a constant-speed loiter? By flying pre-programmed loiter in AUTO, after adjusting some constand speed?

In FBWA, I’m able to fly much tighter circles with the speed below 20 m/s. Maybe it’s leaving the throttle at 0 which causes these oscillations? I’ll try with bigger radius and throttle at 60-70%.

The log: https://drive.google.com/file/d/17eIYgYCgVobHEoOfeGgZ63ZDy9k1iHL9/view?usp=sharing

EDIT: I’ve looked at the GPS speed, which is distorted by the wind. On the other hand, the TECS.sp shows almost constant speed of ~16 m/s. But I don’t believe that the airspeed would be that constant given the throttle changes, the wind wasn’t that strong. So maybe I’ve set up a really demanding scenario where the airspeed estimation (without a sensor) fails?

i’d say your simply going much too fast with badly tuned speed / height control.
it’s well possible to get a much better performance for simple tasks like loiter without an airspeed sensor:

Thanks for the reply. Thanks to the checks I’ve noted that possibly there is a problem with the compass, I’m adding an external one. Also I’ve configured the separate throttle control for each motor.

However I still don’t understand why the controller radically cancels the roll in every circle. In this way it increases the radius, so maybe it’s a navigation problem.

What will happen if I’ll set the maximum ASPD_FBW_MAX and the drone won’t be able to accelerate that much? Will it increase the radius? I’ll try to check this in flight, but it would be nice to have a comment on this in the docs: if the requirements for the commanded radius are not met, will the controller try to fly LOITER with a bigger radius and possibly non-regular circles?

1.Still very poor loiter
2.Roll limit defined to avoid stalls, but loiter radius increased and similar patterns easily flown in FBWA at a lower speed, but…
3.By far too fast in LOITER

Despite making several corrections and adjustments the problem is still there: the drone flies well in the FBWA mode but there are serious problems in LOITER.

In particular, it commands huge throttle level, speeds up well above the FBWA_MAX_SPD, and does not follow the circle navigation patterns.

I’ve increased the loiter radius to 82 metres. The loiter direction is clockwise. The roll is limited to 37 deg as the plane had the tendency to accelerated stalls.

I’ve enabled the separate left and right motor controls channels. In order to prevent stalls, I’ve added some -2 m/s vertical speed in unpowered flight, but it should not have any significance here?

The powertrain is 2xSK3 9x6 propellers, 4S voltage. Now I have extensive pre-arming checks, I’ve replaced the GPS and added and external compass.

I’ve flown two flights.


-wind hardly noticeable

-when switched to LOITER, first it went into two anti-clockwise rounds, distorted and with too big radius (1,2)

-then it made a sharp turn probably to enter the clockwise direction (3), I’ve stopped here because I was worried that something went completely wrong. But it has demonstrated that it can perform a relatively tight turn.

-the average throttle level was around 60%


-wind light (~2 m/s), no gusts
-I’ve increased the NAV_L1 constant from 16 to 23
-the average throttle level was way above 80%
-the plane has flown only clockwise patterns. After selecting LOITER, first it went on a huge turn. Did it want to get into the loiter pattern?

-and than it has made three rounds (marked as 1,2,3 on the track) being pushed downwinds. I’ve quitted when I’ve noticed that it’s not holding the loiter center.

-then I’ve flown several circle-shaped patterns in FBWA, with much lower speed and throttle level.

Some thoughts and questions:

-why the speed goes above the FBW_AIRSD_MAX? Is there no airspeed limit for LOITER? It looks as if the controller was “panicking” and pushing the throttles “to the wall”.

-why there is such a difference between average throttle levels in the two flights? The RC3 (throttle channel) was first slightly above 1500 and than around 1400 in the flight 1, and somehow higher (above 1600) in the flight 2. But even the flight 1 was too fast. In earlier flights, the problem was happening even with the throttle channel RC3 reduced to minimum.

-there seems to be no proper navigation, it just commands the maximum roll. Then it goes way to fast because of commanding too much throttle.

-is the THROTTLE_MAX set too high? Probably yes, but I want to have some margin in case of stronger winds, and I need it for takeoffs in FBWA and TAKEOFF mode (maybe there should be a separate throttle max parameter for TAKEOFF?) - EDIT! There is already! TKOFF_THR_MAX

-I can’t see any rudder action, is there any? Could this contribute to the problem?

-the airspeed estimation in TECS is a constant 16 m/s. Is this fine?

-I don’t think there is a signifant nose up/down tendency from the motors, they are mounted relatively low compared to the types with the single motor on a pylon. The motors have an outward rotation direction to avoid the propwash hitting the elevators.

In response to the first answer in this thread, I’ve setup the loiter radius above what was computed there, but there is still no correct loiter and some turns can be much tighter than that, if the airspeed is not skyrocketing.

When I was trying AUTO some time ago, the problem was also massive throttle shoots in turns.

TECS_RLL2THR? The banking angles are relatively limited…

I have never had similar problems with my other builds, which however were single-motor, not V-tails, and slower, even if not necessarily smaller (Powerzone 2600). I would want so much to get nice circles on the map :slight_smile:

FLIGHT 1 log
FLIGHT 2 log

i think you need to go back one step and make your plane fly well in auto throttle modes like cruise or fbwb, maintaining altitude with a reasonable throttle / airspeed first, before trying loiter.

A good catch, I’ll try to fly these modes. I’ve had TRIM_THROTTLE at 49% and TRIM_ARSPD_CM at 1400. As I can see from the logs from flying FBWA, 60% suffices for level flight, even climbing, all at higher speed (~20 m/s) so probably this 49% is too much for just 14 m/s. Which logged parameter represents the estimated airspeed?

I’ll also limit the THR_MAX to say 60% if there is TKOFF_THR_MAX which I can set to 100%.

Thanks for the advices. After around 10 years of flying DIY drones I’ve bought my first DJI drone (Mavic Air 2). My wife and son, seeing how smoothly it flies and how much trouble I have with this XClouds, commented: you will see, he will give it up soon. I hope they are wrong :slight_smile:

But what I don’t understand is if the navigation is working at all. For example in the second reported flight, the plane has been pushed downwinds. It hasn’t tried to prevent this by reducing the banking angle and trying to fly upwinds, has it?

So I’ve reduced the THR_MAX, increased TRIM_ARSPD_CM, reduced TRIM_THROTTLE and… it started to fly circles!! Not perfect but at least it reacted as one could expect. Maybe some remarks on this could be added to the docs? @vierfuffzig thanks!

Can the parameters be read from a datalog file?


The circles are more precise when flying upwinds but this is probably to be expected?

Kindly post your new values. Thanks!

There is a problem with that, I went for holiday into another location taking just the DJI drone with me, as I have some troubles with putting such as big drones as X-Clouds or Tarot 650 into my car, not very small but those drones are so bulky… So I’ll post the exact values when I’ll be back.

But I would say that they were something like this:

Do you have a fbw min and max speed?

Parameter file for the log downloaded is available after log download in the same directory as the log with a .param file extension.

Yes, FBW min speed was 13 m/s and I’ve increased the max speed from 16 to 21 m/s.

It doesn’t matter what is applied for ARSPD_FBW_MIN and ARSPD_FBW_MAX. In case of ARSPD_TYPE=0 the flying speed is defined by TRIM_THROTTLE.

Oh yeah. If you do have an airspeed sensor, the fbw min speed should be lesser than target airspeed. And max should be higher than that. If your target speed is equal to or lower than min speed, you get distorted circles as well because bank angle is limited to 25degree if stall prevention is also enabled.