Welcome! Log In Create A New Profile

Advanced

Trinamic current setting

Posted by marvin42blue 
Trinamic current setting
February 03, 2025 12:43PM
I'm using TMC2209 drivers on a Marlin 2.1.2.4 with my delta printer - and the printer works nice.

Question: my current setting X_CURRENT in configuration_adv.h is actually 1200mA, but M122 reports 800 - see this:

Send: M122
Recv: X Y Z E
Recv: Address 0 0 0 0
Recv: Enabled false false false false
Recv: Set current 800 800 800 600
Recv: RMS current 795 795 795 581
Recv: MAX current 1121 1121 1121 819
Recv: Run current 25/31 25/31 25/31 18/31
Recv: Hold current 12/31 12/31 12/31 9/31
Recv: CS actual 12/31 12/31 12/31 9/31

I can change the current with M906 to eg 1200 or other values, and then the "set current" is 1200 - but I thought the "X_CURRENT" is the "set current" - am I wrong ?

In case X_CURRENT is the "max current", then why does M122 report 1121 - this is a number I cannot find.

I like to add, that any change of X_CURRENT seems to have no effect, after reboot, the "set current" is always = 800 800 800 600

Can anyone please explain how this current management works ? - I was not able to find any related explanations

thanks

Edited 1 time(s). Last edit at 02/03/2025 05:35PM by marvin42blue.
Re: Trinamic current setting
February 04, 2025 01:57AM
Marlin settings basics 101:

Settings that can be changed via gcode or LCD can be saved in EEPROM
The EEPROM setting are independent of firmware settings.
Updating firmware will not update the values stored in EEPROM (1)(2)(3)
X_CURRENT is one of these variables.

(1) On the first time you update with new firmware, if the EEPROM version does not match or the saved checksum is invalid, then the default values in firmware at the time are written to EEPROM to be used.
(2) If you enable the option EEPROM_INIT_NOW then each and every time you flash the firmware the EEPROM is reset to the firmware defaults.
(3) You can manually set EEPROM contents back to firmware defaults using gcode M502 - Factory Reset then M500 - Save Settings


For tmcstepper driver you set the RMS current.
{X|Y|Z|E}_CURRENT is the requested RMS current.

RMS_CURRENT Is the RMS current actually used, It cannot always give you exactly what you requested (due to hardware limitations).

MAX current (ie Peak Current) = RMS Current * √2. In Marlin we use 1.41

795 * 1.41 = 1120.95
581 * 1.41 = 819.21


After updating rms current with M906 if you want to keep it after a reboot you must save with M500

Edited 6 time(s). Last edit at 02/04/2025 02:33AM by Dust.
Re: Trinamic current setting
February 04, 2025 12:22PM
thank you very much
that explains everything
Sorry, only registered users may post in this forum.

Click here to login