5

I'm trying to connect an Arduino to an Electronic Speed Control and failing horribly. I'll explain what I've done so far, and then I'll explain the problem.

Before we get there, here's the list of parts I'm using:

  • Arduino Uno (genuine)

  • 6V to 8.4V rated 18300 RPM 350 g-cm brushed motor.

  • Traxxas XL-5 brushed motor ESC. 1600 Hz is the highest PWM signal it accepts, if I'm not wrong.

  • Venom 4200mAh NiMH 8.4V battery pack (will replace soon with a 7.2V).

So I first connected the ESC to the motor. The connection is this bullet lead connection (the connection seems intact), and then the ESC to the Arduino. I connected the white wire to pin 9 and the black wire to ground. If I'm not wrong, this is the standard servo motor setup. I then plugged the Arduino into my computer, which has an intact USB port. Lastly, I connected the battery pack to the ESC.

Now I've tried to upload some basic code to try and calibrate my ESC, but it just plain our refuses to work. Under no circumstances will the motor run. The code I'm using just sends the signal sent by the signal monitor.

I'm a complete noob to Arduino, so I don't know what could be wrong. The program I have in mind needs to be able to run while not connected to the computer, activate when a push-button switch is activated, run the motor for a certain distance (which involves an encoder, right?), and then stop.

Any pointers or things I could be doing wrong?

int value = 0;
Servo myservo;
void setup() {
    firstESC.attach(9);    // attached to pin 9
    Serial.begin(9600);    
}
void loop() {
    myservo.writeMicroseconds(value);
    if(Serial.available()) 
        value = Serial.parseInt();    // Parse an Integer from Serial
}

and the one here:

#include <Servo.h>
#define MAX_SIGNAL 2000
#define MIN_SIGNAL 700
#define MOTOR_PIN 9
Servo motor;
void setup() {
    Serial.begin(9600);
    Serial.println("Program begin...");
    Serial.println("This program will calibrate the ESC.");

    motor.attach(MOTOR_PIN);

    Serial.println("Now writing maximum output.");
    Serial.println("Turn on power source, then wait 2 seconds and press any key.");

    motor.writeMicroseconds(MAX_SIGNAL);

    // Wait for input
    while (!Serial.available());
    Serial.read();

    // Send min output
    Serial.println("Sending minimum output");
    motor.writeMicroseconds(MIN_SIGNAL);
}
void loop() {  
} 

^shamelessly copied from the internet

  • What is the code? – Dave X Mar 2 '16 at 16:30
  • just added the code c: – Shashank Addagarla Mar 2 '16 at 16:55
  • @a_human_mistake Please use the Code button in the editor to format code as code. Your current method did not look nice. :) – Avamander Mar 2 '16 at 16:58
  • oh man, I tried and it wouldn't allow me to put newlines in the code. turned out really weird when I used the mini-Markdown formatting. Thanks for editing to make it look decent! – Shashank Addagarla Mar 2 '16 at 17:26
  • @a_human_mistake could you describe what the led is doing on your ESC? – RSM Mar 3 '16 at 11:56
1

The is a standard with RC connectors, that is Black always goes to ground white/orange goes to the signal and red/brown goes to 5V.

I don't know if you have made a typo, but you need to connect the white to D9 and the black to GND. Here is a instructables post, it describes using a brushed ESC step two reiterates the colour code standard.

You would also need a rotary encoder or shaft encoder to tell the distance moved, there are lots of ways to achieve this from simple(coded disk and IR arrangement) to custom made PCB add-ons.

  • Oops, I did make a typo. Thanks for pointing it out. I don't technically need to measure the distance I move, only make it move a certain distance. I considered using a quadrature encoder, but I have enough problems with everything else that the plan was basically benched. – Shashank Addagarla Mar 2 '16 at 17:28
  • @a_human_mistake do you have a RC receiver and transmitter you could use to test the ESC. Also I will move this to a comment rather or delete it. – RSM Mar 2 '16 at 17:30
  • I can check and see -- is it possible that it's a problem with the ESC? – Shashank Addagarla Mar 2 '16 at 17:51
  • @a_human_mistake there may be the annoying possibility that the ESC might have had too much current pulled through. – RSM Mar 2 '16 at 20:12
  • So if I were to buy a new ESC, what would I look for in order to avoid that happening? Can I avoid that problem in any way? – Shashank Addagarla Mar 3 '16 at 0:04
0

Calibration can be done by sending the low throttle and high throttle values through the Serial monitor.Here's an instructable i have made using NODEMCU.Check this out.May be it helps.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.