Skip to content

Commit

Permalink
IMUF 227
Browse files Browse the repository at this point in the history
Math getting a little closer to the very effecient IMUF 211, but with the new sharpness. Take use a larget sharpness than before and be wary with first testing this. Good Luck!!!
  • Loading branch information
Quick-Flash committed Feb 29, 2020
1 parent 9780c11 commit b330fff
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/filter/filter.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,17 +155,17 @@ void filter_data(volatile axisData_t *gyroRateData, volatile axisData_t *gyroAcc
setPointNew = 0;
if (setPoint.x != 0.0f && oldSetPoint.x != setPoint.x)
{
filterConfig.roll_lpf_hz = CONSTRAIN(50.0f * ABS(1.0f - ((setPoint.x * errorMultiplierX) / filteredData->rateData.x))/* + ABS(filteredData->rateData.x / 4)*/, 10.0f, 500.0f);
filterConfig.roll_lpf_hz = CONSTRAIN(10.0f * ABS(1.0f - ((setPoint.x * errorMultiplierX) / filteredData->rateData.x))/* + ABS(filteredData->rateData.x / 4)*/, 10.0f, 500.0f);
filter_biquad_init(filterConfig.roll_lpf_hz, &(lpfFilterStateRate.x));
}
if (setPoint.y != 0.0f && oldSetPoint.y != setPoint.y)
{
filterConfig.pitch_lpf_hz = CONSTRAIN(50.0f * ABS(1.0f - ((setPoint.y * errorMultiplierY) / filteredData->rateData.y))/* + ABS(filteredData->rateData.y / 4)*/, 10.0f, 500.0f);
filterConfig.pitch_lpf_hz = CONSTRAIN(10.0f * ABS(1.0f - ((setPoint.y * errorMultiplierY) / filteredData->rateData.y))/* + ABS(filteredData->rateData.y / 4)*/, 10.0f, 500.0f);
filter_biquad_init(filterConfig.pitch_lpf_hz, &(lpfFilterStateRate.y));
}
if (setPoint.z != 0.0f && oldSetPoint.z != setPoint.z)
{
filterConfig.yaw_lpf_hz = CONSTRAIN(50.0f * ABS(1.0f - ((setPoint.z * errorMultiplierZ) / filteredData->rateData.z))/* + ABS(filteredData->rateData.z / 4)*/, 10.0f, 500.0f);
filterConfig.yaw_lpf_hz = CONSTRAIN(10.0f * ABS(1.0f - ((setPoint.z * errorMultiplierZ) / filteredData->rateData.z))/* + ABS(filteredData->rateData.z / 4)*/, 10.0f, 500.0f);
filter_biquad_init(filterConfig.yaw_lpf_hz, &(lpfFilterStateRate.z));
}
memcpy((uint32_t *)&oldSetPoint, (uint32_t *)&setPoint, sizeof(axisData_t));
Expand Down
2 changes: 1 addition & 1 deletion src/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
#define HARDWARE_VERSION 101
#define BOOTLOADER_VERSION 101

#define FIRMWARE_VERSION 226
#define FIRMWARE_VERSION 227

0 comments on commit b330fff

Please sign in to comment.