Hello i have bought the Quadstepper Motor Driver Board and am trying to use the stepper library with it. The pins coming off of the board that i am using are enable, direction, and step. The code i am using right now just switches on and off really fast making it step but when using a potentiometer to control it it lacks performance and loosing position. I am wondering how to use this with the stepper library. It wants me to list at least 2 pins up to 4 pins that the board connects to the arduino and i am not sure if the pins i am using will work for this. I have tried listing the step and the direction as the pins but no luck.
I just put that code in there for future reference. But i have enable going to ground, step going to 2 and step going to 3. The enable pin is for enabling the channel on the board, there are 4 channels and you can shut them on or off using the enable. As for the pot, in the end i need to control a stepper with an accelerometer that had analog output (acts like a pot). The accelerometer is going to be on my hand and when i rotate my hand i need the stepper to mimic my movements.
As for the pot, in the end i need to control a stepper with an accelerometer that had analog output (acts like a pot).
That does not even begin to define how the pot will CONTROL the stepper. What exactly should a reading of 457 from the pot make the stepper do? How about 38? 957?
Strange. I would have expected to connect enable to a pin and set the pin HIGH to enable, and LOW to disable.
As for the pot, in the end i need to control a stepper with an accelerometer that had analog output (acts like a pot). The accelerometer is going to be on my hand and when i rotate my hand i need the stepper to mimic my movements.
The value returned by the accelerometer will be relative to some mid-point. Values above that represent acceleration in one direction. Values below that represent acceleration in the other direction.
Now, note that acceleration is a change in velocity over time. And velocity is a change in position over time. How knowing either velocity or acceleration will allow you to make the stepper turn the way you want, the amount that you want, escapes me. But, I wish you luck.
What you need to do is to equate the pot value to a number of steps. So the full span of the pot will represent a number of steps. So one full turn of the pot will be 1000 steps. Now if you were at 50% of the pot value you would want to pulse the motor 500 times.
Remember the stepper motor will only move one coil position for one pulse - that is if the micro stepping feature of the driver is turned off. Look at the spec sheet for that. Make sure of the enable polarity as there is a resistor on the board to pull all inputs to a know default state.
Your code has the idea but you need to add a loop to count the number of steps in the right direction.
Don't be scared to ask. Sooner or later you will get the right answer.