Issues Controlling a 10 Amp Brushed ESC

I recently purchased this brushed 10A ESC with brake in the hopes of controlling a salvaged motor in an RC Truck like this one. I hooked up 5 AA batteries (I do not have LiPo batteries yet) to the power connections on the ESC, hooked up the motor to the ESC and finally connected the signal pin from the esc to pin 9 of an Arduino Uno and GND of the ESC to the GND of the Arduino which is powered from a 9V battery. The problem is the lack of documentation, the "user manual" includes some contradicting specs like PWM: 8K and Control Type: PPM (those are 2 DIFFERENT control methods, right?). Anyway, loading this example sketch :

/*
  ESC_Ramp
    Based on the Sweep example in the Servo library, this allow a ramp up and down of the ESC speed based on the Min and Max values.
    The Min and Max speed are defined so you can change them at one location and it will be used in the ramp as well.
    
  27 April 2017
  by Eric Nantel
 */
#include "ESC.h"
#define LED_PIN (13)                                      // Pin for the LED 
#define SPEED_MIN (1000)                                  // Set the Minimum Speed in microseconds
#define SPEED_MAX (2000)                                  // Set the Minimum Speed in microseconds

ESC myESC (9, SPEED_MIN, SPEED_MAX, 500);                 // ESC_Name (ESC PIN, Minimum Value, Maximum Value, Default Speed, Arm Value)
int oESC;                                                 // Variable for the speed sent to the ESC

void setup() {
  pinMode(LED_PIN, OUTPUT);                               // LED Visual Output
  myESC.arm();                                            // Send the Arm value so the ESC will be ready to take commands
  digitalWrite(LED_PIN, HIGH);                            // LED High Once Armed
  delay(5000);                                            // Wait for a while
}

void loop() {
  for (oESC = SPEED_MIN; oESC <= SPEED_MAX; oESC += 1) {  // goes from 1000 microseconds to 2000 microseconds
    myESC.speed(oESC);                                    // tell ESC to go to the oESC speed value
    delay(10);                                            // waits 10ms for the ESC to reach speed
  }
  delay(1000);
  for (oESC = SPEED_MAX; oESC >= SPEED_MIN; oESC -= 1) {  // goes from 2000 microseconds to 1000 microseconds
    myESC.speed(oESC);                                    // tell ESC to go to the oESC speed value
    delay(10);                                            // waits 10ms for the ESC to reach speed  
   }
  delay(5000);                                            // Wait for a while befor restart
}

from this library only makes the motor go one direction very slowly.
Here's what I've tried:

  • changing SPEED_MIN to 0 and the arm value to 1000
  • changing SPEED_MIN to 0, SPEED_MAX to 8000 and the arm value to 4000 (PWM: 8K?), the ESC then flashes and becomes unresponsive until power is cycled (I think it is out of its range)
  • using the Servo library (the Sweep example sketch and writeMicroseconds(0, 1000 and 2000)).
  • I have checked that the motor will run on the AA batteries just fine, it goes much faster
  • I measured the voltage (~7 V) with a Multimeter (it doesn't have a high refresh rate) and the current, which never exceeded (500 mA)
  • Other fruitless efforts

My Questions:

  • From my (limited) understanding of ESCs there is an arming value (the lowest speed, I think) but for bidirectional ESCs what is the arming value?
  • Why does the motor only go one direction? Why does it not have enough torque to run under its own power?
  • Is my ESC underpowered?
  • How did I screw this up?

Lastly, to complete this novel (which is probably missing details) here is a video of someone using the ESC with a servo tester (and before you ask, I do not have a servo tester but I have servos).
Thanks in advance,
John

I've never used that ESC library, I've always just controlled ESCs with the standard Servo library. So what exactly happened when you tried the Servo library?

Exactly what motor are you using? Many RC car motors need more than 10A.

What batteries are you using? Most non-rechargeable AA batteries can't deliver 10A or anything near it. Do you have a meter to check the voltage of the battery when you're trying to run the motor?

ESCs like that often need configuring to switch between forward/brake and the forward/reverse modes.

BTW in ESCs PPM is the input format. The 8KHz PWM refers to the output that drives the motor. There's no real connection between the two.

If you have a potentiometer try using the Knob example sketch. That gives you more control over the signal going to the ESC so you have a better chance of working out what is happening when.

Steve

Hi Steve,
After further tinkering following your advice, I managed to get a smaller 130 size geared motor (one from a standard robot kit) spinning happily with speed control in both directions. The control sequence is really weird (reverse will be disabled once you go forward, there's a sequence to bring it back though) but I got it figured out. Problem is that my larger RC truck motor won't even start, I am going to replace the alkaline batteries with freshly charged NiMH batteries and report back to see if that fixes anything but other than that I am stumped.

When the batteries are hooked directly to the motor, it spins at full speed and pulls an amp with no load and 3 amps continuous when the truck is moving on the ground which is well under the ESC's 10A rating. Now, when I put the ESC and arduino into the mix the motor spins really slowly when unloaded and not at all when the truck is moving on the ground. Any help would be appreciated.

Side note: the ESC is not programmable.

Thanks for your help so far,
John

Hello again,
I am reporting back as I have made further progress, I am using 8 AA NiMH batteries in series to power the car exactly like the truck was originally meant to be powered. The truck's motor behaves similarly to the smaller 130 motor I tried earlier but it does not reach its top speed nor have any torque. I think I have narrowed down my problem though, the ESC appears to be limiting the current available to the motor (less than 900 mA). THe batteries have around 2.5 A at their disposal but the 10A ESC won't draw more than an amp. As I have already checked the motor tops out at around 2.5 to 3 A continuous so the ESC shouldn't have a problem. Maybe my ESC needs to be armed to supply more than an amp? WHat would be the arming value on a bidirectional brushed ESC. I am a little stuck here as I have no real datasheet to go off of nor experience with other RC ESCs.

Any help would be appreciated,
John

How do you know "the batteries have 2.5A at their disposal"? You're not confusing the CAPACITY of 2500mAh with the ability to deliver 2.5A of CURRENT are you? Though having said that most NiMH AAs will deliver more than that. Exactly what batteries are you using?

But probably more important, what code are you using to drive your motors/ESCs? If you want full speed you'd normally just write 2000 or 2500 or something like that and see what happens. Did you ever try the Knob program as I suggested?

Arming should be no different for a motor with reverse. What is different is that the motor is stopped at roughly 1500 with 1000 being full speed reverse and 2000 full speed forward. A forward-only ESC is stopped at 1000, full speed at 2000 (all figures are pulse lengths in microseconds - and I'll say again I don't know that ESC library so I'm only guessing what it's doing).

Steve

Hello Steve,
First things first, I have been using 6 standard Sanyo AA 2500 mAh NiMH batteries to power the motor, I apologize for my poor wording of their ability to deliver 2.5 A of current, all I meant was that the batteries could supply enough voltage and current to run the motor at the desired speed and torque without the ESC in the system.

Code-wise I have been using the standard servo library knob example as you suggested (modified for serial print outs of the value) which worked wonderfully when tested with a smaller 130 size motor I also had on hand. Should I switch to writeMicroseconds? I don't need precision yet, I just want to run the truck's motor at the correct speed. Anyway, here is my code, just in case:

/*
 Controlling a servo position using a potentiometer (variable resistor)
 by Michal Rinott <http://people.interaction-ivrea.it/m.rinott>

 modified on 8 Nov 2013
 by Scott Fitzgerald
 http://www.arduino.cc/en/Tutorial/Knob
*/

#include <Servo.h>

Servo myservo;  // create servo object to control a servo

int potpin = 0;  // analog pin used to connect the potentiometer
int val;    // variable to read the value from the analog pin

void setup() {
  myservo.attach(9);  // attaches the servo on pin 9 to the servo object
  Serial.begin(9600); // begin Serial communication at 9600 baud
}

void loop() {
  val = analogRead(potpin);            // reads the value of the potentiometer (value between 0 and 1023)
  val = map(val, 0, 1023, 0, 180);     // scale it to use it with the servo (value between 0 and 180)
  myservo.write(val);                  // sets the servo position according to the scaled value
  Serial.println(val);                 // print the value
  delay(15);                           // waits for the servo to get there
}

Lastly, would an arming value like myservo.write(95) do the trick, or should I increase it? Either way I will do a little tinkering with the arm value to see if it adds any benefit, if you have any suggestions as to why my ESC is current-limiting my motor to less than 1 Amp even though the ESC is well under its rated spec (10 Amps), let me know.

John

Generally if the arming function is wrong then the ESC simply won't run the motor. I've never met one that limits the output in those circumstances. But in that code there is no specific arming function so do you mean you set it manually to write(95) for a second or two before you try any other values? Is write(95) the value that causes the motor to stop running?

So you're saying that you run that same code and ESC with a 130 motor and it works correctly, full speed forward and reverse etc. What is the current taken at full speed i.e. write(180)? Basically I'm asking if you have ever seen more than 1A out of that ESC.

But when you get to write(180) with the RC truck motor something is limiting the current and the motor turns slowly. What is the battery voltage at this point?

If so none of that makes very much sense. About the only thing I can think of is the the wiring/connections are bad. A picture of your setup might help. You're not trying to connect the motor via a breadboard are you? They're notorious for not handling any real current. Or alligator/crocodile clips which are much the same.

Steve

Hi Steve,
First, I'd like to thank you for all your help with this problem, which I managed to fix thanks to your advice, turns out my alligator clip (4 in total) connections were at fault for the current limiting problem. Newbie mistake, my bad, but at least I learned something.

I managed to get the motors running at their full potential (with AA NiMH batteries at least). Problem is the motor isn't getting enough current to start the truck moving under its own power. Thus, I have been looking to get my hands on some suitable 2S RC LiPo batteries because of their high peak discharge (determined by their C rating if I'm not mistaken). Do you have any advice on where to get them? Like Hobbyking? Also, do you have any LiPo charger recommendations?

Thanks for all your help!
John