Change Speed of Stepper Motor - Variable?

Adafruit Ethernet, Motor, Proto, Wave, Datalogger, GPS Shields - etc!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
eholz1
 
Posts: 16
Joined: Mon Jun 09, 2014 3:40 pm

Change Speed of Stepper Motor - Variable?

Post by eholz1 »

Hello Forum Members,
Is there a way to use a potentiometer to change the speed of
stepper motor while it is running? I.e. go from slow, to fast, etc.

I am using version 2 of the motor shield, and the motor->setSpeed() method.
I use a variable "val" which reads analog data pin, and then I try
to myMotor->setSpeed(val*3) in a loop (in void loop, or a function with a do while loop)
these read the analog value continuously, but once the motor starts, it will not speed up or
slow down. I have seen videos where they seem to be able to speed up or slow on the fly.
But maybe they are using a differert motor. I am using a Jamesco, nema-17 four-phase 1.8 degree,
but using it as a bipolar stepper. I remember reading somewhere that maybe when the motor starts,
it has be be stopped before the next command.

any tips on speed control? or perhaps a higer rpm command.
thanks,

eric h.

User avatar
adafruit_support_mike
 
Posts: 67454
Joined: Thu Feb 11, 2010 2:51 pm

Re: Change Speed of Stepper Motor - Variable?

Post by adafruit_support_mike »

If you're running a single motor, you can control the rotation speed by telling the shield to advance the motor one step at a time, and waiting a variable amount of time between steps.

eholz1
 
Posts: 16
Joined: Mon Jun 09, 2014 3:40 pm

Re: Change Speed of Stepper Motor - Variable?

Post by eholz1 »

Ah Ha! Thanks for that tip, will set it up
thanks again
eholz1

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino Shields from Adafruit”