Stepper Motor rattling on arduino startup/reset

Hi

I have a small project going on.

It involves an Arduino Mega2560, a TMC2300 BOB Stepper Driver and a NEMA6 LSA201S06-TDBA-102 Motor.

I wired up the motor to the driver. The only problem is, that on startup, the motor rattles for about one second and then stops rattling and starts turning.

I hardwired EN, MODE and VIO/STDBY pins to +5V.
If I remove the STEP pin it does rattle continously and doesnt even stop.

My code is very small and basic and shouldnt be the reason for it to rattle.

It makes one full rotation (its 8 microstepped) and then just idles. My code is as follows:


#include <AccelStepper.h>
#define MOTOR_X_STEP 10
#define MOTOR_X_DIR 11
AccelStepper X_AXIS(AccelStepper::DRIVER, MOTOR_X_STEP, MOTOR_X_DIR);
void setup() {
X_AXIS.moveTo(1600);
X_AXIS.setMaxSpeed(200);
X_AXIS.setAcceleration(200);
}
void loop() {
X_AXIS.run();
}


I think it could be that EN (enable) pin or something is floating for a second when the arduino gets powered up and then this rattles happens, but thats just guessing...

I soldered the above mentioned pins so I cant try anything with theese. But if anyone has an answer I can grab my collegues soldering iron :smiley:

I hope anyone can help me :smiley:

Thanks in advance,

Anxodia

Put a 10K pullup or pull down on the EN pin so it won't float at start up. Which ever is appropriate.

Thanks groundFungus for your quick reply.

It works! THX!

12kOhm resistor between my Digital IO pin from arduino and GND. And then wired from the same pin to the EN pin on the driver.

Best,
Anxodia

You left the pin floating - bad idea. Use a pull-down resistor of 4k7 or so to ground on the step wire. This prevents it floating (which allows random interference and the symptoms you describe)