Skip to content

Conversation

@DzikuVx
Copy link
Member

@DzikuVx DzikuVx commented Mar 24, 2019

FIR has to be inited and buffer initialized in case user changes FIR from OFF to ON. Other option is to have dummy function pointers or listeners in MSP and CLI to init it before PID loop is executed. Let's assume this is fine for now

@DzikuVx DzikuVx changed the title Fix FIR init Fix simple Dterm diferentiator Mar 24, 2019
}

for (int axis = 0; axis < 3; ++ axis) {
firFilterInit(&pidState[axis].gyroRateFilter, pidState[axis].gyroRateBuf, PID_GYRO_RATE_BUF_LENGTH, dtermCoeffs);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In case of !use_dterm_fir_filter we can use length of 2 instead of PID_GYRO_RATE_BUF_LENGTH

@DzikuVx
Copy link
Member Author

DzikuVx commented Mar 27, 2019

OK, I'm merging as it is. Those 3 floats could be saved but overhead of managing buffer length at runtime in CLI and MSP seems like an overkill

@DzikuVx DzikuVx added this to the 2.2 milestone Mar 27, 2019
@DzikuVx DzikuVx merged commit 3ce7879 into development Mar 27, 2019
@DzikuVx DzikuVx deleted the dzikuvx-fix-dterm-fir-init branch March 27, 2019 08:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants