Looking for good X-Plane Helicopter (please suggest a model you have parameters for)

@Andre-K Try these gains. Let me know if you know from experience that what I have proposed won’t work. Use only tune seq of 4 (angle_P). I added in ILMI which will allow the integrator to grow in a hover
sugg bell 206 ATC params.param (1.0 KB)

By the way I saw that you had ATC_PIRO_COMP enabled. That feature does not work. So I set it to zero for the params I sent you

@bnsgeyer Using your suggested parameters, I successfully passed pitch tuning seq 4 for pitch:
23-successfull pitch-tune.BIN

  • then, following flight appended to that log(sorry) - and shows a roll tuning that did not go anywhere, it seems like the heli was just oscillating.
    Then, “successfull yaw.BIN” - filename says it all.
    So I re-tried for roll, and uploaded “successfull roll.BIN”
    Success.
    Finally, I flew a “Testflight.BIN” - which produced usable Stabilize performance, a very bumpy GUIDED and POSHOLD mission. (crashed due to mechanical overload when switching to stabilize, as POSHOLD went wild)
    What should be the next tunings steps, now that all axes of Seq4 are completed ?
    What

@Andre-K The Yaw is probably the most responsive with the least amount of lag. I would suggest increasing the ATC_ACCEL_Y_MAX to 20000. Re-run the AUTOTUNE_SEQ 4 for the yaw again. we may need to lower it again but this allows me to see what the yaw axis is capable of.

Looking at the test flight, you will have to stop testing this in modes other than stabilize and acro until we have figured out the tuning for the stabilize. At this point, Loiter, poshold, guided and auto modes are off limits. The position controller will have to be tuned separately after you have tuned the attitude controller. It is pretty evident at this point from your attempted flights in these modes that use the position controller that you will have to cut the position controller gains back. They are way too high for this aircraft.

Ok back to the attitude controller. ATC_INPUT_TC needs to be at least 0.5. The aircraft can’t physically be pushed lower than a 0.5 sec time constant in attitude. Not going to be possible. Set ATC_ACCEL_R_MAX and ATC_ACCEL_P_MAX to 3000. I would recommend setting the ATC_RAT_R_MAX and ATC_RAT_P_MAX to 50 deg/s. There is an oscillation in the pitch and roll axes. I think these are due to the ATC_ANG_PIT_P. set ATC_ANG_PIT_P to 4.5 and set ATC_ANG_RLL_P to 7.

I don’t think you will find the attitude controller performance to be very good. You certainly won’t be able to get it to hold the attitude within 1-2 deg. Slowing down the response shaping using the ATC_INPUT_TC, ATC_ACCEL_X_MAX and ATC_RAT_X_MAX params will help in pitch and roll axes. It will allow the aircraft time to catch up.

Except for the data I asked for with the yaw axis, I would abandon using the autotune any further. I think I have learned enough to help tune the best I can. After you make the changes I asked for above for pitch and roll axes. please fly in stabilize and provide quick inputs and hold them. you only need to make inputs that result in 10 deg attitude changes. hold the input in until you see it achieve a steady state attitude change. do this in both pitch and roll axes.

Thank you @bnsgeyer
Based on your advise, 've done this:
ATC_INPUT_TC was 0.2, now 0.5

ATC_ACCEL_R_MAX, ATC_ACCEL_P_MAX was 8000, now3000
ATC_ACCEL_Y_MAX 2000 , now 20000

ATC_RATE_R_MAX and ATC_RATE_P_MAX to 50 deg/s.

ATC_ANG_PIT_P was 6.9 , is 4.5
ATC_ANG_RLL_P was 10 , is 7

The results are uploaded as “Testflight2.BIN”
I am impressed about your prediction/precision of the values. :slight_smile: it flies quite well, and the Yaw is greatly improved.

Edit: first now I see your suggestion about using the Sikorsky S-76 - I can switch to it if you like, the only reason for using the Bell206 is that old example config Tridge made.

Thanks. I have been doing this for a while so it seems that I have been getting a better sense of the gain settings.

One thing I just realized is that we are needlessly limiting our pitch and roll cyclic control. Set the H_CYC_MAX to 4500. Then you will have to reduce the pitch and roll VFF, rate P and rate D gains by half.

If you are looking to mimic a multicopter flying qualities of a vehicle of the same size as the bell 206, then the S-76 would probably be a better choice even though it is larger than the bell 206.

@bnsgeyer Thanks.
I changed:
H_CYC_MAX 2500 to 4500
ATC_RAT_PIT_VFF ATC_RAT_RLL_VFF 0.5 to 0.25
ATC_RAT_PIT_P ATC_RAT_RLL_P 0.3 to 0.15
ATC_RAT_PIT_D ATC_RAT_RLL_D 0.1 to 0.05

uploaded test flight “H_CYCMAX plus more changed.BIN”
Basically: the cyclic controls are quite sluggish.

I also tried to move to S-76 - just for the simplicity of not using a addon-heli - and as you say, maybe more familiar performance.

uploaded “S76-C test with current PIDs.BIN”
main issue with it is that it oscillates in pitch axis, I am trying to tweak it not to crash and perform an autotune for pitch right now.

Then put the gains back to where they were. Maybe I am mistaken that making the cyc_max change would have doubled the sensitivity.

@bnsgeyer
The log “restored PIDs, Bell and Sikorsky.BIN” shows the results.
First part is with the Bell, second part the S76
Let’s follow your advise and focus on the S76.

Right now, it’s oscillating in the pitch axis.

Ok. Sounds good.

The pitch oscillations are pretty low frequency so I think they are mainly being caused by the attitude feedback loops. You can try reducing the Pitch VFF to 0.3 and reduce the ANG_P to 3. If that doesn’t’ remove the oscillations or change the frequency then return those back to their previous settings and set the Rate P and Rate D values to half their current value. Hopefully we can get the oscillations to stop with one of those two ways.

Once you get the pitch axis not to oscillate, I would recommend that we go back to try and use the autotune. I want you to try SEQ = 1 for the pitch axis and see if that works for setting the VFF. Then I want you to try using SEQ =2 for the pitch axis. I would like to see if it can determine the max gains. If you can’t get it to complete the sweep, then go to SEQ=4 for the pitch axis and set ATC_ACCEL_P_MAX to 50000, ATC_RAT_P_MAX to 100 and ATC_INPUT_TC to 0.2. I am purposely setting these high so I can get a better frequency sweep result. We will return them to lower values once I am able to see what is happening with the pitch axis.

@bnsgeyer Hi, I am reading you post now, because I’ve been working hard on kind-of what you describe.
I did upload “S76 manual tune.BIN” which is a result of me manually tuning the S76 to fly well enough for autotune.
The resulting params are uploaded as “SIKok.param”
Then, I did SEQ=4 for all three axes.
and ended up with “SIKok_plus_autotune.param”

One significant difference is that I did not increase ATC_ACCEL_P_MAX - rather decreased some - as I had some issues where the heli got destroyed by excessive forces during the tuning.
I will continue this work tomorrow, doing what you described above.
In any case, the heli is now behaving ok, kind of slow and smooth as expected. - except navigation flight - which is still a jerky experience, and passengers would be sick and scared :slight_smile:

Let’s assume the steps above produce even better results.
What would be the next steps to make PSC_ play along ?

@Andre-K I loaded Xplane and played with the S-76. First I think your H_RSC_MODE setting is wrong. It should be SETPOINT which is 2. Then H_RSC_SETPOINT should be 100. That will make the rotor speed read 100 percent on the gauges in the cockpit. I then had to set my AHRS_TRIM_Y to 0.082 and the ATC_HVR_RLL_TRM to -380. That gave me a pretty good no drift hover. I found the ATC_RAT_YAW_P causing a significant roll oscillation but never saw the pitch oscillation. So I set Yaw P to 0.2. I think both pitch and roll rate P gains were 0.2 and the Rate D gains were 0.01. Its late and I have an early and busy day at work tomorrow. I plan to work on tuning the attitude controller tomorrow during our Dev meeting. So I should have more to report tomorrow night U.S. Eastern Time.

@bnsgeyer The proper governor setup was a good catch, I did notice that it lost too much headspeed when descending/levelling off after a long descend, but did not give it any attention.

I applied your other suggestions too, but can’t perform the AUTOTUNE_SEQ 1 from the previous post as it never completes.

My main issue now (with the latest changes) is that there is some extreme twitching on the pitch axis, please see video “S-76C - 2021-09-27 09.46.31.avi”

@Andre-K after briefly looking over your tuning gains, I would say that the issue in your pitch axis comes from the rate D gain being too high. I think that gain needs to be lower than .05.

@bnsgeyer Please restart at these params (or yours) 27sept.param
https://drive.google.com/file/d/1rN_Ei86fr_JtS6DPGCIj-GCX413H-vA6/view?usp=sharing

those are based on the manual tune from the post “SIKok.param”
After that, I posted “SIKok_plus_autotune.param” - but those are much worse (only completed SEQ4)

So- If we assume you are commenting on something like those 27sept.param - then we are on the same page.

You wrote you think the " the Rate D gains were 0.01" - mine are 0.4 now, the problem is that if I reduce Pitch Rate D to as much as 0.4 , then any 20°upset will oscillate for >15 seconds

Please share your settings. maybe our params diverged greatly at some point?

@Andre-K I got it figured out. The biggest problem we faced was slow data rates from xplane to SITL. Set the data output in the Xplane menu to 100 hz

That made a huge difference in the gains I could set. This model is certainly not so realistic from true helicopter dynamics. It models a lot of the coupling that I’d expect but not the instabilities of the rotor. But that is good for you. Here is the param file I built. It flies really well in stabilize. I ran out of time and couldn’t get to loiter or althold. Do a param compare in mission planner to see what i changed. I guess as far as the rotor speed, I was wrong. I thought that RSC Mode 2 was what was needed. You really want RSC Mode 3 (can’t use mode 4 as there is no RPM). Use my throttle curve settings. It holds rotor speed at 100% fairly well.
Here is the param file S-76 -set data output to 100hz.param (22.7 KB)

@bnsgeyer great catch! yes, 100hz helps - it’s almost embarassing, but I thought of that eary on, but then I thought that it flew nothing like the stock 15Hz, and I (incorrectly) assumed the SITL requested a higher data rate where needed (as if it was possible like over MAVlink)

Anyway- It’s good progess to have discovered that.
Most of the rate PIDs are about 10x the size I use on some 25kg multirotors, (MTOW 50kg)
I obviously do not fully understand why the position controller needs higher gains as well - I would believe that if desired attitude was set by properly tuned STAB/RATE PID’s - then the PSC would work the same… obviously it’s not like that. and more PSC_ params needs to be increased/changed.
Also - you are flying EK3, I flew EK2 (till now - because I based on Tridge’s old example.)

I don’t think that these PID gains are valid. We would need to get an actual validated model to lay any confidence in these gains. I think these would also have a significant impact on the actuators because of the high frequency/rate requests.

The PSC gains will probably need to be reduced even though the attitude controller PIDs were increased. The PSC gains rely more on the shaping of the attitude controller which is really slow in this case. Thus the requested corrections from the position controller for velocity and position must be slower than what would be used for a 10 lb multicopter. This is due to the position controller, like the pilot, is working thru the attitude controller.

I was using the default EKF for 4.1 which I believe is EK3. I started a fresh sim with no EEPROM and thus got all default Params before making changes for the model. Much of my tuning work for the rate controller was done in acro with the attitude feedback turned off. This assured that I wasn’t driving an instability. Once I was happy with the flying qualities in acro then I moved into stabilize and adjusted the shaping parameters to stay within the capabilities of the aircraft.

@bnsgeyer
As you say… “I don’t think that these PID gains are valid.”
Unfortunatly its PID’s like that that make this thing move “realistically”
As a point, during this weekend, I too did start “from scratch” with defaults for this AC build. (but with liberal use of diff/meld to quickly merge in non-tuning-related setting)
I did the usual stuff covered in “copter manual tuning” and “copter advanced tuning”
And also ended up with a tune that flew fine in STABILIZE (except for the jerking due to too low UDP frame rate)
And also … the PSC_* were nowhere near good (this was basically what I wanted to verify)
I did increase some PSC_*P pretty much and that did not help a lot, and even worse, I had absolutely no success in making it properly control the yaw in GUIDED, and there is not even a PSC_ param for that.
(later I deleted that config - as it did not work that much better, and I did not want to bring more confusion with yet another configuration)
Right now, I speculate whatever the problem really is in the sim_vehicle layer between ardupilot and x-plane - and a change there could magically make everything behave “normally” … but then I know that planes in X-Plane work fine - and the interface between X-Plane and ArduCopter is probably the same…

I hope you have some ideas.