FPV Racer Tuning

This thread is for discussion about tuning the PX4 flight stack for FPV racing multicopters.

I’ll start with the current tuning for my 3S Spedix S250AQ with a Pixracer FC.

MC_PITCHRATE_D  0.0055
MC_PITCHRATE_FF 0.0
MC_PITCHRATE_I  0.2
MC_PITCHRATE_MAX 720.0
MC_PITCHRATE_P  0.19
MC_PITCH_P      8.0

MC_RATT_TH	0.8
MC_ROLLRATE_D	0.0055
MC_ROLLRATE_FF	0.0
MC_ROLLRATE_I	0.1
MC_ROLLRATE_MAX	720.0
MC_ROLLRATE_P	0.19
MC_ROLL_P	8.0

MC_TPA_BREAK	0.4
MC_TPA_SLOPE	1.5

MC_YAWRATE_D	0.0
MC_YAWRATE_FF	0.0
MC_YAWRATE_I	0.1
MC_YAWRATE_MAX	220.0
MC_YAWRATE_P	0.2

MC_YAW_FF	0.5
MC_YAW_P	4.0

You’ll notice the I gains are fairly high; I find that MC_PITCHRATE_I must be especially high for the quad to feel “locked in” on the pitch axis in ACRO mode. It is also necessary to run fairly high P gains to lock in the attitude when in ACRO mode. In STABILIZE mode, these gains can be reduced without loss of attitude accuracy because the controller is using the IMU’s estimate of orientation in addition to the gyro signals.

I’m using a Blade Vortex 250 Pro as my reference vehicle for performance comparisons, since Horizon Hobbies claims that it is delivered pre-tuned and race-ready :slight_smile: I’m flying it and my S250 LOS in ACRO mode to compare the “feel” of the two racers and judge the quality of my PX4/Pixracer setup/tuning. I’ll be doing the same in FPV, once I get a suitable test course set up.

Note that the parameter values shown above are the ones for the “generic_250” config (4050). You can get them automatically by changing to that airframe using QGC.

Here is the impulse response analysis for roll and pitch rate control (acro mode) on the S250 with the above parameter values, The control latency (delay from rate setpoint to vehicle motion (gyro output)) is only 40msec for both roll and pitch. The closed loop system is slightly underdamped and natural frequency is about 5Hz

Roll and pitch angle control latency (stabilize mode) is 112msec for both axes:

This is a plot of the rate control signal (delayed by 40msec) against the modeled and measured rates. The model is accounting for more than 95% of the measured response:

This plot shows that there is no oscillation at full throttle. (roll/pitch/yaw angles are offset +1 radian, z accel is scaled and offset such that hover is zero and freefall is -1) The slow oscillation in pitch is probably due to the low throttle setting during descent, and suggests that it might be beneficial to ramp the P gains up below the TPA breakpoint:

full log: http://logs.px4.io/plot_app?log=c3f7e258-f273-4fc2-ba37-df3ecc3c603f

@olex @schlumpfteam I’d appreciate feedback on how well the latest release s working now on Pixracer if you guys are still flying it. I’d also be very interested in feedback on this PR: https://github.com/PX4/Firmware/pull/5372