hello! can anyone suggest what motor driver will work for our project. it will be an automated wheelchair, but our problem is we don't know what motor driver we will use. In our previous trial, we tried to use the BTS7960, but after days of trials, the driver suddenly stopped working (i don't know if it's broken or not).
Provided below is the code that we used using the BTS7960
/* define BTS7960 motor drive control pins */
int LeftF = 12;
int LeftR = 13;
int RightF = 9;
int RightR = 10;
#define PWM 11
byte com = 0;
void setup() {
Serial.begin(9600);
Serial.println("START");
pinMode(RightF,OUTPUT);
pinMode(RightR,OUTPUT);
pinMode(LeftF,OUTPUT);
pinMode(LeftR,OUTPUT);
Serial.write(0xAA);
Serial.write(0x37);
//delay(1000);
Serial.write(0xAA);
Serial.write(0x21);
}
void loop() {
while(Serial.available()) {
com = Serial.read();
switch(com) {
case 0x11: //command 1 is for move forward
//case forward:
MotorForward();
delay(6000);
MotorStop();
break;
case 0x12: //command 2 is for move reverse
//case reverse:
MotorReverse();
delay(4000);
MotorStop();
break;
case 0x13: //command 3 is for turn right
//case right:
TurnRight();
delay(1500);
MotorStop();
break;
case 0x14: //command 4 is for turn leftt
//case left:
TurnLeft();
delay(1500);
MotorStop();
break;
case 0x15: //command 5 is for stop
//case stopp:
MotorStop();
break;
}
}
}
/*FORWARD*/
void MotorForward() //Clockwise
{
digitalWrite (RightF, HIGH);
digitalWrite (RightR, LOW);
digitalWrite (LeftF, LOW);
digitalWrite (LeftR, HIGH);
analogWrite (PWM, 80); //0 - 255
Serial.println ("MOTOR RUNS FORWARD");
}
/*REVERSE*/
void MotorReverse() //Counter-clockwise
{
digitalWrite (RightF, LOW);
digitalWrite (RightR, HIGH);
digitalWrite (LeftF, HIGH);
digitalWrite (LeftR, LOW);
analogWrite (PWM, 150);
Serial.println ("MOTOR RUNS REVERSE");
}
/* TURN RIGHT */
void TurnRight() {
digitalWrite(RightF, LOW);
digitalWrite(RightR, HIGH);
digitalWrite(LeftF, LOW);
digitalWrite(LeftR, HIGH);
analogWrite (PWM, 100);
Serial.println ("MOTOR TURNS RIGHT");
}
/* TURN LEFT */
void TurnLeft() {
digitalWrite(RightF, HIGH);
digitalWrite(RightR, LOW);
digitalWrite(LeftF, HIGH);
digitalWrite(LeftR, LOW);
analogWrite (PWM, 100);
Serial.println ("MOTOR TURNS LEFT");
}
/*STOP*/
void MotorStop()
{
digitalWrite (RightF, LOW);
digitalWrite (RightR, LOW);
digitalWrite (LeftF, LOW);
digitalWrite (LeftR, LOW);
analogWrite (PWM, 0);
Serial.println ("MOTOR STOPS");
}
(the project is controlled by voice recognition)
We are using 2 units of 24V DC Motor with a rated current of 14A to maneuver the back wheels of the wheelchair, and 2 batteries of 12V with 22Ah