Pages: [1]   Go Down
Author Topic: Looking for help with SparkFun AutoDriver (Stepper Driver)  (Read 759 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 30
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Greetings all,



Our team has been having trouble getting this driver to work, and the tutorial that SparkFun provides is not working as specified.  I don't suppose any users are out there with experience with this device?  I've attached our code and the SparkFun Fritzing Diagram.  We've hooked it up *exactly* as shown by SparkFun.

Potential problems we see, but don't know how to troubleshoot:

1.  In all of the SparkFun Sketches, Pin 6 is referred to as the reset pin, yet pin 6 on the Arduino is never hooked up in any of the Fritzing Diagrams.
2.  Where are pins 11 and 12 initialized for SPI communications?  13 for SCK?  Is this handled internally by calling 'include AutoDriver.h' ?
3.  Doesn't the Board need another Power Source for the Motor itself?  We weren't under the impression that the motors could draw power from the Arduino.

Any assistance would be greatly appreciated - For our code, we took the 'essential' components of the example and tried to make a simple piece of code that would turn at 20 Steps per second forward, wait 1s, then backward, wait 1s, and loop.

Code:
#include <AutoDriver.h>

AutoDriver boardA(10, 6);

void setup()
{
  Serial.begin(9600);
  Serial.println("Hello world");
  dSPINConfig();
}

void loop()
{
 boardA.run(FWD, 20);
 delay(1000);
 boardA.run(REV, 20);
 delay(1000);
 Serial.println("Maybe?");
}

void dSPINConfig(void)
{
  boardA.configSyncPin(BUSY_PIN, 0);// BUSY pin low during operations;
                                    //  second paramter ignored.
  boardA.configStepMode(STEP_FS);   // 0 microsteps per step
  boardA.setMaxSpeed(10000);        // 10000 steps/s max
  boardA.setFullSpeed(10000);       // microstep below 10000 steps/s
  boardA.setAcc(10000);             // accelerate at 10000 steps/s/s
  boardA.setDec(10000);
  boardA.setSlewRate(SR_530V_us);   // Upping the edge speed increases torque.
  boardA.setOCThreshold(OC_750mA);  // OC threshold 750mA
  boardA.setPWMFreq(PWM_DIV_2, PWM_MUL_2); // 31.25kHz PWM freq
  boardA.setOCShutdown(OC_SD_DISABLE); // don't shutdown on OC
  boardA.setVoltageComp(VS_COMP_DISABLE); // don't compensate for motor V
  boardA.setSwitchMode(SW_USER);    // Switch is not hard stop
  boardA.setOscMode(INT_16MHZ_OSCOUT_16MHZ); // for boardA, we want 16MHz
  boardA.setAccKVAL(255);           // We'll tinker with these later, if needed.
  boardA.setDecKVAL(255);
  boardA.setRunKVAL(255);
  boardA.setHoldKVAL(32);           // This controls the holding current; keep it low.
}

« Last Edit: December 04, 2013, 06:28:23 pm by Priest » Logged

UK
Offline Offline
Faraday Member
**
Karma: 101
Posts: 6201
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I see connection points on your picture of the board marked motor power !!!

Yes the motor needs a separate power source - the Arduino can't supply enough power to run a motor.

You haven't described what actually happens? - perhaps nothing if there is no power for the motor?

...R
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 30
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

In this case, even when hooking up 12V / 330 mA to power the  stepper Motor, nothing happens.  We're wondering if maybe their Fritzing diagram is incorrect, as the Chip Select Pin looks to hook up to something other than that the diagram shows.
Logged

UK
Offline Offline
Faraday Member
**
Karma: 101
Posts: 6201
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

330mA seems very little power from a power supply. What motor are you using? The motor I have needs 330mA on each coil and I would expect losses between the power supply and the motor.

You should be able to get the motor to move with a short sketch that puts the step pin high for 1 millisec at a time. Repeat as needed with a short delay (perhaps 100msecs to start with) between steps. Then experiment with different timings.

I think that board defaults to 1/16th microsteps and if so it will need 16x200 steps for a revolution.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 30
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

330mA seems very little power from a power supply. What motor are you using? The motor I have needs 330mA on each coil and I would expect losses between the power supply and the motor.

You should be able to get the motor to move with a short sketch that puts the step pin high for 1 millisec at a time. Repeat as needed with a short delay (perhaps 100msecs to start with) between steps. Then experiment with different timings.

I think that board defaults to 1/16th microsteps and if so it will need 16x200 steps for a revolution.

I'm using the exact same stepper motor and power supply (turns out it's 600mA) that SparkFun uses for their example.

There is no 'step' pin with this driver.  The driver is delivered commands using the AutoDriver.h library using SPI serial communication.

The driver itself doesn't default to any sort of stepping, the setting must be specified in the code, as is with ours -
Code:
boardA.configStepMode(STEP_FS);
Logged

UK
Offline Offline
Faraday Member
**
Karma: 101
Posts: 6201
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Sorry, I didn't realize it uses SPI. All red boards are not the same smiley

...R
Logged

Pages: [1]   Go Up
Jump to: