For an introduction to BLDC motors, please look at my sensored motor driver post, here: http://davidegironi.blogspot.it/2013/09/a-simple-brushless-sensored-motor.html
For this project, I've implemented a simple brushless sensoreless motor driver for AVR Atmega. The code i propose it's not perfect, and can be improved, but for the needs i had it works.
The motor can be controlled in speed and direction (clockwise and anti-clockwise).
This project use open loop startup and bemf zero crossing detection method with ADC.
Speed change can be done only when motor is not running, ADC is used during spinning phase in zc detection so it can not be used during the motor spinning, but digital speed changing can be implemented.
ZC threshold current should be defined by user depending on the motor type.
User has to setup the port used to read the the bemf current. Also the timer interrupt and prescaler should be setup for different running frequency.
The running step for the motor are defined as default, anyway user can change it to fit any motor.
A sample main routine is provided to help you understand how the library works.
The same test board of sensored library post is used, reported here the schamatics, for further info look at the sensored library post.
Setup parameters are contained in bldcsensorless.h
This library was developed on Eclipse, built with avr-gcc on Atmega8 @ 8MHz.
- avr_lib_bldcsensorless_01b.zip fix to the schematics, the previous release contains some wiring that differs from the code setup
- read risk disclaimer
- excuse my bad english