Adjusting speed of stepper motor with potentiometer

Thank you! will give it a shot.

Hi, I tried dropping this in the #6 Wokwi simulation setup. The motor behaves oddly though for some reason. When I set the pot to around 34 % (in the simulation) it speeds up but if I increase it, the motor slows down, then speeds back up again at ~66% and slows down if I increase it.

I also don't understand what you mean by increasing the lower end of the mapping to 250us. Does this mean I change the 5000 in the Speed_Delay to 250? or the 10 to 250?

You should use a library with acceleration or speed ramping,
AccelStepper and MobaTools come to mind.
Both are in the IDE library manager.

1 Like

In the simulation, the motor can spin faster than physical steppers. Using 10us delays would ideally lead to 60*1000000/(10+10)/200=15000RPM*, which is faster than common steppers can spin. Visual speed changes may be an artifact of aliasing, with the stepper turing a larger fractions of a turn relative to the graphics updating. It is similar to the effects stroboscopic tachometer.

Do the math -- you want to increase the small delays from 10 to limit the top speed to be below 15000RPM.

Also:

This is true.

By directly controlling the step interval with the pot, if you turn the knob too too fast the step rate will change faster than a physical motor can keep up and it will act strangely. Using a library to control acceleration is critical for high speeds.

  • -- assuming the stepper & driver is setup for 200 steps/rev.
1 Like

Thank you, I'll try it out!

I see, I understand a bit now. Will try to make these changes, thank you!

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