Mod edit:
Moved to jobs at the request of the OP who would like to commission someone to help with this. I leave the OP to provide the details.
Hi there-
I am attempting to drive a stepper with a simple bit of code. This project has evolved considerably since I first posted about it, so I am re-editing the initial post right now and changing the subject header. The original text of the first message will be reproduced below the hyphenated line, for the sake of historical preservation - but the real question, which begins around Post #22 revolves around this:
I am currently using an ESP32, a TMC2209, and a basic 12v, 1.5A NEMA17 Motor with 1.8 degrees/200 steps-per-revolution. I have the Step and Dir pins attached to the ESP32, as well as the TX/RX Pins (with specified 1k resistor) connected for the purpose of UART control.
My interest at this point is getting to "Fullstep" resolution - which, with ESP32's clock speeds of around 30khz, should be able to produce 1125 RPM or 18.75 rotations per second.
In order to do this, I apparently need to use MobaTools, since other stepper libraries do not meet the necessary spec... so I am trying to understand how to use MobaTools to provide a microstepping message to produce the desired RPM. Thanks!
Original Message:
I am attempting to drive a stepper with a simple bit of code.
The Arduino is attached to a driver board (pin 1 is the stepper, pin 4 is the direction control) and the board is connected to a two-phase motor. It is powered by 12v. This works well until I added the negative values, in order to create forward and backwards motion.
Now, the motor seems to pause every few seconds, but works as expected otherwise.
Any idea what causes this pause?
#include <AccelStepper.h>
// Define the stepper motor and the pins that is connected to
AccelStepper stepper1(1, 4, 1); // (Type of driver: with 2 pins, STEP, DIR)
void setup() {
// Set maximum speed value for the stepper
stepper1.setMaxSpeed(4096);
}
void loop() {
stepper1.setSpeed((analogRead(A0)*8)-4096);
// Step the motor with a constant speed previously set by setSpeed();
stepper1.runSpeed();
}

