Can someone please educate me on Vref / Current when using 2209?

Hi all,

This is my first post, so want to says thanks to Ryan and this community. I have learned a lot, and had fun in the process. I was finally able to build my MPCNC that I had started back in 2016. (Slowest build ever, I know…short story: father passed away in 2017, and brother in 2018 with lots to deal with.) The MPCNC is working great - still uses the threaded rod and pineapple. I hope to update soon. Despite trying to complete an older design, there was enough info on this site and these forums to get through the whole build without any real issues, which is a testament to the design, info, and support available here. (My biggest challenge was figuring out that I needed to specify slower Z speeds in Estlcam since still using threaded rod instead of leadscrews.)

I am now working an MD3DP build. I am still waiting on some parts to arrive to finish the mechanical part of the build, and so I have turned my focus to getting the correct firmware settings in place. I am using a SKR 1.4 board with TMC2209 drivers in UART mode.

I have specifications for the steppers I am using for X, Y, Z, which are Current/Phase of 2.0 A, and so I should be able to calculate the appropriate settings for those steppers. I write should because I am still a bit confused on the calculations for these drivers.

It seems that others are also confused:

In this Teaching Tech video, he calculates VRef (units of Volts) and then sets this for the current (in units of mA): https://youtu.be/dOJbSrWVu_Q?list=PLGqRUdq5ULsOIIaBONPU65uH2s6iI6GqY&t=367

Either that approach is wrong, or I am misinterpreting the Marlin current settings (and they should be called voltage, not current). I checked Marlin documentation which does confirm that current is indeed current in mA, and not voltage: https://marlinfw.org/docs/gcode/M906.html

So this still leaves me a bit confused about Vref, and correct current settings. Steps 6 and 7 at this page clearly lay out the correct equations: https://e3d-online.dozuki.com/Guide/05+-+E3D+Hemera+Current+Adjustments+(VREF)/143

So, I can calculate the RMS current and Vref based on those equations for my stepper motors:

Current/Phase = 2.0 A
Therefore RMS current = 1.42 A (2.0 / 1.41 = 1.42) and
Vref = 2.0 V (1.42 x 2.5) / 1.77
And, using 90% of that gives 1.81 V.

My questions then:

  1. Are my calculations above correct?
  2. Having calculated RMS current, is this the correct value to specify in Marlin? (configuration_adv.h at the appropriate sections starting with #if AXIS_IS_TMC(X) and #define X_CURRENT, for example)
  3. How/where does Vref get used, if at all?
  4. Is it still good practice to measure voltage on the driver so I know what is being output?
  5. Specific to the MP3DP build: I plan to use the MK8 Hotend/Extruder, which comes with a stepper motor with no documentation. What specs should I assume for this motor (recognizing I may need to test and adjust settings)?

Hope that’s clear, and thanks in advance.

Vref is for drv8825 drivers. On the tmc drivers, you need to make sure the rsense for each driver is right, and then you can set the value in mA. Don’t overdo it in a 3D printer. Something like 800mA should be fine. If the motors get too hot, turn it down. If they skio steps, turn it up. Luckily, there is gcode to change it for the tmc drivers.

Thanks Jeff - I really appreciate the reply. After some more reading today, I think I better understand the voltage / current aspect, with current being the critical aspect.

I really do not mind experimenting; but definitely want to avoid needing to replace parts.

The TMCs are pretty tough. They will turn off before overheating.

TMC2209-s have internal temperature sensors and if Marlin is configured correctly it can lower the current if driver gets too hot. See the comments next to MONITOR_DRIVER_STATUS in Configuration_adv.h I can personally verify that it works :wink: I guess I’m a little careless with new electronics when I’m running it in the “burn-in” phase.

1 Like

Thanks Anttix. I appreciate you pointing out the relevant firmware section…and also confirming that it works!

I completed the build and all is working well. I left all motors at the default of 800 mA, the motors are cool to the touch, and no missed steps.

Thanks again for the help.

Just to close this off, a few photos of the printer build here: August 2020 Build

1 Like