Skip to content

Commit

Permalink
Updating PID logging variables
Browse files Browse the repository at this point in the history
  • Loading branch information
matejkarasek committed Oct 3, 2022
1 parent 4f53246 commit 33942e0
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/modules/src/attitude_pid_controller.c
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,10 @@ LOG_ADD(LOG_FLOAT, roll_outI, &pidRoll.outI)
* @brief Derivative output roll
*/
LOG_ADD(LOG_FLOAT, roll_outD, &pidRoll.outD)
/**
* @brief Feedforward output roll
*/
LOG_ADD(LOG_FLOAT, roll_outFF, &pidRoll.outFF)
/**
* @brief Proportional output pitch
*/
Expand All @@ -237,6 +241,10 @@ LOG_ADD(LOG_FLOAT, pitch_outI, &pidPitch.outI)
* @brief Derivative output pitch
*/
LOG_ADD(LOG_FLOAT, pitch_outD, &pidPitch.outD)
/**
* @brief Feedforward output pitch
*/
LOG_ADD(LOG_FLOAT, pitch_outFF, &pidPitch.outFF)
/**
* @brief Proportional output yaw
*/
Expand All @@ -249,6 +257,10 @@ LOG_ADD(LOG_FLOAT, yaw_outI, &pidYaw.outI)
* @brief Derivative output yaw
*/
LOG_ADD(LOG_FLOAT, yaw_outD, &pidYaw.outD)
/**
* @brief Feedforward output yaw
*/
LOG_ADD(LOG_FLOAT, yaw_outFF, &pidYaw.outFF)
LOG_GROUP_STOP(pid_attitude)

/**
Expand All @@ -267,6 +279,10 @@ LOG_ADD(LOG_FLOAT, roll_outI, &pidRollRate.outI)
* @brief Derivative output roll rate
*/
LOG_ADD(LOG_FLOAT, roll_outD, &pidRollRate.outD)
/**
* @brief Feedforward output roll rate
*/
LOG_ADD(LOG_FLOAT, roll_outFF, &pidRollRate.outFF)
/**
* @brief Proportional output pitch rate
*/
Expand All @@ -279,6 +295,10 @@ LOG_ADD(LOG_FLOAT, pitch_outI, &pidPitchRate.outI)
* @brief Derivative output pitch rate
*/
LOG_ADD(LOG_FLOAT, pitch_outD, &pidPitchRate.outD)
/**
* @brief Feedforward output pitch rate
*/
LOG_ADD(LOG_FLOAT, pitch_outFF, &pidPitchRate.outFF)
/**
* @brief Proportional output yaw rate
*/
Expand All @@ -291,6 +311,10 @@ LOG_ADD(LOG_FLOAT, yaw_outI, &pidYawRate.outI)
* @brief Derivative output yaw rate
*/
LOG_ADD(LOG_FLOAT, yaw_outD, &pidYawRate.outD)
/**
* @brief Feedforward output yaw rate
*/
LOG_ADD(LOG_FLOAT, yaw_outFF, &pidYawRate.outFF)
LOG_GROUP_STOP(pid_rate)

/**
Expand Down
50 changes: 50 additions & 0 deletions src/modules/src/position_controller_pid.c
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,23 @@ LOG_ADD(LOG_FLOAT, bodyX, &state_body_x)
*/
LOG_ADD(LOG_FLOAT, bodyY, &state_body_y)

/**
* @brief PID proportional output position x
*/
LOG_ADD(LOG_FLOAT, Xp, &this.pidX.pid.outP)
/**
* @brief PID integral output position x
*/
LOG_ADD(LOG_FLOAT, Xi, &this.pidX.pid.outI)
/**
* @brief PID derivative output position x
*/
LOG_ADD(LOG_FLOAT, Xd, &this.pidX.pid.outD)
/**
* @brief PID feedforward output position x
*/
LOG_ADD(LOG_FLOAT, Xff, &this.pidX.pid.outFF)

/**
* @brief PID proportional output position y
*/
Expand All @@ -358,6 +375,10 @@ LOG_ADD(LOG_FLOAT, Yi, &this.pidY.pid.outI)
* @brief PID derivative output position y
*/
LOG_ADD(LOG_FLOAT, Yd, &this.pidY.pid.outD)
/**
* @brief PID feedforward output position y
*/
LOG_ADD(LOG_FLOAT, Yff, &this.pidY.pid.outFF)

/**
* @brief PID proportional output position z
Expand All @@ -371,6 +392,10 @@ LOG_ADD(LOG_FLOAT, Zi, &this.pidZ.pid.outI)
* @brief PID derivative output position z
*/
LOG_ADD(LOG_FLOAT, Zd, &this.pidZ.pid.outD)
/**
* @brief PID feedforward output position z
*/
LOG_ADD(LOG_FLOAT, Zd, &this.pidZ.pid.outFF)

/**
* @brief PID proportional output velocity x
Expand All @@ -384,6 +409,27 @@ LOG_ADD(LOG_FLOAT, VXi, &this.pidVX.pid.outI)
* @brief PID derivative output velocity x
*/
LOG_ADD(LOG_FLOAT, VXd, &this.pidVX.pid.outD)
/**
* @brief PID feedforward output velocity x
*/
LOG_ADD(LOG_FLOAT, VXff, &this.pidVX.pid.outFF)

/**
* @brief PID proportional output velocity y
*/
LOG_ADD(LOG_FLOAT, VYp, &this.pidVY.pid.outP)
/**
* @brief PID integral output velocity y
*/
LOG_ADD(LOG_FLOAT, VYi, &this.pidVY.pid.outI)
/**
* @brief PID derivative output velocity y
*/
LOG_ADD(LOG_FLOAT, VYd, &this.pidVY.pid.outD)
/**
* @brief PID feedforward output velocity y
*/
LOG_ADD(LOG_FLOAT, VYff, &this.pidVY.pid.outFF)

/**
* @brief PID proportional output velocity z
Expand All @@ -397,6 +443,10 @@ LOG_ADD(LOG_FLOAT, VZi, &this.pidVZ.pid.outI)
* @brief PID integral output velocity z
*/
LOG_ADD(LOG_FLOAT, VZd, &this.pidVZ.pid.outD)
/**
* @brief PID feedforward output velocity z
*/
LOG_ADD(LOG_FLOAT, VZff, &this.pidVZ.pid.outFF)

LOG_GROUP_STOP(posCtl)

Expand Down

0 comments on commit 33942e0

Please sign in to comment.