Hi,
I am trying to use my arduino uno board to control my R/C car's speed controller. But I don't know how to make circuit and what should I write on Arduino IDE.
Please give me some advice. Thanks a lot.
Hi,
I am trying to use my arduino uno board to control my R/C car's speed controller. But I don't know how to make circuit and what should I write on Arduino IDE.
Please give me some advice. Thanks a lot.
Use the Servo library, if it is a standard RC ESC.
Thanks for replying
i don't know how to check whether my RC esc is standard or not.
i tried Servo library, it didn't work.
The following is what i wrote on Arduino IDE
#include<Servo.h>
Servo esc;
void setup()
{
esc.attach(9);
}
void loop()
{
esc.write(180);
delay(150);
esc.write(0);
delay(150);
}
My esc's white wire is connected to pin 9. Black wire is connected to GND.
i don't know how to check whether my RC esc is standard or not.
You haven't told us what it is either, so that makes it doubly difficult.
It may have an arming sequence that you're not sending it.
My EEC is Tamiya TEU104BK, it is made for RC cars. I am not true that whether it is different from ESCs for RC airplane.
Does anyone have same experience as I have?
Thanks for you teaching.
This part of your code
void loop()
{
esc.write(180);
delay(150);
esc.write(0);
delay(150);
}
turns the motor on and off (or off and on) every 150 milliseconds.
I would start with a program that just turns the motor on and leaves it running such as ...
void setup()
{
esc.attach(9);
esc.write(45);
}
void loop() {
}
And then I would try changing the esc.write values to see what happens.
If the car can go forwards and backwards it is possible that the central servo position (90) = stop and 0 and 180 represent full forward and full reverse. It is also possible the the ESC needs a separate channel signal for fwd and rev.
...R
Hi,
Its a very standard Car ESC with forwards and reverse.
I would try
void setup()
{
esc.Attach(8);
// set the centered position to arm the ESC
esc.writeMicroseconds(1500);
// stay centered for 5 seconds
delayMicroseconds(5000);
}
then in your loop, use esc.writeMicroseconds to send values between 1000 (full reverse) 1500 (centered=neutral) and 2000 (full forwards).
To see where I get these values from, read this -
Duane B
Moderator edit: turned off smileys
Thanks for your replying. There are all useful. Because of these useful replying, my project have a chance to be continue.
When i was using DuaneB's code, my RC motor can run forward. But when i want to my motor run backward, it couldn't work.
The following is my code:
#include<Servo.h>
Servo esc;
void setup()
{
esc.attach(8);
esc.writeMicroseconds(1500);
delayMircroseconds(5000);
}
void loop()
{
esc.writeMicroseconds(1600);
delay(1500);
esc.writeMicroseconds(1200);
delay(1500);
}
It suppose that the motor should run forward, wait for 1500 microseconds and run backward. It didn't run like what it supposed to be. Please give me some help.
By the way,did the code esc.wrtieMicroseconds which was in "void setup()" mean the center point of ESC is 1500?
The ESC is designed to put the brakes on the first time you enter reverse after travelling forwards - this is to protect the gears, the can easily get damaged when going from full speed ahead to full speed reverse.
To enter reverse you will need to go reverse, neutral, reverse so 1300,1500,1300
Duane B
It suppose that the motor should run forward, wait for 1500 microseconds and run backward.
You need to be careful distinguishing your millis and your micros. delay(1500)
is a delay of 1.5 seconds.