[solved] Very slow gobo/lazy susan - selection of motor, driver, board

Hej MT,

yep, like R2 mentioned earlier. I got it after reading the TI spec sheet, not just the Polulu information. Now I just hope to receive the parts soon enough. Thank you all for pointing things out, much appreciated!

Ok, rather than opening a new thread, I better add to the existing topic.

I’m using this stepper motor and driver as shown in the schematic below. I am using this library with my setup.

At 3 RPM and 16 microsteps, the motor already visibly “stutters” periodically (like twice per second) ever so slightly and this can also be felt when holding the motor; it gets fairly warm with 46,7°C at the required 0,335V as per Pololu. If I adjust the Vref to 0.6V, the “stutter” seems to subside, but the motor then measures around 93,8°C : (

Any suggestions how to reach 1 RPM with 32 microsteps? Wrong motor? Wrong wiring? Wrong library?

Program used for testing to get to a smooth 1 RPM with 32 microsteps:

#include <Arduino.h>
#include "DRV8825.h"

// using a 200-step motor (most common)
#define MOTOR_STEPS 200
// configure the pins connected
#define DIR 8
#define STEP 9
#define MS1 10
#define MS2 11
#define MS3 12
DRV8825 stepper(MOTOR_STEPS, DIR, STEP, MS1, MS2, MS3); // I hardwired M0, M1 and M2 +5V

void setup() {
    // Set target motor RPM to 1RPM and microstepping to 1 (full step mode)
    stepper.begin(1, 16);
}

void loop() {
    // Tell motor to rotate 360 degrees. That's it.
    stepper.rotate(360);
}

Schematic of how things are physically connected at the moment:

I'm not familiar with that library - why not use the AccelStepper library that many here are familiar with?

If you just need a slow step rate why use any library? Just use the simple code I gave you a link to earlier.

...R

I didn't know that AccelStepper is more widely used or known, being new to this.

I also used your simple sketch. With 1/32 microstepping hardwired and a pulse every 9 milliseconds, I get the smoothest ~1RPM so far. The temperature is 48,9°C with the required Vref of 0,335V. So, for slower speeds, I'd have to buy the 1/128 driver from Pololu or use a pulley/toothed belt 1:2 reduction gear, I suppose; but ~1 RPM with no jitter is already very good indeed. Quite a bit of torque still; a large 300g brass gobo rotates well; like a Swiss railway station clock : )

Now if I could make the speed gently fluctuate randomly (accelerate/decelerate) from dusk until dawn, that would be something. But first, I better complete the artwork as it is now.

Thanks again for your valuable input!

byte directionPin = 8;
byte stepPin = 9;
int numberOfSteps = 6400;
byte ledPin = 13;
int millisbetweenSteps = 9; //60 seconds @ 6400 steps = a pulse every 0,009375 ~ 9 milliseconds

void setup() { 

  Serial.begin(9600);
  Serial.println("Starting StepperTest");
  digitalWrite(ledPin, LOW);
  
  delay(1000);
  
  pinMode(directionPin, OUTPUT);
  pinMode(stepPin, OUTPUT);
  pinMode(ledPin, OUTPUT);
  
  digitalWrite(directionPin, HIGH);
  for(int n = 0; n < numberOfSteps; n++) {
    digitalWrite(stepPin, HIGH);
    digitalWrite(stepPin, LOW);
    delay(millisbetweenSteps);
    digitalWrite(ledPin, !digitalRead(ledPin));
  }
  
  delay(1000);
  
  digitalWrite(directionPin, LOW);
  for(int n = 0; n < numberOfSteps; n++) {
    digitalWrite(stepPin, HIGH);
    digitalWrite(stepPin, LOW);
    delay(millisbetweenSteps);
    digitalWrite(ledPin, !digitalRead(ledPin));
  }
}

void loop() { 
}

Lagom:
I also used your simple sketch. With 1/32 microstepping hardwired and a pulse every 9 milliseconds, I get the smoothest ~1RPM so far.

Am I correct to assume if you increase the interval between steps beyond 9 millsecs that the motion is not smooth enough?

From a programming point of view you could just take one step every 9 hours if you wanted.

Changing the speed just requires changing the interval between steps. If you use 9000 microseconds in place of 9 millisecs it will give you more scope for small changes.

And if you use my second example (which does not use delay() ) the timing will also be more accurate.

...R

Am I correct to assume if you increase the interval between steps beyond 9 millsecs that the motion is not smooth enough?

Yes, if I double it to 18 milliseconds for ~ 0.5 RPM, it already looks noticeably un-smooth to me; light from the lensed LED passing through the lazy susan/gobo disk onto the walls/ceiling of the surrounding space looks a bit "nervous".

1 RPM (or lower) looks smooth, continuous, hence I will later try the 1/64 and 1/128 microstepping driver from Pololu for slower speeds.

Very slow continuous motion really needs a DC motor with suitable gearing - but you ruled out gearing in your Original Post for some reason.

...R

The gear sets I tried were either large, or noisy, or had noticeable periodic jitters, even under load, so I abandoned DC motors after many frustrating weeks of experimentation.

After having obtained a smooth ~ 1 RPM as per the above, I believe that the other Pololu driver I linked to will yield even better results, allowing for some good random variation to lower speeds later on.

The Pololu Micro Metal Gearmotors are very quiet. Similar units are widely available on Ebay and from other suppliers.

If you connect one of them to an additional worm-gear reduction you should be able to get very slow rotation.

...R

Useful decay mode hack to get rid of the remaining barely noticeable 32x microstepping "microjitter" by soldering pin 19 of the driver's IC to M2. When reflecting a laser beam over a longer distance (10 m wide hall) off a mirror mounted to various stepper motors, the reflected beam travels even more smoothly across the opposite wall.

Might be an interesting experiment (you are voiding the driver's warranty, so try at your own risk) for those building astronomical photography mounts or those slapping together artworks like me or anyone else after slow jitter free rotation from stepper motors.