AUTOTUNE resulted in twitchy control surfaces


this is screenshot from sitl. not actual plane. I simply lower this values two times.
May be resulting pids not perfect… but it fly good, as you can see on a video

These values have always been greyed out for me, just like they show on your screen. How do we enable them so that they can be adjusted?

update to beta MP

@Alexey_Degterev Can you turn the PID while plane in the air.?

Thanks! Yea, AUTOTUNE had the D value set to .035. I lowered it to .033 and the twitchiness has stopped while the plane is on the ground. I’ll test later today to see if the twitchiness goes away in the air as well.

No, that not work. Now it’s constantly twitchy in the air. On the ground, the slightest movement results in full deflections, instead of the expected small corrections.

What are the default PID values? Maybe I can just start with those.

I updated to 4.1 beta 3 today and flew. autotake off was good. autotune seemed to be very effective. FBWA and Cruise were quite good. landing in FBWA was safe. I am copying video and .bin and will upload this weekend. Thanks for all the hard work that’s gone into this build!

1 Like

Two times means 0.035/2 =0.017. try this value

here is the log and video from a lengthy 25 minute flight using 4.1 Beta 3 and autotune. no manual tuning was done. I think the results are pretty good - it snaps to the requested 50 degree bank angle quickly and accurately.

I think whatever was changed between beta 1 and beta 3 has made a huge improvement to autotune on this plane.

There are a few problems with the flight though - on auto-takeoff, it can’t hold the desired 30 degree climb. Maybe the plane is incapable of this, or maybe it’s a tuning problem. In flight, climbing performance is poor - much less than 30 degrees. In FBWA it constantly pulls to the right. In CRUISE it tilts about 10 degrees to the left. I think both of these may be because I’m probably using the wrong prop - a tractor prop rather than a pusher prop. Or, it may be more tuning problems.

Very appreciative of advice on anything I can do to improve my setup or configuration.

Volantex Ranger EX with pixhawk 2.4.8, airspeed sensor, lidar and dji goggles. The plane is quite heavy with two 5000 mah 4s lipo in parallel.

https://drive.google.com/file/d/1feSxWO6PY2EUlR87BQ9OQ6q9QeqmlkG0/view?usp=sharing

Update - seems the FLIGHTMODE widget is stuck on RTL. If it’s waggling back and forth, it’s in autotune. if it’s veering to the right, it’s in FBWA. Leaning to the left 10 degrees? CRUISE.

@tridge There is some sort of scaling that is applied relative to speed. PID values that are fine at cruising speed are causing oscillations that increase as speed reduces. I have resorted to manual tuning which has been going well so far.

A good way to analyze this is just to graph aileron RCIN.C1 vs RCOU.C1 (and elevator RCIN.C2 vs RCOU.C2) instead of roll and desired roll. The oscillations become very obvious when just looking at servo output. In the example image below, as speed decreases in green, the oscillations magnify.

Dale, not sure if this helps but i just finished a quadplane build around the ranger ex… Overall it is flying well but i too had a very bad right yaw… worse at higher throttle. I to am using a tractor prop with the motor turning counter clockwise viewed from the front. After lots of testing and reading every forum on thrust angles for pusher plane i decided the problem is related to the rotation of the prop but that’s not the whole problem. It still pulled right even while using a pusher prop. The prop that volantex sends is a tractor prop and the built in down and right thrust is not good. Long story short i ended up continuing to use tractor props but rebuilt the motor mount with additional down and instead of right thrust left… much better than it was…

So after a lot of testing, the PID values below work well for me. Smooth, human-like responses, with no ridiculous oscillations. This is on a 2m piper cub with max control surface deflection.
roll and pitch:
P: 0.1000
I: 0.0200
D: 0.0001 (min limit)

The AUTOTUNE values for roll ant pitch were:
P: 0.340
I: 0.258
D: 0.035

tried it with a pusher prop today - completely solved my problems. no need to offset my motor mount. don’t want to take this thread off topic, but I’ll just say I think the Volantex Ranger EX has had a few revisions and perhaps my version has an appropriate offset on the motor mount to give a good thrust line, given a pusher prop.

I’ve had a small victory adjusting PTCH_RATE_SMAX down to remove oscillations from high P and D values. I don’t know if it will work for you here, but it’s worth a shot if you’re stuck. I used the PID values from the autotune.

@Allister Graph your servo output values for roll and pitch. I bet you will see oscillations (which wear out the servos and waste battery) even though the plane seems to fly ok. (You can also see them by just tilting the plane while it is on the ground, in stabilize mode.) I had to go to really low PID values to get rid of them. Still responds fine, so I don’t know why autotune sets them so high.

I like your suggestion. I may play with this some more.

Here is an example the oscillations that I was focused on during take off:

After adjusting rate_smax I can’t find any evidence of that. However…

I wouldn’t call that oscillations, but it is jittery. But to be fair, what’s normal here? Even in manual mode that little wing get’s bounced around the there’s a lot of movement on those servo channels. So how much of that is just the FC doing its best to keep a 900mm wing on the straight and level?

And to be clear, I see no jitter or twitch in the elevons when the plane is on the ground (and I have seen it in the past on other settings and on other planes)

Your thoughts?

@Allister No, that second graph isn’t too bad. One good way to look at is to scroll to a section of the graph where there is no stick input, and see if you see a sinusoidal pattern in RCOU. It is not as easy to detect when it is also following stick inputs.

There’s another issue where the oscillations magnify as speed decreases. Does PTCH_RATE_SMAX/RLL_RATE_SMAX affect that?

These oscillations have been a long standing problem for me on this plane so I’ve been crawling over all the logs looking for that sinusoidal pattern. So far between Autotune in 4.1 beta 3, and now PTCH_RATE_SMAX it’s like a new plane and I’m not seeing any signs of oscillation anymore. Flight mode, speed, and conditions (that I’ve had a chance to try so far) don’t seem to make a difference. Compared to when I first tuned it in 4.0.7 the oscillations got so bad that at one point I thought the elevons were going to come off and I had to use manual to get the plane back under control.

I don’t know how much SMAX will effect the overall tuning. My adjustment was a total guess. I’m hoping that somebody who knows more about the code can share more about the impact and any potential issues/benefits.

Make sure SERVO_AUTO_TRIM is set to 1.

Hello, i’m having the same issue after the autotune.
The arwing pro after the tune is very nervous on the ground, prior to the tune the adjustment were gentle.
It is flying ok in all the automatic mode.
May i post here the log?