Can I use a Step Motor as a Servo ?

I want it to rotate at X° and stay there, basicaly, as a servo. Is it possible? If, yes, how ?

SKREFI:
I want it to rotate at X° and stay there, basicaly, as a servo. Is it possible? If, yes, how ?

You can rotate it some number of steps, not degrees. Also, a stepper motor has no way of knowing where to start, unless you design in some way of determining the beginning position of the stepper and make it move to that point before telling it to rotate x number of steps.

These links may help
Stepper Motor Basics
Simple Stepper Code

…R

Correct me if I'm wrong, but a continuous servo doesn't know at what angle it is, but it can rotate as a motor. It can take digital orders to rotate clockwise or counter-clockwise. The program that controls it has no control of at which angle the servo is at any moment. A not-continuous servo can take an order to rotate to angle X°, no matter at which angle it was before, but it can't rotate continuously and usually it can rotate to positions from 0° to 180° or less. The controlling program kind of knows at which angle the servo is at any moment - simply at the last angle it was ordered to rotate to.

A step motor is continuous, but the controlling program can keep count of the number of pulses it has sent to the step motor, to keep control of at which angle the motor is at any time. The angle of a step, either clockwise or counter-clockwise, is always the same, namely a fraction of 360°. Say 200 steps per 360°, or 1.8° per step.

So you should be able to use the step motor as a servo. Only you can't define the angles in exact integer degrees. And to know the exact angle of the step motor, you would need a sensor for initializing it when your program starts. Say you would run counter-clockwise steps until a light sensor gets trigged when the motor reaches your zero point. After that, you kind of have a step motor that can act as a servo, both as a continuous servo and as one that rotates to a given angle. It just needs diffrent programming logic than an ordinary servo.

That all sounds right.

Are you aware that you can get sail winch servos that can turn 3 revolutions (and I think there is one that does 6) with position control.

...R

Technically it's possible to create a step motor with feedback of its position including any desired number of revolutions. You just need an attached lowering gearbox with its own wheels and their own position sensors. Say your gearbox takes the speed down to 1/8 of the motor shaft. Now you can place sensors only on the slower wheel to get info of the primary wheel (motor shaft) position at any point of 8 revolutions. To get more accurate position, you need sensors on the primary wheel, too.

Then if your wheel is big enough or if you have small enough LDR sensors, you could print or engrave 8 or 9 tracks of "ones and zeros" - that's black and white stripes - on the wheel. 9 stripes would give you 512 readable positions of the wheel. The most significant stripe would be a black half circle and a white half circle. The least significant stripe would have 256 black and 256 white dots in its own circle.

Johan_Ha:
Correct me if I’m wrong, but a continuous servo doesn’t know at what angle it is, but it can rotate as a motor.

A “continuous rotation servo” is not a servo, its a servo hacked to just be a motor controller, no feedback…
The name is confusing.

Its not clear if the OP was talking about a servomotor or a hobby servo, though I suspect the latter
and is expecting absolute position control (which a stepper motor cannot give without an absolute
encoder added).

What you have said is right. For feed back, I would purchase a stepper with an encoder on it. They are becoming increasingly more popular.

weldsmith: What you have said is right. For feed back, I would purchase a stepper with an encoder on it.

To enable the system to act like a hobby servo it would need to be an absolute position encoder , and they tend to be expensive.

...R

Though some of the hall effect encoder chips are reasonable low-resolution absolute encoders. Surface mount though, and you need a particular magnet for them

MarkT: Though some of the hall effect encoder chips are reasonable low-resolution absolute encoders. Surface mount though, and you need a particular magnet for them

Interesting. Do you have a link with more details?

...R

Here is an example of a cheap motor and encoder. Us digital encoders can be purchased surplus for around $20.00.

http://www.ebay.com/itm/Cetronic-DN7122-A-Nema-Stepper-Motor-Optical-Position-Sensing-/332255416769?hash=item4d5bf751c1:g:gTwAAOSwSypY9l3P

weldsmith:
Here is an example of a cheap motor and encoder.

It does not seem to be an absolute position encoder.

…R

Robin,

Yes. I am assuming that the OP Just wants feed back capability. Any encoder can provide position. However, it will not program exactly like a hobby servo but can be programmed to behave like one.

Dave.

weldsmith: However, it will not program exactly like a hobby servo but can be programmed to behave like one.

I don't think it can.

If I move the arm of a hobby servo when it is depowered it will know the new position when it is next powered up. That is only possible with an absolute position encoder.

NOTE that I am NOT saying that the Arduino will know the new position of the servo. But if I had moved it to 132 degrees and the Arduino told it to move to 90 degrees it would know what to do.

...R

Robin,

I was not thinking in terms of powering it down. However an incremental encoder with a Z channel could perform similarly. Use the Z channel to reference the motor and then move to your desired position. If you had just A and B channels a hard stop would work as well. Use the hard stop as the reference.

Dave

This is all a bit pointless as we seem to have lost the OP.

Just out of curiosity what is "an incremental encoder with a Z channel"? Do you have a link to a typical datasheet?

...R

This is generic, This Quadrature incremental encoder is the same as most that you will see. I use this type because you can use the Z channel to reference a motors angle. US digital is one of the cheaper US made encoders. However, I try to buy new surplus. I have found 10 of them for 15.00 each.

Dave.

http://ww1.microchip.com/downloads/en/DeviceDoc/70208C.pdf

As far as I can see the encoder in that datasheet has an extra slot once per revolution that can be use to re-establish the position. But that does not function at all in the same way as the position potentiometer in a hobby servo.

Unless the encoder is rotated far enough (in the worst case, almost 360 degrees) the extra slot won't produce a pulse.

...R

That is correct.

I did mention that a stepper can be programmed similarly to a hobby servo. In one of my applications I position the reference channel in a convenient location so the motor is where I want it after it references. (maybe like 90 deg. on a servo) When it finds its reference I now know where it is. Now I can tell it to go to the angle I want it to.

Dave