This project uses L298 (known as H-bridge) to run brushless motor (taken from HDD) via Arduino Pro Mini. Find this and other hardware projects on Hackster.io. For more info and code =http://doityourself123.forumgreek.com/.

  1. Arduino Brushless Motor Driver
  2. Intelligent Brushless Driver
  3. Brushless Driver Arduino

A month ago, I build a sensorless brushless DC motor controller using Arduino UNO board, IR2104 gate driver, mosfets ā€¦. and now in this post Iā€™m going to build exactly the same controller but using IR2101 instead of the IR2104. Previous project link is the one below (contains more details about sensorless BLDC motor and back-emf):

Components Required:

  • Arduino UNO board
  • Brushless DC (BLDC) motor
  • 6 x 06N03LA N-type mosfet (or equivalent) ā€“ datasheet
  • 3 x IR2101 (IR2101S) gate driver IC ā€“ datasheet
  • 6 x 33k ohm resistor
  • 3 x 10k ohm resistor
  • 6 x 10 ohm resistor
  • 3 x IN4148 diode
  • 3 x 10uF capacitor
  • 3 x 2.2uF capacitor
  • 2 x pushbutton
  • 12V source
  • Breadboard
  • Jumper wires

Sensorless brushless DC motor control with Arduino circuit:
Project circuit schematic is shown below.

Note that all grounded terminals are connected together.

In the circuit there are 2 pushbuttons, one is used to increase BLDC motor speed and the 2nd one is used to decrease it.

Brushless Driver Arduino

The first three 33k (connected to motor phases) and the three 10k resistors are used as voltage dividers, because we can not supply the microcontroller with 12V, the other three 33k resistors generate the virtual natural point. The virtual natural point is connected to Arduino pin 6.

Arduino Brushless Motor Driver

The Arduino UNO board is based on the ATmega328P microcontroller which has one analog comparator. The positive input of this comparator is on Arduino uno pin 6 (AIN0) and the negative input can be pin 7 (AIN1), A0 (ADC0), A1 (ADC1), A2 (ADC2), A3 (ADC3), A4 (ADC4) or A5 (ADC5). So I connected the virtual natural point to the positive pin of the analog comparator (pin 6), phase A BEMF to pin 7 (AIN1), phase B BEMF to pin A2 and phase C BEMF to pin A3. Each time the comparator compares the virtual point with the BEMF of one phase (this is done in the software). This minimizes the hardware needed and simplifies the circuit.

The IR2101 chips are used to control high side and low side mosfets of each phase. The switching between the high side and the low side is done according to the control lines HIN and LIN. The figure below shows input and output timing diagram:

The HIN lines of the three IR2101 are connected to pins 11, 10 and 9 respectively for phase A, phase B and phase C. The Arduino UNO can generate PWM signals on that pins where only high side mosfets are PWMed.

Sensorless BLDC motor control with Arduino code:
The code below does not use any BLDC motor library.

As mentioned above, Arduino pins 9, 10 and 11 can generate PWM signals where pin 9 and pin 10 are related with Timer1 module (OC1A and OC1B) and pin 11 is related with Timer2 module (OC2A). Both Timer modules are configured to generate a PWM signal with a frequency of about 31KHz and a resolution of 8 bits. The duty cycles of the PWM signals are updated when a pushbutton is pressed (speed up or speed down) by writing to their registers (OCR1A, OCR1B and OCR2A).

The analog comparator compares the positive input AIN0 (Arduino pin 6) with the negative input which can be AIN1 (pin 7), ADC2 (pin A2) or ADC3 (pin A3). When the positive pin voltage is higher than the negative pin voltage, the output of the analog comparator ACO is set, and when the positive pin voltage is lower than the negative pin voltage, ACO is cleared.
In this project I used the analog comparator interrupt and I used its interrupt on rising (transition from low to high) and interrupt on falling (transition from high to low), this makes the zero crossing events interrupt the microcontroller.

To fully understand the code, read the ATmega328 datasheet!

2
4
6
8
10
12
14
16
18
20
22
24
26
28
30
32
34
36
38
40
42
44
46
48
50
52
54
56
58
60
62
64
66
68
70
72
74
76
78
80
82
84
86
88
90
92
94
96
98
100
102
104
106
108
110
112
114
116
118
120
122
124
126
128
130
132
134
136
138
140
142
144
146
148
150
152
154
156
158
160
162
164
166
168
170
172
174
176
178
180
/* Sensorless brushless DC (BLDC) motor control with Arduino UNO (Arduino DIY ESC).
* https://simple-circuit.com/
#define SPEED_UP A0 // BLDC motor speed-up button
#define SPEED_DOWN A1 // BLDC motor speed-down button
#define PWM_MIN_DUTY 50
unsignedinti;
DDRD =0x38;// Configure pins 3, 4 and 5 as outputs
DDRB =0x0E;// Configure pins 9, 10 and 11 as outputs
// Timer1 module setting: set clock source to clkI/O / 1 (no prescaling)
TCCR1B=0x01;
// Timer2 module setting: set clock source to clkI/O / 1 (no prescaling)
TCCR2B=0x01;
ACSR=0x10;// Disable and clear (flag bit) analog comparator interrupt
pinMode(SPEED_DOWN,INPUT_PULLUP);
// Analog comparator ISR
// BEMF debounce
if(bldc_step&1){
}
if((ACSR&0x20))i-=1;
}
bldc_step++;
}
voidbldc_move(){// BLDC motor commutation function
case0:
BEMF_C_RISING();
case1:
BEMF_B_FALLING();
case2:
BEMF_A_RISING();
case3:
BEMF_C_FALLING();
case4:
BEMF_B_RISING();
case5:
BEMF_A_FALLING();
}
SET_PWM_DUTY(PWM_START_DUTY);// Setup starting PWM with duty cycle = PWM_START_DUTY
// Motor start
delayMicroseconds(i);
bldc_step++;
i=i-20;
motor_speed=PWM_START_DUTY;
while(1){
while(!(digitalRead(SPEED_UP))&&motor_speed<PWM_MAX_DUTY){
SET_PWM_DUTY(motor_speed);
}
while(!(digitalRead(SPEED_DOWN))&&motor_speed>PWM_MIN_DUTY){
SET_PWM_DUTY(motor_speed);
}
}
voidBEMF_A_RISING(){
ADCSRB=(0<<ACME);// Select AIN1 as comparator negative input
}
ADCSRB=(0<<ACME);// Select AIN1 as comparator negative input
}
ADCSRA=(0<<ADEN);// Disable the ADC module
ADMUX=2;// Select analog channel 2 as comparator negative input
}
ADCSRA=(0<<ADEN);// Disable the ADC module
ADMUX=2;// Select analog channel 2 as comparator negative input
}
ADCSRA=(0<<ADEN);// Disable the ADC module
ADMUX=3;// Select analog channel 3 as comparator negative input
}
ADCSRA=(0<<ADEN);// Disable the ADC module
ADMUX=3;// Select analog channel 3 as comparator negative input
}
voidAH_BL(){
PORTD =0x10;
TCCR1A=0;// Turn pin 11 (OC2A) PWM ON (pin 9 & pin 10 OFF)
}
PORTD&=~0x30;
TCCR1A=0;// Turn pin 11 (OC2A) PWM ON (pin 9 & pin 10 OFF)
}
PORTD&=~0x30;
TCCR2A=0;// Turn pin 10 (OC1B) PWM ON (pin 9 & pin 11 OFF)
}
PORTD&=~0x18;
TCCR2A=0;// Turn pin 10 (OC1B) PWM ON (pin 9 & pin 11 OFF)
}
PORTD&=~0x18;
TCCR2A=0;// Turn pin 9 (OC1A) PWM ON (pin 10 & pin 11 OFF)
}
PORTD&=~0x28;
TCCR2A=0;// Turn pin 9 (OC1A) PWM ON (pin 10 & pin 11 OFF)
}
voidSET_PWM_DUTY(byteduty){
duty=PWM_MIN_DUTY;
duty=PWM_MAX_DUTY;
OCR1B=duty;// Set pin 10 PWM duty cycle
}

The video below shows how project is working (in this video I used the IR2104S chips).

Intelligent Brushless Driver

Tools

Digital Multimeter (DMM) - It's helpful if your DMM has a frequency meter
Oscilloscope (Preferably with at least 2 channels)
T8 Torx driver (you need one of these to open up any hard drive). A good hardware store will have them.
Machine Shop and Rapid Prototype Machine (These were extremely helpful, but with a little ingenuity I think the project can be done without them).

Materials

BLDC motor from a computer hard drive
A magnet ring (half of the motor) from another hard drive.
Several (3-6) of the silver disks from a hard drive
A second small motor (DC brushed OK)
rubber band or (preferably) belt to turn the BLDC with another motor
Electronic Breadboard
solid core wire 22 AWG for breadboard connections

One Arduino Duemilanove microcontroller
Three 120 k ohm resistors
six ~400 ohm resistors
Linear or Rotary Poteniometer 100 k ohm

Brushless

ST Microelectronics L6234 Three Phase Motor Driver IC
Two 100 uF capacitors
One 10 nF capacitor
One 220 nF capacitor
One 1 uF capacitor
One 100 uF capacitor
Three recifier diodes
one 2.5 amp fuse
one fuse holder

Brushless Driver Arduino

3 Honeywell SS411A Bipolar Hall-Effect Digital Position Sensors
Three 1 K resistors

New super mario bros nds rom rapidshare movies. Note: Mike Anton has designed and is selling a product that will take the place of the power electronics and hall sensors circuits I show in this instructable (it uses back EMF sensing for control). Specifications and purchasing information can be found at these two links: https://www.tindie.com/stores/manton/ http://manton.wikidot.com/open:bldc-motor-driver

12 V hobby sized lead acid battery