@@ -1737,14 +1737,6 @@ void navPidInit(pidController_t *pid, float _kP, float _kI, float _kD, float _kF
1737
1737
navPidReset (pid );
1738
1738
}
1739
1739
1740
- /*-----------------------------------------------------------
1741
- * Float point P-controller implementation
1742
- *-----------------------------------------------------------*/
1743
- void navPInit (pController_t * p , float _kP )
1744
- {
1745
- p -> param .kP = _kP ;
1746
- }
1747
-
1748
1740
/*-----------------------------------------------------------
1749
1741
* Detects if thrust vector is facing downwards
1750
1742
*-----------------------------------------------------------*/
@@ -3036,7 +3028,14 @@ void navigationUsePIDs(void)
3036
3028
3037
3029
// Initialize position hold P-controller
3038
3030
for (int axis = 0 ; axis < 2 ; axis ++ ) {
3039
- navPInit (& posControl .pids .pos [axis ], (float )pidProfile ()-> bank_mc .pid [PID_POS_XY ].P / 100.0f );
3031
+ navPidInit (
3032
+ & posControl .pids .pos [axis ],
3033
+ (float )pidProfile ()-> bank_mc .pid [PID_POS_XY ].P / 100.0f ,
3034
+ 0.0f ,
3035
+ 0.0f ,
3036
+ 0.0f ,
3037
+ NAV_DTERM_CUT_HZ
3038
+ );
3040
3039
3041
3040
navPidInit (& posControl .pids .vel [axis ], (float )pidProfile ()-> bank_mc .pid [PID_VEL_XY ].P / 20.0f ,
3042
3041
(float )pidProfile ()-> bank_mc .pid [PID_VEL_XY ].I / 100.0f ,
@@ -3047,7 +3046,14 @@ void navigationUsePIDs(void)
3047
3046
}
3048
3047
3049
3048
// Initialize altitude hold PID-controllers (pos_z, vel_z, acc_z
3050
- navPInit (& posControl .pids .pos [Z ], (float )pidProfile ()-> bank_mc .pid [PID_POS_Z ].P / 100.0f );
3049
+ navPidInit (
3050
+ & posControl .pids .pos [Z ],
3051
+ (float )pidProfile ()-> bank_mc .pid [PID_POS_Z ].P / 100.0f ,
3052
+ 0.0f ,
3053
+ 0.0f ,
3054
+ 0.0f ,
3055
+ NAV_DTERM_CUT_HZ
3056
+ );
3051
3057
3052
3058
navPidInit (& posControl .pids .vel [Z ], (float )pidProfile ()-> bank_mc .pid [PID_VEL_Z ].P / 66.7f ,
3053
3059
(float )pidProfile ()-> bank_mc .pid [PID_VEL_Z ].I / 20.0f ,
0 commit comments