Pid roll slew rate

Hello,

today I tryed to tune roll axis,

trying to setup the rat roll ff, with little rate d gain,

I see little jerks while inputing with the roll stick:


After flight checking the dataflash logs at pidR,
is see that slew rate (blue curve) goes up, and it’s action seems stopping the ff contrôler action inducing this jerks…

checking the logs it seems to me that srate act in the loop through rate d…

From where comme this slew rate?

also below vibe levels:

also ATC_ACCEL_R_MAX is set to 50000

and atc input tc to 0,2.

Please let me know if you have an idea from where comme this.

also below the gyro output:

I think that this can be due to vibration issue, so I make raw vibration analys:



I have strong rotor vibration at 15,69Hz
I setup the filter as marked on the print screen.

do you think this can be linked ?

If this is linked, how to deal with this vibration @t 15hz, that near the controler frequency ?

Can you post the log file from this flight, please?

1 Like

Hello Bill,

How nice to see you again.

This is fresh tandem heli I build with rigid heads rigid linked to rigid metal servos (on the other post is same type but with plastic soft damped heads with soft servos plastic linked.)

Bellow the link for 2 logs:
The first with the raw vibe analys:
00000033.BIN
The second one with little commands on roll pitch yaw where I see the jerks on the roll:
2024-10-03 16-28-21.bin

I’m thinking to simpli test today with FLTT and FLTE low pass filter @ 14Hz.

Also on this setup imu is hard mounted on the frame.

I just want to fix this jerk, tune it for good control in RPY, and make the roll pitch yaw SID.

Update:
Make the flight with FLTE and FLTT, and I see the the jerk is smoother, but is present:
2024-10-04 11-35-47.bin
and the slewR, continuous to be @t High level

Update,

Below new notch filter setup:


with raw sensor activated log pre and post
00000039-2.BIN

Update,

I just remake flight with pilot roll input for check:
dataflash here: 2024-10-04 16-15-52.bin

looks that with then new notch setup I have less jerks on the roll axis, but it’s not perfect and you see the twitches when you look the heli in flight, so I do not understand from where come the Srate.

Maybe I need to isolate the pixhawk with dampers ?

Slew rate in the log data is showing you how fast the servos are moving for the requested output from the controller. It’s mainly used to determine when feedback instability occurs due to over tuning.

Vibes are fine. I don’t think it is linked to the noise your are seeing at 15 hz. Most likely this is a feedback instability. I’ll know more when I look at the data.

You only need dampers if the vibes were high. I think your vibes look pretty good.

I really think that your gains are too high but I won’t know which one until I look at the data.

Hello Bill thank you for this feedback, I understand more now what is the slew rate.

I shared the log if you can check:
2024-10-04 16-15-52.bin

Rat roll d is at only 0,002, anf rate ff is at 0,17,
When i lower FF r des is more big than r meas on little 20d/s rate inputs.

So i go forward lowering ff and D for check.
Thank you.

Today I make other flights trying to keep out of this jerks on the roll axis, I reduced rate p and d to 0.007 and 0.0007, and this not changed anything.

I always have this jerks on the roll

So I suspect that ff controller make that,
I make flight lowering ff from 0,18 to 0,12, this reduced the jerks, but when I see in the rate logs r measured is 3/4 below rdes.

Do you think that I must go farther reducing ff to make that roll jerks disappear?

Due to this jerks I don’t already make and sid flight.

graph rdeas r meas for roll ff 0.18 P 0.01 D 0.001

graph rdeas r meas for roll ff 0.12 P 0.01 D 0.002

graph rdeas r meas for roll ff 0.18 P 0.01 D 0.002

After looking at the log, I’m pretty certain that the jerkiness is due to the Rate D gain being too high. Continue to reduce ATC_RAT_RLL_D until it goes away. I would recommend reducing it to 0.0001

Hello Bill,

On the hardlinked dual heli I test today to reduct rat_rll_d to 0.0001, and I not see anything, please check below des rat vs meas rat vs ptun, we continuous to see the jerkiness…:

I also tryed on sid on pitch with same settings (5° amplitude) as you told me for the other dual, I stop it when I saw angles greather than 10°:


I will try to reduce FF and push rat pit d/p and stab pit p before retry.
Maybe with this little one we can check on the analytics tune ?
2024-10-14 11-23-17.bin

thank you so much.

On this dual heli we want to limit max rat pitch acc to 10000 centdegré / s / s

it’s possible to make SID tweetches that respect that limit ?

because on last tweetch we reached more than 180°/s/s and this is to much for this dual heli…(50kg)

also do you think we can limit max angle to ±10° and max pitch angular velocity somewhere between 10°/s and 20°/s ?

to handle this is it better to limit slew rate? and pd max?

Yes, use SID_AXIS of 1 (roll), 2 (pitch), or 3 (yaw). That will enforce the acceleration and rate limits.

These SID_AXIS values will do a better job of keeping the attitudes to the requested magnitude. If you feel that the attitudes are still too high, reduce the SID_MAGNITUDE to 2 or 3 deg

No. Use what I described above.

Good news Thank you.

Hello Bill

About the Roll jerk I check the pidR and is what I see @t 0,001D


and @t 0.0001D

we see around 5Hz excitation of D and P…

to better caracterise the issue, can we acivate pid log @t 50hz instead of 10Hz ?

also do you think I can reduce the P to 0.001 with Ptun for test?

do you think we can activate pid notch to filter out all pertubation entering in the target calculation that is above 4 Hz ?

Bill also can you pleae check on the analytic tune tool this one log on the Pitch axis:
2024-10-14 11-23-17.bin

Thank you for your help

Hello Bill,

I see that analytic tune tool is available and I thank you so much for that.

So I played with the analytic tune web tool :wink: on this log below for pitch axis:

2024-10-14 11-23-17.bin

I found that good tune on pitch axis will be:

Can you check with these params and advice me following your experience ?

I see bump on gain just @t 1,64Hz, I think is due to that I end the seep @t 0,8Hz, so analytic tune have no data for it, can I don’t take care of it?

Hello Bill,

Did you see my last questions just above ?

I need you help to limit mistakes if possible.

Many kind regards.

@kuspower Sorry for the slow reply. Just coming back from the conference in Japan. I don’t think you can trust anything from that system ID run. The frequency just didn’t get high enough. I would suggest you use the SID_AXIS 2 for this. Set the SID magnitude to 3. Hopefully this will allow you to collect data throughout a frequency range from 0.5 up to 5 hz. We really need it out to the frequency where you see 270 deg of phase with good coherence.

Looking at your parameters, I would suggest that you bring down the Rate FF gain and raise the rate P gain by the same amount. So I would suggest stepping Rate FF down to 0.14 and rate P up to 0.06. Fly and make sure the low frequency is stable.

Then step Rate FF to 0.11 and Rate P up to 0.09. Then fly and make sure it is stable. You might keep the Rate P gain on a know to ensure you don’t get any bad oscillation. Take one more step to Rate FF of 0.08 and Rate P up to 0.12.

if that all goes well then try the system ID mode again.

Hello Bill,

Thank you for this advices.

I followed your advices and I make a sid on pitch,
I just go farther on lowering FF to 0.06 and increasing P to 0,14.
Also I increased D to 0.08.

Please see log below:
2024-10-29 15-49-50.bin
See the rate analys:


attitude:

input :

Let me know what you think and what I can do to improve the result.

Thank you so much.

It definitely looks better. Conduct the System ID for pitch again but this time set the SID_F_STOP_HZ to 10. It is not capturing the high frequencies that I want to see for the effects of the Rate D term. based on my estimates, i think you will be able to bring up your Rate P more. but I want to be sure that we capture these effects at the high frequencies.

It looks like the acceleration limits in the Feedforward may be reducing the signal and that is why the coherence drops around 4-5 hz. I wouldn’t go much further in changing gains until we understand what is happening at the higher frequencies.

Hello Bill,
I try to redoo a test asap to 10Hz to get the 270° response phase.
To minimise the risk, In case of resonance during the test, do you advice to set ch6 knob to reduce p or d ?

Hi Bill,

After tuning the yaw PID in 3 flights with CH6 knob from
FF 0.05 to 0.000
RAT D 0.002 to 0.025
RAT P 0.19 to 0.33

and after 3 perfect flights with this setup, I had a yaw resonance during the ground run-up, I got scared, and immediately cut the engine.
I had many chances to not brake anything…

You can see below the 2Hz resonance increasing and the RPM curve in yellow.

below the link with the dataflash log:
63 31-10-2024 16-36-38.bin

What do you recommend to avoid this?

the flight just before without resonance but same params: