DRV8825 and stepper not acting right

jremington:
AAA alkaline cells will not supply 3 Amperes without a severe voltage drop. Use a 2 to 3 Ampere, 12-24 V power supply instead.

For running under load, or micro-stepping I would agree. However I showed the setup for full stepping, and set the current to 1.5 amps, which in full stepping mode is 1.5A x 0.71 (see datasheet), so the total current draw is slightly higher than 1 amp, at full power. Batteries should be able to handle that for long enough to be sure the motor is functioning properly.

I suspect though, that the problem stems from the Arduino's ground not being connected to the motor power ground.

Ok here is how I have this wired.

EN - pin 13 (I need to enable and disable)
M0 - no connection
M1 - no connection
RESET - arduino Vcc
SLP - arduino Vcc
STEP - arduino output pin 8
DIR - arduino output pin 9
VMOT - See below
GND - the negative terminal on the motor's power supply
AND the GND pin on your Arduino. (Done now at this time)

I'm curious, why the ground between the 2.

My 12V power supply took a dump. I've got a 20V bat handy - will that work? Other wise I have a 9V bat hookup, which ever would be better.

Thanks

On ohms law:

RayJorgensen:
Ok, I get that now...

How do I apply that to my problem?

You don't, as has been said steppers only have a current rating, not a voltage rating,
as the winding inductance is way more important than its resistance.

The 9V battery is not going to drive any sort of motor.

Set the current right, it should then work. You should probably set M0 and M1 for moderate
microstepping ratio, for better performance (less vibration/resonance)

If you don't connect grounds the two devices are floating w.r.t. each other and random stuff
could happen.

Your 20 volt battery will work. Be sure to set the limiting current per Pololu's video. This is an important step when using DRV drivers.

The grounds must be connected because the signals (step and dir) come from the microprocessor, and without a reference to ground, the signals won't be interpreted by the driver correctly. (HIGH and LOW are in reference to ground.)

I was arcing when I hooked up the 20v bat. Now I don't get any voltage reading. Any Ideas or did I fry it?

Thanks

Arcing is not good. Any chance you shorted something, or hooked the battery backward? 20 volts should have been fine for that driver.

Did you set the current limit?

You should definitely expect a spark on connecting 20V to a circuit with electrolytic decoupling capacitors,
which is why its wise to use a switch, not just free-style the powering up process.

Turn the switch off, connect the circuit, close the switch, all arcing hidden in the switch. If there's a short
circuit the fuse will blow. Switches are good because they don't dither and keep the time of any
arcing to a minimum.

You did include a fuse somewhere of course?

Yesterday I went to the dentist and he gave me some "I really don't care juice". It's not only that but it's I can't remember anything. The fog is finally clearing.

I have not been able to set the voltage, I'm getting no readings.

Sorry to say no to the fuse. It's in the plan for final installation.

Could the capacitor have gotten blown (although it looks fine) and that causing the inability to get a V reading?

Thanks

I think it's time to show a picture - clearly focussed, showing how things are connected. But also be prepared to get a new driver board.

I got a new driver and have it wired up on a breadboard. Even with the ground jumper it's still acting the same.

A picture would be a mess with all the wires so I did a fritzing. Hope this helps. I do have a capacitor in the 12v side just forgot to put it in.

What new driver do you have? That Fritz looks suspect, you have 5V connected to the BLUE power bus and GND to the RED bus, thats backwards to begin with and I can't read the terminal markings on that driver picture.

I just picked that from fritzing - not right at all!!!!! I'm going to figure out how to get a better diagram to you all.

What new driver do you have?

RayJorgensen:
I just picked that from fritzing - not right at all!!!!! I'm going to figure out how to get a better diagram to you all.

Hand draw the circuit. Don't worry about the components looking realistic. just use rectangles. Label the 'pins'.

You got a new DRV8825, right?

The diagram was way to easy - it was staring me in the face all the time. On the data sheet!!!!

It's attached now.

Yes it's a new DRV8825.

driver.png

Did you set the current adjust pot for 1.5 Amps? Is everything working now?

I'm waiting to see if I have it wired right first.

I haven't quit or solved the problem yet. I think I over did the pot trying to adjust and have a new one on the way. The tracking info has said it's headed to the next facility for the last 4 days - must have it coming turtle express

also attached a new wiring diagram, the last one didn't come out well.

Upps forgot to attach!!!!

driver.png

Hi again Ray,

I'm glad to see you've got the common ground between power supplies, the Arduino and driver board.

I re-read the datasheet for the motor you have, and the thing that stands out is that the motor is rated at only 2.8 volts! [1] As we know, you can use a higher voltage, however then it becomes essential that you set the correct limit for the current.

Follow the procedure from the video: Connect the power and ground, then adjust the voltage between the ground and the vref pot by clipping the positive probe to a small, metal screwdriver (and the negative probe to the ground connection) while you adjust the voltage by turning the pot. Set the voltage to 0.75V or less.

In order to test the motor, connect the RESET and SLEEP pins to your Arduino Vcc as shown in your latest schematic. For testing purposes, do not connect the ENABLE pin to pin 13 [2] or anything else - it's pulled high by the board, so the motor will run. Don't connect anything to M0, M1, M2, or FAULT. Once you put your circuit together you can reconnect them as needed.

For the operating voltage, I would suggest that you use as low a voltage as possible. The driver board requires a minimum of 8.2 volts, so I would not hook it right up to 20 to 24 volts - this is to get the maximum RPMs out of the board, and you don't need that to test it. My test sketch (from my earlier post) uses the PWM frequency of 490Hz. My first try would be to hook it up to batteries that give you 9 to 12 volts only, as this will spin the motor under no load just fine.

Don't turn the motor power on yet, [3] until you connect the motor wires to the driver board:

Hook up the motor wires: be sure that B1 and B2 go to one coil, and A1 and A2 go to the other coil. You can tell which wires are on the same coil because there will be 1.4 ohms between those wires. A wire from one coil will be electrically not connected (infinite ohms) to the wires on the other coil. According to the datasheet, black and green are one coil, while red and blue are the other coil, but test this with your meter.

Connect the Arduino to the USB, and load the sketch below (also in reply 18 - do not use the sketch from your first post in this thread.) Connect power to the motor and watch the motor spin.

const byte stepPin = 9;  // connect STEP on driver to pin 9 on Uno
const byte dirPin = 8;  // connect DIR on driver to pin 8 on Uno

void setup() {
  pinMode(stepPin, OUTPUT);
  pinMode(dirPin, OUTPUT);
  digitalWrite(dirPin, LOW);  // send LOW to DIR on driver
  analogWrite(stepPin,1);  // send 490 Hz, 8us pulses to STEP on driver
}

void loop() {  // no need to do anything, analogWrite() does it all
  }

NOTES:

[1] There are driver boards that are explicitly for low voltage motors. I use the similar DRV8834 board from Pololu to drive my own low voltage motors. Your board will do fine, but you MUST set the correct current limit!

[2] Pin 13 is usually connected to an internal LED. The LED is flashed during startup of the Arduino board, so this may cause some problems with the driver. I suggest using another pin.

[3] Never connect or disconnect the motor while the driver's power is connected. Also be sure to put a large electrolytic or tantalum capacitor between the VMOT pin and GND, right next to the board. Not doing these steps can damage the driver board.