Skip to content

Commit

Permalink
Update Mahony_AHRS.h
Browse files Browse the repository at this point in the history
  • Loading branch information
mgrouch authored Aug 31, 2024
1 parent 8b2e5fe commit 02404cc
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions bbn_wave_freq_m5atomS3/Mahony_AHRS.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ void mahony_AHRS_update(Mahony_AHRS_Vars* m,
float *pitch, float *roll, float *yaw, float delta_t_sec);
float invSqrt(float x);

/*
The gain is the Kp term in a PID controller, tune it as you would any PID controller (missing the I and D terms).
If Kp is too low, the filter will respond slowly to changes in sensor orientation.
If too high, the filter output will oscillate.
*/
void mahony_AHRS_init(Mahony_AHRS_Vars* m, float twoKp, float twoKi) {
m->twoKp = twoKp;
m->twoKi = twoKi;
Expand Down

0 comments on commit 02404cc

Please sign in to comment.