PosHold oscillations and tune sanity check

Hi there

I have a Trex 650 copter with a Cube Orange controller mounted as shown in the picture below:

I have just started to test PosHold after initially being very satisfied with how the copter flies in stabilize after following the wiki tuning guide. PosHold performance seems okay, but oscillations sort of “accumulate” over time. This seems to be worse the more wind is present. I was hoping I could get some input before I try higher speed tests.

I have uploaded a log file for a hover flight flown mainly in headwind: https://drive.google.com/file/d/1swNw20G_oZWZFMS3uQPJ_yPfQUn5fC68/view?usp=sharing

If I read the logs correctly, you can see the oscillations as I change to PosHold:

I would greatly appreciate any insights or general advise from this great community.


Kind regards,

Hi Ebbe,

Why dont you set the Harmonic Notch to follow the RPM sensor?
I think you have some small noise in your rates.

You mean toilet bowl effect?


1 Like

Ebbe @epoulsen,
Looks like you’ve done a pretty good job following the wiki with your tuning. There are some improvements that could be made. The one big one that could have an effect on the position hold would be the actual attitudes not following desired.

You can see in the graph above that both pitch and roll are biased from the desired values. This is indicative of the I term not being large enough or you don’t have the aircraft trimmed (i.e. center of gravity or trim pitch and roll values). Unless you were flying in some steady winds, the integrator in pitch and roll should be centered (close to zero) in a hover.

You can see here that they are both at the limit of the ILMI value. The code will not allow the leaky integrator to be leaked below the ILMI value. So I would suggest that you check your CG and trim pitch and roll values before increasing the ILMI values. If you do choose to increase the ILMI values, I would not suggest going much above 0.1.

So fixing that should help the controller with keeping position. You can see in the graph below that the velocities are out of phase with the target velocities when the position controller is trying to hold position.

You could also try adding some PSC_VELXY_D gain. Try 0.2 to begin with. That should help keep these in phase.

1 Like

Because you attach the AP on the side frame maybe is not seeing the same level of the rotor blades plane.
I suggest you to do this:
Use some paper foils and level the helicopter from the skis until you measure 0 degrees in pitch and roll, on a frame surface that is perpendicular to the rotor shaft, could be the motor top surface as well.

Then you send this command. It will adjust the AHRS trims for you.



@bnsgeyer and @Pedro_Claro thank you both very much for your suggestions. I’ll test as soon as possible and return with the results.



Bill, what would be a good value? I ask this, for my own evaluations from my log files.



I got the chance to test your suggestions this morning. Unfortunately there was a bit of gusty wind from approximately heading 110 deg, so I’m not entirely sure the trim is perfect, but to me it looks better:

The I terms for pitch and roll are however still at the limit of the ILMI value. But could this the due to the wind requiring a constant correction in both pitch and roll? Or should I retry trimming the helicopter?

I set the harmonic notch filter to dynamic using the RPM sensor, and increased the PSC_VELXY_D gain in increments from 0.2 until I stopped at 0.4. There is, however, still a phase shift between target/actual velocities.

I’m starting to wonder if my pitch and roll tuning is introducing these oscillations?

Log file from my latest flight, in hover:

Thanks again!


I normally try to get this within 0.02 for a zero wind hover.

1 Like