Skip to content

Set hybrid edit range to 999 - #27473

Merged
thinkyhead merged 5 commits into
MarlinFirmware:bugfix-2.1.xfrom
vovodroid:hybrid-edit-pr
Nov 12, 2024
Merged

Set hybrid edit range to 999#27473
thinkyhead merged 5 commits into
MarlinFirmware:bugfix-2.1.xfrom
vovodroid:hybrid-edit-pr

Conversation

@vovodroid

@vovodroid vovodroid commented Oct 12, 2024

Copy link
Copy Markdown
Contributor

Currently TMC hybrid threshold is edited as uint8. This PR uses unit16 and range up to 999.

P.S. Should min value be >0?

@thinkyhead

Copy link
Copy Markdown
Member

The description from ChatGPT is below. In practice, Marlin uses the values specified by the TMCStepper library and not necessarily the native range of the stepper drivers. So we need to look first at how TMCStepper interprets these values for all the stepper drivers that it supports, and then adjust the code so it can adapt to the type of stepper drivers that are installed.


The Hybrid Threshold on Trinamic stepper drivers determines the speed at which the driver switches between stealthChop (quiet mode) and spreadCycle (performance mode). Different models of Trinamic drivers have different ranges for this parameter. Here is a summary of the ranges for some common Trinamic drivers:

  • TMC2130: The Hybrid Threshold value can range from 0 to 65535. This corresponds to a step frequency threshold where switching between modes occurs.

  • TMC2208 / TMC2225: The Hybrid Threshold value typically ranges from 0 to 255 steps per second. These drivers are commonly used in silent 3D printers, and the range is narrower compared to other models.

  • TMC2209: Like the TMC2208, it also supports a range from 0 to 255 steps per second for the Hybrid Threshold.

  • TMC2660: This driver allows setting the Hybrid Threshold up to 65535 steps per second, providing a broad range for switching between stealthChop and spreadCycle modes.

  • TMC5160: The range for Hybrid Threshold on this model is from 0 to 65535, similar to the TMC2130 and TMC2660.

The specific threshold values you set depend on the application, such as the speed and torque requirements of your setup. Higher thresholds keep the motor in stealthChop longer, which is quieter but less powerful, while lower thresholds switch to spreadCycle earlier, providing more torque at higher speeds.

@vovodroid

vovodroid commented Oct 19, 2024 via email

Copy link
Copy Markdown
Contributor Author

@thinkyhead

Copy link
Copy Markdown
Member

Yes, it does appear that the value is transformed.

12,650,000 * microsteps / (256 * thrs * steps_per_mm)

…however it doesn't appear to be scaled based on the driver type. If the driver type has a range from 0 to 65535, then presumably the value should be scaled to that range as well before sending it to TPWMTHRS. I'm looking into it. Possibly @teemuatlut can provide some guidance.

@thinkyhead
thinkyhead merged commit e6099fd into MarlinFirmware:bugfix-2.1.x Nov 12, 2024
@vovodroid
vovodroid deleted the hybrid-edit-pr branch November 13, 2024 08:19
bsdnomad pushed a commit to bsdnomad/Marlin that referenced this pull request Nov 25, 2024
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
EvilGremlin pushed a commit to EvilGremlin/Marlin that referenced this pull request May 15, 2025
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
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.

2 participants