Go Down

Topic: Control stepper motor starting position? (Read 15302 times) previous topic - next topic

dreken

Hi,

What would be the best way to initialize a stepper motors starting position? Im would like my motor to operate 0-180 degrees but never go beyond that since it will be fitted against a wall. The starting position would be 90 degrees straight out from the wall.

Is there a way to control this? If i have to use a sensor it should be able to last a couple of thousend initializations.

Cheers,
Mike (beginner :-)

jraskell

The standard method of initializing a stepper motor position is with a "home" position switch.

If you want your stepper motor to have a 0-180º range of motion, set up a mechanic switch at the 0 or 180º point.  During startup, move the stepper motor in the direction of your home switch until the switch is activated.  Now you know the position of the motor, and can move it to the 90º starting position.

Another option (since you do not require continuous rotation) is using a potentiometer as a voltage divider tied to the stepper motor shaft.  This will allow you to determine it's current position without having to move the motor.

Grumpy_Mike

One such switch is called an opto slot, as it is optical it will not ware out like a mechanical one. It consists of a photo transistor and detector.


mmcp42

you might be better using a RC servo
easy to drive from *duino
easy to set it's position
travels 0-180
sounds just the job to me (from here)
there are only 10 types of people
them that understands binary
and them that doesn't

41south

#4
Jan 28, 2011, 08:54 pm Last Edit: Jan 29, 2011, 04:19 am by 41south Reason: 1
I'm about to have a similar "problem" to this with an antenna Azumith/Elevation (Az/El) rotator. My Az needs almost 360 degrees rotation (it has a South "stop" so the cables don't wrap around) and the El needs 180 degrees. My thoughts were heading towards using a compass sensor such as the HMC6352 http://www.sparkfun.com/products/7915 for the Az so I knew where the stepper was but I was having trouble finding an inclinometer to handle the El stepper motor. I was trying to stay away from the mechanics of using a pot with such a large rotation.

I like the look of those opto slot switches, should have thought of those sooner - thanks for the tip  :)

41south

I have found these being used in 3 axis mills to "home" the steppers, they are small, cheap and if they are good enough for a cnc mill will solve my problem nicely :)

http://www.sparkfun.com/products/246 QRD1114


retrolefty

I think a simpler method for a home position indicator/sensor is a simple hall effect switch mounted on a fixed part and have a small permanent magnet attached to the rotating part. Won't be effected by light level or dirt/dust build up, etc.

http://www.sparkfun.com/products/9312

Lefty

zoomkat

If the stepper setup has the mechanical strength, one can just drive the stepper motor in in a desired direction until it hits the hardstop. Drive the motor with a larger number of steps than the full travel step number, and then start at that position as step 0.
Google forum search: Use Google Search box in upper right side of this page.
Why I like my 2005 Rio Yellow Honda S2000  https://www.youtube.com/watch?v=pWjMvrkUqX0

Grumpy_Mike

What have these motors got to do with this thread? They are brushless motors and this thread is about stepping motors and initial position.

sbright33

The code I wrote measures the current going to one of the windings to detect the end point if there's a hard stop.
If you fall... I'll be there for you!
-Floor

Skype Brighteyes3333
(262) 696-9619

MarkT


My thoughts were heading towards using a compass sensor such as the HMC6352 http://www.sparkfun.com/products/7915 for the Az so I knew where the stepper was but I was having trouble finding an inclinometer to handle the El stepper motor.


3-axis accelerometer?

But what accuracy / repeatability are you looking for?
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

tautau123

sbright33
Can you share the code please ?

rpt007

If you want to go with the hard stop method, you have to wire a "resistance sensor" - normally a very small resistor (0.05 .. 0.1 Ohms) in series with the power supply of the motor "to the GND side".

Then you measure the voltage across the resistor and GND with an analogue input of the Arduino. Adjust your code such that the voltage level triggers the Arduino to do something, when a certain level is reached or overrun. This happens because the motor draws more current when it is stopped by an external force (in your case: the wall).

But this is a brutal method and not all motors like that for a longer time and you have to make sure that this state will be left soon after it happened. By the way: in automatic coffee machines this method is used to find the Zero position of the internal brewing mechanism.
Before you ask:
Did you really read and understand "How to use this forum"  -> http://forum.arduino.cc/index.php?topic=148996.0
AND:
Do you have already some solution or is a part of the problem sitting in front of the screen?  :)

Robin2

@tautau123, you have resurrected a 3-years-dead Thread.

I would expect it to be difficult to sense that a stepper motor had run into an end-stop by measuring a change in current. Stepper motors draw much the same current whether they are moving or not - that is how they hold position. And they are designed to hold position under power indefinitely.

If you are using a specialized stepper driver (as you should be) it will further complicate any attempt to measure the current due to its own motor current management arrangements. IIRC some of the expensive stepper drivers are equipped with the ability to sense a stalled motor.

Another factor to keep in mind is that your stepper motor system should be designed so it does not stall.

...R
Stepper Motor Basics
Two or three hours spent thinking and reading documentation solves most programming problems.

MarkT

Measuring the current of a current driven stepper motor is pointless, you are setting the current.
(Well it will detect a broken winding!)

Stall detection for steppers can be done, but the simple techniques (periodic back EMF sensing) are
crude and don't work at low speed.  Advanced techniques work better I believe, but require DSP
levels of processing.
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy