Go Down

Topic: Can I use a Step Motor as a Servo ? (Read 1 time) previous topic - next topic

SKREFI

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

Paul_KD7HB

#1
Jun 21, 2017, 01:49 am Last Edit: Jun 21, 2017, 01:49 am by Paul_KD7HB
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.


Robin2

Two or three hours spent thinking and reading documentation solves most programming problems.

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. 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.
____________________

If you ask for help and write 'u' instead of 'you' because you think it's convenient, I will write 'no' instead of 'yes'. For same reasons.

Robin2

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
Two or three hours spent thinking and reading documentation solves most programming problems.

Johan_Ha

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.
____________________

If you ask for help and write 'u' instead of 'you' because you think it's convenient, I will write 'no' instead of 'yes'. For same reasons.

MarkT

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).
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

weldsmith

#7
Jun 28, 2017, 06:49 am Last Edit: Jun 28, 2017, 06:51 am by weldsmith

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.
David Smith

Robin2

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
Two or three hours spent thinking and reading documentation solves most programming problems.

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
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

Robin2

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
Two or three hours spent thinking and reading documentation solves most programming problems.

weldsmith

David Smith

Robin2

Here is an example of a cheap motor and encoder.
It does not seem to be an absolute position encoder.

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

weldsmith


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.
David Smith

Robin2

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
Two or three hours spent thinking and reading documentation solves most programming problems.

Go Up