Welcome! Log In Create A New Profile

Advanced

Setting DRV8825 output current

Posted by Yaro 
Setting DRV8825 output current
October 21, 2015 10:06AM
Hi all,

I've a problem to correctly setup DRV8825.

I'm using this stepper motor:
Two phase 4 lead wires bipolar stepper
Rated Current 1.5A
Rated Voltage: 4V
Resistance per phase: 2.7Ohm +-10%
Inductance per phase: 6.5mH +-20%

Power supply for motor on VMOT and GND is 36v.

Power supply for board is 5v.

Board I'm using is Arduino Mega 2560.

I dind't understand well how to measure VREF on DRV8825. Board is chinase. I've initially tried with via on bottom and gnd on arduino, but I'm measuring 36V. So I've tried to measure from pot pin on DRV8825 and GND on arduino and, probably becouse I've shorted something with multimeter probe, DRV8825 fried.

Can someone explain me better were I need to place multimeter probes to measure VREF on DRV8825?

Also, I need to have motor attached or not to set correct VREF?

Thank you!
Re: Setting DRV8825 output current
October 21, 2015 11:17AM
You can measure Vref between GND and the top of the potmeter. Make sure you've mounted the DRV8825 the right way to the board. The potmeter is on the opposite side of driver compared to A4988 drivers.
For your stepper I'd suggest 0.6V Vref = 1.2A stepper current . But check the shunt resistor value first. Usually they are stamped R100. But some are stamped R050 or R200.
Check this page for calculating the current.
-Olaf
Re: Setting DRV8825 output current
October 21, 2015 01:13PM
Ok, I've tryed with probe on pot and worked. I've set about 0.6V. But now I've a problems with motor, it doesn't move, just emitting a continuos peep. Motor shaft isn't connect and have no load.

This is my code:

#define DIR 2
#define STEP 3

#define SLP 4
#define RST 5
 
#define M0 8
#define M1 7
#define M2 6
 
 
int dirLevel  = HIGH;
  
void setup() {
  pinMode(DIR, OUTPUT);
  pinMode(STEP, OUTPUT);
  pinMode(SLP, OUTPUT);
  pinMode(RST, OUTPUT);
  pinMode(M0, OUTPUT);
  pinMode(M1, OUTPUT);
  pinMode(M2, OUTPUT);

  digitalWrite(M0, LOW  );
  digitalWrite(M1, LOW );
  digitalWrite(M2, LOW  );
  
  digitalWrite(SLP, HIGH  );
  digitalWrite(RST, HIGH );
  
  digitalWrite(DIR, LOW );

}
 
 
void loop()
{

  int dPause = 100;
  digitalWrite(STEP, HIGH);
  delayMicroseconds(dPause);
  digitalWrite(STEP, LOW);
  delayMicroseconds(dPause);

}

With higher delay, like 200 ms, it emitting vibrations, but shaft don't move.

I've tested also inverting wires and another motor to be sure. But same result.
Re: Setting DRV8825 output current
October 21, 2015 06:30PM
I had similar issues, and never really solved them -- I just used trial, error, and rapidly turning the printer on and off to find the right spot. It's not as hard as it sounds.
Re: Setting DRV8825 output current
October 22, 2015 03:38AM
I don't see a definition of the enable pin in your code?!
-Olaf
Re: Setting DRV8825 output current
October 22, 2015 03:47AM

if (millis() %10000 <5000) {
    digitalWrite(STEP, HIGH);
      }
  else {
    digitalWrite(STEP  , LOW);
      }

This is the code of the Ramps test program. Maybe your timing with 100 microseconds is to fast?
-Olaf

Edited 2 time(s). Last edit at 10/22/2015 03:48AM by o_lampe.
Sorry, only registered users may post in this forum.

Click here to login