@@ -18,13 +18,23 @@ extern "C" {
1818/** Attitude gains and inertia (Section 3). */
1919typedef struct {
2020 float Kp [3 ][3 ]; /**< Proportional gain: attitude error -> torque [N·m/rad] */
21+ float Ki [3 ][3 ];
2122 float Kd [3 ][3 ]; /**< Derivative gain: angular rate -> torque [N·m·s/rad] */
2223 float I [3 ][3 ]; /**< Inertia matrix body frame [kg·m²] */
24+ // float x_integral_limit;
25+ // float y_integral_limit;
26+ // float z_integral_limit;
27+ // float x_torque_min;
28+ // float x_torque_max;
29+ // float y_torque_min;
30+ // float y_torque_max;
31+ // float z_torque_min;
32+ // float z_torque_max;
2333} flight_controller_attitude_config_t ;
2434
2535/** Allocation: unit thrust direction in body frame (Section 4). */
2636typedef struct {
27- float t_hat [3 ]; /**< Unit thrust direction (e.g. [0,0,-1] for z-up) */
37+ float thrust_dir [3 ]; /**< Unit thrust direction (e.g. [0,0,-1] for z-up) */
2838} flight_controller_allocation_config_t ;
2939
3040/** Gimbal geometry and angle limits (Section 5). */
@@ -83,6 +93,13 @@ typedef struct {
8393 */
8494void flight_controller_init (const flight_controller_config_t * config );
8595
96+ // /**
97+ // * @brief Set flight controller internal state.
98+ // * Call to update config (e.g. thrust gains)
99+ // * @param config Controller config (thrust gains used for z-PID).
100+ // */
101+ // void flight_controller_set_config(const flight_controller_config_t *config);
102+
86103/**
87104 * @brief Run one step: torque → allocation → thrust PID → gimbal angles.
88105 * @param state Current estimated state (from state_exchange).
@@ -97,6 +114,12 @@ void flight_controller_run(const state_t *state,
97114 control_output_t * out ,
98115 float dt_s );
99116
117+ /**
118+ * @brief Reset flight controller internal state (e.g. z-PID integral).
119+ *
120+ */
121+ void flight_controller_reset (void );
122+
100123#ifdef __cplusplus
101124}
102125#endif
0 commit comments