Hi!
I've been working on a project for several months and recently hit a road block with motors.
The motors can turn CW but with visible jittering at most speeds and are unable to run CCW at all when using negative speeds.
Its an Arduino UNO R3 based project using Nema 8HS11-0204S Bipolar motors:
Specs: https://www.omc-stepperonline.com/download/8HS11-0204S.pdf
Using BIGTREETECH TMC2209 drivers:
https://www.amazon.ca/dp/B09YNFBGKJ?psc=1&ref=ppx_yo2ov_dt_b_product_details
Specs: https://zco.ro/media/documente/TMC2209-V1.2-manual.pdf
Library to handle driver: AccelStepper
Powered by a 12V 30A 360W AC to DC Adapter:
https://www.amazon.ca/gp/product/B07TZMMZ66/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1
I've been digging many threads in several forums talking about similar issues for a couple of days.
While threads like these were very helpful:
none of them are using exactly the same setup and most of them are going all in on using UART which require at least 4 wires where I'm hoping to be able to keep using the simple step and direction pins approach where only 2 pins are required to the Arduino board.
There are many ways to achieve this but I initially followed the Mechatronics documentation, here is the final customized schematics that represent my current hardware setup and wiring:
Side note; the Arduino board is powered up via USB since I'm in the middle of developing but in the end it will be powered by a dedicated 5V power supply.
As we can see I'm only using the Step and Dir pins to drive the motor which is very light in connection requirements on the board.
Going the UART route would be my last resort only if I have no other option.
Schematics are essential guides but here is that setup in reality and because an image is worth a thousand words, here are a couple of pics.
To help with clarity I'll try to proceed incrementally instead of showing the spaghetti of a fully wired system in only one pic:
Here is how the 12V30A power supply is hooked to the TMC2209:
As we can see there is a 10V100uF Capacitor between them where the live wire is plugged in the VM pin and the Ground wire in the GND pin of the TMC2209:
Arduino To TMC2209:
TMC2209 Dir pin in the Arduino pin 2
TMC2209 Step in in the Arduino pin ~3
TMC2209 Enable pin in TMC2209 GND pin (to enable the driver):
Nema 8HS11-0204S Bipolar wires:
The spec sheet (link at the beginning of thread) show:
Black: A+
Green: A-
Red: B+
Blue: B-
TMC2209 to Nema 8HS11-0204S Bipolar wires:
Nema 8 Black to TMC2209 A2
Nema 8 Green to TMC2209 A1
Nema 8 Blue to TMC2209 B1
Nema 8 Red to TMC2209 B2
Here is the bare bone version of the code I'm testing with:
#include <AccelStepper.h>
#define STEP_PIN 2
#define DIR_PIN 3
AccelStepper stepper01(AccelStepper::DRIVER, STEP_PIN, DIR_PIN);
void setup()
{
// Initialize serial and wait for port to open:
Serial.begin(115200);
stepper01.setMaxSpeed(10000);
stepper01.setSpeed(1000); // Using -1000 here doesn't work but it should!
}
void loop()
{
stepper01.runSpeed();
}
About the Voltage:
The motors are hosted in 3D printed socket where temperature is the main constraint (the goal is to have the motor to heat as less as possible).
But the motor's job is only to rotate a very light propeller (don't need much torque) at low and medium speeds (1 to 200 rpm).
In many places I've been reading a similar tip about using the potentiometer on the driver to lower the voltage as much as possible (and investigate stall limits) to reach the lowest voltage while everything is still working and ultimately avoid heating as much as possible.
If I want to provide 0.2A (or less) of current to the motor I'd need to provide 0.282V since the TMC2209 VREF is equal to current * 1.41, but I believe I'm missing the 24Ohms resistance of the motor in that calculation?
But the motor seem to be able to run with very low voltage and around 0.16V it doesn't heat at all (important parameter) and still able to rotate the small propeller a low and medium speeds:
The motor is at least able to rotate when positive values are set on the speed (up to a certain speed of course where it start skipping most steps).
BUT, even with the "working" positive values there are subtle but noticeable jittering that feels like its frequently skipping steps even it it does manages to rotate (which show its not working smoothly even with positive values):
And the fact that the motor doesn't move at all with any negative values in (setSpeed(-1000) for example) show there is something fundamentally wrong in my setup.
When setting a negative speed touching the motor I can feel its actively trying to step but all it does is vibrate.
I have 6 of these motors and some 2 of them are even yelling when I attempt to run them with a negative value!:
Closeup:
I tried the whole range of voltage between 0.1 and 0.9V on the driver but negative speed values just don't work.
I also tried permuting the motor wires (I didn't try mixing A and B wires, just permuting the positive and negative on each sides) but all that does is inverse the rotation of positive speed values (which then rotate CCW) and negative speed values still don't produce any movements.
At this point I'm kinda stomped, does anybody have an idea what I'm missing to make this simple setup work with no jitter and able to reverse direction with negative speeds?
Any advice on this will be greatly appreciated!