Este Driver Motor de Passo DRV8825, da Keyestudio, é um módulo indicado para controlar os motores de passo de impressoras 3D. Funciona com uma alimentação de 8.2 a 45 V e pode fornecer até aproximadamente 1.5A por fase sem dissipador de calor ou ar forçado. A sua interface e pinout são praticamente idênticos aos do driver motor de passo A4988, por isso pode utilizado como um substituto de alto desempenho em várias ocasiões.
Driver Motor de Passo DRV8825 para impressora 3D Keyestudio
1. Suitable for driving stepper motors within 8.2V~45V 2.5A;
2. Simple step and direction control interface;
3. Six different step resolutions: full-step, half-step, 1/4-step, 1/8-step, 1/16-step, and 1/32-step;
4. Adjustable current control lets you set the maximum current output with a potentiometer, which lets you use voltages above your stepper motor’s rated voltage to achieve higher step rates
5. Intelligent chopping control that automatically selects the correct current decay mode (fast decay or slow decay);
6. Over-temperature thermal shutdown, over-current shutdown, and under-voltage lockout;
7. Short-to-ground and shorted-load protection.
#include
#include
// called this way, it uses the default address 0x40
Adafruit_PWMServoDriver pwm = Adafruit_PWMServoDriver();
// you can also call it with a different address you want
//Adafruit_PWMServoDriver pwm = Adafruit_PWMServoDriver(0x41);
// Depending on your servo make, the pulse width min and max may vary, you
// want these to be as small/large as possible without hitting the hard stop
// for max range. You'll have to tweak them as necessary to match the servos you
// have!
#define SERVOMIN 150 // this is the 'minimum' pulse length count (out of 4096)
#define SERVOMAX 600 // this is the 'maximum' pulse length count (out of 4096)
// our servo # counter
uint8_t servonum = 0;
void setup() {
Serial.begin(9600);
Serial.println("16 channel Servo test!");
pwm.begin();
pwm.setPWMFreq(60); // Analog servos run at ~60 Hz updates
}
// you can use this function if you'd like to set the pulse length in seconds
// e.g. setServoPulse(0, 0.001) is a ~1 millisecond pulse width. its not precise!
void setServoPulse(uint8_t n, double pulse) {
double pulselength;
pulselength = 1000000; // 1,000,000 us per second
pulselength /= 60; // 60 Hz
Serial.print(pulselength); Serial.println(" us per period");
pulselength /= 4096; // 12 bits of resolution
Serial.print(pulselength); Serial.println(" us per bit");
pulse *= 1000;
pulse /= pulselength;
Serial.println(pulse);
pwm.setPWM(n, 0, pulse);
}
void loop() {
// Drive each servo one at a time
Serial.println(servonum);
for (uint16_t pulselen = SERVOMIN; pulselen < SERVOMAX; pulselen++) { pwm.setPWM(servonum, 0, pulselen); } delay(500); for (uint16_t pulselen = SERVOMAX; pulselen > SERVOMIN; pulselen--) {
pwm.setPWM(servonum, 0, pulselen);
}
delay(500);
servonum ++;
if (servonum > 15) servonum = 0;
}