Comments: Getting Started with the AutoDriver - v13
Looking for answers to technical questions?
We welcome your comments and suggestions below. However, if you are looking for solutions to technical questions please see our Technical Assistance page.
If you've found an issue with this tutorial content, please send us your feedback!
If you were like me and experienced problems hooking up the autodriver, I hope my comment below will help. I burned 1 autodriver prior to getting this to work and you don't have to!
Credits to the tech support team at Sparkfun, especially Mike, who worked through my setup problem via email.
Credits to bboyho for his help comment, which is good enough for most intermediate users to get a successful setup.
This is my working setup diagram
Make sure the connectors are soldered on properly on the autodriver before attempting the setup as per above. I chose a 12V, 0.33A, 1.8 degree stepper motor for this setup and complimented it with a 12V, 1A DC power supply for the motor.
Install Arduino IDE on your COM
Install the sparkfun autodriver library
Open SparkfundSPINexample in the IDE: File > Examples > SparkFun L6470 Autodriver >
I spotted some mistakes on the example code:
Mistake 1: The comments in the code suggested that the setting for "dSPIN_STEP_SEL_x" is set to full step, but I discovered that it was set to 16 microsteps per full step instead! Full step setting for "dSPIN_STEP_SEL_x" should be "dSPIN_STEP_SEL_1", not "dSPIN_STEP_SEL_1_16". This setting also means that there will be no microstepping per full step of the motor!
Mistake 2: Slew rate by default was set to 180V/us, and not 290V/us as per commented in the code
On top of that you can edit the code further if you need to (depending on your stepper motor specs). I'll list some of the main ones you'd want to check out:
Point 1: Set the current threshold by using one of various values from "SparkFunL6470.h". For my 0.33A motor, I have chosen 750mA.
Point 2: You might need to play around with the setting below in iterations so as to set an appropriate upper limit on your motor speed. I had the benefit of getting the setup working even with default settings for this.
Point 3: You might need to play around with the setting below in iterations so as to impose a global scaling on the current used. I had no problems when left at default settings.
Point 4: I wrote my own loop() function as below:
LASTLY...
Connect the Arduino Uno via USB to your COM and switch on the DC power supply to the autodriver.
Make sure the motor is secured as it will turn if setup is good!
Upload the code into Arduino Uno via the IDE and wait for motor to spin.
If you used my loop() function above, your motor should spin a degree equal to 50*[your motor step angle] every 1 second. My motor step angle is 1.8degrees, so it spins 90 degrees every 1 second.
Success! You're on your own from here!
If not, you probably got one of the steps earlier wrong. Check for burnt parts and wiring setup mostly.
-------------------- Tech Support Tips/Troubleshooting/Common Issues --------------------
AutoDriver V13 MISO and MOSI Pins
The difference between V10 and V13 of the Autodriver is the labeling and pin locations. Overall, the boards function the same.
Unfortunately, V13 does not explicitly say what pins are MISO and MOSI. You would need to open up the Eagle files to determine what pins they are. Here's a picture showing where the MISO and MOSI pins are if you are connecting one AutoDriver to the Arduino => https://drive.google.com/file/d/0B0jwgLkjMWzDVGVuYWE1Z01ENjg/view .
Arduino Pin Definitions in dSPIN Example
Comparing the example code from the GitHub Repository and the hookup guide, there are some wires not connected that is not in the hookup. This isn’t an error. It’s so that the customers can hookup to the AutoDriver and just make it work with the example code in the hookup guide. There is a note under the Fritzing diagram that indicates that the wiring is different and it is not using the same example code that is in the GitHub Repository.
If you were using the dSPIN_example.ino [ https://github.com/sparkfun/L6470-AutoDriver/tree/master/Libraries/Arduino/examples/SparkFundSPINexample ] code, you must hook up dSPIN_BUSYN to pin 16 and dSPIN_RESET to pin 17 from AutoDriver’s “IN” or "FROM PREV BOARD" pins to the Arduino Uno. On the Arduino Uno, this would technically be A3 for pin 17 and A2 for pin 16 [ http://playground.arduino.cc/Learning/Pins ].
Wiring it up correctly, I was able to get the dSPIN_example to work. The 125 oz.in stepper motor in our catalog was able to spin in one direction with an 8V, 2.1A power supply as the code suggests. Here was the wiring between the AutoDriver and an Arduino Uno:
Note: Not all the pins (like busy, reset, and chip select) are defined the same in each of the examples. Make sure that the Arduino's I/O pins are connected to the AutoDriver correctly with respect to the to the defined pins.
Arduino 101?
If you see this error when using the Arduino 101 and AutoDriverV13 with the dSPIN example:
, it's probably because the timers defined in the library are not compatible with the Arduino 101's Intel Curie. I recommend following the tutorial and using the Atmega328P that is populated on the Arduino Uno or RedBoard Programmed with Arduino.
Can you please update the hookup guide for the v13 boards. I would like to see a table with Arduino pins on one side and v13 AutoDriver header connections on the other.
Notes: - v13 boards no longer have MISO / MOSI written on them. - v10 had Arduino pin 10 (chip select) going to the 6 way header (pin 4), it now goes to the 10 way. It looks like the SDO has moved as well.
At the moment I am unable to get this board to communicate with an Arduino so my project has come to a screaming halt. Please post some pictures of a working v13 board.
We'll get that fixed ASAP. In the meantime, the pin labeled "SD from prev board" is MOSI and the pin labeled "SD to prev board" is MISO. Sorry for the mixup!
By opening up the Eagle files and highlighting the pins, I was able to determine what pin was MISO and MOSI. Here's an image with some labels for those wiring one AutoDriver to the Arduino Uno => https://drive.google.com/file/d/0B0jwgLkjMWzDVGVuYWE1Z01ENjg/view .
I've updated the schematic on the example page to show more clearly the connections needed on the v13 board, and to match the example sketch.
If you're only using one board, simply omit the connections to the bottom board and leave it off. You'll also need to remove all references to "BoardB" from the example sketch.
There are two example wiring pictures for the tutorial and they don't match. The first wiring picture showing the teal UNO board has either /CS or SD-to (MISO) not connected, depending on which way the ribbon cable is flipped. Also depending on flipping either /BUSY or /RESET is going to D10 which should be /CS. That picture is totally wrong and should be replaced. I had been trying to verify connections compared to pin definitions in the sketch.
The second example showing the RedBoard has the correct connections.
Hi, i have an AutoDriver and connected the SW Pin to an Optical switch. When I use the function GoUntil() it does what it should, but I have one question: Is there any possibility that the driver does not stop the motor when the SW pin is triggered? I have the following scenario in mind: My optical switch is used as an end switch. With GoUntil() my motor moves until the end switch is fired. The motor stops as intended and resets the position to zero, but if there is not a lot of holding torque on the motor, it can happen, that the end switch is not only reached but also passed (maybe a few microsteps). when I now try to move away from the switch with any command (e.g. move() ), the end switch is triggered immediately and the motor will stop, although this is not intended. I hope you can understand what I mean. is there any possibility to configure the driver to "tolerate" a SW-signal without stopping the motor? thanks!
Hi there, it sounds like you are looking for technical assistance. Please use the link in the banner above, to get started with posting a topic in our forums. Our technical support team will do their best to assist you.
That being said, the switch operates as a hard stop. It is a functionality that is built into the motor driver and can't be reprogrammed. You could adapt the example code to be triggered by one of the digital pins on your microcontroller instead and then program the functionality you need. However, this shouldn't be used to replace the safety functionality of the hard stop. (*aka Use your software-based stop/reset a few millimeters before the hard stop.)
Hi! How does one change the ‘SDO to:’ jumper setting to ‘Next bd’? Thank you