Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

BLDC motor and ESC beeps but do'nt start

Status
Not open for further replies.

polashd

Member
I'm trying to control a bldc motor(1800KV) using MCU (Atmega32) PWM signal (duty cycle controled by a Pot(VR).

I connected it with an ESC(non-branded) and Lipo battery(2s, Mystery 2800mAh).

when i connect it with battery the motor beeps and jurk a little with each beep. But dont start spin.

Beep sequence:
- 1 musical beep.
- 2 beeps
- 1 beep in every second (until i disconnect power)

can anyone please help me.

note: I'm not using any remote control
 
What is the pulse repetition period of your PWM signal?
Does the Lipo voltage exceed the minimum voltage required by the motor?
 
While the beeps come from the motor, the logic for them is created in the ESC. To interpret that code, you need the ESC instructions.

John
 
when i turn on my esc this is what i must do:


1) pwm on low
2)power esc, wait for beep(s)
3)pwm to high for about 2secs, wait for more beeps
4)pwm low\
5) on final low esc is hot, and any pwm adjustment will now fire motor;

my esc was GWS, and beeps like yours when started, but as stated you need to refer to manual for specifics, i have had motors jump out of my hand a few times unexpectedly while programming, i recommend securely anchoring motor while learning about esc.
 
I'm using fast PWM mode. I don't know what the frequency is. I'm just using a VR to control duty cycle.
How can i set it to repeat in 40/50Hz and control speed at the same time?

my code:
---
void InitPWM(void)
{
TCCR0|=(1<<WGM00)|(1<<WGM01)|(1<<COM01)|(1<<CS00);
DDRB|=(1<<PB3);
}

void SetPWMOutput(uint8_t duty)
{
OCR0=duty;
}

---
in main inside while loop:

SetPWMOutput(ADCvalue); // ADC value controlled by VR

---

please help me to solve

note: Atmega32 with internal 1MHz
 
It is not clear what the problem you want to address is. Have you figured out how to get your motor to run using the esc? If not, you need to re-read Dr_Doggy's post (#4). That is one sequence. There are others. Your esc contains a microcontroller. Your original question seemed to be related to the need to program it, which is what the sequence given by Dr_Doggy does..

Castle Creations is a major vendor of esc's. Check out its site and you may find the sequence of beeps needed to program your esc.

Generally speaking, an esc will not start until it receives a signal that corresponds to the low/off throttle signal, which is often about a 1 mS pulse repeated every 20 mS. If in programming mode, it will often need the high speed signal (about 2 mS) to set the range. You will also set the cut-off voltage; although, some come pre-programmed for that variable. After setting the high range, you then return to low speed or power off to start the motor. When you power up, the signal on the esc input must be the low speed/off signal pulse width. Modern esc's will not start with power on for obvious safety reasons.

Here is a snippet from a Castle Creations manual:

Capture.PNG

A simple way to get programming done is to use an RC transmitter and receiver. Another way is to make a simple servo driver based on the 555 chip. There are many designs for such drivers.

Regards,

John
 
Can any one please provide me with the complete code. I'm new in this
I googled a lot but got confused (20ms, 2ms, 1ms,1.5ms pulse etc.). I can control the duty cycle with OCR0 (PB3 pin), but dont know about the frequency.

is it possible by doing some editing in my code (that I posted above)
I want to control speed by turning a veriable register(ADC value).
Can i do it (setting MCU, ESC & motor) TCCR0 & OC0? Or i must use TCCR1A/B & OC1A/B.

Please help me to solve this problem.
 
One last time:

1) Is your problem now that you cannot control the motor's speed; or
2) You can't get the motor to run because it just beeps?

I have been trying to address the second issue (#2). If you have gotten past that point, please let us know on this forum.

If you don't know what signal the esc needs to work, your programming will never work. You need to learn how model servos and this esc work. Please describe what you find confusing about sending a pulse with a certain width every 20 mS. The control response is proportion to the pulse width in mS. That width usually ranges between 1 mS and 2 mS with "center" at 1.5 mS. Now, of course, esc's don't have a meaningful center. Also, some systems use slightly different pulse widths, but use the ones I have suggested to get started.

John
 
Sorry for my ignorance. and thanks for your willingness to help
-I can create PWM on PB3 (OC0) pin(Atmega32) using a potentiometer (and ADC)
-what i understand PWM value is a ratio of Ton & Toff. if so it should be dimensionless. how can it be of XY ms.
-How can I generate (& control) frequency and Pulse with at the same time on that pin (PB3) (& without making the CPU busy all the time doing this).

Nb.: please review my code (above) and suggest me on that also

thanks again
 
Sorry, I cannot do C, only MPASM.

Servo control is often called "PWM." You are correct that PWM is usually characterized as a duty cycle, that is, the percentage of cycle that is "on." Some people might call that pulse proportion modulation, but I am not a big advocate of bickering about words.

The pulse width that causes a servo to center is usually 1.5 mS. Since that is repeated every 20 mS, you could call that a duty cycle of 0.075 (7.5%). Doing the same calculation for full swing in either direction results in a range of 0.05 to 0.10 duty cycle. Now assume you want 256 steps and you can see the problem that is faced in using the PWM generator in various chips.

Therefore, it is usually easier just to generate the servo control signal by toggling a port pin using delays. If you do that, you will find that the servo responds primarily to pulse width, not percent duty cycle, so long as the pulse repeat rate is something near 50 Hz. I have run servos at 100 Hz repeat rate, and most of them do just fine, so long as the pulse width is within the limits given here.

The main point I have been trying to make is not how to program your MCU, but how you can find out what you need to do to get the esc to respond as you want it to respond. Your esc almost certainly has its own MCU, and you need to figure out its programming codes to get it to work. The easiest way to do that is to read its instruction manual, but you apparently do not have that available. That is why I have suggested that you borrow an RC transmitter and receiver or use an established design for a servo controller. That removes from the trouble shooting equation any variable related to your programming code.

We are not sure where you are, but from my knowledge of RC hobbyists, I think any one of them would enthusiastically help you figure out the esc. Once that is done, then work on your C code for speed control.

EDIT: If you can get a cheap servo, you could approach this problem from another direction. First, get your MCU to work the servo with a potentiometer, then try to decode/program the esc with your MCU. There must be many examples in C for controlling a servo with an AVR chip.

John
 
Last edited:
if esc is beeping like that probabally code is working

if you are getting pwm output as you say then next step is figuring out esc setup process, before you can continue with the code.

1) pwm on low, ie turn potentiometer (and ADC) down
2)power esc, wait for beep(s)
3)pwm to high for about 2secs, wait for more beeps ie turn potentiometer (and ADC) all the way up
4)pwm low ie turn potentiometer (and ADC) back down
5) on final low esc is hot, and any pwm adjust potentiometer (and ADC) will fire motor;

if that doesnt work you need to find vendor of product,
plan b)
google all the different boot sequences you can get for all the esc's an go through them all one by one till one works
 
I'm trying to control a bldc motor(1800KV) using MCU (Atmega32) PWM signal (duty cycle controled by a Pot(VR).

I connected it with an ESC(non-branded) and Lipo battery(2s, Mystery 2800mAh).

when i connect it with battery the motor beeps and jurk a little with each beep. But dont start spin.

Beep sequence:
- 1 musical beep.
- 2 beeps
- 1 beep in every second (until i disconnect power)

can anyone please help me.

note: I'm not using any remote control

Position sensors not working
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top