I have an Arduino Uno along with an external power supply.
I am attempting to control the motor so that when I run the code it will simply go forward and backward. I have been attempting to do this for the past week with no luck. I have read through many different forms and I have not been able to get the motor running at all. I know that the driver comes with software to program but I am unable to write script.
Can somebody please assist me in wiring and programming the Arduino, motor, and driver? Nothing I have done so far is working. I am able to run a simple DC motor on the Arduino, but I cannot get this motor/driver to function. Any help is appreciated.
I am attempting to simply make the motor go forward and backward so that I can power a linear slide. I would like to make this a continuous loop which is why I was unable to use the PC software, as that software only allows for one command at a time rather than writing script.
Would it be possible to get some sort of wiring diagram? I am new to arduino and I have not yet fully mastered the art. I was able to order a starter kit about a month back but I haven't yet mastered it.
IIRC there are wiring diagrams in the driver datasheet. If there is something you don't understand tell me what it is and what page of the datasheet it is on.
For a simple wiring diagram look at the Pololu 4988 page. The general principle is the same.
I have the motor connected to A+, A-, B+, and B-. I have the external power supply connected to V+ and V-. The problem that I am having is connecting the driver to the Arduino. I have GND, AIN, +5V, OUT-, OUT+, EN-, EIR-, EN-, EN+, DIR-, DIR+, STEP-, and STEP+ left to use on the driver. I am unsure how to wire the driver to the Arduino. Again, I have looked at both data sheets and read through forms for the past week an I haven't been able to get the motor to run at all. Any help is appreciated.
dan12146:
I have the motor connected to A+, A-, B+, and B-. I have the external power supply connected to V+ and V-. The problem that I am having is connecting the driver to the Arduino. I have GND, AIN, +5V, OUT-, OUT+, EN-, EIR-, EN-, EN+, DIR-, DIR+, STEP-, and STEP+ left to use on the driver. I am unsure how to wire the driver to the Arduino. Again, I have looked at both data sheets and read through forms for the past week an I haven't been able to get the motor to run at all. Any help is appreciated.
What page of the datasheet is all that stuff on?
Then I can have a look at it.
Had to go back and refresh what I did in dealing with this driver.
First of all follow the instructions on how to hook this up from the website.
All you really need is the power supply hooked up and the correct wires of the stepper connected and of course the rs232 cable to allow the sure step software to communicate with it.
You will need to configure the drive to the power supply and the stepper thru the sure step software.
In the software you will be able to also set other features like the inputs and outputs.
Look into the SCL feature of the drive. That is how I used a BS2 to drive it by simply sending it commands and not fiddle farting with trying to provide all the necessary timing pulses.
The wiring diagram on the first page to the right is the one that I followed to wire the power supply and the motor to the driver. I do not know how to connect to the Arduino
I have read and downloaded the manual a while back. I was able to control the motor using the drive and the computer software, but I am unable to do anything other than give a single command as the computer software only allows for one command at a time rather than writing script. I would like to be able to use the Arduino to write a script and have the motor oscillate back and forth to allow a linear slide constant back and forth motion. I have the motor connected to the drive and the power supply connected as well. What I need to do is figure out how to wire the motor drive to the Arduino and write the code. I know that I need to use the STEP+, STEP-, DIR+, and DIR- to create bidirectional motion and I do not believe that I need the EN+ and EN- terminals as I do not think I need to use the enable function, but I could be wrong.
I am having trouble because I do not know how to wire this motor drive to the Aruduino and I do not know what code to use. I have tried many different wiring schematics and different codes but noting has helped.
I would like to be able to use the Arduino to write a script and have the motor oscillate back and forth to allow a linear slide constant back and forth motion.
Well that is what I did with just a simple BS2 so an arduino could do it with it's eyes closed.
but I am unable to do anything other than give a single command as the computer software only allows for one command at a time rather than writing script.
There is a buffer so more than one command can be sent. You cannot store a program but all that needs to be done is simply resend the commands each time.
Why on earth when you have a quite capable driver (I bet you never looked at the scl manual) do you want to use it as a brain dead stepper driver? Kind of like getting a ferrari to do parking lot sweeping.
dan12146:
I am having trouble because I do not know how to wire this motor drive to the Aruduino
The reason I asked you to download the manual was so that you could read through it and find the page that describes connections to a micro-processor. Then you can tell me the page number and I can read the page and try to help you.
Robin2:
The reason I asked you to download the manual was so that you could read through it and find the page that describes connections to a micro-processor. Then you can tell me the page number and I can read the page and try to help you.
...R
The problem is that there is not real detailed page that shows how to wire to a micro-processor. I would say that the best pages in the manual to look at would be 2-7 through 2-9.
Now, what is it about that page that you need help with?
Maybe the best thing would be for you to make a pencil diagram showing how you think everything should be connected and then post a photo of the drawing.
As I said in Reply #2, I think all that is needed is to connect Step+ to an Arduino I/O pin and Step- to Arduino GND and the same for the DIR connections.
Below is the code and I redrew the wiring diagram.
// testing a stepper motor with a Pololu A4988 driver board or equivalent
// this version uses millis() to manage timing rather than delay()
// and the movement is determined by a pair of momentary push switches
// press one and it turns CW, press the other and it turns CCW
byte directionPin = 9;
byte stepPin = 8;
unsigned long curMillis;
unsigned long prevStepMillis = 0;
unsigned long millisBetweenSteps = 25; // milliseconds