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)



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

Hi All,

Thank you for the help so far. The reason it has taken me so long to come back is because you all gave me A LOT to think about as some one new to this.

You're absolutely correct. While I was initially frustrated by this flow being inappropriate for my needs, I begrudgingly admit it was useful for better understanding how steppers work.

I am building a Barn Door Star Tracker so I can take longer exposures when doing some astrophotography. Given the materials used, I need to achieve a minimum of 4.1875 rpm from the stepper motor with a fairly high degree of accuracy. The tracker I am building uses a straight drive rod, so one of my upcoming challenges will be to use software to correct for tangential error.

I've (finally) discovered that this would be the optimum solution, however one of my self imposed restrictions is to build this on the cheap, utilising existing hardware I have laying around. I may very well end up buying an Arduino, but for now I am going to explore the possibilities and limitations of my existing setup.

Yep - looks like Python is the way to go. I've figured out how to save a .py file with this code and then use NR to execute it. I've not tried scratch before, but I will check it out.

Next Steps
While I can now run a python script from NR, I am now trying to figure out how to change the speed, direction and runtime of the motor via a NR dashboard.

Can any one recommend a good "Dummys Guide"?

1 Like

I didn't mean for you to use Scratch for this :slight_smile:

BTW - Do those steppers have enough torque for the job?

yep, seems to handle it fine but I haven't properly tested it. It's worth noting that I'm using a 2.0834:1 gear ratio between the motor and the nut that spins around the drive rod.

1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.