Stepper Motor

I have found several discussions about controlling stepper motors with Arduino. What I need it the ability to change the stepper motor speed using a pot, and also change the direction of the motor.

I want to do the following:

Control rotation direction with a simple switch.
Change the speed with a potentiometer and a foot controller from an old singer sewing machine. The pot will be used to set maximum speed and the foot pedal will be used to change the speed from 0 to the max set by the pot. The foot pedal is digital, two wires.

I am thinking all of this is pretty easy to do, I am a Computer Consultant and can program pretty well. Just never worked with hardware interfaces before, so this is a new area.

Thanks for any help/direction.

Hi,
Couple things:

Some How-to HERE: (see last example code: speed changes, direction changes..

Foot Pedal: Do you have details of the interface?? 2 wires do what??

Have a look at the code in these examples Simple Stepper Code. They should illustrate the basics of how a stepper motor is controlled.

Your direction switch can be used to change the value of the direction variable.

Your footpedal can be used to change the value of the interval between steps - which is what controls the speed.

You may also want to look at the AccelStepper library.

...R

What actual speed do you want the motor to run at? A lot will depend on your motor driver, supply voltage and ramping up and down. As well as the mechanical load the motor is under.
Many people expect it is easy to get a stepping motor to turn fast but it is a challenge.

depending on what you are doing you may not need a stepper motor perhaps a geared dc motor that can easily reverse direction or plain old dc motor. Steppers are better with incremental rotation like half turn forward 1/4 turn back etc.

Or look into a continuous rotation servo motor. Very easy to control direction and speed!

terryking228:
Foot Pedal: Do you have details of the interface?? 2 wires do what??

Sorry I took so long to respons. The foot pedal is a two wire variable resistor. It has an interesting design, but basically a two wire pot.

Grumpy_Mike:
What actual speed do you want the motor to run at? A lot will depend on your motor driver, supply voltage and ramping up and down. As well as the mechanical load the motor is under.
Many people expect it is easy to get a stepping motor to turn fast but it is a challenge.

I will be using it on a fishing rod building lathe, so not really that fast. About the speed of a sewing machine motor, or maybe a 100-200 rpm range. Maybe a little faster, just not sure right now.

The foot pedal is a two wire variable resistor.

Then you need to connect it between an analogue input and ground. Then you need to connect a pull up resistor from the same input to 5V. The value of this resistor should be roughly the same as the variable resistor at the half travel point. Measure what resistance this is with your multimeter. If you haven’t got one then buy one, at only $5 to $10 it is indispensable when doing electronics.

I will be using it on a fishing rod building lathe

For controlling the turning or the tool?

If the former then a stepping motor is not what you want because the movement will not be smooth and the torque will have jitter on it from the steps being applied.

maybe a 100-200 rpm range.

So that is a step rate of 800 per second, while not very fast it is reasonably fast on a Uno.

Right now I use 1000 rpm gear motors and they work pretty well. I simply connect a simple motor controller I got from ebay, throw in a couple of switches to control the direction of rotation and either direct control or foot pedal control and its done. I can build the control box (motor controller and switches) in a couple of hours. Then I just plug in either 12V or 24V power supply and the appropriate motor and it works fine. I have attached a photo of the current configuration of my drying motor, but the same basic configuration for my rod turning motors.

But eventually I want to use a stepper motor as an indexer to rotate the rod I am building either 180, 90, or 45 degrees to help in wrapping the different patterns I use on the handle section of the rod. So this is just the first step in my learning process.

All that said, the jitter doesn’t really bother me that much and yes the motor will be connected directly to the rod that I am building or connected to it via a pulley arrangement.

Many thanks for your information.

Thanks for getting back to us. It is good to see you managed to do something satisfactory to you. For others here is the photo you posted.

IMG_0750.JPG

ov10fac:
But eventually I want to use a stepper motor as an indexer to rotate the rod I am building either 180, 90, or 45 degrees to help in wrapping the different patterns I use on the handle section of the rod. So this is just the first step in my learning process.

Have you considered adding a rotary encoder to your existing setup to report the precise rotational position. If you don't need to stop the rotation at specific angles then it might be a simpler and more appropriate solution.

...R

Robin,

I will need to stop it. Some patterns I wrap are located at 0 and 180 position on the rod. Some have critical points every 90 degrees and some at 45. So what I need is to rotate the rod, stop it, move thread to make the wrap, rotate the rod, move thread, etc.

What is a rotary encoder?

Thanks.

What is a rotary encoder?

http://playground.arduino.cc/Main/RotaryEncoders

ov10fac:
What is a rotary encoder?

Google will give you a better answer than I can.

It is a device that produces a number of pulses as it is rotated. Some might produce 12 pulses per rev. Others can produce hundreds for greater precision. The Arduino can count the pulses and know how far the shaft has rotated.

But if you need to stop the machine at a precise position a stepper motor will be much more appropriate.

...R

Robin and Mike,

Many thanks. Yes I do need to stop the motor for this application. But I have another applications the would just require a motor reversing after a fixed time (number of revolutions) The rotary encoder might do exactly what I need in that instance.

Again, many thanks for the insight.

John