BLDC Main

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 24

BLDC CONTROLLER REPORT

Group: 20
I. DESCRIPTION DESIGN
1. Specification
- Rated voltage: 24V.
- Rated power: 300W.

2. Functionality

- Regulate motor’s speed/torque


- User interface:
+ Using keypad: including numbers, back (C), enter (D), clockwise
direction (A), counterclockwise direction, velocity mode (*),
torque mode(#).
+ Display data through LCD, led.
- Current protection
- Keep track of rotor’s position through Hall sensor and
communicate to MCU
- Overheat protection
- Communication through RS485

II. BLOCK DIAGRAM


III. HARDWARE DESIGN
3.1 Overview
a.
- Source: buck (24V-12V,5V,3.3V)
- LCD and keypad & reset button
- MCU STM32
- Inverter circuit
- Driver circuit
- Current feedback circuit
- Velocity Feedback
- Hall Sensor
- Overheat Protection
- Communication RS485

III.2 Detailed Design

1. Source
a. Buck 24V-12V, 24V-5V

*Buck converter 24V →5V

-Description: buck converter to regulate high voltage to low level voltage; step-
down 24V to Vcc(5V) to supply for others components.
+ Input: 24VDC, output: 5VDC
+ Using LM2576:
. Switch mode step-down voltage regulator.
. Output Voltage for fixed voltage regulator: 3.3V, 5V, 12V or 15V.
. Output Current: 3A
. Maximum Input Voltage: 40V
- Choosing components

V Out =V REF 1+
( ) R2
R1
where V REF =1.23 V

¿> R 2=R1
( V Out
V REF )
−1 ; Select R1=3.6 k Ω

¿> R 2=( 1.235 −1)∗3600=11kΩ


Inductor L1
Vout 1000
E x T= ( Vin−Vout ¿ Vin x Fs = 158,3
I max=3A

¿> ¿Choose L1=150uH

Capacitor out
V¿
C Out ≥ 13.3 =0.06 ( µF )
V Out . L

 Choose C Out =638 µF


Choose C 1=¿100uF , C 2=¿638uF
Diode:
I D =1.2 I max =1.2∗3=3.6 ( A )

V reverse =5∗3.6=18(V )

 Diode: 1N5824

*Buck converter 24V →12V

-Description: buck converter to regulate high voltage to low level voltage; step-
down 24V to 12V to supply for mosfet driver.
+ Input: 24VDC, output: 12VDC
+ Using LM2576:
. Switch mode step-down voltage regulator.
. Output Voltage for fixed voltage regulator: 3.3V, 5V, 12V or 15V.
. Output Current: 3A
. Maximum Input Voltage: 40V
- Choosing components

V Out =V REF 1+
( ) R2
R1
where V REF =1.23 V

¿> R 2=R1
( V Out
V REF )
−1 ; Select R1=1.5 k Ω

¿> R 2=( 1.23


12
−1 )∗1500=13 kΩ

So choose component:
Resistance: R1=1.5 k Ω , R2=13 k Ω
Input capacitor : C 1=¿100uF
Output capacitor : C 2=177uF
Inductor : L1=150uH
Diode : 1N5824

b. Buck 5V-3.3V
In order to supply for MCU, using LM1117 to converter 5V Vcc to 3.3V and
isolated by RSH2-3.33.3S/H3.
R 10
+ Vout= Vref (1+ R 9 ) + IADJ*R2, (IADJ small)

Where: Vref=1.25V;
=> Select R9=0.8kΩ (<1k);
Vout
=> R10= ( Vref −1)* R9

=> R10 = ¿)*0.8= 1.312kΩ

2. LCD and keypad & reset button


a. LCD & Keypad
- In order to display data to user; using LCD 2004 within display format: 20
characters x 4line, power supply 5V.
- In order to insert the desired velocity, rotating direction from user, using keypad
4x4.

b. Reset button
- The LED is connected to MCU that is active for RESET mode. When
pushing the RESET button, the Led will be turned on.
3. Digital input
- Description: digital input for start, stop and choosing direction & control
mode for motor.
+ Input voltage:
. Logic low: 0 - 0.2V
. Logic high: 2 - 5V
+ Output voltage:
. Logic low: 2 – 3.3V
. Logic high: 0 – 0.8V
- Using PC817 to isolate and protect MCU
+ When Vin= 0 - 0.2V -> Vin < 0.7 -> Diode is at cut off region -> transistor
is at cut off region -> Vout =0.
+ When Vin= 2 - 5V:
Vin−0.7
I1= R1
3.3
I2= R 2

+ Transistor is working at saturation region:


I2 3.3∗R 1
I1
< CTR ó ( Vin−0.7 )∗R 2
< 0.5

R1 R1
+ Vin = 2 => R 2 < 0.19; Vin= 5 => R 2 < 0.64. And MCU rating current is
5mA=> I1= 80% *5= 4mA
 Choosing R1= 1 k Ω , R2= 10 k Ω

4. Analog input
- Describe: + Analog input: 0V – 10V
+ Output: 0V – 3.3V
- Voltage divider: choosing R3=10kΩ, R4= 40kΩ
R3 10 k Vin
=> V1= R 3+ R 4 * Vin = 10 k +40 k * Vin = 5

10
=> V+ = V1 = (0 ~ 5 ) = 0 ~ 2V

- Using inverter amplifier


−R1
Vout = R 2 * (3.3-V1) ; Choosing R1=10k => R2 =3.94k

5. MCU STM32F101R6T6
a. Overview
- 12-bit synchronized ADC number of channels: 1-16 channel
- GPIOs: 51
- CPU frequency: 36 MHz
- Operating voltage: 2.0 to 3.6 V
- Operating temperature: ambient temp: -40 to 85Oc, junction tem: -40 to 105Oc
-Packages: LQFP64

c. General pinouts and pin description

No Pin Name Function Pin.Num


1 PC14-OSC32_IN OSC32_IN 3

2 PC15-OSC32_OUT OSC32_OUT 4
3 NRST RESET System 7
4 PCO ~ PC7 Led Data Bus 8 ~ 11,
24,25,37,38
5 PC10 Led Register 51
6 PC11 Led Enable 52
7 PB5 ~ PB12 Keyboard pins 57~59,
61,62,29,30,33
8 PA8 HIN1 (PWM) 41
9 PA9 HIN2 (PWM) 42
10 PA10 HIN3 (PWM) 43
11 PB13 LIN1 34
12 PB14 LIN2 35
13 PB15 LIN3 36
14 PC8 Encoder A 39
15 PC9 Encoder B 40
16 PA4 Current Feedback 20
17 PB0 Hall Sensor A 26
18 PB1 Hall Sensor B 27
19 PB2 Hall Sensor C 28
20 PA2 USART_TX 16
21 PA3 USART_RX 17
22 PA5,PA6,PA12,PA13 Start, Stop,Direction, 21,22,45,46
Mode
23 PA11 Analog input 44
24
25

4. Inverter circuit
- Purpose: inverter transfer source 24 VDC into AC source to supply for motor ->
using 6 mosfets IRF3205.
- The voltage source inverter contains six switches to drive 3-phase BLDC. The
designed order1 to 6 represents the sequence of switch operation in time. It
contains of 3 phase legs which operate in 120o apart. The three phase legs have a
phase shift at 120o among themselves that means phase leg (3-6) switches 120o
after phase leg (1-4) and phase leg (5-2) switches 120o after (3-6). Switch 1 and 4
get turned ON to give the voltage at one phase i.e, Va.Switch 3 and 6 turned ON to
give voltage Vb. Switch 5 and 2 turned ON to give voltage Vc.
- Power’s Motor: P = 300W
- U= 24V -> I= 300/24= 12.5(A) -> The switches need to withstand the nomial
values of the motor -> It could be mosfet IRF3205
5. Driver circuit (IC IR2110)

- VCC: Low side fixed supply voltage from 10V to 20V -> using source 12VDC
- VDD: logic supply voltage from VSS+3 to VSS+20 (recommend VDD>=+4V) -
> using source VCC (5V)
- VSS: logic supply offset voltage – connected to ground
- COM: Low side return – connected to ground
- HIN: logic input for high side gate driver output (HO), in phase – connected to
MCU.
- LIN: logic input for low side gate driver output (LO), in phase – connected to
MCU.
- Electrolytic capacitor in paralled with ceramic capacitor (12V with C1, C2) is use
as boost trapping capacitor.
- Diode and resistance (R1, R2, D2,D3) are use for protection of from reversal of
supply from switches.
- C1= 22uF, C2=100nF; C3=22uF, C4= 100nF
- R1=R2=10; R3=R4= 1k.

6. Current feedback circuit


- Requirement:
+ Input current in range -12.5A to +12.5 A (I = P/V= 300W/24V= 12.5 A)
+ Desired voltage for MCU pin 0-3.3V
 In order to feedback current, using IC ACS712, its output will be isolated by
IC HCPL-7800; after that it is gained by IC OP-AMP MCP601 before
sending to MCU.
- IC ACS712
Using ACS7 to detect the DC current. Connecting DC from Ip+ to Ip-, then
Vout will respond voltage 2.5~5VDC, otherwise Vout will get 2.5-0VDC; and
the current will be 0~Max and 0~(-Max) respectively.
+ When supplying 5VDC for IC without current Ip -> Vout= 2.5VDC
+ Ip+ & Ip- connected to feedback current
+ Vcc supply connected to voltage source Vcc(5V)
+ Cbyp= 0.1uF reducing disturbances and Cf= 1nF for filter pin, getting
values as datasheet.
+ We have Idm= 12.5A but to save motor’s life, using current 80%Idm =
10A
VIOUT= 0.2*IP + 2.5
Thus VIOUT= 0.2*IP + 2.5= 0.2*10+2.5= 4.5V
+ Respect to current 10A is output voltage of 4.5. Using voltage
divider , voltage before through the IC HCPL is:
R5 10 k
VA1 = R 1+ R 2+ R 3+ R 4+ R 5
∗Vout = 1 M +1 M + 200 k +200 k +100 k
∗4.5 =
0.18V
- IC HCPL
Because the voltage will be gained 8 times through the IC HPCL thus we get
0.18*8= 1.44V
- The Differential Amplifier:
+ Choosing R7=R8= 10k
R 10
+ Vout= (Vout+ - Vout-)* R 8

R8 10 k
 R10= Vout* Vout+−Vout−¿ ¿ = 3.3* 1.44 = 22.9k(Ohm)
7. Velocity Feedback

In order to feedback the motor’s velocity, for example using encoder HN3806-AB
Rotary Encoder and using opto PC817 is to isolate encoder and MCU.
8. Hall Sensor
9. Overheat Protection

- In order to protect the controller from overheat situation; using relay to open
circuit when it appears.
- Using the IC LM35 to detect the circuit’s temperature
-> Thus, Vout in range of (-55*10mV/C; 150*10mV/C )= (-0.55V;1.5V)
- After that; using voltage divider from source Vcc to pin V- of op-amp LM339.
Reference for V- is set 1.3V respect to 130oC:
Choosing R3= 10k
R4 R4
V- = Vcc* R 4+ R 3 => 1.3= 5* R 4+10 k => R4= 3.51k

-> If occurring overheat situation, V+ > V- means Vout is high logic. After that,
using transistor BC547 to control relay open circuit to isolate between source 24V
and inverter.

10. Communication RS485

-Choosing IC MAX485
+ Quantity: 1 port
+ Protocol: Modbus
+ Communication Standard: RS485
+ 3-3.5V supply voltage
+ Transmission speed up to 20 Mbps
+ Isolation to MCU: 6N137A

IV. SOFTWARE DESIGN


Finite state machine
1. Unit Control

* Normal
Normal operation: normal operating state; if the motor occurs any problems,
such as overcurrent, overheat, interruption,etc, it will convert to Emergency Stop
state.
- IDLE: stop and wait for Run signal/keypad signal and parameter setting,set
point, PWM calculation and duty cycle
- RUN: the motor is running normally (eventhough within warning)
+ If the operator mode is mode-1, the controller will work as speed control
+ If the operator mode is mode-2, the controller will work as torque control
- STOP: stop working and go back to the idle if needed
* Emergency Stop
Emergency Stop: if existing any emergency problems, the system will be
immediately stopped. -> Choosing Start again to start the motor after emergency
situation.

2. User interface

Where:
- Idle: the initial state, waiting for command.
- Master’s transmit: the controller received data from peripheral(such as
master’s MCU, PLC,…).
- Keypad’s transmit: send data command from user to controller
- Warning: response to system if there’re any problems(overheat, overcurrent,
incorrect syntax, error,etc).

2.1 User interface from keypad

User can directly control BLDC through keypad 4x4 unless any other’s master
command.
* Menu
The options displayed on the LCD screen menu is in ordered:
Value,Direction,Mode. In order to move to left or right through key * or #
respectively, then user choose one of them, return to menu options by ‘back’
+ Set value: user will insert speed/torque value by keypad’s number
+ Set direction: * respected to speed mode and ; # respected to torque mode
+ Set mode: ‘A’ stand for clockwise direction, ‘B’ stand for counter clock wise
Note: ‘C’ stand for back & ‘D’ stand for enter

* Peripheral’s request
- If there’s any request from peripheral, stop keypad’s command then supplied to
serve master.
Each actions will be displayed on LCD.

2.2 User interface from master

Các biến nhận -> là gì; xử lý biến như nào.


2 nguồn khác cho 2 con cách ly RS485

You might also like