SlideShare a Scribd company logo
AVR496: Brushless DC Motor Control using
                      ATtiny861

                                                                                         8-bit
Features
•   BLDC Motor Control in Sensor Mode
                                                                                         Microcontroller
•   Timer 1 Waveform Generator Use
•   Hardware Implementation
•   Code Example                                                                         Application Note
References
[1] ATtiny261/461/861 data sheet
[2] AVR449: Sinusoidal driving of 3-phase permanent magnet motor using
ATtiny261/461/861
[3] AVR430: MC300 Hardware User Guide
[4] AVR469: MC301 Hardware User Guide


1. Introduction
This application note describes how to implement a brushless DC motor control in
sensor mode using the ATtiny861 AVR microcontroller.
The high performance AVR® core a long with the Timer 1 of the ATtiny861 allows to
design high speed brushless DC motor applications.
In this document, we will give a short description of brushless DC motor theory of
operations, we will detail how to control a brushless DC motor in sensor mode and we
will also give a short description of the ATAVRMC301 and ATAVRMC300 boards
used in this application note.
This application note deals only with BLDC motor control application using Hall effect
position sensors to control commutation sequence.


2. Theory of Operations
Brushless DC motors are used in a growing number of motor applications as they
have many advantages:
They have no brushes so they require little or no maintenance.
They generate less acoustic and electrical noise than universal brushed DC motors.
They can be used in hazardous operation environments (with flammable products).
They have a good weight/size to power ratio...                                                    7827A–AVR–04/09
Such motors have a little rotor inertia. The coils are attached to the stator. The commutation is
                controlled by electronics. Commutation times are provided either by position sensors or by coils
                Back Electromotive Force measurements.
                In sensor mode, Brushless DC motors usually consist of three main parts: a Stator, a Rotor and
                Hall Sensors.

2.1   Stator
                A basic three phases BLDC motor Stator has three coils. In many motors, the number of coils is
                replicated to have a smaller torque ripple.
                Figure 2-1 shows the electrical schematic of the stator. It consists of three coils each including
                three elements in series, an inductance, a resistance and one back electromotive force.

                Figure 2-1.    Stator Electrical Configuration (Three phases, three coils)
                                                               U

                                                                        L,R

                                                                        Bemf U


                                                  Bemf W                    Bemf V



                                                       L,R                    L,R
                                          W                                                    V

2.2   Rotor
                The rotor in a BLDC motor consists of an even number of permanent magnets. The number of
                magnetic poles in the rotor also affects the step size and torque ripple of the motor. More poles
                give smaller steps and less torque ripple. The permanent magnets go from 1 to 5 pairs of poles.
                In certain cases it can go up to 8 pairs of poles.(Figure 2-2).

                Figure 2-2.    Three phase, three coil BLDC motor stator and rotor

                coil U                                         coil U
                                                      Stator                                           Stator

                                              Rotor                                            Rotor
                 coil W                                        coil W                  N   S
                                      N   S
                                                                                       S   N




                  coil V                                           coil V


                                  1 pair of poles                                   2 pairs of poles




2      AVR496
                                                                                                          7827A–AVR–04/09
AVR496



2.3   Hall Sensor

                    Hall Sensors are placed every 120°. With these sensors, 6 different commutations are possible.
                    Phase commutation depends on Hall Sensor values.
                    Power supply to the coils changes when Hall Sensor values change. With right synchronized
                    commutations, the torque remains nearly constant and high.

                                   Hall Sensor signals for CW rotation

                                  H1


                                  H2


                                  H3


                                            +V
                              Coil U
                                                               -V

                                       +V                            +V
                              Coil V
                                                  -V

                                                        +V
                              Coil W
                                       -V




2.4   Phase Commutations
                    To simplify the explanation of how to operate a three phases BLDC motor, a typical BLDC motor
                    with only three coils is considered. As previously shown, phases commutation depends on the
                    Hall Sensor values. When motor coils are correctly powered, a magnetic field is created and the
                    rotor moves. The most elementary commutation driving method used for BLDC motors is an on-
                    off scheme: a coil is either conducting or not conducting. Only two windings are powered at the
                    same time and the third winding is floating. Connecting the coils to the power and neutral bus
                    induces the current flow. This is referred to as trapezoidal commutation or block commutation.
                    To command brushless DC motors, a power stage made of 3 half bridges is used. Figure 2-4
                    below shows a 3 half bridge schematic.




                                                                                                                 3
Figure 2-4.
                                                    +V



                                                    UH       Q1 VH          Q3 WH         Q5


                                                                                                    U
                                   VDC
                                                                                                    V
                                                                                                    W

                                                    UL       Q2 VL          Q4 WL         Q6



                                                    0




                   Table 2-1.
                    Hall Sensors Value (H3 H2 H1)               Phase                        Switches
                    101                                         U-V                          Q1 ; Q4
                    001                                         U-W                          Q1 ; Q6
                    011                                         V-W                          Q3 ; Q6
                    010                                         V-U                          Q3 ; Q2
                    110                                         W-U                          Q5 ; Q2
                    100                                         W-V                          Q5 ; Q4




                                        ElectricalFieldRotation = MecanicalRotation × P ( poles )



2.5   Speed and Torque Control

                   current flow through the coils, the speed and torque of the motor can be adjusted. The most
                   common way to control the current flow is to control the average current flow through the coils.
                   The duty cycle of the PWM(Pulse Width Modulation) outputs are used to adjust the average volt-
                   age and thereby the average current, inducing the speed. To give an idea, the PWM frequency
                   is chosen is the range from 10kHz to 200kHz according to the application (maximum of transis-
                   tor switching frequency, electrical parameters of motors, commutation losses, audible
                   frequency...)



4      AVR496
AVR496


Figure 2-5.
                   Hall_H3H2H1
                      011
coil U                                    coil U
                                 010
             001


coil W                                    coil W




             101
                                   110
  coil V                                    coil V
                     100
                   Step1                                     Step2

  coil V                                    coil U




  coil W                                    coil W




    coil V                                    coil V


                    Step3                                     Step4
 coil U                                    coil U




 coil W                                    coil W




   coil V                                    coil V


                    Step5                                    Step6




voltage by the switch Q1 and Phase V is connected by the switch Q4, Phase W is unpowered as
the others swiches (Q2,Q3,Q5 and Q6) are opened. Two flux vectors are generated by phase U
(red arrow) and phase V (blue arrow). The sum of the two vectors give the stator flux vector
(green arrow). Then the rotor tries to follow the stator flux. As soon as the rotor reaches a given
position, the Hall Sensors gives a new logical state of this position (from “010” to “011”) and the
next voltage pattern is selected and applied to the BLDC motor. Phase V is unpowered and
Phase W is connected to the ground, resulting in a new stator flux vector ‘Step2’.
The switching sequence described in schematic Figure 2-3 and Table 1, shows six different sta-
tor flux vectors corresponding to the six commutation steps. The six steps provide one electrical
field rotation.




                                                                                                 5
3. ATtiny861 microcontroller

3.1   Generating PWM signals with dead-time with ATtiny261/461/861
                   The Timer/Counter1 (TC1) module of the ATtinyX61 family is very well suited for driving three-
                   phase motors. It can be run from a 64MHz PLL, and has a resolution of 10 bits. Six PWM out-
                   puts can be generated from this timer, grouped into three complementary output pairs with
                   configurable dead-time. The “PWM6” mode is perfect for block commutation of brushless DC
                   motors. For a maximum safety, a hardware fault protection unit can disable the PWM drivers
                   without any intervention from the CPU.
                   To control a triple half-bridge driver stage, the “Phase and frequency correct PWM mode” of TC1
                   is used. In this mode, three pair of complementary PWM outputs with hardware dead-time inser-
                   tion can be generated. This is exactly what is needed to generate three-phase sinusoidal drive
                   waveforms with a triple half-bridge driver stage and chosen in the PWM generation.
                   The operation of one of the three complementary output pairs can be seen in Figure 3 2. The
                   counter counts in an up-down counting mode. The OCR1x register specifies the current duty
                   cycle. An intermediate waveform, labeled as OCW1x in the figure, is generated by clearing the
                   output on a compare match when up-counting and setting the output on compare match when
                   down-counting. This intermediate waveform feeds to the dead time generator, which in turn gen-
                   erates two outputs from this waveform. The non-inverted output, OC1x, follows OCW1x, except
                   it will not go high until a specified dead-time period, DT1H, has elapsed after OCW1x goes high.
                   The inverted output,      OC1x , follows the inverted OCW1x signal, except it will not go high
                   until a specified dead-time period, DT1L, has elapsed after OCW1x goes low. The result is a pair
                   of complementary outputs with dead-time.
                   To control the duty cycle of one half-bridge, only one register, OCR1x needs to be changed. The
                   average voltage output of the half-bridge will be proportional to this signal.

                   Figure 3-1.     Generating PWM signals.
                                                                    PWM cycle
                                            OCR1x

                             TOP




                          TCNT1




                          OCW1x



                            OC1x
                                                             DT1L               DT1H


                            OC1x




6      AVR496
                                                                                                     7827A–AVR–04/09
AVR496

3.2   PWM base frequency




                  Timer/counter1 clock will be referred to as fCLK,T/C1 in the following.
                  The PWM frequency as a function of Timer/Counter1 clock frequency can be calculated from
                  Figure 3-2.

                  Figure 3-2.    PWM base frequency as a function of timer clock frequency.
                                                                  f CLK, T ⁄ ( C1 )
                                                          f PWM = ----------------------------
                                                                                             -
                                                                  2 ⋅ TOP – 2

                  The PWM frequency with a Timer/Counter1 clock frequency of 64 MHz and 10 bit resolution is
                  thus 31,28kHz.




4. Hardware Description




                  Figure 4-1.    ATAVRMC301 & ATAVRMC300 connection




                       ATAVRMC301                                     ATAVRMC300
                       Processor Board                                Power Board
                        (ATtiny861)                                       (bridge)


                  The power bridge (Q1 to Q6) is controlled through 6 signals UL, UH, VL, VH, WL, WH which are
                  modulated by the PWM signal to adjust the motor DC voltage.See “Speed and Torque Control”
                  on page 4.



                                                                                                            7
Figure 4-2.
                                                               +12V
                                    BLDC Application

               Potentiometer
                                                       UL
                                                       UH     POWER
                                                       VL     BRIDGE
                                                                             3      BLDC
                                                       VH     (Q1..Q6)
                                                                                    motor
                                                       WL
                                                       WH
                     TWI
                                                               shunt                Rotor
                                                                                    Position
                                                  shunt +                           Sensors
                                                  shunt -

                                                       H1
                                                       H2
                                                       H3




             Figure 4-3.

                               UL     PB0/OC1A*                          PA0/SDA       TWI/speed

                               UH     PB1/OC1A                           PA1/ADC1      Speed

                               VL     PB2/OC1B*                     PA2/ADC2/SCL       TWI

                                                                                       Hall_1
                               VH     PB3/OC1B                   PA3/AREF/PCINT3

                                      VCC                                  AGND

                                      GND                                  AVCC

                               WL     PB4/OC1D*              PA4/ADC3/ICP0/PCINT4      Hall_2

                               WH     PB5/OC1D               PA5/ADC4/AIN2/PCINT5      Hall_3

                      Fault/Speed     PB6/ADC9/INT0(fault)   PA6/ADC5/AIN0/PCINT6      Shunt +

                      Debug Wire      PB7/RESET/ADC10        PA7/ADC6/AIN1/PCINT7      Shunt -




8   AVR496
AVR496

5. Software Description

5.1   Preamble
                  And html documentation is delivered with the AVR496 software package. It can be
                  opened thanks to the readme.html file located in the source directory.


                     main.c
                     ushell_task.c
                     USI_TWI_Slave.c




5.2   BLDC Motor Control Implementation

                  Figure 5-1.
                                                                                                       Power
                                                        PWM             Switch
                                                        Generation      Commutation                    Bridge
                                                                                                                    BLDC
                                                                                              UH
                                                                                                                U   Motor
                                                                                      OC1A

                                                                                      OC1A*   UL
                                             Duty
                                             Cycle                                    OC1B    VH                V
                                                                                      OC1B*   VL
                                                                     Timer 1          OC1D    WH                W
                                                                                      OC1D*   WL
                                                                                                                    H1 H2 H3
                                                                         Commutate




                                      ADC5    Current Measurement
                                      ADC6




                          ADC

                                                 Speed
                                      ADC2
                                                 Reference                commTableForward         PCINT3
                                                                          commTableReverse

                                                                                                   PCINT4
                        Speed
                        Measurement
                                                                                                   PCINT5


                                                                          Pin Change Int
                          timer 0




                                                                                                                               9
5.3   Function description
                   void main(void):
                   void Commutate(void):


                   void SpeedMeasurement(void):
                   void PLLInit(void):
                   void PWMInit(void):
                   void HallSensorInit(void):


                   void ADCInit(void):
                   void PortsInit(void):
                   void TWInit(void):


                   void MotorSetDutyCycle(uint16_t duty):
                   __interrupt void HallChangeISR():


                   __interrupt void ADCISR():
                   void Timer0Init(void):
                   __interrupt void ovfl_timer0(void):



      CPU & Memory usage
                   All measurements have been realized with Fosc = 8MHz. They also depend on the motor type
                   (numbers of pair of poles). With a motor of 4 pairs of poles, Hall Sensor frequency is four times
                   as high as the motor frequency.
                   All results in Figure 5-1 are obtained with a three-phase BLDC motor with four pairs of poles and
                   a maximum speed of 6600 rpm. (Motor provided with the ATAVRMC300 kit).


                                   Microcontroller utilization rate
                       Function          Parameters              Activation Time   Activation Period    Ratio CPU %
                       HallChangeISR()   Speed = 6600 rpm        10µS              380µS                2.7
                       ADCISR()          Speed = 6600 rpm        4µS               25µS                 16

                   With the same conditions, the microcontroller memory usage is:
                   •     1332 bytes of CODE memory (Flash occupation = 17% ).
                         Including communication protocole through TWI
                   •     153 bytes of DATA memory (SRAM occupation = 30%).
                         Including stack and communication protocole through TWI




10     AVR496
                                                                                                       7827A–AVR–04/09
ATAVRMC300 & ATAVRMC301 Configuration and Use



                  Table 6-1.
                   Jumper                                Position                       Comment
                   J1(VHa)                               Pin1 & 2 shorted               VHa = +5V
                   J2(VCC)                               Open                           Vcc = +5V




                               ATAVRMC301 jumper settings


                                       Speed => Potentiometer
                   J8                                               Select speed reference
                                       SCL => TWI
                   J9                  All mounted                  Connect PBO/PB1/PB2 to UL/UH/VL
                   J10                 Not mounted
                   J11                 SH+                          Connect Shunt+ to PA6
                   J12                 SH-                          Connect Shunt- to PA7
                   J13                 Not mounted
                   J15                 H1                           Connect H1 to PA1
                   J16                 H2                           Connect H2 to PA4
                   J17                 H3                           Connect H3 to PA5
                   J19                 See Hardware User Guide      Select UVCC for USB stage




7. Conclusion




8. Appendix




7827A–AVR–04/09
42BLS01-001 Motor Characteristics




                                    7827A–AVR–04/09
Headquarters                                  International

Atmel Corporation                             Atmel Asia                              Atmel Europe                            Atmel Japan
2325 Orchard Parkway                          Unit 1-5 & 16, 19/F                     Le Krebs                                9F, Tonetsu Shinkawa Bldg.
San Jose, CA 95131                            BEA Tower, Millennium City 5            8, Rue Jean-Pierre Timbaud              1-24-8 Shinkawa
USA                                           418 Kwun Tong Road                      BP 309                                  Chuo-ku, Tokyo 104-0033
Tel: 1(408) 441-0311                          Kwun Tong, Kowloon                      78054 Saint-Quentin-en-                 Japan
Fax: 1(408) 487-2600                          Hong Kong                               Yvelines Cedex                          Tel: (81) 3-3523-3551
                                              Tel: (852) 2245-6100                    France                                  Fax: (81) 3-3523-7581
                                              Fax: (852) 2722-1369                    Tel: (33) 1-30-60-70-00
                                                                                      Fax: (33) 1-30-60-71-11




                                              Product Contact

                                              Web Site                                Technical Support                       Sales Contact
                                                                                      avr@atmel.com                           www.atmel.com/contacts




                                              Literature Requests




Disclaimer: The information in this document is provided in connection with Atmel products. No license, express or implied, by estoppel or otherwise, to any
intellectual property right is granted by this document or in connection with the sale of Atmel products. EXCEPT AS SET FORTH IN ATMEL’S TERMS AND CONDI-
TIONS OF SALE LOCATED ON ATMEL’S WEB SITE, ATMEL ASSUMES NO LIABILITY WHATSOEVER AND DISCLAIMS ANY EXPRESS, IMPLIED OR STATUTORY
WARRANTY RELATING TO ITS PRODUCTS INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE, OR NON-INFRINGEMENT. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, CONSEQUENTIAL, PUNITIVE, SPECIAL OR INCIDEN-
TAL DAMAGES (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF PROFITS, BUSINESS INTERRUPTION, OR LOSS OF INFORMATION) ARISING OUT OF
THE USE OR INABILITY TO USE THIS DOCUMENT, EVEN IF ATMEL HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. Atmel makes no
representations or warranties with respect to the accuracy or completeness of the contents of this document and reserves the right to make changes to specifications
and product descriptions at any time without notice. Atmel does not make any commitment to update the information contained herein. Unless specifically provided
otherwise, Atmel products are not suitable for, and shall not be used in, automotive applications. Atmel’s products are not intended, authorized, or warranted for use
as components in applications intended to support or sustain life.


© 2009 Atmel Corporation. All rights reserved. Atmel®, Atmel logo and combinations thereof, AVR® and others are registered trademarks or
trademarks of Atmel Corporation or its subsidiaries. Other terms and product names may be trademarks of others.




                                                                                                                                                   7827A–AVR–04/09

More Related Content

What's hot

BLDC HUB MOTOR PPT
BLDC HUB MOTOR PPTBLDC HUB MOTOR PPT
BLDC HUB MOTOR PPT
BikasNishad
 
Electromechnical Energy Conversion ppt
Electromechnical Energy Conversion pptElectromechnical Energy Conversion ppt
Electromechnical Energy Conversion pptAnirudhan Guru
 
Chapter 1 dc machines new
Chapter 1 dc machines newChapter 1 dc machines new
Chapter 1 dc machines newmkazree
 
seminar on brush less dc motors
seminar on brush less dc motors seminar on brush less dc motors
seminar on brush less dc motors
vinayvickky
 
Multi-phase Brush-less DC motor And Applications
Multi-phase Brush-less DC motor And Applications Multi-phase Brush-less DC motor And Applications
Multi-phase Brush-less DC motor And Applications
Zain Ul Abideen
 
Brushless dc (bldc) motors
Brushless dc (bldc) motorsBrushless dc (bldc) motors
Brushless dc (bldc) motors
amolsuryawanshi23
 
Unit5:- D.C Machines
Unit5:- D.C MachinesUnit5:- D.C Machines
Unit5:- D.C Machines
Abhinay Potlabathini
 
PMBLDC motor
PMBLDC motorPMBLDC motor
PMBLDC motor
karthi1017
 
Unit 4 pmbldc1
Unit 4 pmbldc1Unit 4 pmbldc1
Unit 4 pmbldc1
Er.Meraj Akhtar
 
Dcmachines 2016
Dcmachines 2016Dcmachines 2016
Dcmachines 2016
madhu1729
 
Drives lec 11_12_Braking of DC Motors
Drives lec 11_12_Braking of DC MotorsDrives lec 11_12_Braking of DC Motors
Drives lec 11_12_Braking of DC Motors
Mohammad Umar Rehman
 
PMDC motor
PMDC motorPMDC motor
PMDC motor
Girish Illanad
 
D.c. machine[1]
D.c. machine[1]D.c. machine[1]
D.c. machine[1]
Nisarg Amin
 
PERMANENT MAGNET BRUSHLESS DC MOTOR
PERMANENT MAGNET BRUSHLESS DC MOTORPERMANENT MAGNET BRUSHLESS DC MOTOR
PERMANENT MAGNET BRUSHLESS DC MOTOR
Archana Balachandran
 
Lecture dc machines
Lecture dc machinesLecture dc machines
Lecture dc machinessudeep kumar
 
Electrical Machines - I
Electrical Machines - IElectrical Machines - I
Electrical Machines - I
karthik prabhu
 
Electrical machines lecture notes
Electrical machines lecture notesElectrical machines lecture notes
Electrical machines lecture notes
IYAKAREMYE Jean De Dieu
 
Dc motors
Dc motorsDc motors
Dc motors
Ameya Nijasure
 

What's hot (20)

BLDC HUB MOTOR PPT
BLDC HUB MOTOR PPTBLDC HUB MOTOR PPT
BLDC HUB MOTOR PPT
 
Electromechnical Energy Conversion ppt
Electromechnical Energy Conversion pptElectromechnical Energy Conversion ppt
Electromechnical Energy Conversion ppt
 
Chapter 1 dc machines new
Chapter 1 dc machines newChapter 1 dc machines new
Chapter 1 dc machines new
 
PMBLDC motors
PMBLDC motorsPMBLDC motors
PMBLDC motors
 
seminar on brush less dc motors
seminar on brush less dc motors seminar on brush less dc motors
seminar on brush less dc motors
 
Multi-phase Brush-less DC motor And Applications
Multi-phase Brush-less DC motor And Applications Multi-phase Brush-less DC motor And Applications
Multi-phase Brush-less DC motor And Applications
 
Brushless dc (bldc) motors
Brushless dc (bldc) motorsBrushless dc (bldc) motors
Brushless dc (bldc) motors
 
Unit5:- D.C Machines
Unit5:- D.C MachinesUnit5:- D.C Machines
Unit5:- D.C Machines
 
PMBLDC motor
PMBLDC motorPMBLDC motor
PMBLDC motor
 
Unit 4 pmbldc1
Unit 4 pmbldc1Unit 4 pmbldc1
Unit 4 pmbldc1
 
Dcmachines 2016
Dcmachines 2016Dcmachines 2016
Dcmachines 2016
 
Drives lec 11_12_Braking of DC Motors
Drives lec 11_12_Braking of DC MotorsDrives lec 11_12_Braking of DC Motors
Drives lec 11_12_Braking of DC Motors
 
PMDC motor
PMDC motorPMDC motor
PMDC motor
 
Dc machiness
Dc machinessDc machiness
Dc machiness
 
D.c. machine[1]
D.c. machine[1]D.c. machine[1]
D.c. machine[1]
 
PERMANENT MAGNET BRUSHLESS DC MOTOR
PERMANENT MAGNET BRUSHLESS DC MOTORPERMANENT MAGNET BRUSHLESS DC MOTOR
PERMANENT MAGNET BRUSHLESS DC MOTOR
 
Lecture dc machines
Lecture dc machinesLecture dc machines
Lecture dc machines
 
Electrical Machines - I
Electrical Machines - IElectrical Machines - I
Electrical Machines - I
 
Electrical machines lecture notes
Electrical machines lecture notesElectrical machines lecture notes
Electrical machines lecture notes
 
Dc motors
Dc motorsDc motors
Dc motors
 

Viewers also liked

2. brushless dc motors
2. brushless dc motors2. brushless dc motors
2. brushless dc motors
benson215
 
Catalog DOMEL - Brushless Motors and Blowers
Catalog DOMEL - Brushless Motors and BlowersCatalog DOMEL - Brushless Motors and Blowers
Catalog DOMEL - Brushless Motors and BlowersPeter Korosec
 
Chapter 7 stepper motor
Chapter 7 stepper motorChapter 7 stepper motor
Chapter 7 stepper motorHattori Sidek
 
A seminar on brushless dc motors
A seminar on brushless dc motorsA seminar on brushless dc motors
A seminar on brushless dc motors
vishal Barvaliya
 
Various Electric Motors and comparison
Various Electric Motors and comparisonVarious Electric Motors and comparison
Various Electric Motors and comparison
Don't Search
 
Permanent magnet dc motors
Permanent magnet dc motorsPermanent magnet dc motors
Permanent magnet dc motors
berdici
 

Viewers also liked (6)

2. brushless dc motors
2. brushless dc motors2. brushless dc motors
2. brushless dc motors
 
Catalog DOMEL - Brushless Motors and Blowers
Catalog DOMEL - Brushless Motors and BlowersCatalog DOMEL - Brushless Motors and Blowers
Catalog DOMEL - Brushless Motors and Blowers
 
Chapter 7 stepper motor
Chapter 7 stepper motorChapter 7 stepper motor
Chapter 7 stepper motor
 
A seminar on brushless dc motors
A seminar on brushless dc motorsA seminar on brushless dc motors
A seminar on brushless dc motors
 
Various Electric Motors and comparison
Various Electric Motors and comparisonVarious Electric Motors and comparison
Various Electric Motors and comparison
 
Permanent magnet dc motors
Permanent magnet dc motorsPermanent magnet dc motors
Permanent magnet dc motors
 

Similar to Brushless dc motor control using

potentiometer II.pptx
potentiometer II.pptxpotentiometer II.pptx
potentiometer II.pptx
tadi1padma
 
Transformer_theory.pptx
Transformer_theory.pptxTransformer_theory.pptx
Transformer_theory.pptx
Satish Pydimarla
 
Alternator
AlternatorAlternator
Alternator
Parth Patel
 
SG lecture 1&2.pdf
SG lecture 1&2.pdfSG lecture 1&2.pdf
SG lecture 1&2.pdf
RaselMahmud64
 
Elektrik
ElektrikElektrik
Elektrik
fadhielahya
 
Synchmachi.ppt
Synchmachi.pptSynchmachi.ppt
Synchmachi.ppt
AskUdaipur
 
Stabilised Power Supplies
Stabilised Power SuppliesStabilised Power Supplies
Cd35455460
Cd35455460Cd35455460
Cd35455460
IJERA Editor
 
Synchmachine
SynchmachineSynchmachine
Synchmachine
Engineer Noman Shahid
 
Inverter
InverterInverter
Lecture 28 360 chapter 9_ power electronics inverters
Lecture 28 360 chapter 9_  power electronics invertersLecture 28 360 chapter 9_  power electronics inverters
Lecture 28 360 chapter 9_ power electronics invertersValentino Selayan
 
Directional over current relay
Directional over current relayDirectional over current relay
Directional over current relay
CS V
 
Handouts dc machines
Handouts dc machinesHandouts dc machines
Handouts dc machines
SamMendoza17
 
Handouts dc machines
Handouts dc machinesHandouts dc machines
Handouts dc machines
SamMendoza17
 
Synchmachine-1.ppt
Synchmachine-1.pptSynchmachine-1.ppt
Synchmachine-1.ppt
BOOPATHIMADHAIYAN
 
Synchmachine-1.ppt
Synchmachine-1.pptSynchmachine-1.ppt
Synchmachine-1.ppt
deepaMS4
 
Control And Programingof Synchronous Generator
Control And Programingof Synchronous GeneratorControl And Programingof Synchronous Generator
Control And Programingof Synchronous Generator
freelay
 
ee2259-lab-manual
 ee2259-lab-manual ee2259-lab-manual
ee2259-lab-manualsurya721327
 
146686534 ee-410-lab1-fall10-1305411901
146686534 ee-410-lab1-fall10-1305411901146686534 ee-410-lab1-fall10-1305411901
146686534 ee-410-lab1-fall10-1305411901
homeworkping3
 

Similar to Brushless dc motor control using (20)

potentiometer II.pptx
potentiometer II.pptxpotentiometer II.pptx
potentiometer II.pptx
 
Transformer_theory.pptx
Transformer_theory.pptxTransformer_theory.pptx
Transformer_theory.pptx
 
Alternator
AlternatorAlternator
Alternator
 
SG lecture 1&2.pdf
SG lecture 1&2.pdfSG lecture 1&2.pdf
SG lecture 1&2.pdf
 
Elektrik
ElektrikElektrik
Elektrik
 
Synchmachi.ppt
Synchmachi.pptSynchmachi.ppt
Synchmachi.ppt
 
Stabilised Power Supplies
Stabilised Power SuppliesStabilised Power Supplies
Stabilised Power Supplies
 
Cd35455460
Cd35455460Cd35455460
Cd35455460
 
Synchmachine
SynchmachineSynchmachine
Synchmachine
 
Inverter
InverterInverter
Inverter
 
Lecture 28 360 chapter 9_ power electronics inverters
Lecture 28 360 chapter 9_  power electronics invertersLecture 28 360 chapter 9_  power electronics inverters
Lecture 28 360 chapter 9_ power electronics inverters
 
Directional over current relay
Directional over current relayDirectional over current relay
Directional over current relay
 
Handouts dc machines
Handouts dc machinesHandouts dc machines
Handouts dc machines
 
Handouts dc machines
Handouts dc machinesHandouts dc machines
Handouts dc machines
 
Synchmachine-1.ppt
Synchmachine-1.pptSynchmachine-1.ppt
Synchmachine-1.ppt
 
Synchmachine-1.ppt
Synchmachine-1.pptSynchmachine-1.ppt
Synchmachine-1.ppt
 
Control And Programingof Synchronous Generator
Control And Programingof Synchronous GeneratorControl And Programingof Synchronous Generator
Control And Programingof Synchronous Generator
 
ee2259-lab-manual
 ee2259-lab-manual ee2259-lab-manual
ee2259-lab-manual
 
Ee2259 lab-manual
Ee2259 lab-manualEe2259 lab-manual
Ee2259 lab-manual
 
146686534 ee-410-lab1-fall10-1305411901
146686534 ee-410-lab1-fall10-1305411901146686534 ee-410-lab1-fall10-1305411901
146686534 ee-410-lab1-fall10-1305411901
 

Recently uploaded

To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
Elena Simperl
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
g2nightmarescribd
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 

Recently uploaded (20)

To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 

Brushless dc motor control using

  • 1. AVR496: Brushless DC Motor Control using ATtiny861 8-bit Features • BLDC Motor Control in Sensor Mode Microcontroller • Timer 1 Waveform Generator Use • Hardware Implementation • Code Example Application Note References [1] ATtiny261/461/861 data sheet [2] AVR449: Sinusoidal driving of 3-phase permanent magnet motor using ATtiny261/461/861 [3] AVR430: MC300 Hardware User Guide [4] AVR469: MC301 Hardware User Guide 1. Introduction This application note describes how to implement a brushless DC motor control in sensor mode using the ATtiny861 AVR microcontroller. The high performance AVR® core a long with the Timer 1 of the ATtiny861 allows to design high speed brushless DC motor applications. In this document, we will give a short description of brushless DC motor theory of operations, we will detail how to control a brushless DC motor in sensor mode and we will also give a short description of the ATAVRMC301 and ATAVRMC300 boards used in this application note. This application note deals only with BLDC motor control application using Hall effect position sensors to control commutation sequence. 2. Theory of Operations Brushless DC motors are used in a growing number of motor applications as they have many advantages: They have no brushes so they require little or no maintenance. They generate less acoustic and electrical noise than universal brushed DC motors. They can be used in hazardous operation environments (with flammable products). They have a good weight/size to power ratio... 7827A–AVR–04/09
  • 2. Such motors have a little rotor inertia. The coils are attached to the stator. The commutation is controlled by electronics. Commutation times are provided either by position sensors or by coils Back Electromotive Force measurements. In sensor mode, Brushless DC motors usually consist of three main parts: a Stator, a Rotor and Hall Sensors. 2.1 Stator A basic three phases BLDC motor Stator has three coils. In many motors, the number of coils is replicated to have a smaller torque ripple. Figure 2-1 shows the electrical schematic of the stator. It consists of three coils each including three elements in series, an inductance, a resistance and one back electromotive force. Figure 2-1. Stator Electrical Configuration (Three phases, three coils) U L,R Bemf U Bemf W Bemf V L,R L,R W V 2.2 Rotor The rotor in a BLDC motor consists of an even number of permanent magnets. The number of magnetic poles in the rotor also affects the step size and torque ripple of the motor. More poles give smaller steps and less torque ripple. The permanent magnets go from 1 to 5 pairs of poles. In certain cases it can go up to 8 pairs of poles.(Figure 2-2). Figure 2-2. Three phase, three coil BLDC motor stator and rotor coil U coil U Stator Stator Rotor Rotor coil W coil W N S N S S N coil V coil V 1 pair of poles 2 pairs of poles 2 AVR496 7827A–AVR–04/09
  • 3. AVR496 2.3 Hall Sensor Hall Sensors are placed every 120°. With these sensors, 6 different commutations are possible. Phase commutation depends on Hall Sensor values. Power supply to the coils changes when Hall Sensor values change. With right synchronized commutations, the torque remains nearly constant and high. Hall Sensor signals for CW rotation H1 H2 H3 +V Coil U -V +V +V Coil V -V +V Coil W -V 2.4 Phase Commutations To simplify the explanation of how to operate a three phases BLDC motor, a typical BLDC motor with only three coils is considered. As previously shown, phases commutation depends on the Hall Sensor values. When motor coils are correctly powered, a magnetic field is created and the rotor moves. The most elementary commutation driving method used for BLDC motors is an on- off scheme: a coil is either conducting or not conducting. Only two windings are powered at the same time and the third winding is floating. Connecting the coils to the power and neutral bus induces the current flow. This is referred to as trapezoidal commutation or block commutation. To command brushless DC motors, a power stage made of 3 half bridges is used. Figure 2-4 below shows a 3 half bridge schematic. 3
  • 4. Figure 2-4. +V UH Q1 VH Q3 WH Q5 U VDC V W UL Q2 VL Q4 WL Q6 0 Table 2-1. Hall Sensors Value (H3 H2 H1) Phase Switches 101 U-V Q1 ; Q4 001 U-W Q1 ; Q6 011 V-W Q3 ; Q6 010 V-U Q3 ; Q2 110 W-U Q5 ; Q2 100 W-V Q5 ; Q4 ElectricalFieldRotation = MecanicalRotation × P ( poles ) 2.5 Speed and Torque Control current flow through the coils, the speed and torque of the motor can be adjusted. The most common way to control the current flow is to control the average current flow through the coils. The duty cycle of the PWM(Pulse Width Modulation) outputs are used to adjust the average volt- age and thereby the average current, inducing the speed. To give an idea, the PWM frequency is chosen is the range from 10kHz to 200kHz according to the application (maximum of transis- tor switching frequency, electrical parameters of motors, commutation losses, audible frequency...) 4 AVR496
  • 5. AVR496 Figure 2-5. Hall_H3H2H1 011 coil U coil U 010 001 coil W coil W 101 110 coil V coil V 100 Step1 Step2 coil V coil U coil W coil W coil V coil V Step3 Step4 coil U coil U coil W coil W coil V coil V Step5 Step6 voltage by the switch Q1 and Phase V is connected by the switch Q4, Phase W is unpowered as the others swiches (Q2,Q3,Q5 and Q6) are opened. Two flux vectors are generated by phase U (red arrow) and phase V (blue arrow). The sum of the two vectors give the stator flux vector (green arrow). Then the rotor tries to follow the stator flux. As soon as the rotor reaches a given position, the Hall Sensors gives a new logical state of this position (from “010” to “011”) and the next voltage pattern is selected and applied to the BLDC motor. Phase V is unpowered and Phase W is connected to the ground, resulting in a new stator flux vector ‘Step2’. The switching sequence described in schematic Figure 2-3 and Table 1, shows six different sta- tor flux vectors corresponding to the six commutation steps. The six steps provide one electrical field rotation. 5
  • 6. 3. ATtiny861 microcontroller 3.1 Generating PWM signals with dead-time with ATtiny261/461/861 The Timer/Counter1 (TC1) module of the ATtinyX61 family is very well suited for driving three- phase motors. It can be run from a 64MHz PLL, and has a resolution of 10 bits. Six PWM out- puts can be generated from this timer, grouped into three complementary output pairs with configurable dead-time. The “PWM6” mode is perfect for block commutation of brushless DC motors. For a maximum safety, a hardware fault protection unit can disable the PWM drivers without any intervention from the CPU. To control a triple half-bridge driver stage, the “Phase and frequency correct PWM mode” of TC1 is used. In this mode, three pair of complementary PWM outputs with hardware dead-time inser- tion can be generated. This is exactly what is needed to generate three-phase sinusoidal drive waveforms with a triple half-bridge driver stage and chosen in the PWM generation. The operation of one of the three complementary output pairs can be seen in Figure 3 2. The counter counts in an up-down counting mode. The OCR1x register specifies the current duty cycle. An intermediate waveform, labeled as OCW1x in the figure, is generated by clearing the output on a compare match when up-counting and setting the output on compare match when down-counting. This intermediate waveform feeds to the dead time generator, which in turn gen- erates two outputs from this waveform. The non-inverted output, OC1x, follows OCW1x, except it will not go high until a specified dead-time period, DT1H, has elapsed after OCW1x goes high. The inverted output, OC1x , follows the inverted OCW1x signal, except it will not go high until a specified dead-time period, DT1L, has elapsed after OCW1x goes low. The result is a pair of complementary outputs with dead-time. To control the duty cycle of one half-bridge, only one register, OCR1x needs to be changed. The average voltage output of the half-bridge will be proportional to this signal. Figure 3-1. Generating PWM signals. PWM cycle OCR1x TOP TCNT1 OCW1x OC1x DT1L DT1H OC1x 6 AVR496 7827A–AVR–04/09
  • 7. AVR496 3.2 PWM base frequency Timer/counter1 clock will be referred to as fCLK,T/C1 in the following. The PWM frequency as a function of Timer/Counter1 clock frequency can be calculated from Figure 3-2. Figure 3-2. PWM base frequency as a function of timer clock frequency. f CLK, T ⁄ ( C1 ) f PWM = ---------------------------- - 2 ⋅ TOP – 2 The PWM frequency with a Timer/Counter1 clock frequency of 64 MHz and 10 bit resolution is thus 31,28kHz. 4. Hardware Description Figure 4-1. ATAVRMC301 & ATAVRMC300 connection ATAVRMC301 ATAVRMC300 Processor Board Power Board (ATtiny861) (bridge) The power bridge (Q1 to Q6) is controlled through 6 signals UL, UH, VL, VH, WL, WH which are modulated by the PWM signal to adjust the motor DC voltage.See “Speed and Torque Control” on page 4. 7
  • 8. Figure 4-2. +12V BLDC Application Potentiometer UL UH POWER VL BRIDGE 3 BLDC VH (Q1..Q6) motor WL WH TWI shunt Rotor Position shunt + Sensors shunt - H1 H2 H3 Figure 4-3. UL PB0/OC1A* PA0/SDA TWI/speed UH PB1/OC1A PA1/ADC1 Speed VL PB2/OC1B* PA2/ADC2/SCL TWI Hall_1 VH PB3/OC1B PA3/AREF/PCINT3 VCC AGND GND AVCC WL PB4/OC1D* PA4/ADC3/ICP0/PCINT4 Hall_2 WH PB5/OC1D PA5/ADC4/AIN2/PCINT5 Hall_3 Fault/Speed PB6/ADC9/INT0(fault) PA6/ADC5/AIN0/PCINT6 Shunt + Debug Wire PB7/RESET/ADC10 PA7/ADC6/AIN1/PCINT7 Shunt - 8 AVR496
  • 9. AVR496 5. Software Description 5.1 Preamble And html documentation is delivered with the AVR496 software package. It can be opened thanks to the readme.html file located in the source directory. main.c ushell_task.c USI_TWI_Slave.c 5.2 BLDC Motor Control Implementation Figure 5-1. Power PWM Switch Generation Commutation Bridge BLDC UH U Motor OC1A OC1A* UL Duty Cycle OC1B VH V OC1B* VL Timer 1 OC1D WH W OC1D* WL H1 H2 H3 Commutate ADC5 Current Measurement ADC6 ADC Speed ADC2 Reference commTableForward PCINT3 commTableReverse PCINT4 Speed Measurement PCINT5 Pin Change Int timer 0 9
  • 10. 5.3 Function description void main(void): void Commutate(void): void SpeedMeasurement(void): void PLLInit(void): void PWMInit(void): void HallSensorInit(void): void ADCInit(void): void PortsInit(void): void TWInit(void): void MotorSetDutyCycle(uint16_t duty): __interrupt void HallChangeISR(): __interrupt void ADCISR(): void Timer0Init(void): __interrupt void ovfl_timer0(void): CPU & Memory usage All measurements have been realized with Fosc = 8MHz. They also depend on the motor type (numbers of pair of poles). With a motor of 4 pairs of poles, Hall Sensor frequency is four times as high as the motor frequency. All results in Figure 5-1 are obtained with a three-phase BLDC motor with four pairs of poles and a maximum speed of 6600 rpm. (Motor provided with the ATAVRMC300 kit). Microcontroller utilization rate Function Parameters Activation Time Activation Period Ratio CPU % HallChangeISR() Speed = 6600 rpm 10µS 380µS 2.7 ADCISR() Speed = 6600 rpm 4µS 25µS 16 With the same conditions, the microcontroller memory usage is: • 1332 bytes of CODE memory (Flash occupation = 17% ). Including communication protocole through TWI • 153 bytes of DATA memory (SRAM occupation = 30%). Including stack and communication protocole through TWI 10 AVR496 7827A–AVR–04/09
  • 11. ATAVRMC300 & ATAVRMC301 Configuration and Use Table 6-1. Jumper Position Comment J1(VHa) Pin1 & 2 shorted VHa = +5V J2(VCC) Open Vcc = +5V ATAVRMC301 jumper settings Speed => Potentiometer J8 Select speed reference SCL => TWI J9 All mounted Connect PBO/PB1/PB2 to UL/UH/VL J10 Not mounted J11 SH+ Connect Shunt+ to PA6 J12 SH- Connect Shunt- to PA7 J13 Not mounted J15 H1 Connect H1 to PA1 J16 H2 Connect H2 to PA4 J17 H3 Connect H3 to PA5 J19 See Hardware User Guide Select UVCC for USB stage 7. Conclusion 8. Appendix 7827A–AVR–04/09
  • 12. 42BLS01-001 Motor Characteristics 7827A–AVR–04/09
  • 13. Headquarters International Atmel Corporation Atmel Asia Atmel Europe Atmel Japan 2325 Orchard Parkway Unit 1-5 & 16, 19/F Le Krebs 9F, Tonetsu Shinkawa Bldg. San Jose, CA 95131 BEA Tower, Millennium City 5 8, Rue Jean-Pierre Timbaud 1-24-8 Shinkawa USA 418 Kwun Tong Road BP 309 Chuo-ku, Tokyo 104-0033 Tel: 1(408) 441-0311 Kwun Tong, Kowloon 78054 Saint-Quentin-en- Japan Fax: 1(408) 487-2600 Hong Kong Yvelines Cedex Tel: (81) 3-3523-3551 Tel: (852) 2245-6100 France Fax: (81) 3-3523-7581 Fax: (852) 2722-1369 Tel: (33) 1-30-60-70-00 Fax: (33) 1-30-60-71-11 Product Contact Web Site Technical Support Sales Contact avr@atmel.com www.atmel.com/contacts Literature Requests Disclaimer: The information in this document is provided in connection with Atmel products. No license, express or implied, by estoppel or otherwise, to any intellectual property right is granted by this document or in connection with the sale of Atmel products. EXCEPT AS SET FORTH IN ATMEL’S TERMS AND CONDI- TIONS OF SALE LOCATED ON ATMEL’S WEB SITE, ATMEL ASSUMES NO LIABILITY WHATSOEVER AND DISCLAIMS ANY EXPRESS, IMPLIED OR STATUTORY WARRANTY RELATING TO ITS PRODUCTS INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, CONSEQUENTIAL, PUNITIVE, SPECIAL OR INCIDEN- TAL DAMAGES (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF PROFITS, BUSINESS INTERRUPTION, OR LOSS OF INFORMATION) ARISING OUT OF THE USE OR INABILITY TO USE THIS DOCUMENT, EVEN IF ATMEL HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. Atmel makes no representations or warranties with respect to the accuracy or completeness of the contents of this document and reserves the right to make changes to specifications and product descriptions at any time without notice. Atmel does not make any commitment to update the information contained herein. Unless specifically provided otherwise, Atmel products are not suitable for, and shall not be used in, automotive applications. Atmel’s products are not intended, authorized, or warranted for use as components in applications intended to support or sustain life. © 2009 Atmel Corporation. All rights reserved. Atmel®, Atmel logo and combinations thereof, AVR® and others are registered trademarks or trademarks of Atmel Corporation or its subsidiaries. Other terms and product names may be trademarks of others. 7827A–AVR–04/09