Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix & flapper platform defaults updates #1409

Merged
merged 2 commits into from
Sep 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions src/platform/interface/platform_defaults_flapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,21 +73,21 @@
#define PID_PITCH_KFF 0.0
#define PID_PITCH_INTEGRATION_LIMIT 20.0

#define PID_YAW_KP 30.0
#define PID_YAW_KP 8.0
#define PID_YAW_KI 0.0
#define PID_YAW_KD 1.0
#define PID_YAW_KD 0.35
#define PID_YAW_KFF 0.0
#define PID_YAW_INTEGRATION_LIMIT 360.0

#define PID_VEL_X_KP 25.0f
#define PID_VEL_X_KP 15.0f
#define PID_VEL_X_KI 1.0f
#define PID_VEL_X_KD 0.0f
#define PID_VEL_X_KFF 10.0f
#define PID_VEL_X_KFF 15.0f

#define PID_VEL_Y_KP 15.0f
#define PID_VEL_Y_KP 10.0f
#define PID_VEL_Y_KI 1.0f
#define PID_VEL_Y_KD 0.0f
#define PID_VEL_Y_KFF 5.0f
#define PID_VEL_Y_KFF 8.0f

#define PID_VEL_Z_KP 12.5f
#define PID_VEL_Z_KI 0.5f
Expand All @@ -99,8 +99,8 @@
#define PID_VEL_Z_KD_BARO_Z_HOLD 1.0f
#define PID_VEL_Z_KFF_BARO_Z_HOLD 0.0f

#define PID_VEL_ROLL_MAX 20.0f
#define PID_VEL_PITCH_MAX 20.0f
#define PID_VEL_ROLL_MAX 30.0f
#define PID_VEL_PITCH_MAX 30.0f
#define PID_VEL_THRUST_BASE 40000.0f
#define PID_VEL_THRUST_BASE_BARO_Z_HOLD 40000.0f
#define PID_VEL_THRUST_MIN 20000.0f
Expand All @@ -120,14 +120,14 @@
#define PID_POS_Z_KD 0.0f
#define PID_POS_Z_KFF 0.0f

#define PID_POS_VEL_X_MAX 1.0f
#define PID_POS_VEL_Y_MAX 1.0f
#define PID_POS_VEL_X_MAX 2.0f
#define PID_POS_VEL_Y_MAX 2.0f
#define PID_POS_VEL_Z_MAX 1.0f

// PID filter configuration
#define ATTITUDE_ROLL_RATE_LPF_CUTOFF_FREQ 12.5f
#define ATTITUDE_PITCH_RATE_LPF_CUTOFF_FREQ 12.5f
#define ATTITUDE_YAW_RATE_LPF_CUTOFF_FREQ 3.0f
#define ATTITUDE_ROLL_RATE_LPF_CUTOFF_FREQ 20.0f
#define ATTITUDE_PITCH_RATE_LPF_CUTOFF_FREQ 20.0f
#define ATTITUDE_YAW_RATE_LPF_CUTOFF_FREQ 5.0f
#define ATTITUDE_RATE_LPF_ENABLE true
#define PID_VEL_XY_FILT_CUTOFF 10.0f
#define PID_VEL_Z_FILT_CUTOFF 10.0f
Expand Down
1 change: 1 addition & 0 deletions src/utils/src/pid.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include "num.h"
#include <math.h>
#include <float.h>
#include "autoconf.h"

void pidInit(PidObject* pid, const float desired, const float kp,
const float ki, const float kd, const float kff, const float dt,
Expand Down