teemuatlut / TMCStepper

MIT License
510 stars 200 forks source link

TMC5160 is it possible to make it silent when it is in coolStep ? #226

Closed gauix4 closed 1 year ago

gauix4 commented 2 years ago

is it possible to make the TMC5160 silent when it is in coolStep? I would like to switch my printer to coolstep so that the TMCs do not heat up and to avoid skipping steps, my problem is that this cool step mode is noisy if you have any suggestions i'm interested, thank you in advance

teemuatlut commented 2 years ago

You may be able to tune spreadCycle to be more quiet but it won't match stealthChop. Or you can try the TMC2209 where stallGuard works with stealthChop. But coolstep is not an easy feature you can turn on and expect it to work right away. You'll need to monitor the stallGuard and current values to tune each threshold and increments. The most likely outcome is that you either get skipped steps because it doesn't react fast enough or you get no benefit because it's maxed out most of the time.

gauix4 commented 2 years ago

in fact there is a bug in Marlin the TMC does not work with STM32 processors I tested with a LPC1768 it works perfectly

I tested with the SKR pro 1.1 card ans SKR 1.4 LPC1768

gauix4 commented 2 years ago

TMC2208_n::GCONF_t gconf{0}; gconf.pdn_disable = true; // Use UART gconf.mstep_reg_select = true; // Select microsteps with UART gconf.i_scale_analog = false; gconf.en_spreadcycle = !stealth; st.GCONF(gconf.sr); st.stored.stealthChop_enabled = stealth;

TMC2208_n::CHOPCONF_t chopconf{0};
chopconf.tbl = 0b00; // blank_time = 24
chopconf.toff = chop_init.toff;
chopconf.intpol = interpolate;
chopconf.hend = chop_init.hend + 3;
chopconf.hstrt = chop_init.hstrt - 1;
TERN_(SQUARE_WAVE_STEPPING, chopconf.dedge = true);
st.CHOPCONF(chopconf.sr);

st.rms_current(mA, HOLD_MULTIPLIER);
st.microsteps(microsteps);
st.iholddelay(10);
st.TPOWERDOWN(128); // ~2s until driver lowers to hold current

TMC2208_n::PWMCONF_t pwmconf{0};
pwmconf.pwm_lim = 12;//1/12 jerk
pwmconf.pwm_reg = 8;//1/15 valeur de modiffication empliture PWM
pwmconf.pwm_autograd = true;
pwmconf.pwm_autoscale = true;
pwmconf.pwm_freq = 0b01;
pwmconf.pwm_grad = 50;
pwmconf.pwm_ofs = 50;
st.PWMCONF(pwmconf.sr);

COOLCONF_t coolconf{0}; 

coolconf.semin = 15;
coolconf.semax = 15; coolconf.seup =3;
coolconf.sedn = 0b010;
coolconf.seimin = 1;
coolconf.sgt = - 0 ; coolconf.sfilt = 0; st.COOLCONF(coolconf.sr);

st.GSTAT(0b111); // Clear
delay(200);
issuefiler commented 1 year ago

@teemuatlut: coolstep is not an easy feature you can turn on and expect it to work right away. You'll need to monitor the stallGuard and current values to tune each threshold and increments. The most likely outcome is that you either get skipped steps because it doesn't react fast enough or you get no benefit because it's maxed out most of the time.

Thanks for confirming that coolStep™ is useless and should be disabled because it requires manual tuning and is prone to misconfiguration that causes poor motor torque and step losses, which is not worth risking to reduce the heat. I find your quick little advice very helpful, far more helpful than Trinamic’s cryptic datasheets and the wiki page of this repository.