UNO R3-ARMMA 12T RC MTR-Car battery

Hello,
I was following DronBot Workshop's video on motor controllers as a guide. However my motor doesn't turn on. I tried searching here and found that sharing a gnd between the battery, IBT_2 board and UNO was missing. So I added that and still nothing. I kept searching and everything i found said this setup should work(see schematic below). The one thing I thought about was that the led on the uno doesn't lite up, so I hooked up a 9V battery to power it and now they lite up; but the motor still doesn't spin. I've tried a couple of different code examples, which primarily swap PWM ports on the UNO but otherwise are the same. Anyway I've seen that people like to see a schematic, a picture of the setup, and the code. Can you see what I'm doing wrong?


/*
  DRV8871 H-Bridge Demo
  drv8871-demo.ino
  Demonstrates operation of DRV8871 H-Bridge Motor Driver
  
  DroneBot Workshop 2022
  https://dronebotworkshop.com
*/

// Motor Connections (Both must use PWM pins)
#define IN1 9
#define IN2 10

void setup() {

  // Set motor connections as outputs
  pinMode(IN1, OUTPUT);
  pinMode(IN2, OUTPUT);

  // Stop motor
  digitalWrite(IN1, LOW);
  digitalWrite(IN2, LOW);
}

void loop() {

  // Accelerate forward
  digitalWrite(IN1, LOW);
  for (int i = 0; i < 255; i++) {
    analogWrite(IN2, i);
    delay(20);
  }

  delay(500);

  // Decelerate forward
  for (int i = 255; i >= 0; i--) {
    analogWrite(IN2, i);
    delay(20);
  }

  delay(500);

  // Accelerate reverse
  digitalWrite(IN2, LOW);
  for (int i = 0; i < 255; i++) {
    analogWrite(IN1, i);
    delay(20);
  }

  delay(500);

  // Decelerate reverse
  for (int i = 255; i >= 0; i--) {
    analogWrite(IN1, i);
    delay(20);
  }

  delay(500);
}

A PP3? A fire alarm battery? If so, go for a power source, not only a voltage source.

That's not needed, shouldn't even be there. The driver has a low voltage logic interface that has nothing to do with the motor side.

Post links to technical information on each of the hardware devices. If the IBT2_board is not isolated you may be correct in having the ground connected. If it is the one with the BTS7960 the grounds are connected together on the module. If you lose ground you can blow the drivers.

1 Like

@gilshultz Thanks for commenting! As requested here are links to the components.

IBT2 BTS7960
http://www.hiletgo.com/ProductDetail/1958385.html

Armma 12T motor
https://www.arrma-rc.com/en/product/mega-550-12t-brushed-motor/ARAG1005.html

UNO R3
https://docs.arduino.cc/hardware/uno-rev3

Unfortunately I'm a beginner and didn't know there was a IBT2 without the BTS7960. How do you know which version you have?

1 Like

@Railroader You're correct about the 9V batter, its a PP3 battery that came with my Arduino Mega starter kit. Unfortunately I'm new to Arduino and I added it because the Arduino and IBT2 aren't powered without it. It sounds like you're suggesting I use a bigger battery, is that correct? The end state of this project is self contained power, so it won't be plugged in. Please correct me if I misunderstand you or are way off base. Thanks for your help!

Yes! Absolutely!
One suggestion is to avoid using Vin totally, if possible. Feed the controller with 5 volt to the 5 volt pin.
Feed external things separately. Sometimes buck/boost converters are handy to use.
I have contacted some Youtubers launching tutorials using PP3 batteries, pulling their pants down, but they persist....
Using battery.... For how long time do You want the project to run before charging/replacing the batteries?
You're correct in reading my reply! No mistakes there.

Thanks for the information. The bridges are basically the same, they are also sold under under the BTS7960 Bridge name. I am using a bunch of them as LED drivers, very inexpensive for the power I can switch. Generally I just use it as a dual High Side driver as it has a very low RDSon and at 20A is barely warm. That should not get very how with 171 (~15A at 12V) watts shown as the motor requirement.

The specification on the motor is very vague but knowing the wattage is a good start. I will take a SWAG and say I would expect something in the 50A range when you turn the motor on from a dead stop. Wire size etc will help limit this surge. Your battery will be also acting as a filter, a good thing.

The BTS7960 has a minimum voltage requirement of about 8 volts for the motor power If I remember correctly. I suggest simply feeding the UNO from the same battery via Vin. Isolating Vin with a diode would not hurt. It would support the driver control current as it has a few HCMOS parts (depends on version as to what parts).

@gilshultz @Railroader Ok. I switched power of the arduino and the IBT2 to the battery as well. I checked voltage at the arduino bullet connector (12V) & checked voltage at the IBT2 and am getting 12V to that as well. I have an updated wiring schematic below. However the motor still doesn't turn on. Do you have any ideas?

If You disconnect pin 9 and 10, what voltage do You measure at the driver pins RPWM reså. LPWM? ( I don't know that driver by heart.) Measure the voltage from GND and to the pins.
Check the eventual straps on the driver.

From the frizzy picture missing almost of the details I will take a SWAG and say it is not properly wired. Take a look at this link and see if it helps: IBT-2 H-Bridge with Arduino – Dr Rainer Hessmer

@Railroader When testing the voltage at the rpwm & lpwm I got 0.0V at each pin. I reconnected rpwm & lpwm and checked voltage at the pins and got 1.88V at each. I was expecting that when the microcontroller is running and sending pwm that the voltage would increase and decrease or would be really sporatic because a fluke volt meter can read pwm signals. So a constant voltage seems weird to me. What do you think?

@gilshultz Thanks for the link, I will compare my wiring to confirm its right.

Good! I was afraid there would be 12 volt. More thinking needed.

You can't use a DVM on a pulsing signal. You would need an oscilloscope for that.

I don't know how a PWM reading instrument present the values, what it presents.

The motor doesn't turn...... Try to measure at the driver outputs to see if it pulses or not.

For constant voltage you need a voltage regulator or a specially designed circuit that uses PWM. Sorry to say the Arduino being a digital machine only that is saying it is not measurable with any accuracy with a standard voltmeter. You need to use an oscilloscope or a logic analyzer to check the signal. The output pulses should go from zero to Vcc, the voltage will remain constant, the width of the pulse will change. The link showed the bridge schematic which calles out a different part, a BTN7970: INFNS11665-1.pdf You can check the part for yourself.

You appear not to understand what a schematic is, check this link out:

This will explain that a schematic is a drawing that defines the logical connections between components on a circuit board whether it is a rigid PCB or a flex board . It basically shows you how the components are electrically connected, annotation tells you what the parts and signal names. Schematics is the language of electronics. One well drawn schematic would convey more information then the totality of this post, enough to solve your problem

@Railroader @gilshultz
Ah, I meant to say "a fluke meter can't read pwm signals". Just trying to convey that i understand i don't have the right equipment to read the values. I measured voltage at the motor outputs and i got the 12.5V at M+ & M-. It didn't pulse either.

Any strap or connection missed at the driver?

1 Like

This probably isn't what you want to hear, but i don't know what a strap is and if I'm missing one. Would you like me to send more photos?


I connected the Neg Probe of my DVM to the battery and poke the motor connections. I got 12V at both the + & -. I thought only one side would have a voltage difference. So I changed the code for testing purposes as below. This should just cycle the motor on/off every second.


#define R_EN 2
#define L_EN 4
#define RPWM 9
#define LPWM 10

int rotDirection = 0;
int pressed = false;

void setup() {
  pinMode(R_EN, OUTPUT);
  pinMode(L_EN, OUTPUT);
  pinMode(RPWM, OUTPUT);
  pinMode(LPWM, OUTPUT);
  // Stop Motor
  digitalWrite(R_EN, LOW);
  digitalWrite(L_EN, LOW);
}

void loop() {
  // Enable the motor
  digitalWrite(R_EN, HIGH);
  digitalWrite(L_EN, HIGH);

digitalWrite(RPWM, HIGH);
digitalWrite(LPWM, HIGH);
//analogWrite(LPWM, 200);

delay(1000);

digitalWrite(RPWM, LOW);
digitalWrite(LPWM, LOW);

delay(1000);
}

Checking voltage at the pins on the IBT2. The motor + & - had 12V. The enable pins were going back and forth between 3V & 0. This was not expected since the code set them to high. The LPWM & RPWM were cycling back and forth as expected. Why is the arduino cycling the enable pins?

Update:
That last scenario was when the arduino was plugged into the computer. When I unplugged it, and plugged the bullet from the battery in some things changed. The enable pins are now holding steady @ 4.5V. The PWM pins were cycling between 4.5V & 0. The Motor + & - both still said 12V. Ahh, an amateur like me doesn't know what to make of all of this inconsistency.

Sooo, i figured it out. It has everything to do with being a rookie. I beleive that i was in overvoltage lockout because i had the vcc & gnd (ibt2) direct from the 12V batt. So i put a buck converter between there and was able to get the motor to spin. @gilshultz @Railroader thanks for the helpful suggestions!

2 Likes

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.