New Loiter Mode - Alpha Testers Wanted

Hi @james_pattison,
I want to try this mode on Beaglebone with my hardware. How can I checkout this pull request to build it from source? Thanks.

Builds for TradHeli are here if anybody wants to test New Loiter with a helicopter. I test flew it twice already.

Keep in mind if you test it with a heli this is a multicopter-specific modification to Loiter and my initial test flights indicates it works worse than I thought with heli’s. If you fly it make sure you have plenty of altitude - don’t test less than 10m above ground. And make sure you have Acro set up for easy bailout when it goes sour (especially if you have one of the CHx_OPTS set to 43 and engage it with the New Loiter).

If this eventually replaces the current Loiter flight mode in Copter, TradHeli will require it’s own category like Plane or Rover. Unless it can be significantly reworked. Helicopters are essentially more closely related to airplanes than they are multirotors. The only common trait they share with multi’s is that they both have fans on top going around.

Thanks Chris, that’s great feedback.
Could you put the logs up?

No logs yet. They are b()rked. Merging my dev branch, and Randy’s branch, resulted in merge conflicts that I thought I fixed, but effectively broke the logging. We have not moved our helicopter development code to 3.6-dev yet (until this attempt). And I found some things in 3.6-dev that need to fixed (or locked out) first for TradHeli.

I have to discuss this with the other guys and figure out what direction we’re going to take. If this change to Loiter affects Auto too, then we have a problem.

The builds I posted will fly your helicopter, and allow you to try new loiter. But it is by no means anything but experimental firmware.

Edit:
I found two issues not related to New Loiter in those helicopter builds, one of which will cause a crash. I pulled them. If anybody downloaded them to try it, don’t fly it. We have some work to do on 3.6-dev before we get excited about experimenting with New Loiter with helicopters.

thanks Chris. Helicopters are hard!

They’re not hard at all if you look at them from an airplane standpoint. In hover they sort of share some characteristics with multi’s (very loosely). But that’s where the similarities end. In flight they fly like an airplane - the control inputs, short of collective management, are even like an airplane. They pitch up and down, roll, climb, dive and create lift in forward flight - just like an airplane. The only real difference is that the wing on a heli is rotary and used for propulsion thru cyclic pitch, on an airplane it’s fixed.

Let’s face it - current Loiter controller (and Nav controller) in Copter is far from ideal for heli’s. We really need the L1 Nav controller from Plane. And this New Loiter will be fun to test to see if I can arrive at a combination of settings for it that is suitable for helicopters and maybe get better performance on Auto flights.

I didn’t get a chance to play with settings in my first two flights. But the defaults were not ideal. How do you turn off that “braking” feature? Or least limit it to say 0.1G or something so you can get a smooth stop with a heli vs it acting like somebody just whacked it with a baseball bat? Maybe that can be tuned with the lean angle? As long as it doesn’t limit my acceleration coming off turns in Auto. I run 590-650 for WPNAV_ACCEL to keep the “leash” short and kind of, sort of, roughly get the heli to hit the waypoints @ 30m/s. But the current implementation still pretty much sucks for heli’s. It took me a long time to arrive at a setup that (kind of) works with the current controller. There’s a lot of stuff to test here. :grinning:

1 Like

@ChrisOlson,
In case it matters, I’ve just re-based the lthall-new-loiter5 branch on master including resolving the logging conflict.

Hi @ChrisOlson,

This should work fine with Heli with appropriate parameters. The trick is to not put it into a situation where it is climbs dramatically when you pull back in Alt Hold. While Heli’s behave like a plane at high speed they are the same as a multi at low speed. If you set Loiter up with that in mind I think you will get good results. In any case, if you were able to get Loiter working before then this Loiter will also work but with a more direct feeling on the sticks.

For Heli I would suggest keeping the maximum Loiter speed to about 15m’s
WPNAV_LOIT_SPEED 1500

Then set the maximum lean angle to be whatever you need to achieve 15m/s.
WPNAV_LOIT_ANGM 20 (It is in degrees at the moment)

Drop the deceleration down so you get a more gentle braking and slow the transition time.
WPNAV_LOIT_MINA = 50;
WPNAV_LOIT_TRAN = 1.0

You may also like to reduce the aggressiveness with which it corrects for position errors by dropping:
WPNAV_LOIT_MAXA to 250.

The issues you highlight with heli are all around the fact that heli transitions from a mode where the altitude is controlled primarily by the thrust with only a small coupling to pitch (or angle of attack), to a mode where it is primarily controlled by angle of attack and the thrust has little to do with it. We see this issue with a number of aircraft types including multi rotor aircraft with lifting surfaces. I have not formulated an acceptable solution but I am working on it.

Thanks for testing Chris I really appreciate it!

This is the param I was wondering about. Roughly 7 degrees of nose-down pitch is what’s required with my 600 test heli to cruise at 15m/s in no-wind conditions. But I can pull 20 degrees or more in hard acceleration. So if I set that to 7 how does it affect the heli’s lateral accel capabilities? And what effect does it have in Auto flight?

These are questions based on the fact that I haven’t tested it enough yet. But just curious up-front as to what to look for.

It does matter, and thanks! That was one of the things I had to fix and I br()ke it as I did it quickly and didn’t review your changes close enough to merge with Peter’s changes adding units. The other issue is that my test heli has a DDVP drive on the tail and that’s still broken in master. I fixed that in my test code and as soon as I have a working implementation of New Loiter for heli’s with everything working I’ll re-post the binaries so other interested folks can test it too.

I now have functioning helicopter builds for TradHeli New Loiter testers.

The logging works so you can report issues and provide logs. DDVP drives now work properly. I was going to remove InvertedFlight (CHx_OPT = 43) from this build because I found a problem with it. Some TradHeli users might not be aware that you can engage inverted flight in Loiter with helicopters in 3.6-dev. I decided to leave it in for now, but just don’t use it in testing New Loiter until we get a chance to look at the issues with it.

The primary function of loiter isn’t to thrash around and perform hard accelerations. Lets start by getting it working for precise placement of the aircraft during a landing or aerial filming situation. So start with a lean angle that is representative of what you would do if you were trying to fly around smoothly below 15m/s.

It does not affect auto flight. It does limit your acceleration to what you would get with a maximum lean angle of 7 degrees. I would suggest starting with 10 to 15 degrees based on what you have said. This will not restrict the aircraft’s ability to fight the wind.

I would suggest that you start with a maximum lean angle of 10 degrees and maximum speed of 15m/s. Then look at increasing up to something like 20 degrees and 30m/s (or whatever your top speed is at 20 degrees). In any case start slow and think of this as tuning the repositioning during landing in an RTL. Then you can push it.

Hi @Leonardthall

WPNAV_LOIT_MINA : This is the deccelration parameter for LOITER.

I am facing hard braking during auto missons.
Pixhawk 2.1
AC3.5.3
Quadcopter

What is decceeleration parameter for AUTO Mode . ?

@R_Q_Robert

It is WPNAV_ACCEL drop it to 500 or lower. I would not go below 250 generally.

I have already set it to 100 but still hard braking is seen .

One thing i notice is when the quad brakes near the Waypoint , it pitches up to 20-30 degrees for braking. And MP says “Reached Waypoint # 1 (etc)” .

By the way in RTL mode quad reurns Home with smooth braking .

I was only able to get one flight in yesterday. Using a solo with the speed about 1500cms and Max angle 30 degrees. Or really anything in that general vicinity. The copter seems to brake way too hard. It accelerated smoothly to maximum speed. Then I let go of the stick. It brakes pretty hard, making a rather dramatic throttle surge. If the .ax speed is set slower, say 10-15 mph, that doesn’t happen.

I noticed this on the first two flights I flew with it, with a heli. But based on Leonard’s recommendation on how to “tune” it I think I have a better understanding of how it works. I think the key is here:

My primary use of Loiter is for stationary hovering work, or limited maneuvering where I want the autopilot to hold the aircraft’s position so I can concentrate on other aspects of the flight such as hooking a tethered load, or running the payload. If I’m going to fly it at any speed I typically switch to Alt Hold or Stabilize. So I have to try this again with different settings taylored to what I use Loiter for.

@Leonardthall or @rmackay9 would you be able to give testers a sort of briefing, explaining what these different params do, and how to tune them so we have a better understanding during testing?

Attitude Controller Group - angular velocity pitch/roll/yaw (not part of this testing, but still…):
ATC_ANG_V_P_MAX 0.0
ATC_ANG_V_R_MAX 0.0
ATC_ANG_V_Y_MAX 0.0

Position Controller Group - some of these have been moved from other groups in New Loiter:
PSC_ACCELZ_D 0.0
PSC_ACCELZ_FF 0.0
PSC_ACCELZ_FILT 20
PSC_ACCELZ_I 1.0
PSC_ACCELZ_IMAX 800
PSC_ACCELZ_P 0.30 (TradHeli testers be careful with this one - it is 0.5 default!!)
PSC_ACC_XY_FILT 2.0
PSC_POSXY_P 1.0
PSC_POSZ_P 1.0
PSC_VELXY_D 1.0
PSC_VELXY_D_FILT 10
PSC_VELXY_FILT 5
PSC_VELXY_I 1.0
PSC_VELXY_IMAX 1000
PSC_VELXY_P 2…0
PSC_VELZ_P 5.0

The new Loiter Controller Group params - new ones bold faced:
WPNAV_LOIT_ANGM 10
WPNAV_LOIT_DELA 0.0
WPNAV_LOIT_MAXA 637
WPNAV_LOIT_MINA 250
WPNAV_LOIT_SPEED 1500.0
WPNAV_LOIT_TRAN 0.5

Thanks!

Hi Robert, just to be clear, you are using Randy’s release here and you don’t have this problem with the old code right?
Could you please provide a log for me to look at?