{"id":2377,"date":"2024-03-06T04:58:09","date_gmt":"2024-03-06T04:58:09","guid":{"rendered":"https:\/\/blog.embeddedexpert.io\/?p=2377"},"modified":"2024-03-06T04:58:12","modified_gmt":"2024-03-06T04:58:12","slug":"working-with-stm32-and-motors-bldc-motors","status":"publish","type":"post","link":"https:\/\/blog.embeddedexpert.io\/?p=2377","title":{"rendered":"Working with STM32 and Motors: BLDC Motors"},"content":{"rendered":"\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"700\" height=\"700\" src=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/03\/1_ba6dcb37-c01b-4f67-b296-820dbb0f9d64.jpg.webp\" alt=\"\" class=\"wp-image-2378\" srcset=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/03\/1_ba6dcb37-c01b-4f67-b296-820dbb0f9d64.jpg.webp 700w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/03\/1_ba6dcb37-c01b-4f67-b296-820dbb0f9d64.jpg-300x300.webp 300w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/03\/1_ba6dcb37-c01b-4f67-b296-820dbb0f9d64.jpg-150x150.webp 150w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/03\/1_ba6dcb37-c01b-4f67-b296-820dbb0f9d64.jpg-400x400.webp 400w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/03\/1_ba6dcb37-c01b-4f67-b296-820dbb0f9d64.jpg-250x250.webp 250w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/><\/figure><\/div>\n\n\n\n<p><\/p>\n\n\n\n<p>In this guide, we shall take a look at BLDC and how to control the speed of the BLDC using STM32F4.<\/p>\n\n\n\n<p>In this guide, we shall cover the following:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>What is BLDC Motor.<\/li><li>Construction of the BLDC Motor and how it works.<\/li><li>Connection of the BLDC Motor with ESC and STM32.<\/li><li>Driver.<\/li><li>Results.<\/li><\/ul>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">1. What is BLDC Motor:<\/h2>\n\n\n\n<p>A&nbsp;<strong>Brushless DC motor (BLDC)<\/strong>, also known as an&nbsp;<strong>electronically commutated motor<\/strong>, is a type of synchronous motor that operates using a&nbsp;<strong>direct current (DC) electric power supply<\/strong>. Unlike traditional brushed DC motors, BLDC motors&nbsp;<strong>do not have brushes<\/strong>. Instead, they utilize an&nbsp;<strong>electronic controller<\/strong>&nbsp;to switch DC currents to the motor windings, creating&nbsp;<strong>magnetic fields<\/strong>&nbsp;that effectively rotate in space. The permanent magnet rotor then follows these magnetic fields.<\/p>\n\n\n\n<p>Here are some key points about BLDC motors:<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li><strong>Working Principle<\/strong>:<ul><li>BLDC motors use\u00a0<strong>electronic commutation<\/strong>to control the motor\u2019s speed and torque.<\/li><li>The controller adjusts the\u00a0<strong>phase and amplitude<\/strong>\u00a0of the DC current pulses to achieve precise control.<\/li><li>This electronic control system replaces the\u00a0<strong>mechanical commutator (brushes)<\/strong>\u00a0found in conventional electric motors.<\/li><\/ul><\/li><li><strong>Advantages of BLDC Motors<\/strong>:<ul><li><strong>High power-to-weight ratio<\/strong>: BLDC motors are lightweight and powerful.<\/li><li><strong>High speed<\/strong>: They can operate at high rotational speeds.<\/li><li><strong>Instantaneous control<\/strong>: BLDC motors respond quickly to changes in speed and torque.<\/li><li><strong>High efficiency<\/strong>: They minimize energy loss.<\/li><li><strong>Low maintenance<\/strong>: No brushes means less wear and tear.<\/li><\/ul><\/li><\/ol>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">2. Construction of BLDC Motor and How It Works:<\/h2>\n\n\n\n<p><\/p>\n\n\n\n<p>For detailed information about this, please check this youtube video:<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"Brushless DC Motor, How it works ?\" width=\"1170\" height=\"658\" src=\"https:\/\/www.youtube.com\/embed\/bCEiOnuODac?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">3. Connection of the BLDC and ESC with STM32:<\/h2>\n\n\n\n<p><\/p>\n\n\n\n<p>The connection as following:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"685\" src=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/03\/Screenshot-2024-03-06-at-7.03.40\u202fAM-1024x685.png\" alt=\"\" class=\"wp-image-2379\" srcset=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/03\/Screenshot-2024-03-06-at-7.03.40\u202fAM-1024x685.png 1024w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/03\/Screenshot-2024-03-06-at-7.03.40\u202fAM-300x201.png 300w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/03\/Screenshot-2024-03-06-at-7.03.40\u202fAM-768x514.png 768w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/03\/Screenshot-2024-03-06-at-7.03.40\u202fAM-1536x1028.png 1536w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/03\/Screenshot-2024-03-06-at-7.03.40\u202fAM-2048x1370.png 2048w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/03\/Screenshot-2024-03-06-at-7.03.40\u202fAM-1150x769.png 1150w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/03\/Screenshot-2024-03-06-at-7.03.40\u202fAM-750x502.png 750w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/03\/Screenshot-2024-03-06-at-7.03.40\u202fAM-400x268.png 400w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/03\/Screenshot-2024-03-06-at-7.03.40\u202fAM-250x167.png 250w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>When connecting the BLDC to ESC, make sure that the middle wire of BLDC is connected to the middle wire of the ESC. The other two can be connected in any direction. However, this will effect the rotation of the BLDC.<\/p>\n\n\n\n<p>The connection of control pins as following:<\/p>\n\n\n\n<figure class=\"wp-block-table is-style-stripes\"><table><tbody><tr><td>ESC<\/td><td>STM32F4xx<\/td><\/tr><tr><td>PWM (Orange)<\/td><td>PA0<\/td><\/tr><tr><td>GND (Brown)<\/td><td>GND<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>Note: The red wire (5V) will provide 5V in case you want to power the MCU from external 5V power supply.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">4. Developing the Drivers:<\/h2>\n\n\n\n<p><\/p>\n\n\n\n<p>Since this type of ESC requires standard 50Hz PWM signal with length of 1 to 2ms to control the speed, which is similar to servo signal which already developed driver for it <a href=\"https:\/\/blog.embeddedexpert.io\/?p=2363\" data-type=\"URL\" data-id=\"https:\/\/blog.embeddedexpert.io\/?p=2363\" target=\"_blank\" rel=\"noreferrer noopener\">here<\/a>.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>We start off by creating new source and header file with name of bldc.c and bldc.h respectively.<\/p>\n\n\n\n<p>Within the header file, include the header guard as following:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-csrc&quot;,&quot;theme&quot;:&quot;dracula&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;C&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;c&quot;}\">#ifndef BLDC_H_\n#define BLDC_H_\n\n\n\n\n\n#endif \/* BLDC_H_ *\/<\/pre><\/div>\n\n\n\n<p>Include stdint library:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-csrc&quot;,&quot;theme&quot;:&quot;dracula&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;C&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;c&quot;}\">#include &quot;stdint.h&quot;<\/pre><\/div>\n\n\n\n<p>Declare the following functions:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-csrc&quot;,&quot;theme&quot;:&quot;dracula&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;C&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;c&quot;}\">\/* @Brief This function shall initial GPIOA Pin 0 to control the BLDC motor\n * @Param Nothing\n * @Return Nothing\n * *\/\nvoid BLDC_Pin_Init(void);\n\n\/* @Brief This function shall initial TIM2 of STM32F4 to generate 50Hz PWM signal\n * @Param freq which is the bus frequency that connected to TIM2 in MHz\n * @Return Nothing\n * *\/\nvoid BLDC_TIM2_Init(uint16_t freq);\n\n\n\/* @Brief This function shall set the speed of the BLDC motor\n * @Param speed in percentage\n * @Return nothing\n * *\/\nvoid BLDC_SetSpeed(uint8_t speed);\n\n\n\/* @Brief This function shall calibrate the ESC for the pulses\n * @Param nothing\n * @Return nothing\n * *\/\nvoid BLDC_Calibrate(void);<\/pre><\/div>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>For the source file:<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>Include the following header files<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-csrc&quot;,&quot;theme&quot;:&quot;dracula&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;C&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;c&quot;}\">#include &lt;bldc.h&gt;\n#include &quot;stm32f4xx.h&quot;\n#include &quot;delay.h&quot;<\/pre><\/div>\n\n\n\n<p>For the BLDC pin initialization:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-csrc&quot;,&quot;theme&quot;:&quot;dracula&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;C&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;c&quot;}\">void BLDC_Pin_Init(void)\n{\n\t#define TIM2_AF 0x01\n\t\/*Enable clock access to GPIOA*\/\n\tRCC-&gt;AHB1ENR|=RCC_AHB1ENR_GPIOAEN;\n\n\t\/*Set PA0 to alternate function*\/\n\tGPIOA-&gt;MODER|=GPIO_MODER_MODE0_1;\n\tGPIOA-&gt;MODER&amp;=~GPIO_MODER_MODE0_0;\n\n\t\/*Set the GPIO speed to maximum*\/\n\tGPIOA-&gt;OSPEEDR|=GPIO_OSPEEDER_OSPEEDR0;\n\n\t\/*Set which alternate function *\/\n\tGPIOA-&gt;AFR[0]|=(TIM2_AF&lt;&lt;GPIO_AFRL_AFSEL0_Pos);\n\n}<\/pre><\/div>\n\n\n\n<p>For the timer initialization:<\/p>\n\n\n\n<p><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-csrc&quot;,&quot;theme&quot;:&quot;dracula&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;C&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;c&quot;}\">void BLDC_TIM2_Init(uint16_t freq)\n{\n\t\/*Enable clock access to TIM2*\/\n\tRCC-&gt;APB1ENR|=RCC_APB1ENR_TIM2EN;\n\n\t\/*Set the PSC and ARR values*\/\n\tTIM2-&gt;PSC=freq-1;\n\tTIM2-&gt;ARR=20000-1;\n\n\t\/*Set TIM2_CH1 as PWM *\/\n\n\tTIM2-&gt;CCMR1|=TIM_CCMR1_OC1M_2|TIM_CCMR1_OC1M_1;\n\n\t\/*Enable TIM2_CH1*\/\n\tTIM2-&gt;CCER|=TIM_CCER_CC1E;\n\n\t\/*Set TIM2_CH1 to 1ms (1000)*\/\n\tTIM2-&gt;CCR1=0;\n\n\t\/*Enable TIM2*\/\n\n\tTIM2-&gt;CR1|=TIM_CR1_CEN;\n\n}<\/pre><\/div>\n\n\n\n<p><\/p>\n\n\n\n<p>So far, it is similar to the servo motor initialization.<\/p>\n\n\n\n<p>Now, we declare a static function that will convert the speed to duty cycle value as following:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-csrc&quot;,&quot;theme&quot;:&quot;dracula&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;C&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;c&quot;}\">\/* @Brief This function shall calculate the duty cycle according the required speed\n * @Param speed in percentage\n * @Return duty cycle for the required speed\n * *\/\n\nstatic long speedt_to_duty(uint8_t speed)\n{\n  return (10*speed +1000);\n}<\/pre><\/div>\n\n\n\n<p>For set speed function:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-csrc&quot;,&quot;theme&quot;:&quot;dracula&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;C&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;c&quot;}\">void BLDC_SetSpeed(uint8_t speed)\n{\n\tif (speed &gt;100){speed=100;}\n\n\t\/*Set the duty cycle according to the calculation*\/\n\tTIM2-&gt;CCR1=speedt_to_duty(speed);\n}<\/pre><\/div>\n\n\n\n<p>Some ESC has the ability to be calibrated for the signal, hence the function to calibrate the ESC as following:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-csrc&quot;,&quot;theme&quot;:&quot;dracula&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;C&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;c&quot;}\">void BLDC_Calibrate(void)\n{\n\tTIM2-&gt;CCR1=1000;\n\tdelay(3000);\n\tTIM2-&gt;CCR1=2000;\n\tdelay(3000);\n\tTIM2-&gt;CCR1=0;\n}<\/pre><\/div>\n\n\n\n<p>The steps as following:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Send the lowest required signal.<\/li><li>Wait for 3 seconds.<\/li><li>Send the maximum required signal.<\/li><li>Wait for 3 seconds.<\/li><li>set the duty cycle to 0.<\/li><\/ul>\n\n\n\n<p>In main.c file:<\/p>\n\n\n\n<p><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-csrc&quot;,&quot;theme&quot;:&quot;dracula&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;C&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;c&quot;}\">#include &lt;bldc.h&gt;\n#include &quot;delay.h&quot;\nint speed;\nint main(void)\n{\n\n\tBLDC_Pin_Init();\n\tBLDC_TIM2_Init(16);\n\tdelay_init(16000000);\n\tBLDC_Calibrate();\n\n\twhile(1)\n\t{\n\t\tfor (speed = 0; speed &lt;= 100; speed += 1)\n\t\t{\n\t\t\t\tBLDC_SetSpeed(speed);\n\t\t    delay(15);\n\t\t}\n\t\tdelay(500);\n\t\tfor (speed = 180; speed &gt;= 0; speed -= 1)\n\t\t{\n\t\t\t\tBLDC_SetSpeed(speed);\n\t\t    delay(15);\n\t\t}\n\t\tdelay(500);\n\n\n\n\t}\n\n}\n<\/pre><\/div>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">5. Results:<\/h2>\n\n\n\n<p><\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"BLDC Motor Interface with STM32\" width=\"1170\" height=\"658\" src=\"https:\/\/www.youtube.com\/embed\/U3vfrENsMOY?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>Happy coding \ud83d\ude42<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this guide, we shall take a look at BLDC and how to control the speed of the BLDC using STM32F4. In this guide, we shall cover the following: What is BLDC Motor. Construction of the BLDC Motor and how it works. Connection of the BLDC Motor with ESC and STM32. Driver. Results. 1. What [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,11,12],"tags":[],"class_list":["post-2377","post","type-post","status-publish","format-standard","hentry","category-embedded-systems","category-peripheral-drivers","category-stm32"],"_links":{"self":[{"href":"https:\/\/blog.embeddedexpert.io\/index.php?rest_route=\/wp\/v2\/posts\/2377"}],"collection":[{"href":"https:\/\/blog.embeddedexpert.io\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.embeddedexpert.io\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.embeddedexpert.io\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.embeddedexpert.io\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2377"}],"version-history":[{"count":1,"href":"https:\/\/blog.embeddedexpert.io\/index.php?rest_route=\/wp\/v2\/posts\/2377\/revisions"}],"predecessor-version":[{"id":2380,"href":"https:\/\/blog.embeddedexpert.io\/index.php?rest_route=\/wp\/v2\/posts\/2377\/revisions\/2380"}],"wp:attachment":[{"href":"https:\/\/blog.embeddedexpert.io\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2377"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.embeddedexpert.io\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2377"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.embeddedexpert.io\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2377"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}