Skip to content

Commit

Permalink
Defaults set, Annotations
Browse files Browse the repository at this point in the history
Default threshold 40 deg/sec
Anotations provided to explain
- cutoff independence factor when calculating itermRelaxSetpointThreshold
- meaning of ITERM_RELAX_SETPOINT_THRESHOLD
  • Loading branch information
ctzsnooze committed Mar 3, 2019
1 parent a646c09 commit a0237e6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/main/flight/pid.c
Expand Up @@ -621,6 +621,7 @@ void pidInitConfig(const pidProfile_t *pidProfile)
itermRelax = pidProfile->iterm_relax;
itermRelaxType = pidProfile->iterm_relax_type;
itermRelaxCutoff = pidProfile->iterm_relax_cutoff;
// 20.0f below is current default itermRelaxCutoff value, to adapt setpoint to change from cutoff
itermRelaxSetpointThreshold = ITERM_RELAX_SETPOINT_THRESHOLD * 20.0f / itermRelaxCutoff;
#endif

Expand Down
4 changes: 2 additions & 2 deletions src/main/flight/pid.h
Expand Up @@ -44,8 +44,8 @@
// This value gives the same "feel" as the previous Kd default of 26 (26 * DTERM_SCALE)
#define FEEDFORWARD_SCALE 0.013754f

// Full iterm suppression at 40deg/sec * default cutoff of 20
#define ITERM_RELAX_SETPOINT_THRESHOLD 30.0f
// Full iterm suppression in setpoint mode at high-passed setpoint rate > 40deg/sec
#define ITERM_RELAX_SETPOINT_THRESHOLD 40.0f

typedef enum {
PID_ROLL,
Expand Down

0 comments on commit a0237e6

Please sign in to comment.