Help me understanding controlling Brushless motor

Hi , iam trying to understand the controlling of Brushless motor .

Main problem that i did not understand is this code , esc.write(0);

i know this code is to write value to esc Ok but what is the value that we pass is it the voltage ? or is it the amperes or what ?
How can i add value that works with full power to my motor

Welcome to the forum

The value that you pass to the write() function would be an angle between 0 and 180 degrees if you were controlling a servo. When controlling an ESC it is interpreted as the speed of rotation of the brushless motor

As with the servo the range of values is 0 to 180, 0 being the slowest and 180 being the fastest
Note, however, that some ESCs require an arming process to be carried out before the motor will start and that there may also be a calibration process if you wish to have the speed of 2 or more motors to be matched

1 Like

Hi , thanks for your answer so for servo motor if i want to move the angle of motor i use value from 0 degree to 180 degree maximum ,

And for the brushless motor wich is more important for me , I have to pass the KV for example : i have brushless motor with 1000Kv and it take maximum volt 12v and 10 amperes how can i calculate the maximum value and pass it using esc.write(maximum_speed)

Sorry, I have no idea how to do that

1 Like

Np thank you

The instruction manual for your ESC should specify a min and max pulse width for zero and full speed.

You enter those values in the ESC.attach().
This explains what to do:

1 Like

this is my esc detail .
ESC Specification:

  • Output: 30A continuous, burst 40A up to 10 Secs.
  • Input voltage: 2-4 cells lithium battery or 5-12 cells NiCd/NIMh battery
  • BEC: 2A/5V (linear mode).
  • Maximum speed: 210,000 rpm for 2-pole BLM, 70,000 rpm for 6-pole BLM, 35,000 rpm for 12-pole BLM. (BLM: brushless motor)
  • Size: 452411mm/1.80.90.4in

and this is my motor details .

Brushless Motor Specification:

  • XXD A2212 1000KV brushless pioneer motor
  • KV: 1000
  • Max. Efficiency: 80%
  • Max. Efficiency current: 4-10A (> 75%)
  • Current capacity: 12A/60 s No
  • Load current @ 10 V: 0.5A
  • Number of cells: 2-3 li-poly
  • Motor size: 27.527mm/1.11.1in
  • Shaft diameter: 3.17mm/0.1in

There are no pulse widths given, you will have to find them by trial and error.
Start with the values given in the tutorial and see if it works.

1 Like

if you write:

const int max_speed = 180;
esc.write(maximum_speed);

then 1000 * 12 = 12 000 rpm
savvy?

1 Like

@codev200 see this old thread. It has a discussion about calibrating the ESCs.

HTH

a7

1 Like

In general ESC devices require a low frequency command who's duty cycle varies from some low number to near 100%.

read this to get a better understanding.

On many ESC designs stopped is something above zero PWM. Perhaps anything < 5%, and max speed is often something like > 95%. This is because the internal circuitry cannot sense the % PWM it no signal change is present. For instance, at 0% is it 0% or a broken wire.

1 Like

thanks for all , Can someone tell me what is passed here esc.write(Value);

What is the value , this is my question? Voltage or ampere or percentagege ?

This is my motor and esc i use : https://ar.aliexpress.com/item/32842414497.html?spm=a2g0o.productlist.main.13.7d9f3cfcv7e8b0&algo_pvid=f35d28c4-cfdd-4094-ba66-65288a47c0f8&algo_exp_id=f35d28c4-cfdd-4094-ba66-65288a47c0f8-6&pdp_npi=4%40dis!USD!18.31!10.8!!!18.31!!%402101d64d16919522120841490eb20f!10000001485424536!sea!LB!0!A&curPageLogUid=0shkS9kziNbC

I took the link and the first thing I read was

ESCs, in a broader sense, are PWM controllers for electric motors. The ESC generally accepts a nominal 50 Hz PWM servo input signal whose pulse width varies from 1 ms to 2 ms.

The duty cycle comes nowhere near 100 percent. 50 Hz is a pulse every 20 milliseconds.

Modern ESCs do take control,signals other than standard servo style PWM, but they do respond to old school,waveforms.

a7

As previously explained it is none of those

1 Like

then what is it ? my project is control brushless motor using esp32 over TCP/IP Socket
So i need this in dead

The value is degrees 0 to 180, or alternately a pulse width typically 1000 to 2000 microseconds, understood to be issued at 50 Hz.

Something in the servo library translates 0 to 180 into that pulse range if you use a function that takes degrees.

As has been said, 0 to,180 would give you o to full speed. On a 3D ESC, 0 is full reverse, 90 is stationary and 180 is full speed ahead.

Assuming you have calibrated the ESC.

a7

1 Like

Good i understand you now , so for example if i want to run the motor at 25% of his speed

i do this
int value = (180 * 25 / 100); // the value is 45
esc.write(value);

Did you get an instruction sheet with the ESC that tells how to setup or "arm" it?

No, its Chinese motor and ESC.

For servo's I agree. As this was just a speed controller I didn't know if the same applied. I know some DC speed controllers work with 10% to 90% input control.