[Báo cáo] Thiết kế bộ điều khiển động cơ BLDC - TG.Nguyễn Đức Cường, Giáp Đăng

UN
Uni24h
0 lượt tải
49
0

Nội dung tài liệu

Trang 1

ĐẠI HỌC BÁCH KHOA HÀ NỘI TRƯỜNG ĐIỆN – ĐIỆN TỬ KHOA TỰ ĐỘNG HÓA PROJECT REPORT EMBEDED SYSTEM DESIGN BLDC motor controller design Instructor: Chu Đức Việt Group number: Group 15 Nguyễn Đức Cường 20192190 Giáp Đăng Khánh 20192219 Mạc Tuấn Anh 20192182 Hanoi, 2023

Trang 2

Table of Contents I. Block diagram and characteristics....................................................................................................3 1. Block diagram .................................................................................................................................3 2. Characteristic..................................................................................................................................3 II. Schematic and Calculation.............................................................................................................4 1. Buck converter................................................................................................................................4 2. MCU supply voltage isolation........................................................................................................7 3. Current sensor.................................................................................................................................7 4. Digital Input ....................................................................................................................................9 5. Digital Output................................................................................................................................10 6. Analog Input..................................................................................................................................11 7. RS485 for communication............................................................................................................12 8. Inverter driver...............................................................................................................................14 9. MOSFET Circuit ..........................................................................................................................16 10. Hall Sensor.................................................................................................................................17 11. Encoder......................................................................................................................................18 12. LCD............................................................................................................................................19 13. MCU block.................................................................................................................................20 III. Software design .............................................................................................................................20 1. Software Diagram.........................................................................................................................20 a. System software diagram .........................................................................................................20 b. Control panel interface software diagram..............................................................................21 c. RS485 Interface Diagram.........................................................................................................25 2. Code................................................................................................................................................28 a. System software.........................................................................................................................28 b. Control panel interface software .............................................................................................30 c. RS485 interface software..........................................................................................................35 IV. Detail schematic of the controller................................................................................................38 1. Power source..................................................................................................................................38 2. MCU supply voltage isolation......................................................................................................39 3. Driver circuit.................................................................................................................................40 4. Mosfet circuit.................................................................................................................................41 5. Digital input circuit.......................................................................................................................42 1

Trang 3

6. Digital output circuit.....................................................................................................................43 7. Analog input circuit......................................................................................................................44 8. Current sensor circuit...................................................................................................................44 9. RS485 Circuit................................................................................................................................45 10. Hall sensor circuit .....................................................................................................................45 11. Encoder circuit..........................................................................................................................46 12. Lcd circuit..................................................................................................................................47 13. MCU...........................................................................................................................................48 2

Trang 4

I. Block diagram and characteristics 1. Block diagram 2. Characteristic • Motor voltage: 24V • Power: 300W • Speed: 0 – 3000rpm • Can work in torque mode or velocity mode controlled by buttons • Have LCD screen to display • Have isolation circuit for the controller • Can select control between control panel and connected device via RS485 3

Trang 5

• 2 analog input and 2 digital input • 2 digital output • Control the parameters through the button II. Schematic and Calculation 1. Buck converter Use to convert 24V input to 12V,5V,3.3V and include reverse voltage protection. Figure 1 Buck converter Reverse voltage protection ❖ Choosing MOSFET • Drain source Resistance (RDS) Need low RDS for low heat dissipation and low voltage drop. • Drain Current Maximum current that passes through the MOSFET • Drain to Source Voltage Higher than circuit voltage ➢ Choose IRF9530 𝑉𝐷𝑆 = −100 𝑅𝐷𝑆 = 0.30 𝑉𝐺𝑆 = ±20 ❖ Selection of Diode • Select Zener diode: Each MOSFET comes with a Vgs (gate to source voltage) if the source voltage increases than the max rating => Damage the MOSFET => Choose 1N4099 ❖ Selection of Resistor 4

Trang 6

• Need to be chosen in a way that it should not be high enough to not overheat the Zener, but low enough to provide adequate Zener bias current to discharge the gate if the supply voltage is reverse. Therefore, here is a tradeoff between the gate discharge time and Zener biasing => choose 1kΩ Buck converter to 12V 𝑅2 𝑉𝑂𝑢𝑡 = 𝑉𝑅𝐸𝐹 (1 + ) 𝑤ℎ𝑒𝑟𝑒 𝑉𝑅𝐸𝐹 = 1.23𝑉 𝑅1 𝑉𝑂𝑢𝑡 => 𝑅2 = 𝑅1 ( − 1) ;𝑆𝑒𝑙𝑒𝑐𝑡 𝑅1 = 1𝑘 𝑉𝑅𝐸𝐹 12 => 𝑅2 = ( − 1) ∗ 1000 = 8.75𝑘Ω 1.23 Closet 1% value = 8.84Ω [for safety] ❖ Inductor: 𝑉𝑂𝑢𝑡 1000 𝐸 ∗ 𝑇 = (𝑉𝑖𝑛 − 𝑉𝑂𝑢𝑡) ∗ 𝑉𝑖𝑛 𝐹  E * T = 115Vμs Because current needs to be 2A  Choose L(H220)  L = 220μH Capacitor out 𝑉𝑖𝑛(𝑚𝑎𝑥) 𝐶𝑂𝑢𝑡 ≥ 13.3. = 12.6(μ𝐹) 𝑉𝑂𝑢𝑡.𝐿  C = 680μF Diode: 𝐼𝐷 = 1.2𝐼𝑚𝑎𝑥 = 1.2 ∗ 2 = 2.4(𝐴) 𝑉𝑟𝑒𝑣𝑒𝑟𝑠𝑒 = 12 ∗ 1.25 = 15(𝑉)  Diode: 1N5820 Select 1𝑘Ω resistor to reduce current goes into MCU. 5

Trang 7

5 𝑅2 = 1𝑘 ( − 1) = 3𝑘 1.23 Closet 1% value: 3.1k Output capacitor 𝑉𝑖𝑛 𝐶𝑂𝑢𝑡 ≥ 13.3 = 0.06(μ𝐹) 𝑉𝑂𝑢𝑡.𝐿  𝐶𝑂𝑢𝑡 = 680μ𝐹 Buck converter to 5V 𝑅2 𝑉𝑜𝑢𝑡 = 𝑉𝑅𝐸𝐹 (1 + ) 𝑅1  𝑅 = 𝑅 (𝑉𝑜𝑢𝑡 − 1);𝑠𝑒𝑙𝑒𝑐𝑡 𝑅 = 1𝐾 2 1 𝑉 1 𝑅𝐸𝐹  𝑅2 = 3.1𝐾Ω ❖ Inductor 𝐸 ∗ 𝑇 = 54.73(𝑉 ∗ μ𝑠) Because current need 2A => Choose L (H220) => L = 220μH ❖ Capacitor out 𝐶𝑂𝑢𝑡 ≥ 13.3 𝑉𝑖𝑛(max) = 43.9μ𝐹 => 𝐶𝑂𝑈𝑇 = 680μ𝐹 𝑉𝑂𝑢𝑡 ❖ Diode 𝐼𝐷 = 12𝐼𝑚𝑎𝑥 = 12 ∗ 2 = 2,4𝐴 {𝑉 = 3.3 ∗ 1.25 = 4.125𝐴 => 𝐷𝑖𝑜𝑑𝑒:1𝑁5820 𝑟𝑒𝑣𝑒𝑟𝑠𝑒 Buck converter to 3.3V 𝑅2 𝑉𝑜𝑢𝑡 = 𝑉𝑅𝐸𝐹 (1 + ) 𝑅1  𝑅 = 𝑅 (𝑉𝑜𝑢𝑡 − 1);𝑠𝑒𝑙𝑒𝑐𝑡 𝑅 = 1𝐾 2 1 𝑉 1 𝑅𝐸𝐹  𝑅2 = 1.68𝐾Ω ❖ Inductor 𝐸 ∗ 𝑇 = 54.73(𝑉 ∗ μ𝑠) Because current need 2A => Choose L (H220) => L = 220μH ❖ Capacitor out 6

Trang 8

𝐶𝑂𝑢𝑡 ≥ 13.3 𝑉𝑖𝑛(max) = 43.9μ𝐹 => 𝐶𝑂𝑈𝑇 = 680μ𝐹 𝑉𝑂𝑢𝑡 ❖ Diode 𝐼𝐷 = 12𝐼𝑚𝑎𝑥 = 12 ∗ 2 = 2,4𝐴 {𝑉 = 3.3 ∗ 1.25 = 4.125𝐴 => 𝐷𝑖𝑜𝑑𝑒:1𝑁5820 𝑟𝑒𝑣𝑒𝑟𝑠𝑒 2. MCU supply voltage isolation We choose: 𝐶1 = 4.7𝜇𝐹 {𝐶 = 10𝜇𝐹 2 3. Current sensor Description 7

Trang 9

• Choose resistor: The input of the MCU is between 0-33V. So, we have: 𝑅1 3.3 = 𝑅1 + 𝑅2 5 𝑅1 = 3.3𝑘Ω ⇒ Choose {𝑅 = 1.7𝑘Ω 2 • With Opamp - We choose the one with isolation voltage: 𝑉𝐼𝑠𝑜 = 3.3 x 2.5 = 8.25(V) - Low noise - Input range 0 – 3.3V ⇒ Choose MAX4231. • Low pass filter - Choose cut-off frequency 100Hz. 8

Trang 10

1 = 100 2𝜋𝑅4𝐶3 𝑅4 = 1𝑘Ω ⇒ {𝐶 = 1.6𝜇𝐹 3 • Capacitor - 2 capacitors used to filter noise (porcelain capacitors) - Pick value 𝐶1 = 𝐶2 = 1μ𝐹 2 pins IP+ and IP- used to receive current (MOSFET circuit) 4. Digital Input • Choose C1, C2 𝐶1 = 𝐶2 = 1𝜇𝐹 • Choose resistors: - With 𝑅1,𝑅2: The input voltage range 0-24V and the opto input voltage will range 0-5V. 𝑅2 5 ⇒ ≤ 𝑅1 + 𝑅2 24 𝑅2 = 5𝑘Ω ⇒{𝑅 = 20𝑘Ω 1 - With 𝑅𝑓,𝑅𝑐: PC817 works in range 5-20mA. ⇒ Choose 𝑅𝑓: 5 − 1.2 5 − 1.4 ≤ 𝑅𝑓 ≤ 20 × 10−3 5 × 10−3 9

Trang 11

⇒190 ≤ 𝑅𝑓 ≤ 720 ⇒𝑅𝑓 = 220Ω - To make sure current not over 25mA 3.3 ⇒𝑅𝑐 = = 132Ω 0.025 • Choose diode: Maximum reversed voltage: 𝑉𝑟𝑒𝑣𝑒𝑟𝑠𝑒 = 2.5 × 5 = 12.5(V) ⇒ Choose 1N5817 Schottky diode 5. Digital Output When PC817 guide: choose R2, R3 to current through LED from 10-12mA. Voltage drop on Led 1.8-2.5V, saturation voltage C,E of PC817is: 𝑈𝐶𝐸 ≤ 0.2𝑉. So 21.3 ≤ 𝑈𝑅2 + 𝑈𝑅3 ≤ 22𝑉 ;10𝑚𝐴 ≤ 𝐼𝐿𝑒𝑑 ≤ 12𝑚𝐴. 22.2𝑉 21.3𝑉 ⇒ ≤ 𝑅2 + 𝑅3 ≤ ⇒ 1850 ≤ 𝑅2 + 𝑅3 ≤ 2130 12𝑚𝐴 10𝑚𝐴 ⇒ Choose R2 = R3 = 1k. 10

Trang 12

Replace the opposite, R2 = R3 = 1kΩ ⇒ 10.65 ≤ 𝐼𝐿𝑒𝑑 ≤ 11.1𝑚𝐴 ⇒10.65 ≤ 𝑈𝑅3 ≤ 11.1𝑉 ⇒ − 11.1 ≤ 𝑈𝐺𝑆 ≤ −10.65𝑉 6. Analog Input • With current source change capacitor C1 to Ra with 𝑅𝑎 = 220Ω • R1 and R2 Because the input voltage is 0 – 10V and ADC input voltage is 0 – 3.3V ⇒ Choose divider circuit: 𝑉 = 𝑅2 × 𝑉 ≤ 3.3 ⇒ 𝑅2 ≤ 3.3 𝐷𝑖𝑣 𝑅 +𝑅 𝑖𝑛 𝑅 +𝑅 1 2 1 2 𝑅2 = 1𝑘Ω ⇒{𝑅 = 2𝑘Ω 1 • Opamp Choose LM324: - Supply voltage 3 – 30V 11

Trang 13

- Low noise - Band width approximately: 1MHz • Low pass filter Select cut off frequency 100Hz. 1 𝑅 = 1𝑘Ω ⇒ 𝜔 = ⇒ { 3 𝐶 2𝜋𝑅 𝐶 𝐶 = 1.6𝜇𝐹 3 4 4 • Diode Maximum reverse voltage: 𝑉𝑟𝑒𝑣𝑒𝑟𝑠𝑒 = 𝐾 × 10𝑉 = 2.5 × 10 = 25(𝑉) Current rating: 𝐼𝑟 = 100𝑚𝐴 ⇒ Choose BAT54S Schottky diode 7. RS485 for communication Description Use to communicate with other microprosesor and with computer. 12

Trang 14

Pins Details Truth Table Capacitors Calculation 𝐶1 = 𝐶4 = 100𝑛𝐹 𝐶2 = 𝐶3 = 10𝑛𝐹 𝐶5 = 𝐶7 = 100𝑛𝐹 13

Trang 15

𝐶6 = 𝐶8 = 10𝑢𝐹 8. Inverter driver Three IR2110S Driver will be implemented to control the MOSFET circuit. Each driver will be used to control two MOSFET using bootstrap method. • Pins Details - LO: Output pin for low side gate driver - COM: Return path for low side configuration - VCC: Power supply pin for low side - VS: floating point return path for high side drive - VB: floating supply for high side drive - HO: Output signal for high side FET - VDD: Power supply - HIN: PWM signal for high FET - SD: Shut down pin, under voltage - LIN: PWM signal input for low side - VSS: Power supply ground 14

Trang 16

• Recommended Operation Condition • Capacitor Calculation - Capacitors 𝐶1,𝐶3 will be use as Bootstrap Capacitors. - Capacitors 𝐶2,𝐶4,𝐶5 will be to reduce noise to VB, VS, VCC, COM, VDD. ⇒ 𝐶1 = 𝐶3 = 30μ𝐹 (Recommend for Bootstrap Capacitors is in range 22𝜇𝐹 − 40𝜇𝐹 ⇒ 𝐶2 = 𝐶4 = 1μ𝐹 • Resistor Calculation - 𝑅1 = 𝑅2 • Diode Selection Diode 𝐷1 is used to avoid discharge at VCC and VB Able to withstand 12V reverse voltage. Choose 1N4148 fast switching diode. 15

Trang 17

9. MOSFET Circuit • Selection based on absolute max rating of driver circuit.  𝑉𝐵 < 𝑉𝐻𝑂 ≤ 𝑉𝐵 + 0.3 => 𝑉𝐻𝑂 ≤ 12.3  −0.3 < 𝑉𝐿𝑂 < 𝑉𝑐𝑐 + 0.3 => 𝑉𝐿𝑂 < 12 - The voltage apply to the Drain of the up MOSFETs is 24V.So, choose MOSFET: IRF3205 16

Trang 18

10.Hall Sensor • Choose resistor: PC817 works in range 5-20mA. ⇒ Choose 𝑅1, 𝑅2, 𝑅3: 5 − 1.2 5 − 1.4 ≤ 𝑅1,2,3 ≤ 20 × 10−3 5 × 10−3 ⇒190 ≤ 𝑅1,2,3 ≤ 720 ⇒𝑅1,2,3 = 220Ω - To make sure current not over 25mA 3.3 ⇒𝑅𝑐 = = 132Ω 0.025 17

Trang 19

11.Encoder • Choose resistor: PC817 works in range 5-20mA. ⇒ Choose 𝑅1, 𝑅2: 5 − 1.2 5 − 1.4 ≤ 𝑅1,2 ≤ 20 × 10−3 5 × 10−3 ⇒190 ≤ 𝑅1,2 ≤ 720 ⇒𝑅1,2 = 220Ω - To make sure current not over 25mA 3.3 ⇒𝑅𝑐 = = 132Ω 0.025 18

Trang 20

12.LCD LCD use 5V input voltage. The NOT gate represents a inverting Schmitt trigger gate use in 74HC14. There are 7 buttons include RUN, STOP, RESET, UP, DOWN, SETTING, BACK. 19

Hiển thị 20 trang đầu. Tải tài liệu để xem đầy đủ.

Bình luận (0)

Đăng nhập để tham gia bình luận

Chưa có bình luận nào. Hãy là người đầu tiên!