AVR172 : Atmel BLDC control on ATAVRMC310 with ATmega32M1 Documentation
Use of this program is subject to Atmel's End User License Agreement.
Please read file LICENSE.TXT for copyright notice.
This application drives a BLDC motor with trapezoidal waveforms
The motor runs in the sensor less mode
It runs on an ATAVRMC310 board with an ATmega32M1 part
The main source files are :
All parameters are given for the motor included in the kit with no load.
They must be ajusted according to the application (motor, load ...)
The ramp-up sequence must be adjusted to the motor and load
- Timer 0 is used for speed measurement and main tick generation
- Timer 1 is used by sensor less to manage commutation delay
- PSC is used to generate PWM
- ADC is used for current and potentiometer measurement
- At power on, the motor starts running
- The reference speed is ajusted with the potentiometer connected to the ATmega32M1 Isrc Input
- One can control the motor through Uart Interface :
- Connect the MC310 RS232 DB9 to the PC
- Set J12 jumper on TxD
- Set J13 jumper on RxD
- Connect the MC310 USB connector to the PC
- Set J12 jumper on TxDUSB
- Set J13 jumper on RxDUSB
- ATAVRMC310 (ATmega32M1 clock is 16MHz from PLL)
- ATAVRMC300 (Power Board)
- Set the ATAVRMC300 jumpers as described in the AVR194 App Note
- Set the ATAVRMC310 jumpers as described in the AVR194 App Note
- Speed : 38400 bauds
- Bits : 8
- Stop : 1
- Handshake : None
- Parity : None
After reset the ATAVRMC310 board prints the welcome message and a prompt
The user commands are :
- ru : run / start the motor
- st : stop / stop the motor
- help : help / return the list of commands
- fw : forward
- bw : backward
- ss v : set speed (v is the value)
- gi : get identification / return the board id, the soft id and the soft rev
- g0 : get status 0 : return the status byte, the speed and the current
- g1 : get status 1 : return the rotation counter
Note : All values are in hexadecimal form
These commands are compatible with ATMEL Motor Control Center
This firmware sets an overcurrent protection. The motor current is measured thanks to a shunt resistor located on the MC300 board. The amplifier 1 amplifies the shunt voltage. The output of the amplifier 1 is used as ADC input to get the motor current. The output of the amplifier 1 is also used as comparator 1 positive input. The negative output of the comparator 1 is connected to the DAC output which provides a treshold voltage for the overcurrent detection. The output of the comparator 1 is used as PSC fault input. When an overcurrent occurs, the PSC is stopped.