Go Down

Topic: DRV8825 and stepper not acting right (Read 840 times) previous topic - next topic

RayJorgensen

RIGHT!!!

I looked up Ohms law and that might as well be in Greek!!!

I barely passed algebra 48 yrs ago so I kinda need a little help here.   :(  :(  :(

It's the season - help the handicapped please :)

Thanks

jremington

V = I*R = (2.0 Amperes)*(1.4 Ohms) = 2.8 Volts

RayJorgensen

Ok, I get that now...

How do I apply that to my problem?

ChrisTenone

#18
Dec 03, 2018, 06:49 am Last Edit: Dec 03, 2018, 08:11 am by ChrisTenone Reason: used 8834 numbers, not 8825 :( - fixed
Chris - The motor ground (12V) is going to the DRV8825 GRND  right by the VMOT post.

I set it as per the instructions on the product page, but it just sorta hung so I tried the sweet spot method and then it started moving.  Just went back and started over and am getting the same results.
Wire your driver board and motor like this:
EN - no connection
M0 - ground through a 10 K resistor
M1 - ground through a 10 K resistor
SLP - arduino Vcc
STEP - arduino output pin
DIR - arduino output pin

VMOT - external voltage supply of at least 8.2 volts.
               Don't worry about Ohm's law, because the chip has
               active current limiting. You will set the maximum
               current with the tiny pot on the board.
GND - the negative terminal on the motor's power supply
             AND the GND pin on your Arduino.

NOTE: put a 100uF capacitor between VMOT and GND, right next to the board.

B2 - green wire to motor
B1 - black wire to motor
A1 - red wire to motor
A2 - blue wire to motor

NOTE: the wire order can be reversed, but the motor will run backward.

FLT - no connection
GND - same as above

Don't use the 'sweet spot' method to set the limiting current. Too much current will eventually burn out your motor and/or your driver. Set the current exactly as shown by Pololu. The method is shown at 3:36 in their video.

If you have no heatsink or fan, set vref by this method to 0.75 volts.
If you have a heatsink on the chip, AND a fan, you can set it as high as 1.1 volts. Beware though, at the higher  numbers it WILL get hot. I touched my DVR8834 just to see, and had to put ice on my finger!

Now load the sketch below onto the arduino, and attach 6 aaa cells (9 volts) to VMOT and ground. The motor should spin smoothly at about 150rpm.

Code: [Select]
const byte stepPin = 9;
const byte dirPin = 8;

void setup() {
  pinMode(stepPin, OUTPUT);
  pinMode(dirPin, OUTPUT);
  digitalWrite(dirPin, LOW);
  analogWrite(stepPin,1);
}

void loop() {
  }
Atmosphere carries combustion vapors to places where they will do good instead of harm - Mike Faraday's 'History of a Candle': https://www.youtube.com/watch?v=6W0MHZ4jb4A

Whoops ::)

jremington

#19
Dec 03, 2018, 04:42 pm Last Edit: Dec 03, 2018, 04:43 pm by jremington
Quote
6 aaa cells (9 volts)
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.

ChrisTenone

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.
Atmosphere carries combustion vapors to places where they will do good instead of harm - Mike Faraday's 'History of a Candle': https://www.youtube.com/watch?v=6W0MHZ4jb4A

Whoops ::)

RayJorgensen

#21
Dec 03, 2018, 11:59 pm Last Edit: Dec 04, 2018, 12:27 am by RayJorgensen
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

MarkT

On ohms law:

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.

[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

ChrisTenone

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.)
Atmosphere carries combustion vapors to places where they will do good instead of harm - Mike Faraday's 'History of a Candle': https://www.youtube.com/watch?v=6W0MHZ4jb4A

Whoops ::)

RayJorgensen

#24
Dec 05, 2018, 12:39 am Last Edit: Dec 05, 2018, 12:40 am by RayJorgensen
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

ChrisTenone

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?
Atmosphere carries combustion vapors to places where they will do good instead of harm - Mike Faraday's 'History of a Candle': https://www.youtube.com/watch?v=6W0MHZ4jb4A

Whoops ::)

MarkT

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?
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

RayJorgensen

#27
Dec 06, 2018, 09:52 pm Last Edit: Dec 06, 2018, 09:53 pm by RayJorgensen
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

ChrisTenone

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.
Atmosphere carries combustion vapors to places where they will do good instead of harm - Mike Faraday's 'History of a Candle': https://www.youtube.com/watch?v=6W0MHZ4jb4A

Whoops ::)

RayJorgensen

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.


Go Up