@@ -177,15 +177,7 @@ class Axis : public PersistentStorage, public CommandHandler, public ErrorHandle
177177
178178 const Error outOfBoundsError = Error(ErrorCode::axisOutOfRange,ErrorType::warning," Axis out of bounds" );
179179
180- const TMC4671PIDConf tmcpids = TMC4671PIDConf({.fluxI = 400 ,
181- .fluxP = 400 ,
182- .torqueI = 400 ,
183- .torqueP = 300 ,
184- .velocityI = 0 ,
185- .velocityP = 128 ,
186- .positionI = 0 ,
187- .positionP = 64 ,
188- .sequentialPI = true });
180+
189181 TMC4671Limits tmclimits = TMC4671Limits({.pid_torque_flux_ddt = 32767 ,
190182 .pid_uq_ud = 30000 ,
191183 .pid_torque_flux = 30000 ,
@@ -194,13 +186,24 @@ class Axis : public PersistentStorage, public CommandHandler, public ErrorHandle
194186 .pid_pos_low = -2147483647 ,
195187 .pid_pos_high = 2147483647 });
196188
197- // Lowpass 1KHZ
198- const TMC4671Biquad fluxbq = TMC4671Biquad({.a1 = -134913 ,
199- .a2 = 536735999 ,
200- .b0 = 67457 ,
201- .b1 = 134913 ,
202- .b2 = 67457 ,
203- .enable = true });
189+ // Lowpass 500Hz Q 0.7 @ 25khz
190+ const TMC4671Biquad tmcbq_500hz_07q_25k = TMC4671Biquad(
191+ { .a1 = 979476766 ,
192+ .a2 = -450370144 ,
193+ .b0 = 1941073 ,
194+ .b1 = 3882145 ,
195+ .b2 = 1941073 ,
196+ .enable = true });
197+
198+ // Lowpass 1000Hz Q 0.7 @ 25khz
199+ const TMC4671Biquad tmcbq_1000hz_07q_25k = TMC4671Biquad(
200+ { .a1 = 886773302 ,
201+ .a2 = -378358476 ,
202+ .b0 = 7114021 ,
203+ .b1 = 14228043 ,
204+ .b2 = 7114021 ,
205+ .enable = true });
206+
204207
205208
206209 float encoderOffset = 0 ; // Offset for absolute encoders
@@ -247,7 +250,7 @@ class Axis : public PersistentStorage, public CommandHandler, public ErrorHandle
247250 const biquad_constant_t filterSpeedCst[4 ] = {{ 30 , 55 }, { 60 , 55 }, { 120 , 55 }, {120 , 55 }};
248251 const biquad_constant_t filterAccelCst[4 ] = {{ 40 , 30 }, { 55 , 30 }, { 70 , 30 }, {120 , 55 }};
249252 const biquad_constant_t filterDamperCst = {60 , 55 };
250- uint8_t filterProfileId = 0 ;
253+ uint8_t filterProfileId = 1 ; // Default medium (1) as this is the most common encoder resolution and users can go lower or higher if required.
251254 const float filter_f = 1000 ; // 1khz
252255 const int32_t damperClip = 20000 ;
253256 uint8_t damperIntensity = 30 ;
0 commit comments