Just curious is this is possible... If I have a stepper motor driving a single carriage along a single axis, Is it possible to move the carriage by hand and have the program record my movements and play them back to me? Just need to know if this is possible for a project I'd like to start. If so is there a term for this I could start studying up on?
davis422:
Just curious is this is possible... If I have a stepper motor driving a single carriage along a single axis, Is it possible to move the carriage by hand and have the program record my movements and play them back to me? Just need to know if this is possible for a project I'd like to start. If so is there a term for this I could start studying up on?
Thanks!
You realize the motor will have to be powered up in order to generate any signal. And it is powered up through your motor controller, which is also powered. So no, it only works one way.
In the real world, manual movement of such a device is done with a "jog" switch to tell the program to move the stepper. Then the program can count the step movement and always know the step count for that motor.
You could revise your code to allow movement of the motor under serial commands. Record the totals of those commands as what you want the software to do.
I was reading about rotary encoders and using the stepper motors as an encoder to record movement. Am I on the right track? I have a hard time believing it's not possible.
It might be way easier to use an independent optical encoder on the shaft.
If you need to monitor which direction then a quadrature encoder would be required.
@davis422,
A Nema 17 or similar stepper motor with permanent magnets can be used as a generator.
I know by observing a 3D printer, no power on, when turning one stepper quickly by hand.
It gives enough power to lit a led on on the controller board (and even activate a small fan).
Most Nema 17 has a resolution of 200 steps/revolution or 1.8 degrees per step.
How to decode the pulses is another matter.
If it is driving a carriage, you might need to switch between the driver circuit and a detector circuit.
And be sure that the detector circuit can handle the voltage.
There are or were videos on youtube of people driving stepper motors with small windmills or by hand.
They tend to be made by people who measure voltage with no load and speculate about 12V with no idea how small the current likely is.
I can do the same thing with a red led, it makes current flow when light falls on it. And if I wait long enough it can build to almost 2V according to Arduino analog read.
However if I read that even once per second the voltage will drop significantly. AnalogRead eats about 1 micro-Amp per read, the current from the led is next to nothing.
You'll get more from the stepper but don't use long wires and I don't know if you ever could wire it to be both sensor and motor.