How are calculated the “hold_current” and “run_current” for TMC2209 ?
Its up to you. Sometimes there is a recommendation for say an extruder.
But in general find the specification sheet for your steppers and try a value around 40 to 50 percent of the max.
Set the hold to around 25 percent.
Run the printer checking the stepper temp and see if you get missed steps at the acceleration and speed you wish to run at.
Cheers
Out of curiosity, what’s the basis for these recommendations? Why not set them to the rated current of the motors?
My experience (around 8 years) is that running the steppers at their rated current will cause them to run very hot (above 70C). Initially using a lower current and only increasing when needed help keep the temperature as low as possible.
As most of our printers use plastic parts keeping the stepper temps as low as practical means less issues.
IMO, this answer is a bit too simple. There are two dimension to the story:
- The correct current for the stepper
- A TMC driver chip matching the current requirements of the stepper
The correct current for the stepper
- Klipper uses RMS current as configuration values
- Datasheets of the various stepper motors either give RMS or Peak current as rated current. More often peak current to my knowledge (often unclear from the specs)
- Current as Peak Current: Multiply by 0.707 to get RMS and then by 0.85 as safety margin
- Current as RMS: Multiply by 0.85 as safety margin
- The safety margin of x0.85 can be tuned according to heat development and / or load of the stepper (e.g. Z-axis vs. Extruder stepper)
hold_current
is of lower importance since it typically just keeps the stepper’s position in place and (except for maybe the Z-axis in Cartesian printers) is seldom in effect. Personally I use between 50% and 75% of therun_current
-
hold_current
is not recommended any longer. It has been found that the switch betweenrun_current
andhold_current
has a negative impact on precision
Matching TMC driver
- The drivers do some black magic aka IRUN current scale to achieve optimal microstep resolution
- This can only efficiently do its work when the current requirements of the stepper matches the driver and the driver’s R-Sense value
- A 2209 with the typical R-Sense of 0.11 Ohm has an ideal RMS working current between ~1.92 A (
VSENSE
= 0) and ~0.97 A (VSENSE
= 1) - Klipper does an internal
VSENSE
switching to achieve higher accuracy at current scaling. IIRC,VSENSE
= 1 is the optimal working condition - From this logic, running a 0.4 A NEMA14 stepper with a TMC5160 at R-Sense of 0.075 Ohm (RMS current ~3.11 A) seems like a bad idea
Disclaimer:
The “wisdom” above is my understanding of the matter and I happily stand corrected.
This “Calculating Driver Current Settings” howto from the Voron site reinforces what @Sineos said, mainly regarding the run_current
calculation.
Since the hold_current
setting is a bit squishy, what sorts of things do you look for in the print quality or printer behavior that might make you want to change it?