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.
Step them too slowly and they move slowly, step them too fast and they don't like that! They need a Goldilocks treatment
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:
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 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)
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.
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.