A project that I've been working on contains a stepper motor connected to an a4998, which is connected to an Arduino, but I need the motor to reset to a specified position every time it runs. I'm wondering if anyone has any idea of the circuitry and code that would be involved in doing this?
I heard that the RESET pin has something to do with setting a home position, but right now I have connected it to SLEEP so that my program will work. Maybe I have to connect RESET to one of the digital pins on my Arduino instead? but how would I program it?
Any help would be appreciated (P.S, I'm new at this, so please try to dumb it down for me :P)
A project that I've been working on contains a stepper motor connected to an a4998, which is connected to an Arduino, but I need the motor to reset to a specified position every time it runs. I'm wondering if anyone has any idea of the circuitry and code that would be involved in doing this?
I heard that the RESET pin has something to do with setting a home position, but right now I have connected it to SLEEP so that my program will work. Maybe I have to connect RESET to one of the digital pins on my Arduino instead? but how would I program it?
Any help would be appreciated (P.S, I'm new at this, so please try to dumb it down for me :P)
EB
Instead of paying attention to what you heard, read the data sheet it.
Reset Input (¯R¯ ¯E¯ ¯S¯ ¯E¯ ¯ T). The ¯R¯ ¯ E¯ S¯ E¯ Tinput sets the translator
to a predefined Home state (shown in Figures 9 through 13), and
turns off all of the FET outputs. All STEP inputs are ignored until
the ¯R¯ ¯ E¯ S¯ E¯ Tinput is set to high.
If you want the stepper to be moved to a certain position, you must program the movement to that position. How you determine that position depend entirely on how you are using the stepper motor and what is attached to the rotating shaft.
Many stepper motor applications move an attached arm to press a microswitch which is connected between an Arduino pin which has a pull-up resistor, and ground. Check for switch pin to be zero and if not, move the stepper one step toward the pin. Repeat until the microswitch pin shows zero. Then you know the stepper is at your home position and the rest of your program can run, knowing it starts at your home position.
There are two standard ways of defining a "home" position for a stepper.
One is to use an opto-interrupter with a vane attached to the shaft so the stepper is moved until the interrupter senses it.
The other is simpler - provide a fixed stop to one end of the stepper arm travel and drive the sensor against it. As long as the stop is robust, the stepper is in no way (electrically) overloaded by doing this for dozens or hundreds of "steps". Then step it out to the position desired.
Paul__B:
The other is simpler - provide a fixed stop to one end of the stepper arm travel and drive the sensor against it. As long as the stop is robust, the stepper is in no way (electrically) overloaded by doing this for dozens or hundreds of "steps". Then step it out to the position desired.
I'm guessing that when the Stepper Motor does drive against the stop, it will draw a bit more current than usual. If so, would it be possible to, consistently, sense this extra current, and provide a way for the Arduino to "know" when the stop is reached. This might be a consideration in a time critical application. Or even in a power sensitive situation.
ReverseEMF:
I'm guessing that when the Stepper Motor does drive against the stop, it will draw a bit more current than usual. If so, would it be possible to, consistently, sense this extra current, and provide a way for the Arduino to "know" when the stop is reached. This might be a consideration in a time critical application. Or even in a power sensitive situation.
It won't draw more current if everything is working properly.
Paul
Stepper motors are not constant current devices. Operate on pulses, right?
ReverseEMF:
I'm guessing that when the Stepper Motor does drive against the stop, it will draw a bit more current than usual. If so, would it be possible to, consistently, sense this extra current, and provide a way for the Arduino to "know" when the stop is reached. This might be a consideration in a time critical application. Or even in a power sensitive situation.
You are guessing completely wrong, the stepper is current driven. There's no point sensing a current
that you've already controlling. Basically steppers are fully open-loop, there is no useful feedback
available (yes, there are chips that claim to have stall detection, but its a very unreliable feature).
In a power sensitive situation using a stepper would be a bad idea, they are very inefficient.