Arduino UNO + BTS 7960 for RC Combat Robot

Hi guys good day. I'm a newbie combat bot hobbyist. I'm pretty well versed in mechanical stuff but I'm a dummy to this arduino logics so I really need help. THANK YOU IN ADVANCE :slight_smile:

As my initial reference, this are the links

The program I made, I believe the RC signal is working well with the Arduino Uno because the serial monitor shows the figures change when I move the joy stick (<1200 left, =1500 middle, >1800 right). My problem is that the motors doesn't respond at all even though I interchanged 3 different BTS 7960 motor drivers.

So I made a program using the Uno to directly drive the motor to check if the motor driver is working or not. What happens is that the motor shaft is not moving but it produces a sort of running sound so I assumed that power is coming out from the motor driver but it may not be enough to make the motor run (just my initial very raw theory). I interchanged the 3 motor drivers and 2 kinds of motors (12V wiper motor & 24V e-bike motor) and the result is consistent on it just producing sound.

So as a fool proof test, I tested both the motors and the batteries outside of the Arduinos. I directly connected the wires of the motors to the terminals of the 12V SLA's and both motors run properly. When I reverse the polarities I get the same max speed on opposite direction which is what I intended to achieve with RC+Uno+BTS 7960.

I'm sure I'm missing a lot here so I'm not getting things right.

My intention is to drive 3 motors (Right motor, Left Motor, Weapon Motor).

This are my parts;

Flysky transmitter FS-CT6B
Flysky receiver FS-R6B
Arduino Uno
Motor Driver Arduino BTS-7960 (x3)
DC brushed motor 24V, 14A (x3)
12V 7AH SLA batteries (x2 in series)

PROGRAM with RC;

int RightMotor_RPWM = 5;
int RightMotor_LPWM = 6;
int RightMotor_R_EN = 7;
int RightMotor_L_EN = 8;
int channel1 = A0;
int Channel1;

void setup() {
// put your setup code here, to run once:

for(int i = 0; i<12; i ++){
pinMode(i,OUTPUT);
digitalWrite(i,LOW);
pinMode(channel1, INPUT);
Serial.begin(9600);
}
}

void loop()
{
analogWrite(RightMotor_RPWM,0);
analogWrite(RightMotor_LPWM,0);
digitalWrite(RightMotor_R_EN,LOW);
digitalWrite(RightMotor_L_EN,LOW);
delay(10);

Channel1 = (pulseIn(channel1, HIGH, 25000));
Serial.print("Channel1 Value = "); //uncomment to just to check if the arduino receives the correct channel values
Serial.println(Channel1);
delay(1000);

// RC is OFF
if(Channel1 == 0){
analogWrite(RightMotor_RPWM,0);
analogWrite(RightMotor_LPWM,0);
digitalWrite(RightMotor_R_EN,LOW);
digitalWrite(RightMotor_L_EN,LOW);

}
//FORWARD
if(Channel1 > 1800){

analogWrite(RightMotor_RPWM,255);
analogWrite(RightMotor_LPWM,0);
digitalWrite(RightMotor_R_EN,HIGH);
digitalWrite(RightMotor_L_EN,HIGH);
}

//REVERSE
if(Channel1 < 1200){
analogWrite(RightMotor_RPWM,0);
analogWrite(RightMotor_LPWM,255);
digitalWrite(RightMotor_R_EN,HIGH);
digitalWrite(RightMotor_L_EN,HIGH);
}
}

PROGRAM w/o RC

int MR_RPWM = 10;
int MR_LPWM = 11;
int MR_R_EN = 7;
int MR_L_EN = 8;

void setup() {
// put your setup code here, to run once:
pinMode (MR_RPWM, OUTPUT);
pinMode (MR_LPWM, OUTPUT);
pinMode (MR_R_EN, OUTPUT);
pinMode (MR_L_EN, OUTPUT);
}

void loop() {
// put your main code here, to run repeatedly:
{

analogWrite (MR_RPWM,255);
analogWrite (MR_LPWM,0);
digitalWrite (MR_R_EN,HIGH);
digitalWrite (MR_L_EN,HIGH);
delay (2000);}

{
analogWrite (MR_RPWM,0);
analogWrite (MR_LPWM,0);
digitalWrite (MR_R_EN,LOW);
digitalWrite (MR_L_EN,LOW);
delay (5000);}

{
//for(int i=0;i<256;i++)
analogWrite (MR_RPWM,0);
analogWrite (MR_LPWM,255);
digitalWrite (MR_R_EN,HIGH);
digitalWrite (MR_L_EN,HIGH);
delay (1000);}

{
analogWrite (MR_RPWM,0);
analogWrite (MR_LPWM,0);
digitalWrite (MR_R_EN,LOW);
digitalWrite (MR_L_EN,LOW);
delay (5000);}

}

Thanks a lot guys :slight_smile:

Gemmo #NoviceFromManila

Attached is my my schematics & my actual combat bot (which unfortunately couldn't run wireless :confused: )

You are sending RC signals (ie servo signals) into an H-bridge directly - that doesn't work.
H-bridges need direction/enable digital control as well 0..100% PWM for throttle setting.
An H-bridge is not an ESC.

Servo signals are a very low duty cycle PWM.

You need to decode the servo signals from the receiver using the Arduino (pulseIn()), and
send the direction/enable/PWM signals to each motor driver from the Arduino.