brushless motor rc car and arduino guidance?

Hey guys, i have this rc car Radio Control Planes, Drones, Cars, FPV, Quadcopters and more - Hobbyking

And i integrate it with arduino mega board. My problem is that in setup function, i have to make for loop to start up the motor

for (int i=1500; i<1540; i=i+3)
{
motor.writemilliseconds (i)
delay(500);
}

it is noted that this is the lowest forward speed achieved (anything lower than 1540 limit , the motor wont run). i want it to go slow because its suitable for my project.

Anyways, in the loop()

I have some conditions if (sth) {motor.writemilliseconds(1540)} else motor.writemillisecond(1500)

The problem i have is that sometimes the runs sometimes i have to wait for a long time untill it runs or does not run at all (this is after the setup function is finished). Without the for loop startup inside setup() function, the motor will nener starts.

My question is why does it happen that way? Why it needs to go through a for loop in order to start up?

Also, is it because of the esc or the motor? I cant just write any value immediately to the motor

And i integrate it with arduino mega board. My problem is that in setup function, i have to make for loop to start up the motor

for (int i=1500; i<1540; i=i+3)
{
motor.writemilliseconds (i)
delay(500);
}

What does this function do? The ESC should respond to that same value, but in microseconds, not milliseconds.

I'm presently working with a Turnigy brushless motor for an aircraft, and the ESC requires a minimum pulse on the ESC signal input (1000us) for about 5 seconds before the ESC arms and will turn the motor. That is how it determines where "stopped" (motor not running) is.

If it is a reversible motor (reversing ESC actually), it may require 1500us for the same amount of time to determine where "stopped" is.

edit: In my case, I think it is a safety feature also. It prevents the motor from turning for a few seconds after you connect the battery. My motor is powerful enough that it could easily remove a finger if it was caught in the prop and the motor started turning.

Moral - use copy and paste always, the function is called writeMicroseconds().

The behaviour is that of the ESC, its not a precision instrument, its designed for one
purpose only, to enable human-controlled R/C airplane to be controlled. You are wanting
precise behaviour.

You either need closed loop control (sense the motor speed and apply negative feedback
with a PID loop) or to get a better ESC or reflash the ESC with known firmware that
guarantees a particular response.

Thank you so much for your replies.

Is what you mean is that i cannot use writemicroseconds with specific value straight way? I calibrated the esc already 1000 is fully backwards and 2000 is fully forward.

Do you think what is the best option, buying a new esc? im thinking using strong dc motor with motor controller because i can just use analog write and dont need startup for loop?

Because if you switched it on while the R/C throttle is not pushed all the way to zero, it will cut your fingers off. This sequence is used to tell the ESC that you have stepped back from the model and you have your hand on the throttle. That is why it requires this very definite sequence of inputs to enable the ESC.

CAn you explain a bit more details please? The range is from 1000 to 2000 microseconds. When you said zero, what does that mean

Throttle fully off.

You need to play with a real RC controller and receiver to see why the interface is as it is.

RC motors driving a propeller really can cut you to ribbons in a fraction of a second, R/C ESCs
have to implement safety measures.

Why is it so important to you to bypass the safety and calibration feature? Is a few seconds wait that inconvenient?

dmngu9:
CAn you explain a bit more details please? The range is from 1000 to 2000 microseconds. When you said zero, what does that mean

A "normal" ESC throttle fully off (zero movement = throttle lever fully back) is 1000us. For a reversible ESC (zero movement = throttle lever centered), I think that is 1500us. The ESC wants to know two things:

  1. The throttle is in the off position (close to zero speed).
  2. The pulse length for the off position (zero speed).

R/C radios are not exact on the pulse length for fully off and fully on. They could be off by several microseconds.