Drive an ESC with PWM from AVR Microcontroller

A brushless DC motor (BLDC) is an AC synchronous electric motor that from a modeling perspective looks very similar to a DC motor. Sometimes the difference is explained as an electronically controlled commutation system, instead of a mechanical commutation system, although this is misleading, as physically the two motors are completely different…
Brushless DC motor controllers are much more complicated than brushed motor controllers. They have to convert the DC from the battery into phased AC (usually three phase) in order to produce the changing magnetic field.
DC ESCs in the broader sense are PWM controllers for electric motors. An electronic speed control or ESC is an electronic circuit with the purpose to vary an electric motor's speed, its direction and possibly also to act as a dynamic brake. The ESC generally accepts a nominal 50 Hz PWM servo input signal whose pulse width varies from 1ms to 2ms. When supplied with a 1 ms width pulse at 50Hz, the ESC responds by turning off the DC motor attached to its output. A 1.5ms pulse-width input signal results in a 50% duty cycle output signal that drives the motor at approximately half-speed. When presented with 2.0ms input signal, the motor runs at full speed due to the 100% duty cycle (on constantly) output.
The correct phase varies with the motor rotation, which is to be taken into account by the ESC: Usually, back EMF from the motor is used to detect this rotation, but variations exist that use magnetic or optical detectors. Computer-programmable speed controls generally have user-specified options which allows setting low voltage cut-off limits, timing, acceleration, braking and direction of rotation. Reversing the motor's direction may also be accomplished by switching any two of the three leads from the ESC to the motor.

Why use an AVR microcontroller?
In the AVR, the timer/counter 1 is used to generate PWM signals. This signal emitted from OC1A pin of ATmega8535 microcontroller and fed to an ESC to drive two brushless DC motors. The width of the PWM pulse was defined by the value of OCR1A. The maximum value of this register will set the motor at low voltage cut-off limits. This value was defined by OCR1_HIGH. And the minimum value of this register will set the motor run at highest speed. This value was defined by OCR1_LOW.
To speed up motor, you can use a command or make port C pin 2 high; and to slow down motor, you can use a command or make port C pin 3 high.

The development of this application to specific purpose application is become new really enabled and has been done.

18 comments:

  1. Is It Correct That We Can Change The direction of BLDC motor by exchanging 2 wires betwen ESC and BLDC ?
    Isn,t it harmful anyway?

    ReplyDelete
  2. Yup...
    You can try it,but make sure that you turn off the ESC or motor at cut off conditions while exchanging them...

    ReplyDelete
  3. Do you have to continuously send a PWM to the ESC
    to keep the motor rotating or you can just send a pulse once and the ESC will keep the motor rotating at the relevant speed until u send a different pulse?

    ReplyDelete
  4. To maintain the motor speed, we must provide PWM pulses continuously. Giving a brief PWM pulses to the motor usually will not cause the motor to move. For this reason, we usually use the PWM generated from the timer, thus not burdening the microcontroller.

    ReplyDelete
  5. can i control mac8 h30a esc with atmega?

    ReplyDelete
  6. hello can you give me the program in C if it possible I need to controll the ESC with atmega16

    ReplyDelete
  7. ada contoh program dalam bahasa c pak? mohon bantu

    ReplyDelete
  8. Is it possible to reverse the direction of the brush less motor just using something at the MCU level (where the PWM for ESC is being generated) and not by actually reversing any two of the three connections form ESC to motor.

    ReplyDelete
  9. High freq PWM Affect the ESC???????

    ReplyDelete
  10. I want to run a BLDC using my atmega8. I have successfully generated PWM with period of 20ms and duty cycle varying from 1 to 2ms. But my motor is not responding. It only generates beep as if signal is not fed at all.
    What can I do?

    ReplyDelete
  11. can i use the 555 timer to generate pwm pulse. but the motor is not responding only generating beep sound so what will be the possible problem?????
    and second thing if we using pure dc as a ESC input with 100% duty cycle beep sound is eliminated but 123 sound generates till motor not responding???
    please give me any solution !!!!!

    ReplyDelete
  12. Very nice blog...
    Great information provided. We also provide AVR Microcontroller Training in Noida. I appreciate your work.

    ReplyDelete
  13. Thank you for sharing such great information very useful to us.
    Microcontroller Training in Delhi

    ReplyDelete