-
Notifications
You must be signed in to change notification settings - Fork 3
Home
If any information is missing here, please update the wiki or create an issue.
Consider downloading this PDF for a more advanced guide on programming stepper motor drivers.
Please reference the datasheet whenever possible here.
Note: This board does NOT have reverse polarity protection.
- The TMC2209 has a voltage range of 4.75V-29V
- The DC/DC switching regulator has a voltage range of 3.8V-32V
For stepper motors, higher voltage allows for more torque at higher speeds as can be see in Lin Engineering's Torque Curve calculator. A stepper motor can run at 5V with maximum torque but the speed must be kept very low.
Current draw is based on the irun setting of the TMC2209. This board uses a 0.1 mOhm current sense resistor, which allows a maximum current draw of 1.92A RMS (reference section 8, Selecting Sense Resistors, of the datasheet).
Because the current draw is Root Mean Square current, it needs to be multiplied by 1.4 to find the maximum current draw. 1.92 x 1.4 = 2.7. If you plan to use the maximum current, be sure your power supply can supply at least 2.7A.
Note: The USB is connected directly to the ESP32 and uses USB CDC mode. There is no USB to UART bridge, like the CP2102. When flashing the ESP32 for the first time, you need to manually enter boot/download mode using the Boot and Reset button. After successfully uploading new firmware, you will not need to do this manually again, the Arduino IDE will automatically do it for you.
To enter download mode, press and hold BOOT button then press and release the RESET button, then release the BOOT button.
To use the Serial Monitor in Arduino, set Tools-> USB CDC on Boot->Enabled
Simple firmware for this device can be found in the firmware folder. It's a good place to begin and get familiar with how the TMC2209 works and will have the motor spinning right away.
If you would like more advanced firmware, consider using the Ropener firmware. The Ropener is a smart curtain opener that allows you to open/close curtains via API or Matter integration with Apple Home/Google Home/ Home Assistant.
There are two ways to drive the TMC2209
- STEP/DIR interface
- Internal Pulse Generator
In short: It's recommended to use the internal pulse generator, otherwise the ESP32 cannot be used for any other function.
The ESP32 is connected to the STEP and DIR pins of the TMC2209. If you would like to use these pins for a different purpose, two 0R resistors have been placed. Remove these resistors to disconnect the pins from the STEP/DIR interface. You can then use the large vias as GPIO pins.
When using the STEP pin, the quick HIGH/LOW pulse is required to make the TMC2209 move one microstep. This pulsing uses the entire CPU cycle, therefore the ESP32 cannot be used for any other task, including Wi-Fi as that will cause stuttering in the motor.
To use the pulse generator, simply set the velocity you would like to move, such as driver.VACTUAL(500). To stop the motor, set velocity to zero. To monitor position, the TMC2209 triggers an interrupt on the INDEX pin which the ESP32 registers and counts.
The four mounting holes are designed to fit a NEMA 17 motor. 3D print the standoffs and remove 2 of the M3 screws from the stepper motor. Find two screws that are about 7mm longer than the screws you removed.