How to control/arm an ESC using Arduino?

Hello Guys, I really need help with this
So how exactly do i arm an ESC with an arduino to control a brushless motor? Im using the esc for a robotic car But i have no clue how to arm it, i looked all over and nothing is working for me.

This is the ESC i have: https://hobbyking.com/en_us/hobbykingr-tm-35a-sensored-sensorless-car-esc-1-10-1-12.html

You have to get the Arduino to emulate the arming sequence that you would use with a regular remote-control. Some of them need you to move the joystick to the bottom and then to the top - but you need to read the manual and tell us what is required for your ESC.

...R

I understand that but how do i do it? what ms pulse do i need to give? how do i controll the speed after arming?

masterfo:
I understand that but how do i do it?

You may understand it but as you have not told us what is required by your specific ESC how can you expect advice?

...R

http://forum.arduino.cc/index.php?topic=444297.0

Check this one - pls let me know if it helped.

Best -

helitus:
Lessons on Arming ESC with Arduino - Motors, Mechanics, Power and CNC - Arduino Forum

Check this one - pls let me know if it helped.

Best -

Hello, i will try this but was the esc u were using for quadcopter esc? from my understanding, quadcopters and land (car) esc have different arming and starting beeps.

They will have different encoding, but the basic idea remains the same - going by what I have read. If it didn't arm it, try the following:

send the maximum signal (writeMicroseconds(2000)) for 2 seconds - and then go to neutral.

You can also do the following (cheating) --

connect your arduino to the Rx and then move your throttle around to read [pulseIn()] to read the pulse width - then based on the middle, low , high positions - use the respective mapped servo angle ( 0:180 = min:max) .. the middle is the neutral position for cars - for quads, it will be low throttle.

Hope this helps.

If the OP had taken the trouble to answer the simple question in Reply #1 he would almost certainly have had a working suggestion immediately.

I have not watched the video in Reply #7 but if it does not address the arming process for the ESC in the link in the Original Post it seems to me to miss the point.

...R

helitus:
Lessons on Arming ESC with Arduino - Motors, Mechanics, Power and CNC - Arduino Forum

Check this one - pls let me know if it helped.

Best -

1.) Hi thx for the help, i think i armed it, this is what i did in the setup loop:
"for(i = 97; i < 103; i++){
motor.write(i);
Serial.println(i);
delay(500);
}"
but im noticing a huge problem:

2.) I figured out that by neutral pulse (where the brushless motor stop turning) is at "motor.write(97)". And this is where the problem comes in. In the loop(), i wrote:

"int i=96;
for (i=96; i<101; i++){

motor.write(i);
Serial.println(i);
delay(5000); //5 second delay so that i can white down when the motor stops
}"

The first time the loop runs, the brushless motor spins slowly at 96, and then stops at 97,98,99,100....in the 2nd loop, the motor dont turn at all. it seems that when i tell the motor to turn to 97, it turns dead or something :confused:

Why does it do this? I need the motor to go forward and also reverse if its possible.

Thanks again

Close to neutral, the BLDC + ESC is not too happy to move. Try a number somewhat distant from neutral. Usually 110 or 80 - that should tell you if you have a problem.

Also - to move in two directions (F and R), the ESC has to be capable of doing that. Make sure you have such an ESC.

Best,

helitus:
Close to neutral, the BLDC + ESC is not too happy to move. Try a number somewhat distant from neutral. Usually 110 or 80 - that should tell you if you have a problem.

Also - to move in two directions (F and R), the ESC has to be capable of doing that. Make sure you have such an ESC.

Best,

i cannot tell u how much u helped me, i have been struggling with this for so long. i have armed it before by writing HIGH to the servo pin for 1500 microseconds, but the arming for loop u have provided did wonders. I figured out that my neutral range was from 97 to 102 ( i always though that the neutral would be only 1 position, never did i think that it was a range lol). Anyways, its working well for now, will need to test more.

i also have another question: since i will be hooking up about 6 of these esc+brushlessmotors to my robot, how many motors can i connect to the arduino mega? i read somewhere long ago that u need to use a different library for lots of servos? im not too sure.

Hi Masterfo,

If you are still interested in getting Fwd / Reverse movement - see this new post.

http://forum.arduino.cc/index.php?topic=444297.new#new

Finally, I managed to get this to move both sides (F and R) .. As you can see, the code is quite raw and untested. I will keep posting to the same thread as I add more details.

Also, I do believe the Servo library can't handle 6 servos at the same time.

Why don't you try connecting the servos as mere digitalPins in PWM, and send the requisite pulses in Microseconds -

  digitalWrite(pin,HIGH);
  delayMicroseconds(pulse_width);
  digitalWrite(pin,LOW);
  delayMicroseconds(20000-pulse_width);

This code will send one pulse at a given pulse width - repeat it until you have sent it for at least 20milli secs.

If I am not mistaken, the pulse range for servos / ESC is 700 to 2200 μSec, with the neutral falling somewhere in the middle. Instead of writing angles to servos through the servo library, directly send pulses

This might help you overcome the Servo Library limits.

best of luck.

HT

helitus:
Also, I do believe the Servo library can't handle 6 servos at the same time.

RTFM.

12 for an Uno and 48 for a Mega

...R