Section 3: Power Requirements
The advanced features such as StallGuard can be purchased in our PDF guide here. |
Power Requirements
Understanding what size power supply you need is very important. In this section we’ll cover the power requirements of the TMC2209 so that you apply the correct voltage and size your power supply correctly.
Current Sense Resistors
The TMC is always checking how much current is passing through it. Otherwise, it will not be able to accurately output the current that you told it to in the settings. The way it checks its current is by use two current sense resistors that are placed near the driver.
The driver sends its entire current through the resistors which is why they are so large. It then reads back the voltage and can figure out how much current it is using at any moment in time. For more info on how Current Sense Resistors work, please Google it.
What matters most is the value of the two resistors that were placed near the driver, because the value will determine the maximum current the driver can use. Note that the engineer who designed your board could have chosen any value they wanted. But to properly run your code, we need to know this value.
Let’s go to page 49 of the datasheet and look at this table:
Let’s see what happens when 0.10 Ohm resistors are used. Looking at the chart, it means that the max current that can be used by this board is 1.92A RMS.
That is what the value of 0.10f (the “f” is for floating point number) is for, because we have a 0.10 Ohm resistor. Be sure to check your board to find the value of the resistors. It should be listed somewhere on the datasheet, otherwise it will most likely be stamped onto the resistors themselves.
Quick note on power. While the TMC2209 states it can handle 2A, don’t be fooled. The TMC2209 is very small and gets extremely hot, extremely fast. That’s why I prefer the TMC2226, because it’s much larger and has a much larger ground pad which helps dissipate heat faster. Just be sure that you use a massive ground plan on your custom PCB and add a heat sink and maybe a fan if you plan to run it on high power for extended periods.
Fortunately, there is an internal temperature sensor, and you can monitor when it’s about to overheat via the DIAG and INDEX pins (See section 15.4 of the datasheet). If it does overheat, it will simply shut off and start working when it cools down. Sometimes this will result in your motor randomly starting/stopping during a movement.
RMS Current
RMS current is important to understand because it determines what size power supply we need. If our power supply is too small, it may overheat and start a fire.
RMS means Root Mean Square. It is the average current the motor is using. Sometimes it’s using less, sometimes it is more. For example, when the motor needs to push a heavy object, its current draw will increase.
To determine max current, take the RMS and multiply it by 1.41. Why 1.41? Because Trinamic says so.
RMS x 1.41 = Max Current
If our RMS is 1.92A, our max current will be 1.92A x 1.41 = 2.71A
Since the ESP32 requires at least a 500mA power supply as stated in the ESP32 datasheet, this will give us a max current draw of 2.71A + 0.5A = 3.21A
We need to purchase at least a 3.21A power supply to make sure it does not get overloaded or overheat if you want to run the device at max power. Of course, you can choose to keep the current low in the firmware and use a smaller power supply.
Voltage
While we’re here, let’s discuss voltage as it’s a big source of confusion when it applies to stepper motors. If we go back to our electronics 101 course, we probably learned that current is like the volume of water that the motor pulls while running. And voltage is the force of the water that gets pushed into the motor.
When it comes to stepper motors, we need to consider the voltage that is going into the driver and not the motor itself. Do not pay attention to the voltage rating of the stepper motor, only pay attention to the voltage range that the driver accepts.
For the TMC2209, the range is 4.75 to 29V. The reason the range is so wide is because voltage is only a concern when we want to increase the speed of the motor. The higher the voltage, the higher the maximum speed for the motor.
The higher the voltage, the faster the current in the windings will reach its new target value from one step to the next, overcoming the inherent inductance value of the winding and building the magnetic field in the rotor. So, a higher voltage will result in better speed performance.
To have full torque, we need to increase the voltage as we speed up the motor. If we run the motor very slowly, we can achieve full torque at a low voltage. You can speed the motor up, but it will become weaker as it spins faster, unless you increase the voltage to the driver.
NEXT SECTION: 4
Course Sections:
- Section 0: Background
- Section 1: Hardware Setup
- Section 2: Stepper Motor Basics
- Section 3: Power Requirements
- Section 4: Arduino Setup
- Section 5: Understanding Trinamic Drivers
- Section 6: TMCStepper Library
- Section 7: FastAccelStepper Library
- Section 8: ESP32 Dual Core Setup
- Section 9: Motor Setup
- Section 10: Understanding Positioning
Advanced Sections: