Flybar 450 Heli in loiter mode

Hello Gentlemen,
This is my first 450 Heli flybar using Pixhawk 2.1. In loiter mode, it oscillates and does not hold. Could you take a look at the bin file here and offer some help?
https://drive.google.com/drive/u/1/folders/1V0NLSphv0SZZ072VS3rCG1N1t9RhsAHv 4

Thanks,
David

Your log file says I need permission to download it.

Thanks Chris for your reply. Please try it again.

David, it would appear to me that it’s like a “toilet bowl” effect in Loiter? It appears to be both the pitch and roll axes. This is usually related to compass issues and I do notice you have one internal mag enabled. I don’t know if that’s the issue, as the calibrations on the mags look good, but they don’t agree well on the z-axis. Since it is usually recommended to disable the internal mags in Copter, even though I don’t know if that’s causing it, I think I would disable COMPASS_USE2 by setting it to zero. Then try it again and see if that makes a difference.

I also notice you have your COMPASS_EXTERNAL set to 2 to force it external and disable auto-detection. The default is 1, so I assume you must’ve set that. But I don’t think that’s the issue.

Chris, Thanks for your comments. I changed both parameters per your suggestion but the “toilet bowl” effect remains the same as before while in loilter mode. Anything else I should be looked at?
Here is the updated 00000257.bin file for your review.
https://drive.google.com/drive/u/1/folders/1V0NLSphv0SZZ072VS3rCG1N1t9RhsAHv

Well, I just wanted to eliminate the possibility of the compass causing it. That is the usual cause of “toilet bowel” in Loiter.

@bnsgeyer it would appear the actual velocity request from the position controller is over-shooting the target, and it’s out of phase. The PSC settings are the defaults, are what was used in 3.5 for heli’s. What do you make of this?

I don’t see any issues in tuning of the attitude controller.

do you suggest any PSC_ settings need to be tuned for my setup?

I don’t know. I would like to get Bill’s opinion on it. One thing in the attitude controller tuning that I noticed is that the Stabilize P gains have been turned down. And the ATC Accel settings are at 72000, where most 450’s need more like 110,000. I suspect the ATC settings came from the defaults, which are kind of for middle-of-the-road 550 class. For big heli’s we’ll usually turn them down as low as maybe 36000. For small ones they usually need to be higher, like 110,000.

So it is possible that it has been tuned to be gentle handling on the sticks for the pilot. But it is so far de-tuned that the autopilot is struggling with it in Loiter and it is simply not responsive enough for the autopilot to hold position.

If Bill thinks that might be the case with the attitude controller too we may have you set those gains up and try tuning the “pilot feel” with the ATC_INPUT_TC setting instead. The default for the Stabilize P gains are 4.5, yours are set to 3.5.

Thank you much Bill and Chris. I managed to tune the PSC parameters and it works like a champ now. I will share more detail info later in the next post. Thanks again.

David,
Please post your latest param file. I’m not at a computer that I can view a log file.

thanks,
Bill

The default for the PSC Velocity XY P is 2, I gain is 1, and D gain is 0.5 for multicopters.

I purposely de-tuned those to:
PSC_VELXY_P,1
PSC_VELXY_I,0.5
PSC_VELXY_D,0

for heli’s in 3.6 defaults because I found the multi defaults caused severe oscillation of the position controller with big heli’s that would result in total loss of control in Loiter or Pos Hold. Mostly related to the D-gain, which was hard-coded to zero in 3.5, but the setting was moved to the params in 3.6.

The defaults I set in the PR to heli are the same as what was used in 3.5 and proved to be “safe” no matter what I flew them in.

So if that “fixed” it we may need to keep that in mind for the future for smaller heli’s.

Chris, I detuned them to lower values like your for my 450 flybar heli setup which I built from scratch. Loiter, stabilize, altitude modes work great. I will post the details later tonight when I am back home. thanks again for prompt reply.

Ok, look forward to seeing your setup. I have de-tuned stabilize P’s before for 600 flybars because they are extremely quick with light paddles. So I add flybar weights and then turn the Stab P’s back up to 4 or 4.5 to make them more stable for UAV. I can imagine a 450 flybar is a quite quick-handling little helicopter :grinning:

Chris,

450heli.param (14.6 KB)

I uploaded the latest 00000264.bin file here for your review and comments
https://drive.google.com/drive/u/0/folders/1V0NLSphv0SZZ072VS3rCG1N1t9RhsAHv

Also I uploaded some pictures of the 450 flybar heli, it is still work in progress.

Here is the link to the video(only the first 46 sec). Looks like I need to tune some more to have it stationary while in loiter mode. What do you suggest?

Yes, that is very bad.

Try setting these to this values and see what it does.
PSC_POSXY_P, 1
PSC_VELXY_I, 1
PSC_VELXY_P, 2

For my particular setup as I recall that with the suggested values, it would oscillate in X and Y positions. I think that the value of PSC_VELXY_I can be lower instead and keeping PSC_POSXY_P, 0.5 and PSC_VELXY_P, 0.5. What is your thought?

David and Chris, My only thought on this is to verify that the deviations that you are seeing are truly due to the inability of the aircraft to hold position and not the GPS pulling the position around. You can see the deviation in the desired and measured position in the PSC? message. It is one of those messages. You will see both desired and measured position and desired and measured velocity. If the deviations in position that are observed in flight look a lot bigger than the difference between the log desired and measured, then it is the gps inaccuracy that is pulling the heli around.

EDIT: I actually looked at the video and I would agree that that is probably not the GPS dragging it around. Sorry I haven’t had much time to look at data.

EDIT 2: I had looked at your parameters. the ATC_INPUT_TC could have an effect on this. the default value is 0.15. yours was set to 0.2. the frequency of your oscillation was like pretty low maybe a period of 5 seconds. but the higher time constant can affect the autopilot making corrections. Also your filters are set pretty low. I don’t think this would affect the response for that slow of an oscillation. the one thing that I had done in the past that has improved the position holding was increase the WPNAV_ACCEL param. I’m not sure this is recommended because it also makes the aircraft more aggressive in missions in attaining speed.

IMO it is a problem with the PSC gains. These gains should never be messed with unless there is a serious problem. The defaults for heli are less than the defaults for multicopter due to helicopters normally having faster roll and pitch response. So having the PSC gains set too high causes the PSC to oscillate. But this oscillation in the PSC is SEVERE when it happens. It is not merely failure to hold position. The helicopter goes into a quite dangerous oscillation of about 20-30Hz that causes the autopilot to totally lose control of it.

In this case, the target position vs actual on x axis is way off.

And the target velocity request is out of phase.

Which means to me the PSC gains are too low. If it didn’t hold position with the heli defaults, then what I suggested above is the multicopter defaults for a slower-handling aircraft, with the exception I left the D-gain at zero. The multi default for the velocity request XY D gain is 0.5. But I recommend leaving that at zero for helicopters. But the VELXY_P and I have to be at least 1 and 0.5 respectively or it won’t hold position at ALL. And those happen to be the defaults from Copter 3.5 which I had changed in this commit after I found the problem:

I made the following changes:
PSC_POSXY_P, 0.5
PSC_VELXY_I, 0.07
PSC_VELXY_P,0.5
And here is video with the above updates:

it improves a bit compared to the previous video. What is your thought on these changes?

Well, in my opinion it still looks pretty loose. It is not hardly ever necessary to tune the Position Controller, and mis-tuning it can be very detrimental. Leonard recommends having velocity xy I half of P, for example.

I would set the PSC back to the defaults and try to identify the real problem of why it won’t hold position instead of continuing to make random adjustments in the PSC.