Thanks!
I just tested a bunch of stuff, the numbers did not seem to change anything, 2 or 15 seemed the same for both settings.
switch (_mode) {
case TrinamicMode ::StealthChop:
log_debug(axisName() << " StealthChop");
tmc2209->en_spreadCycle(false);
tmc2209->pwm_autoscale(true);
break;
case TrinamicMode ::CoolStep:
log_debug(axisName() << " Coolstep");
tmc2209->en_spreadCycle(true);
tmc2209->pwm_autoscale(false);
break;
case TrinamicMode ::StallGuard: //TODO: check all configurations for stallguard
{
auto axisConfig = config->_axes->_axis[this->axis_index()];
auto homingFeedRate = (axisConfig->_homing != nullptr) ? axisConfig->_homing->_feedRate : 200;
log_debug(axisName() << " Stallguard");
tmc2209->en_spreadCycle(false);
tmc2209->pwm_autoscale(true);
tmc2209->TCOOLTHRS(calc_tstep(homingFeedRate, 150.0));
tmc2209->SGTHRS(_stallguard);
break;
}
}
// dump the registers. This is helpful for people migrating to the Pro version
log_verbose("CHOPCONF: " << to_hex(tmc2209->CHOPCONF()));
log_verbose("COOLCONF: " << to_hex(tmc2209->COOLCONF()));
log_verbose("TPWMTHRS: " << to_hex(tmc2209->TPWMTHRS()));
log_verbose("TCOOLTHRS: " << to_hex(tmc2209->TCOOLTHRS()));
log_verbose("GCONF: " << to_hex(tmc2209->GCONF()));
log_verbose("PWMCONF: " << to_hex(tmc2209->PWMCONF()));
log_verbose("IHOLD_IRUN: " << to_hex(tmc2209->IHOLD_IRUN()));
This is interesting. From FluidNC. Stealthchop has pwm autoscale…Coolstep is just spreadcycle (that doesn’t seem right), Stallguard seems like it is coolstep to me. I need to figure out what pwm autoscale is.