ArduCopter可以自动通过算法来对PID进行调优,不过这里有个前提是模型噪声要比较少。
注:PID初始值会设置的比较小,因此,调整后的PID理论上会比默认的更加灵敏。
注:这里就操作性比较强的重点参数列出来,因为这个文档并不和代码同步。如果大家发现遇到问题,请多看官网+论坛+Discord。
Reduce the vibrations in the control signals as low as possible
On a calm day, the heli will maintain a near driftless hover (< 1 m/s)
RC10_OPTION = 17 //autotune,请根据大家的遥控器进行设置
AUTOTUNE_AXES = 7 // roll+pitch+yaw,通常15分钟左右,如果电池时间不够,请减少一次自动调整的项目,比如:仅roll+pitch,不做yaw
AUTOTUNE_MIN_D = 0.0003 // small copter,这个就经验吧,多做实验,大家基本也就知道了。真想搞明白,请搞懂原理,熟读代码
AUTOTUNE_AGGR = 0.1 //(0.1=agressive, 0.075=medium, 0.050=weak), normally start with the default 0.1.
Power up the controller.
Set the flight mode to either stabilize or AltHold (Althold recommended).
Enable motor interlock and allow rotors to complete runup.
Lift off and establish stable hover approximately 3-5 meters above the ground.
Switch into AutoTune and center all sticks.
AutoTune will start conducting the maneuvers.
After the tuning is complete, a message will appear in the GCS saying “AutoTune complete”.
To test the settings, switch out of AutoTune and then back to AutoTune and you will be able to test the settings that were tuned.
Once you are finished testing, descend and land in AutoTune. Once the aircraft has landed, the engine will shutdown on its own. At that point flip your motor interlock switch to disabled and disarm the aircraft.
Mark4 Roll Pitch Yaw YawD Autotune
笔者这台Mark4电机有点问题:稍有振动噪声,详见:
【1】BetaFlight Mark4之“妖怪”声音
【2】BetaFlight Mark4之“妖怪”声音之二
参数 | 初始值(手动) | 有风场地 | 无风场地 |
---|---|---|---|
ATC_ACCEL_P_MAX | 165300 | 228225.7 | 316101.2 |
ATC_ACCEL_R_MAX | 165300 | 350944.3 | 403007.5 |
ATC_ACCEL_Y_MAX | 31500 | 43567.17 | 43567.17 |
ATC_ANG_PIT_P | 4.5 | 24.62969 | 34.38787 |
ATC_ANG_RLL_P | 4.5 | 36 | 35.721 |
ATC_ANG_YAW_P | 4.5 | 13.029 | 13.029 |
ATC_RAT_PIT_D | 0.0064 | 0.004245891 | 0.003076027 |
ATC_RAT_PIT_I | 0.135 | 0.1255343 | 0.1093932 |
ATC_RAT_PIT_P | 0.24 | 0.1255343 | 0.1093932 |
ATC_RAT_RLL_D | 0.0056 | 0.002464709 | 0.00208265 |
ATC_RAT_RLL_I | 0.135 | 0.09347163 | 0.095719 |
ATC_RAT_RLL_P | 0.21 | 0.09347163 | 0.095719 |
ATC_RAT_YAW_FLTE | 2 | 1.79243 | 1.79243 |
ATC_RAT_YAW_I | 0.018 | 0.03550447 | 0.03550447 |
ATC_RAT_YAW_P | 0.18 | 0.3550447 | 0.3550447 |
最终调教出来的参数并不理想,因为手动调整的参数比自动调准的PD值更高,且并不振动,而较低的PD值,响应会差很多。
不管怎么说,这个确实是个好的功能,但是作为手动飞的情况,还是需要每个人根据自己的习惯以及喜好进行调整。
【1】ArduPilot之H743+BMI270x2+First Normal Takeoff
【2】BetaFlight Mark4之“妖怪”声音
【3】BetaFlight Mark4之“妖怪”声音之二
【4】ArduPilot: traditional-helicopter-autotune
Arducopter Tuning (AUTOTUNE, PIDs & FILTERS, FLIGHT TESTS!)