Stepper motor speed issues

I'm playing around with a 28BYJ stepper motor paired with a ULN2003 chip using a Raspberry Pi 3b using this flow Stepper Motor (flow) - Node-RED.

There seems to be some sort of glass ceiling on the stepper motor speed - the fastest ive been able to get it to turn is approx 2RPM.

There is nothing else running on the Pi, but there seems to be a delay between whats happening on the screen and the actual motion of the motor.

Any ideas as to what could be causing this?

Hi @Jay1234 , welcome to the forum. There is nothing wrong with your setup for sure. If you have look in github page you will see that someone else pointed out that this flow will generate slow RPM.

Even if you change the delay inside the subflow the end result will not improve a lot. This flow is nice to understand how to drive a stepper motor. If you want to create something useful you will need to use a microcontroller for driving the motor.

These steppers have a max in the region of 12 rpm

Step them too slowly and they move slowly, step them too fast and they don't like that! They need a Goldilocks treatment :slight_smile:

I broke the subflow out and changed the rate limit to 200/sec and changed the step sequence to the most coarse one that can be used and can get about 10pm out of it (which isn't too bad for these)

image

2 Likes

Don’t believe that a full featured os with JavaScript what not is suitable for driving stepper motors. That what microcontrollers are good for - you have precious control over every processor cycle and generate precision pwm signals. Or you use dedicated controller chips like the L6470 via spi where you only give high level commands like speed, count and acceleration

With precise timing you are able to get incredible speeds:

1 Like

Came back to this this morning and I've done a bit more investigation

It would seem using a rate limit of 60 gives about 2 rpm

Going with higher rate limits does increase the rpm but at the expense of missing out steps (e.g doesn't make a full revolution for a multistep value of 2048)

And now I've actually timed it with a stop watch instead of just counting in my head :slight_smile: you need about 360 on rate limit to get up to 10 rpm (and it misses off about 15 deg or turning at that rate)

BTW What is your end goal for using these?

Years ago, I wrote a python program that interfaced to Scratch to allow control of lots of hardware on a Pi.

And I finally managed to get it talking to NodeRED so this could be a route for you to get full speed

I've not fully tested it out for robustness but it does get 10 rpm out of the stepper