0% found this document useful (0 votes)
161 views20 pages

STM32 ESC PCB Design (FOC ESC For BLDC Motors)

The document outlines the design and development of the DeepDrive v1.0 ESC PCB, which is based on the STM32 microcontroller and intended for evaluating motor control algorithms for BLDC motors. It details the project's requirements, schematic design, and manufacturing process, including collaboration with JLCPCB for fabrication. Key components and design decisions are discussed, focusing on aspects such as power supply, gate drivers, current measurement, and temperature monitoring.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
161 views20 pages

STM32 ESC PCB Design (FOC ESC For BLDC Motors)

The document outlines the design and development of the DeepDrive v1.0 ESC PCB, which is based on the STM32 microcontroller and intended for evaluating motor control algorithms for BLDC motors. It details the project's requirements, schematic design, and manufacturing process, including collaboration with JLCPCB for fabrication. Key components and design decisions are discussed, focusing on aspects such as power supply, gate drivers, current measurement, and temperature monitoring.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 20
Drie) ro form Ce) Learn STM32 Bases Setting Up STS2 Toaldnin Getting Started ‘wth STME2 STME2 HAL Uibeany PIO Tutorial ‘PIO Output rite #2 Tosale Fin) PIO Input end Fin) STMB2 REE (esst adock) STM? delay us (OWT + Timer) Search The Pic || Electronics Website stM32 || 65°32 || ARDUINO STM32 ESC PCB Design Categories Categories ‘Select Category o Subscribe To Our Newsletter To.Get All New Upulates i: STM32 ESC PCB Design (FOC ESC For BLDC Motors) sed Mogay This is the fist version of the DeepDrive project, an STMB2-Based ESC PCB. Designed For Evahuating Motor Contiol Algorithms for BLDC (Brushless DC Motors, Ive designed this board to be a development boatd that can be used to test various motor contrat algarithms, especially Sensorless FOC (Feld-Oriented Contra) with taza In this article, 1M show you the STMB2 ESC PCB & schematic design steps, explain ‘some of the design decisions that ve made, how to prepare the files needed for ‘manufacturing, and how to place the PCS SMT order at JLCPCB who are kindly sponsoring this project as well This Project is Sponsored By JLCPCB Oe Rel fo) 54$ COUPON ans DISCOUNT poe sr soPanNne awagal Table of Contents 1 Deepbrive v1.D ESC PCRA Overview 2. STM32 ESC PCB Design Requirements 2 DeepDrive vi,0STH432 ESC Hardaare HLD 4. STIRZ ESC Schematic Design Diagram 6 Placing PCEA Order @ JLCPCB 1. ST¥32 ESC PCR Spinning a BLDC Motor {Conclusion &: Next steps 9, DeepDrive STM32 ESC PCB Project Video DeepDrive v1.0 ESC PCBA Overview ‘The intention behind this project was to cteate 2 customized ESC board for BLOC/PMSM_ motor control algorithm evahsation, | wanted some sort of motor control dev board that helps me demonstrate motor control algorithms and ‘commutation schemes. Topics tke si-step commutation, SPWEM, SVPWM, and most Importantly FOC (ield- oriented contro), ‘That led me to write down the complete requirements ist ofthis project and start Planning the HLD (High-Level Design. That consists of a Jot of smaller pieces (blocks) ‘of hardware that Idd design simulate, and test one by one afterward ‘The whole thing was ready for fabrication back in earhy 2020 when the COVID-19 silicon shortage crisis distupted the global market. So had to abandon It ill now in 2023 wien JUCPCB kindly offered to sponsor the project and bring ito fife again. FYI, {during the silicon shortage crisis, the gate driver that fm using was being sold for around 37USS/part, while It's now 3USS/part. This is just one simple example of hav ‘the situation was back then, “The final project is shown below in KICAD 3D viewer and in eat life ater fabrication and SMT assembly by JUCPCB. It's eally amazing how similar they look a the end sr S aa Pos) ae STM22 FSC DCR Nacian Ranuiramante ee. Fete are the requirements of this project that Ive listed down in the following ‘categories before starting to design or select any part ofthe BOM. Power Requirements + 12V0C input 2 Handle upto 304 commis 05009 + RPP eves Plait Potton) 1¥S For The OC Input +k capac Bank Forte OCtink votage » 33V DC-DC Buck Converter (Logic Supply) + Poe Lgl Supply Over USB No DC Input Exists Gate Driver & Inverter Requirements +2: hase Ha ridge Smart Gate Diver + 3-Phase Inverter That Consists of 6x MOSFETS (Love Rison. High |) Measurements For Motor Control + ust shunt Phase Curent Measurement + 0c-LinkVottage&Batery Voltage Measurement + ¢ current ealtery current Measavement + lnvrer Bdge Temperate Measurement + :-Phase Voltages Measiement +5 Phase Bett Zo10 Crossing Beteton Microcontroller & Auxiliaries + STIMG264 Motor Conttol Micracontraller 1Us8.2.0 Full Speed (Data Transfer to GUI on PC) + Onboard Buttons & Indicator LEDS NVM (2kB 2c EEPROM) Aux. UART Port + Aux ADE Input DeepDrive v1.0 STM32 ESC Hardware HLD A this stage, we can easily come up with a first draft forthe whole system’s HLD (High-Level Design) that indicates the system's hardware design breakdown for ‘smaller HW blocks and thei interfaces. This wil facitate the process of design and BOM selection. ‘ital components can ako be selected by the end of the HLD draft After weve ‘decided on the number of hardware interfaces needed (ADC channels, UARTS, 10 pins, etQ. So we can select the microcontroller part more specifically and also the ‘smart gate diver & inverter bridge's MOSFETS, ‘The BOM selection process will stil be ongoing but It starts here at the HLD stage and wll continue unl the end of the footprints assignment, where well be ready to art the PCB layout and routing, Before starting the PCB layout and routing, the BOM selection process must be complete and pretty much stable Any change in the BOM afterward will fake more time to accommodate going back and forth from Pca >Schematlc Hete isthe HLD of the Deepbrive 1.0 project DEEPDRIVE no Oo \o Note Note That this may look ike a UML (unified modeling language) diagram but it actually fs t's my way to communicate HW HLD and you're pretty much free {to draw it however yes like-a¢ long ae it's understandable by other engineers in your team, STM32 ESC Schematic Design Diagram Lets now move to the mest interesting part of the project, which i= designing the cicults needed to complete the HLD (high-level design). Well go through the HW blocks mentioned in the HLD one ata tine and discuss hens to implement them and justity the design decisions that Ive made during the design process. For a more in-depth demonstration, its highly recommended to check out the projedt's YouTube video as I go through the desiga decisions that Tve made in this project with a bit more elaboration and explanation. 1. DC PWR In + RPP (Reverse Polarity Protection) Hete isthe DC voltage input section of the FSC schematic design. There is a TVS ‘lode that kicke in whenever the voltage goes beyond 204, despite the fact that out Input port is 12V0C. This fs because the ESC will be switching an inductive load breaking on fault condition ak ‘An inductor is also present on the DC input fine for that purpose, to resist the back. energy from the motor to protect my uni-divectional power supply (regenerative breaking is not supported in this ESC design), The inductor helps also in reducing Inush current during power up that happens due to the large DC-Link voltage ‘capacitors bank RPP Is achieved by using an N-Channel MOSFET ia the GND path. The MOSFETS gate is protected with zener diodes (¥z=168y extended part in JLCPCB library). | could have used a P-Channel MOSFET in the +e ral path instead both options are totally fine, its up to you to decide whic path to go. 2. Logic Supply (DC-DC Buck Converter) \we need! to step clown the 12v DC input voltage to 3.2 in order to supply the STINE core as well as vatious logic elements and measurement circus actoss the board Supporting up to 4.54 is defintely overkill compared to the actual needs of the projec, this will be optimized inthe upcoming revision of the board ‘An D0 could have been used instead to reduce the BOM cost significantly and the ‘Stiiching noice atthe buck converter. However, stepping down a 2VDC ta 2:39 will generate a signitcant power loss (head, 3. Gate Driver + 3PH Inverter Bridge + RC Snubbers Ive decided to go for a Ti DRV6302 smart gate driver which Ive been using in other {designs and motor control ECUSs I costs only 3USS in the JKCPCB parts library, which is avery good value tor money as far as | know. ‘The ORVA3U2 qives us the basic hardware fault detection that wed! expect from a smart gate driver as well as internal 2x current sensing ep-amps with Viel/2 offset voltage bull-in. i's got a HW programmable deadtime, overcurtent detection, and. ‘op-amp gain tts also built-in buck converter that | could have used instead of what ve bull eatlier but rll do this optimization in the next revision | believe You can definitely use 2x simple half-bridge gate divers like the well-kncwm 1R2110. Iti cost you around 1USS"part which means youte already atthe same price point as 2 DRV8302 chip while youre slill missing current sensing amps, current offset ieurny, smart gate driver faut detection, and more ther features, At the OPS (output stage) of each inverter Ieg, youll find a couple of RE networks. ‘Those ate called snubber circuits that we typically use to protect the output drivers (MOSFETS) from the Inductive spikos that stem from switehing an inductive toad. (Motors, ‘The RC Snubber circuits init the inductive voltage spies that the inverters MOSFETs ‘experience while suitehing, The IRF7440 MOSFETs ate rated for 8 maximum VOS of, 40, so we need to make sure that it doesn't experience a higher voltage than this {during operation, 4, Phase Current Measurement (Dual Shunt) For the 3:phase current measurement, Ive decided to go for a dual shunt configuration, ts very easy to implement ia software and It doesnt cost very much in twins of harchvare needed, Here i a sumimatized comparison between all different configurations that you may encounter while studying this subject Triple Shunt: This is obviously the most expensive sokution among all while being. ‘the easiest to implement in software. The third shunt resistor is actualy recundant it youre going to cede the current reconctruction equation by yourself as rll demonstrate hereafter in the dual shunt method, Dual Shunt: This is the most balanced option among all in terms of cost andl ease of Implementation in software. You can easly read 2x phase currents using the dual ‘hunt configuration and reconstruct the third phase current using the equation (ly + vt hw= 0), ‘Single Shunt: This is obviousty the cheapest solution of al, However, its way more ‘complex to set up the ADC Wiggering to get the reading of the shunt resistors channel a the correct moment to get iy &iy then you can reconstruct the i phase ceurrent. It also forces you to complicate the SVM saitehing sequence in order to mntigate lind zones where PWM edges avetlap each othen. 5. BEMF (Back EMF Sensing) + PHV Measurement For sencorless FOC control, we need to measute the phase voltages & BEME. This can bee simply achieved by creating the 3x voltage divider networks shown in the schemiatic design below. However, the BEMF measurement is telative to the motors heutal point n many 3-phase motors, you may nat have access tothe W-line (only = wires UW, ‘Thats why we should algo construct the star network of resetore shown below in ‘order to create a virtual neutral point that can be usec to find the absolute BEM voltages and also for the BEM ZCD (zeto-cressing detection). BEMF (Phase Voltage) Measurement 47 835 7 a6 FOTO] “7 R36 RAT — TORT 7 OTOH] Ro Py Res py Ras 10x [] sor [tox 'by taking the vietual neuteal point and any floating phase voltage (BERAF and feeding both signals to a comparator, well end up having a back-EMF zero-crossing detect 6. ZCD (3x Zero-Crossing Detectors) As discusced In the previous section, well fed all 3x phase voltages & the virual reutral point to 3x comparators to achieve zero-crassing detection for the three phases’ BEMF, Which is crucial for BLDC’ six step commutation dive Ttiple BEMF ZCD (Zero~Crossing Detectors) vvseuiog) == TY po 3. SL nF Pi TE = CET vwszuneve| = TF ‘The 3x ZCD output digital signals will go to external interrupt pins on the STMB2Z64 microcontroller 7. DC Current Measurement ‘The OC current measurement is required to caleulate the input electric pewver which ‘can be useful for implementing software power-initing algorithms And it can be ‘ecremely useful in IPD (initial postion detection algorithms. IPD i Very important feature in many motor drive systems, so we need to have an accurate OC current measurement citcuit. Here's my design decision forthe DC current measurement. ve decided to use the RPP MOSFETs characteristic internal resistance (Rasen) aS & current sensos, ve connected the RFP MOSFET's diain and source pins to the dliferential amplifier showin below oe 2 a om ayoo oO

You might also like