{"id":1554,"date":"2021-04-02T12:29:15","date_gmt":"2021-04-02T12:29:15","guid":{"rendered":"https:\/\/imperix.com\/doc\/?p=1554"},"modified":"2026-04-16T09:11:59","modified_gmt":"2026-04-16T09:11:59","slug":"fpga-based-direct-torque-control","status":"publish","type":"post","link":"https:\/\/imperix.com\/doc\/implementation\/fpga-based-direct-torque-control","title":{"rendered":"FPGA-based Direct Torque Control using Vivado HLS"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 ez-toc-wrap-right-text counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/imperix.com\/doc\/implementation\/fpga-based-direct-torque-control\/#Suggested-prerequisites\" >Suggested prerequisites<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/imperix.com\/doc\/implementation\/fpga-based-direct-torque-control\/#Software-resources\" >Software resources<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/imperix.com\/doc\/implementation\/fpga-based-direct-torque-control\/#Design-choices\" >Design choices<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/imperix.com\/doc\/implementation\/fpga-based-direct-torque-control\/#HLS-C-code-implementation\" >HLS C code implementation<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/imperix.com\/doc\/implementation\/fpga-based-direct-torque-control\/#Vivado-HLS-testbench\" >Vivado HLS testbench<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/imperix.com\/doc\/implementation\/fpga-based-direct-torque-control\/#Observing-comparator-inputs\" >Observing comparator inputs<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/imperix.com\/doc\/implementation\/fpga-based-direct-torque-control\/#Verifying-PWM-signals\" >Verifying PWM signals<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/imperix.com\/doc\/implementation\/fpga-based-direct-torque-control\/#Deployment-of-the-Vivado-HLS-code-on-the-B-Box-RCP\" >Deployment of the Vivado HLS code on the B-Box RCP<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/imperix.com\/doc\/implementation\/fpga-based-direct-torque-control\/#Synthesis-result\" >Synthesis result<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/imperix.com\/doc\/implementation\/fpga-based-direct-torque-control\/#Integrating-the-Vivado-HLS-design-in-the-FPGA-firmware\" >Integrating the Vivado HLS design in the FPGA firmware<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/imperix.com\/doc\/implementation\/fpga-based-direct-torque-control\/#CPU-implementation-using-Simulink-blockset\" >CPU implementation (using Simulink blockset)<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/imperix.com\/doc\/implementation\/fpga-based-direct-torque-control\/#Experimental-results-of-the-Vivado-HLS-Direct-Torque-Control\" >Experimental results of the Vivado HLS Direct Torque Control<\/a><\/li><\/ul><\/nav><\/div>\n\n<p>This technical note presents an FPGA-based Direct Torque Control (DTC) of a PMSM motor using Vivado HLS, coupled with the possibility to customize the FPGA firmware of a B-Box. This approach increases the responsiveness of the DTC implementation presented in&nbsp;<a href=\"https:\/\/imperix.com\/doc\/example\/direct-torque-control\">AN004<\/a>&nbsp;by porting part of the control logic to the FPGA.<\/p>\n\n\n\n<p>Xilinx <a href=\"https:\/\/imperix.com\/doc\/help\/xilinx-vitis-hls\">Vivado High-Level Synthesis<\/a> (HLS) is a tool that transforms C code into an RTL implementation that can be synthesized for an FPGA. The two main benefits are:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>It greatly facilitates the implementation of complex algorithms, as the designer can work at a higher level of abstraction (C\/C++ code)<\/li>\n\n\n\n<li>It provides a higher system performance by offloading parts of the computations from the CPU to the FPGA and leverages the parallel architecture of the FPGA<\/li>\n<\/ul>\n\n\n\n<p>Another example of high-level synthesis is presented in&nbsp;<a href=\"https:\/\/imperix.com\/doc\/implementation\/fpga-based-hysteresis-controller-hdl-coder\">TN121<\/a>, which addresses automated HDL code generation using Matlab HDL Coder.<\/p>\n\n\n\n<div class=\"wp-block-simple-alerts-for-gutenberg-alert-boxes sab-alert sab-alert-info\" role=\"alert\">This example has been written before the release of the newest <em><a href=\"https:\/\/imperix.com\/doc\/help\/getting-started-with-fpga-control-development\">FPGA control template<\/a><\/em>, as such is does not implement the latest recommendations such as the use of AXI4-Stream interfaces.<\/div>\n\n\n\n<div class=\"wp-block-simple-alerts-for-gutenberg-alert-boxes sab-alert sab-alert-dark\" role=\"alert\">To find all FPGA-related notes, you can visit\u00a0<a href=\"https:\/\/imperix.com\/doc\/help\/fpga-development-on-imperix-controllers\">FPGA development homepage<\/a>.<\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-suggested-prerequisites\"><span class=\"ez-toc-section\" id=\"Suggested-prerequisites\"><\/span>Suggested prerequisites<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Information on how to set up the toolchain for the FPGA programming is available in the <a href=\"https:\/\/imperix.com\/doc\/help\/vivado-design-suite-installation\">Vivado Design Suite installation<\/a> page.<\/li>\n\n\n\n<li>Quick-start information on how to use the <em>sandbox<\/em> is provided in the <a href=\"https:\/\/imperix.com\/doc\/help\/getting-started-with-fpga-control-development\">getting started with FPGA<\/a> page.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-software-resources\"><span class=\"ez-toc-section\" id=\"Software-resources\"><\/span>Software resources<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<div class=\"wp-block-file\"><a href=\"https:\/\/cdn.imperix.com\/doc\/wp-content\/uploads\/2021\/04\/hls_dtc_project_2019.2.zip\">Direct_torque_control_HLS_project<\/a><a href=\"https:\/\/cdn.imperix.com\/doc\/wp-content\/uploads\/2021\/04\/hls_dtc_project_2019.2.zip\" class=\"wp-block-file__button wp-element-button\" download>Download<\/a><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-design-choices\"><span class=\"ez-toc-section\" id=\"Design-choices\"><\/span>Design choices<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>The DTC algorithm has been split into two parts:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>A <em>fast <\/em>part, implemented in the FPGA. This part requires a fast action to keep the torque and flux values within the hysteresis bounds. This corresponds to all the computations and logic resulting from the current measurements, which can be sampled at a high rate (typically 400 kHz).<\/li>\n\n\n\n<li>A <em>slow <\/em>part, implemented in the CPU and executed at the interrupt frequency (typically 40 kHz). This includes mainly the generation of the torque and flux references, which don\u2019t require to be updated as fast as the sampling of the currents, given that the mechanical dynamics are much slower than the electrical ones.<\/li>\n<\/ul>\n\n\n\n<p>The two parts are illustrated below:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"384\" src=\"https:\/\/imperix.com\/doc\/wp-content\/uploads\/2021\/04\/image-126-1024x384.png\" alt=\"Overall direct torque control algorithm with CPU and FPGA parts\" class=\"wp-image-2123\" srcset=\"https:\/\/imperix.com\/doc\/wp-content\/uploads\/2021\/04\/image-126-1024x384.png 1024w, https:\/\/imperix.com\/doc\/wp-content\/uploads\/2021\/04\/image-126-300x113.png 300w, https:\/\/imperix.com\/doc\/wp-content\/uploads\/2021\/04\/image-126-768x288.png 768w, https:\/\/imperix.com\/doc\/wp-content\/uploads\/2021\/04\/image-126-1536x576.png 1536w, https:\/\/imperix.com\/doc\/wp-content\/uploads\/2021\/04\/image-126-2048x768.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-hls-c-code-implementation\"><span class=\"ez-toc-section\" id=\"HLS-C-code-implementation\"><\/span>HLS C code implementation<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>The logic ported to the FPGA is illustrated in the figure below. The ports are intended to be interfaced to the imperix firmware IP as follow:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>adc_0<\/code>, <code>adc_1<\/code>, <code>adc_2<\/code>: connected to the <code>ADC<\/code> interface<\/li>\n\n\n\n<li><code>phi_alpha_r<\/code>, <code>phi_beta_r<\/code>, <code>Tem_ref<\/code>, <code>phi_ref<\/code>: connected to <code>SBO<\/code> registers (real-time registers)<\/li>\n\n\n\n<li><code>l<\/code>, <code>p<\/code>, <code>epsilon_Tem<\/code>, <code>epsilon_phi<\/code>: connected to <code>SBO<\/code> registers (configuration registers)<\/li>\n\n\n\n<li><code>pwm<\/code>: connected to <code>sb_pwm<\/code><\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"483\" src=\"https:\/\/imperix.com\/doc\/wp-content\/uploads\/2021\/04\/image-127-1024x483.png\" alt=\"FPGA logic of the direct torque control\" class=\"wp-image-2124\" title=\"Technical notes &gt; TN133: FPGA-based direct torque control using Vivado HLS &gt; DTC_HLS_LOGIC.png\" srcset=\"https:\/\/imperix.com\/doc\/wp-content\/uploads\/2021\/04\/image-127-1024x483.png 1024w, https:\/\/imperix.com\/doc\/wp-content\/uploads\/2021\/04\/image-127-300x142.png 300w, https:\/\/imperix.com\/doc\/wp-content\/uploads\/2021\/04\/image-127-768x362.png 768w, https:\/\/imperix.com\/doc\/wp-content\/uploads\/2021\/04\/image-127.png 1280w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>The logic above has been translated into HLS C code. To derive an efficient hardware implementation, the following choices have been made:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The inputs are 16-bit wide to be compatible with the <code>SBO<\/code> and <code>ADC<\/code> interfaces of the imperix IP<\/li>\n\n\n\n<li>The algorithm uses the ADC 16-bit results without applying any gain. This imposes to divide the setpoints coming from the CPU (Tem_ref, phi_ref, epsilon_Tem and epsilon_phi) by the gain that would have been applied to the ADC before sending them to the FPGA.<\/li>\n\n\n\n<li>The internal logic uses fixed-point arithmetic to be fast enough to handle the 250 MHz clock of the imperix IP and avoid the need to perform clock-domain crossing (CDC).<\/li>\n\n\n\n<li><code>Ld<\/code> ranges between 0.001 and 0.1. To convey its value to the FPGA using a 16-bit integer, the original value is multiplied by 2<sup>15<\/sup> from the CPU and re-divided by the same amount in the HLS implementation.<\/li>\n<\/ul>\n\n\n\n<p>HLS implementation source code:<\/p>\n\n\n<style>.kt-accordion-id1554_fe3d63-a2 .kt-accordion-inner-wrap{column-gap:var(--global-kb-gap-md, 2rem);row-gap:1px;}.kt-accordion-id1554_fe3d63-a2 .kt-accordion-panel-inner{border-top:2px solid transparent;border-right:2px solid transparent;border-bottom:2px solid transparent;border-left:2px solid transparent;border-top-left-radius:2px;border-top-right-radius:2px;border-bottom-right-radius:2px;border-bottom-left-radius:2px;background:#ffffff;padding-top:20px;padding-right:20px;padding-bottom:20px;padding-left:20px;}.kt-accordion-id1554_fe3d63-a2 > .kt-accordion-inner-wrap > .wp-block-kadence-pane > .kt-accordion-header-wrap > .kt-blocks-accordion-header{border-top:2px solid #f2f2f2;border-right:2px solid #f2f2f2;border-bottom:2px solid #f2f2f2;border-left:2px solid #f2f2f2;border-top-left-radius:2px;border-top-right-radius:2px;border-bottom-right-radius:2px;border-bottom-left-radius:2px;background:#ffffff;font-size:16px;line-height:24px;letter-spacing:0px;font-weight:bold;text-transform:none;color:var(--global-palette3, #1A202C);padding-top:12px;padding-right:10px;padding-bottom:8px;padding-left:16px;}.kt-accordion-id1554_fe3d63-a2:not( .kt-accodion-icon-style-basiccircle ):not( .kt-accodion-icon-style-xclosecircle ):not( .kt-accodion-icon-style-arrowcircle )  > .kt-accordion-inner-wrap > .wp-block-kadence-pane > .kt-accordion-header-wrap .kt-blocks-accordion-icon-trigger:after, .kt-accordion-id1554_fe3d63-a2:not( .kt-accodion-icon-style-basiccircle ):not( .kt-accodion-icon-style-xclosecircle ):not( .kt-accodion-icon-style-arrowcircle )  > .kt-accordion-inner-wrap > .wp-block-kadence-pane > .kt-accordion-header-wrap .kt-blocks-accordion-icon-trigger:before{background:var(--global-palette3, #1A202C);}.kt-accordion-id1554_fe3d63-a2:not( .kt-accodion-icon-style-basic ):not( .kt-accodion-icon-style-xclose ):not( .kt-accodion-icon-style-arrow ) .kt-blocks-accordion-icon-trigger{background:var(--global-palette3, #1A202C);}.kt-accordion-id1554_fe3d63-a2:not( .kt-accodion-icon-style-basic ):not( .kt-accodion-icon-style-xclose ):not( .kt-accodion-icon-style-arrow ) .kt-blocks-accordion-icon-trigger:after, .kt-accordion-id1554_fe3d63-a2:not( .kt-accodion-icon-style-basic ):not( .kt-accodion-icon-style-xclose ):not( .kt-accodion-icon-style-arrow ) .kt-blocks-accordion-icon-trigger:before{background:#ffffff;}.kt-accordion-id1554_fe3d63-a2 > .kt-accordion-inner-wrap > .wp-block-kadence-pane > .kt-accordion-header-wrap > .kt-blocks-accordion-header:hover, \n\t\t\t\tbody:not(.hide-focus-outline) .kt-accordion-id1554_fe3d63-a2 .kt-blocks-accordion-header:focus-visible{color:#444444;background:#ffffff;border-top:2px solid #eeeeee;border-right:2px solid #eeeeee;border-bottom:2px solid #eeeeee;border-left:2px solid #eeeeee;}.kt-accordion-id1554_fe3d63-a2:not( .kt-accodion-icon-style-basiccircle ):not( .kt-accodion-icon-style-xclosecircle ):not( .kt-accodion-icon-style-arrowcircle ) .kt-accordion-header-wrap .kt-blocks-accordion-header:hover .kt-blocks-accordion-icon-trigger:after, .kt-accordion-id1554_fe3d63-a2:not( .kt-accodion-icon-style-basiccircle ):not( .kt-accodion-icon-style-xclosecircle ):not( .kt-accodion-icon-style-arrowcircle ) .kt-accordion-header-wrap .kt-blocks-accordion-header:hover .kt-blocks-accordion-icon-trigger:before, body:not(.hide-focus-outline) .kt-accordion-id1554_fe3d63-a2:not( .kt-accodion-icon-style-basiccircle ):not( .kt-accodion-icon-style-xclosecircle ):not( .kt-accodion-icon-style-arrowcircle ) .kt-blocks-accordion--visible .kt-blocks-accordion-icon-trigger:after, body:not(.hide-focus-outline) .kt-accordion-id1554_fe3d63-a2:not( .kt-accodion-icon-style-basiccircle ):not( .kt-accodion-icon-style-xclosecircle ):not( .kt-accodion-icon-style-arrowcircle ) .kt-blocks-accordion-header:focus-visible .kt-blocks-accordion-icon-trigger:before{background:#444444;}.kt-accordion-id1554_fe3d63-a2:not( .kt-accodion-icon-style-basic ):not( .kt-accodion-icon-style-xclose ):not( .kt-accodion-icon-style-arrow ) .kt-accordion-header-wrap .kt-blocks-accordion-header:hover .kt-blocks-accordion-icon-trigger, body:not(.hide-focus-outline) .kt-accordion-id1554_fe3d63-a2:not( .kt-accodion-icon-style-basic ):not( .kt-accodion-icon-style-xclose ):not( .kt-accodion-icon-style-arrow ) .kt-accordion-header-wrap .kt-blocks-accordion-header:focus-visible .kt-blocks-accordion-icon-trigger{background:#444444;}.kt-accordion-id1554_fe3d63-a2:not( .kt-accodion-icon-style-basic ):not( .kt-accodion-icon-style-xclose ):not( .kt-accodion-icon-style-arrow ) .kt-accordion-header-wrap .kt-blocks-accordion-header:hover .kt-blocks-accordion-icon-trigger:after, .kt-accordion-id1554_fe3d63-a2:not( .kt-accodion-icon-style-basic ):not( .kt-accodion-icon-style-xclose ):not( .kt-accodion-icon-style-arrow ) .kt-accordion-header-wrap .kt-blocks-accordion-header:hover .kt-blocks-accordion-icon-trigger:before, body:not(.hide-focus-outline) .kt-accordion-id1554_fe3d63-a2:not( .kt-accodion-icon-style-basic ):not( .kt-accodion-icon-style-xclose ):not( .kt-accodion-icon-style-arrow ) .kt-accordion-header-wrap .kt-blocks-accordion-header:focus-visible .kt-blocks-accordion-icon-trigger:after, body:not(.hide-focus-outline) .kt-accordion-id1554_fe3d63-a2:not( .kt-accodion-icon-style-basic ):not( .kt-accodion-icon-style-xclose ):not( .kt-accodion-icon-style-arrow ) .kt-accordion-header-wrap .kt-blocks-accordion-header:focus-visible .kt-blocks-accordion-icon-trigger:before{background:#ffffff;}.kt-accordion-id1554_fe3d63-a2 .kt-accordion-header-wrap .kt-blocks-accordion-header:focus-visible,\n\t\t\t\t.kt-accordion-id1554_fe3d63-a2 > .kt-accordion-inner-wrap > .wp-block-kadence-pane > .kt-accordion-header-wrap > .kt-blocks-accordion-header.kt-accordion-panel-active{color:var(--global-palette3, #1A202C);background:var(--global-palette9, #ffffff);border-top:2px solid var(--global-palette6, #718096);border-right:2px solid var(--global-palette6, #718096);border-bottom:2px solid var(--global-palette6, #718096);border-left:2px solid var(--global-palette6, #718096);}.kt-accordion-id1554_fe3d63-a2:not( .kt-accodion-icon-style-basiccircle ):not( .kt-accodion-icon-style-xclosecircle ):not( .kt-accodion-icon-style-arrowcircle )  > .kt-accordion-inner-wrap > .wp-block-kadence-pane > .kt-accordion-header-wrap > .kt-blocks-accordion-header.kt-accordion-panel-active .kt-blocks-accordion-icon-trigger:after, .kt-accordion-id1554_fe3d63-a2:not( .kt-accodion-icon-style-basiccircle ):not( .kt-accodion-icon-style-xclosecircle ):not( .kt-accodion-icon-style-arrowcircle )  > .kt-accordion-inner-wrap > .wp-block-kadence-pane > .kt-accordion-header-wrap > .kt-blocks-accordion-header.kt-accordion-panel-active .kt-blocks-accordion-icon-trigger:before{background:var(--global-palette3, #1A202C);}.kt-accordion-id1554_fe3d63-a2:not( .kt-accodion-icon-style-basic ):not( .kt-accodion-icon-style-xclose ):not( .kt-accodion-icon-style-arrow ) .kt-blocks-accordion-header.kt-accordion-panel-active .kt-blocks-accordion-icon-trigger{background:var(--global-palette3, #1A202C);}.kt-accordion-id1554_fe3d63-a2:not( .kt-accodion-icon-style-basic ):not( .kt-accodion-icon-style-xclose ):not( .kt-accodion-icon-style-arrow ) .kt-blocks-accordion-header.kt-accordion-panel-active .kt-blocks-accordion-icon-trigger:after, .kt-accordion-id1554_fe3d63-a2:not( .kt-accodion-icon-style-basic ):not( .kt-accodion-icon-style-xclose ):not( .kt-accodion-icon-style-arrow ) .kt-blocks-accordion-header.kt-accordion-panel-active .kt-blocks-accordion-icon-trigger:before{background:var(--global-palette9, #ffffff);}@media all and (max-width: 1024px){.kt-accordion-id1554_fe3d63-a2 .kt-accordion-panel-inner{border-top:2px solid transparent;border-right:2px solid transparent;border-bottom:2px solid transparent;border-left:2px solid transparent;}}@media all and (max-width: 1024px){.kt-accordion-id1554_fe3d63-a2 > .kt-accordion-inner-wrap > .wp-block-kadence-pane > .kt-accordion-header-wrap > .kt-blocks-accordion-header{border-top:2px solid #f2f2f2;border-right:2px solid #f2f2f2;border-bottom:2px solid #f2f2f2;border-left:2px solid #f2f2f2;}}@media all and (max-width: 1024px){.kt-accordion-id1554_fe3d63-a2 > .kt-accordion-inner-wrap > .wp-block-kadence-pane > .kt-accordion-header-wrap > .kt-blocks-accordion-header:hover, \n\t\t\t\tbody:not(.hide-focus-outline) .kt-accordion-id1554_fe3d63-a2 .kt-blocks-accordion-header:focus-visible{border-top:2px solid #eeeeee;border-right:2px solid #eeeeee;border-bottom:2px solid #eeeeee;border-left:2px solid #eeeeee;}}@media all and (max-width: 1024px){.kt-accordion-id1554_fe3d63-a2 .kt-accordion-header-wrap .kt-blocks-accordion-header:focus-visible,\n\t\t\t\t.kt-accordion-id1554_fe3d63-a2 > .kt-accordion-inner-wrap > .wp-block-kadence-pane > .kt-accordion-header-wrap > .kt-blocks-accordion-header.kt-accordion-panel-active{border-top:2px solid var(--global-palette6, #718096);border-right:2px solid var(--global-palette6, #718096);border-bottom:2px solid var(--global-palette6, #718096);border-left:2px solid var(--global-palette6, #718096);}}@media all and (max-width: 767px){.kt-accordion-id1554_fe3d63-a2 .kt-accordion-inner-wrap{display:block;}.kt-accordion-id1554_fe3d63-a2 .kt-accordion-inner-wrap .kt-accordion-pane:not(:first-child){margin-top:1px;}.kt-accordion-id1554_fe3d63-a2 .kt-accordion-panel-inner{border-top:2px solid transparent;border-right:2px solid transparent;border-bottom:2px solid transparent;border-left:2px solid transparent;}.kt-accordion-id1554_fe3d63-a2 > .kt-accordion-inner-wrap > .wp-block-kadence-pane > .kt-accordion-header-wrap > .kt-blocks-accordion-header{border-top:2px solid #f2f2f2;border-right:2px solid #f2f2f2;border-bottom:2px solid #f2f2f2;border-left:2px solid #f2f2f2;}.kt-accordion-id1554_fe3d63-a2 > .kt-accordion-inner-wrap > .wp-block-kadence-pane > .kt-accordion-header-wrap > .kt-blocks-accordion-header:hover, \n\t\t\t\tbody:not(.hide-focus-outline) .kt-accordion-id1554_fe3d63-a2 .kt-blocks-accordion-header:focus-visible{border-top:2px solid #eeeeee;border-right:2px solid #eeeeee;border-bottom:2px solid #eeeeee;border-left:2px solid #eeeeee;}.kt-accordion-id1554_fe3d63-a2 .kt-accordion-header-wrap .kt-blocks-accordion-header:focus-visible,\n\t\t\t\t.kt-accordion-id1554_fe3d63-a2 > .kt-accordion-inner-wrap > .wp-block-kadence-pane > .kt-accordion-header-wrap > .kt-blocks-accordion-header.kt-accordion-panel-active{border-top:2px solid var(--global-palette6, #718096);border-right:2px solid var(--global-palette6, #718096);border-bottom:2px solid var(--global-palette6, #718096);border-left:2px solid var(--global-palette6, #718096);}}<\/style>\n<div class=\"wp-block-kadence-accordion alignnone\"><div class=\"kt-accordion-wrap kt-accordion-id1554_fe3d63-a2 kt-accordion-has-2-panes kt-active-pane-0 kt-accordion-block kt-pane-header-alignment-left kt-accodion-icon-style-arrow kt-accodion-icon-side-left\" style=\"max-width:none\"><div class=\"kt-accordion-inner-wrap\" data-allow-multiple-open=\"false\" data-start-open=\"none\">\n<div class=\"wp-block-kadence-pane kt-accordion-pane kt-accordion-pane-1 kt-pane1554_0e632d-07\"><div class=\"kt-accordion-header-wrap\"><button class=\"kt-blocks-accordion-header kt-acccordion-button-label-show\" type=\"button\"><span class=\"kt-blocks-accordion-title-wrap\"><span class=\"kt-blocks-accordion-title\">HLS C code of the DTC algorithm<\/span><\/span><span class=\"kt-blocks-accordion-icon-trigger\"><\/span><\/button><\/div><div class=\"kt-accordion-panel kt-accordion-panel-hidden\"><div class=\"kt-accordion-panel-inner\"><pre class=\"wp-block-code\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"C++\" data-shcb-language-slug=\"cpp\"><span><code class=\"hljs language-cpp\"><span class=\"hljs-meta\">#<span class=\"hljs-meta-keyword\">include<\/span> <span class=\"hljs-meta-string\">\"dtc.h\"<\/span><\/span>\n \n<span class=\"hljs-meta\">#<span class=\"hljs-meta-keyword\">define<\/span> ONE_OVER_SQRT_3 (d_t)0.577350269<\/span>\n<span class=\"hljs-meta\">#<span class=\"hljs-meta-keyword\">define<\/span> ONE_OVER_THREE (d_t)0.333333333<\/span>\n<span class=\"hljs-meta\">#<span class=\"hljs-meta-keyword\">define<\/span> TWO_OVER_THREE (d_t)0.66666666<\/span>\n \n<span class=\"hljs-function\"><span class=\"hljs-keyword\">void<\/span> <span class=\"hljs-title\">ComputeAbcToAlphaBeta<\/span><span class=\"hljs-params\">(<span class=\"hljs-keyword\">d_t<\/span> a, <span class=\"hljs-keyword\">d_t<\/span> b, <span class=\"hljs-keyword\">d_t<\/span> c, <span class=\"hljs-keyword\">d_t<\/span> &amp;alpha, <span class=\"hljs-keyword\">d_t<\/span> &amp;beta)<\/span><\/span>;\n \n<span class=\"hljs-function\"><span class=\"hljs-keyword\">void<\/span> <span class=\"hljs-title\">ComputeRectangularToPolar<\/span><span class=\"hljs-params\">(<span class=\"hljs-keyword\">d_t<\/span> x, <span class=\"hljs-keyword\">d_t<\/span> y, <span class=\"hljs-keyword\">d_t<\/span> &amp;r, <span class=\"hljs-keyword\">d_t<\/span> &amp;theta)<\/span><\/span>;\n \n<span class=\"hljs-function\"><span class=\"hljs-keyword\">d_t<\/span> <span class=\"hljs-title\">ComputeTorque<\/span><span class=\"hljs-params\">(<span class=\"hljs-keyword\">d_t<\/span> a, <span class=\"hljs-keyword\">d_t<\/span> b, <span class=\"hljs-keyword\">d_t<\/span> c, <span class=\"hljs-keyword\">d_t<\/span> d, <span class=\"hljs-keyword\">d_t<\/span> p)<\/span><\/span>;\n \n<span class=\"hljs-function\">ap_uint&lt;2&gt; <span class=\"hljs-title\">ComputeTemHystState<\/span><span class=\"hljs-params\">(ap_uint&lt;<span class=\"hljs-number\">2<\/span>&gt; previous_state, <span class=\"hljs-keyword\">d_t<\/span> Tem_s, <span class=\"hljs-keyword\">d_t<\/span> ref_Tem, <span class=\"hljs-keyword\">d_t<\/span> epsilon_Tem)<\/span><\/span>;\n \n<span class=\"hljs-function\">ap_uint&lt;1&gt; <span class=\"hljs-title\">ComputePhiHystState<\/span><span class=\"hljs-params\">(ap_uint&lt;<span class=\"hljs-number\">1<\/span>&gt; previous_state, <span class=\"hljs-keyword\">d_t<\/span> phi_s, <span class=\"hljs-keyword\">d_t<\/span> ref_phi, <span class=\"hljs-keyword\">d_t<\/span> epsilon_phi)<\/span><\/span>;\n \n<span class=\"hljs-function\">ap_uint&lt;3&gt; <span class=\"hljs-title\">ComputeSector<\/span><span class=\"hljs-params\">(<span class=\"hljs-keyword\">d_t<\/span> theta)<\/span><\/span>;\n \n<span class=\"hljs-keyword\">static<\/span> ap_uint&lt;<span class=\"hljs-number\">3<\/span>&gt; pwm_lut&#91;<span class=\"hljs-number\">2<\/span>]&#91;<span class=\"hljs-number\">3<\/span>]&#91;<span class=\"hljs-number\">6<\/span>] =\n{\n  {\n    {<span class=\"hljs-number\">0b100<\/span>, <span class=\"hljs-number\">0b101<\/span>, <span class=\"hljs-number\">0b001<\/span>, <span class=\"hljs-number\">0b011<\/span>, <span class=\"hljs-number\">0b010<\/span>, <span class=\"hljs-number\">0b110<\/span>},\n    {<span class=\"hljs-number\">0b000<\/span>, <span class=\"hljs-number\">0b111<\/span>, <span class=\"hljs-number\">0b000<\/span>, <span class=\"hljs-number\">0b111<\/span>, <span class=\"hljs-number\">0b000<\/span>, <span class=\"hljs-number\">0b111<\/span>},\n    {<span class=\"hljs-number\">0b010<\/span>, <span class=\"hljs-number\">0b110<\/span>, <span class=\"hljs-number\">0b100<\/span>, <span class=\"hljs-number\">0b101<\/span>, <span class=\"hljs-number\">0b001<\/span>, <span class=\"hljs-number\">0b011<\/span>}\n  },\n  {\n    {<span class=\"hljs-number\">0b101<\/span>, <span class=\"hljs-number\">0b001<\/span>, <span class=\"hljs-number\">0b011<\/span>, <span class=\"hljs-number\">0b010<\/span>, <span class=\"hljs-number\">0b110<\/span>, <span class=\"hljs-number\">0b100<\/span>},\n        {<span class=\"hljs-number\">0b111<\/span>, <span class=\"hljs-number\">0b000<\/span>, <span class=\"hljs-number\">0b111<\/span>, <span class=\"hljs-number\">0b000<\/span>, <span class=\"hljs-number\">0b111<\/span>, <span class=\"hljs-number\">0b000<\/span>},\n{<span class=\"hljs-number\">0b011<\/span>, <span class=\"hljs-number\">0b010<\/span>, <span class=\"hljs-number\">0b110<\/span>, <span class=\"hljs-number\">0b100<\/span>, <span class=\"hljs-number\">0b101<\/span>, <span class=\"hljs-number\">0b001<\/span>}\n  }  \n};\n \n<span class=\"hljs-meta\">#<span class=\"hljs-meta-keyword\">ifdef<\/span> TESTBENCH<\/span>\n<span class=\"hljs-function\">ap_uint&lt;3&gt; <span class=\"hljs-title\">dtc<\/span><span class=\"hljs-params\">(inputs &amp;ins, outputs &amp;outs)<\/span>\n<span class=\"hljs-meta\">#<span class=\"hljs-meta-keyword\">else<\/span><\/span>\nap_uint&lt;3&gt; <span class=\"hljs-title\">dtc<\/span><span class=\"hljs-params\">(inputs &amp;ins)<\/span>\n<span class=\"hljs-meta\">#<span class=\"hljs-meta-keyword\">endif<\/span><\/span>\n<\/span>{\n  <span class=\"hljs-keyword\">d_t<\/span> adc0 = ins.adc0 + ins.adc_offset0;\n  <span class=\"hljs-keyword\">d_t<\/span> adc1 = ins.adc1 + ins.adc_offset1;\n  <span class=\"hljs-keyword\">d_t<\/span> adc2 = ins.adc2 + ins.adc_offset2;\n \n  <span class=\"hljs-comment\">\/\/ ------------------------------------------------------------------------<\/span>\n \n  <span class=\"hljs-keyword\">d_t<\/span> i_alpha, i_beta;\n \n  ComputeAbcToAlphaBeta(ins.adc0, ins.adc1, ins.adc2, i_alpha, i_beta);\n \n  <span class=\"hljs-comment\">\/\/ ------------------------------------------------------------------------<\/span>\n \n  <span class=\"hljs-keyword\">d_t<\/span> Ld = ((ap_fixed&lt;W,I&gt;)ins.l \/ <span class=\"hljs-number\">32768<\/span>);\n   \n  <span class=\"hljs-keyword\">d_t<\/span> i_alpha_times_l = i_alpha * Ld;\n  <span class=\"hljs-keyword\">d_t<\/span> i_beta_times_l  = i_beta * Ld;\n   \n  <span class=\"hljs-keyword\">d_t<\/span> psi_alpha = i_alpha_times_l + ins.phi_alpha_r;\n  <span class=\"hljs-keyword\">d_t<\/span> psi_beta  = i_beta_times_l  + ins.phi_beta_r;\n \n  <span class=\"hljs-comment\">\/\/ ------------------------------------------------------------------------<\/span>\n   \n  <span class=\"hljs-keyword\">d_t<\/span> phi_s;\n  <span class=\"hljs-keyword\">d_t<\/span> theta_s;\n   \n  ComputeRectangularToPolar(psi_alpha, psi_beta, phi_s, theta_s);\n   \n  <span class=\"hljs-comment\">\/\/ ------------------------------------------------------------------------<\/span>\n   \n  <span class=\"hljs-keyword\">d_t<\/span> Tem_s;\n   \n  Tem_s = ComputeTorque(psi_alpha, psi_beta, i_alpha, i_beta, ins.p);\n   \n  <span class=\"hljs-comment\">\/\/ ------------------------------------------------------------------------<\/span>\n   \n  <span class=\"hljs-keyword\">static<\/span> ap_uint&lt;<span class=\"hljs-number\">2<\/span>&gt; Tem_hyst_state = <span class=\"hljs-number\">0<\/span>;\n   \n  Tem_hyst_state = ComputeTemHystState(Tem_hyst_state, Tem_s, ins.Tem_ref, ins.epsilon_Tem);\n   \n  <span class=\"hljs-comment\">\/\/ ------------------------------------------------------------------------<\/span>\n   \n  <span class=\"hljs-keyword\">static<\/span> ap_uint&lt;<span class=\"hljs-number\">1<\/span>&gt; phi_hyst_state = <span class=\"hljs-number\">0<\/span>;\n   \n  phi_hyst_state = ComputePhiHystState(phi_hyst_state, phi_s, ins.phi_ref, ins.epsilon_phi);\n   \n  <span class=\"hljs-comment\">\/\/ ------------------------------------------------------------------------<\/span>\n   \n  ap_uint&lt;<span class=\"hljs-number\">3<\/span>&gt; sector = ComputeSector(theta_s);\n   \n  <span class=\"hljs-comment\">\/\/ ------------------------------------------------------------------------<\/span>\n   \n<span class=\"hljs-meta\">#<span class=\"hljs-meta-keyword\">ifdef<\/span> TESTBENCH<\/span>\n \n  outs.debug_i_alpha = i_alpha;\n  outs.debug_i_beta = i_beta;\n  outs.debug_psi_alpha = psi_alpha;\n  outs.debug_psi_beta = psi_beta;\n  outs.debug_phi_s = phi_s;\n  outs.debug_theta_s = theta_s * <span class=\"hljs-number\">8<\/span>;\n  outs.debug_Tem_s = Tem_s;\n  outs.debug_TemHystState = Tem_hyst_state;\n  outs.debug_PhiHystState = phi_hyst_state;\n  outs.debug_sector = sector;\n \n<span class=\"hljs-meta\">#<span class=\"hljs-meta-keyword\">endif<\/span><\/span>\n \n \n  <span class=\"hljs-comment\">\/\/ ------------------------------------------------------------------------<\/span>\n \n  <span class=\"hljs-keyword\">return<\/span> pwm_lut&#91;phi_hyst_state]&#91;Tem_hyst_state]&#91;sector];\n}\n \n<span class=\"hljs-function\"><span class=\"hljs-keyword\">void<\/span> <span class=\"hljs-title\">ComputeAbcToAlphaBeta<\/span><span class=\"hljs-params\">(<span class=\"hljs-keyword\">d_t<\/span> a, <span class=\"hljs-keyword\">d_t<\/span> b, <span class=\"hljs-keyword\">d_t<\/span> c, <span class=\"hljs-keyword\">d_t<\/span> &amp;alpha, <span class=\"hljs-keyword\">d_t<\/span> &amp;beta)<\/span>\n<\/span>{\n  alpha = a*ONE_OVER_THREE - b*TWO_OVER_THREE - c*TWO_OVER_THREE;\n  beta  = (b - c)*ONE_OVER_SQRT_3;\n}\n \n<span class=\"hljs-function\"><span class=\"hljs-keyword\">void<\/span> <span class=\"hljs-title\">ComputeRectangularToPolar<\/span><span class=\"hljs-params\">(<span class=\"hljs-keyword\">d_t<\/span> x, <span class=\"hljs-keyword\">d_t<\/span> y, <span class=\"hljs-keyword\">d_t<\/span> &amp;r, <span class=\"hljs-keyword\">d_t<\/span> &amp;theta)<\/span>\n<\/span>{\n  ap_fixed&lt;W*<span class=\"hljs-number\">2<\/span>,I*<span class=\"hljs-number\">2<\/span>, AP_TRN, AP_SAT&gt; x_squared = x*x;\n  ap_fixed&lt;W*<span class=\"hljs-number\">2<\/span>,I*<span class=\"hljs-number\">2<\/span>, AP_TRN, AP_SAT&gt; y_squared = y*y;\n   \n  r = hls::<span class=\"hljs-built_in\">sqrt<\/span>((ap_fixed&lt;<span class=\"hljs-number\">64<\/span>,<span class=\"hljs-number\">32<\/span>&gt;)(x_squared + y_squared));\n   \n  <span class=\"hljs-meta\">#<span class=\"hljs-meta-keyword\">pragma<\/span> HLS PIPELINE<\/span>\n  theta = hls::<span class=\"hljs-built_in\">atan2<\/span>((ap_fixed&lt;W,I&gt;)y, (ap_fixed&lt;W,I&gt;)x);\n}\n \n<span class=\"hljs-function\"><span class=\"hljs-keyword\">d_t<\/span> <span class=\"hljs-title\">ComputeTorque<\/span><span class=\"hljs-params\">(<span class=\"hljs-keyword\">d_t<\/span> a, <span class=\"hljs-keyword\">d_t<\/span> b, <span class=\"hljs-keyword\">d_t<\/span> c, <span class=\"hljs-keyword\">d_t<\/span> d, <span class=\"hljs-keyword\">d_t<\/span> p)<\/span>\n<\/span>{\n  ap_fixed&lt;W*<span class=\"hljs-number\">2<\/span>, I*<span class=\"hljs-number\">2<\/span>&gt; a_times_d = a*d;\n  ap_fixed&lt;W*<span class=\"hljs-number\">2<\/span>, I*<span class=\"hljs-number\">2<\/span>&gt; b_times_c = b*c;\n   \n  ap_fixed&lt;W, I&gt; temp = (ap_fixed&lt;W*<span class=\"hljs-number\">2<\/span>, I*<span class=\"hljs-number\">2<\/span>&gt;)(a_times_d - b_times_c) \/ <span class=\"hljs-number\">4096<\/span>;\n   \n  <span class=\"hljs-keyword\">return<\/span> (<span class=\"hljs-keyword\">d_t<\/span>)(<span class=\"hljs-number\">1.5<\/span>) * p * temp;\n}\n \n<span class=\"hljs-function\">ap_uint&lt;2&gt; <span class=\"hljs-title\">ComputeTemHystState<\/span><span class=\"hljs-params\">(ap_uint&lt;<span class=\"hljs-number\">2<\/span>&gt; previous_state, <span class=\"hljs-keyword\">d_t<\/span> Tem_s, <span class=\"hljs-keyword\">d_t<\/span> ref_Tem, <span class=\"hljs-keyword\">d_t<\/span> epsilon_Tem)<\/span>\n<\/span>{\n  <span class=\"hljs-keyword\">d_t<\/span> ref_Tem_minus_Tem_s = ref_Tem - Tem_s;\n   \n  <span class=\"hljs-keyword\">if<\/span>(previous_state == <span class=\"hljs-number\">0<\/span>)\n  {\n    <span class=\"hljs-keyword\">if<\/span>(ref_Tem_minus_Tem_s &gt;  epsilon_Tem)\n    {\n      <span class=\"hljs-keyword\">return<\/span> <span class=\"hljs-number\">2<\/span>;\n    }\n    <span class=\"hljs-keyword\">else<\/span> <span class=\"hljs-keyword\">if<\/span>(ref_Tem_minus_Tem_s &gt;  <span class=\"hljs-number\">0<\/span>)\n    {\n      <span class=\"hljs-keyword\">return<\/span> <span class=\"hljs-number\">1<\/span>;\n    }\n  }\n  <span class=\"hljs-keyword\">else<\/span> <span class=\"hljs-keyword\">if<\/span>(previous_state == <span class=\"hljs-number\">1<\/span>)\n  {\n    <span class=\"hljs-keyword\">if<\/span>(ref_Tem_minus_Tem_s &gt;  epsilon_Tem)\n    {\n      <span class=\"hljs-keyword\">return<\/span> <span class=\"hljs-number\">2<\/span>;\n    }\n    <span class=\"hljs-keyword\">else<\/span> <span class=\"hljs-keyword\">if<\/span>(ref_Tem_minus_Tem_s &lt; - epsilon_Tem)\n    {\n      <span class=\"hljs-keyword\">return<\/span> <span class=\"hljs-number\">0<\/span>;\n    }\n  }\n  <span class=\"hljs-keyword\">else<\/span>\n  {\n    <span class=\"hljs-keyword\">if<\/span>(ref_Tem_minus_Tem_s &lt; - epsilon_Tem)\n    {\n      <span class=\"hljs-keyword\">return<\/span> <span class=\"hljs-number\">0<\/span>;\n    }\n    <span class=\"hljs-keyword\">else<\/span> <span class=\"hljs-keyword\">if<\/span>(ref_Tem_minus_Tem_s &lt; <span class=\"hljs-number\">0<\/span>)\n    {\n      <span class=\"hljs-keyword\">return<\/span> <span class=\"hljs-number\">1<\/span>;\n    }\n  }\n \n  <span class=\"hljs-keyword\">return<\/span> previous_state;\n}\n \n<span class=\"hljs-function\">ap_uint&lt;1&gt; <span class=\"hljs-title\">ComputePhiHystState<\/span><span class=\"hljs-params\">(ap_uint&lt;<span class=\"hljs-number\">1<\/span>&gt; previous_state, <span class=\"hljs-keyword\">d_t<\/span> phi_s, <span class=\"hljs-keyword\">d_t<\/span> ref_phi, <span class=\"hljs-keyword\">d_t<\/span> epsilon_phi)<\/span>\n<\/span>{\n  <span class=\"hljs-keyword\">d_t<\/span> ref_phi_minus_phi_s = ref_phi - phi_s;\n \n  <span class=\"hljs-keyword\">if<\/span>(previous_state == <span class=\"hljs-number\">0<\/span>)\n  {\n    <span class=\"hljs-keyword\">if<\/span>(ref_phi_minus_phi_s &gt;  epsilon_phi)\n    {\n      <span class=\"hljs-keyword\">return<\/span> <span class=\"hljs-number\">1<\/span>;\n    }\n  }\n  <span class=\"hljs-keyword\">else<\/span>\n  {\n    <span class=\"hljs-keyword\">if<\/span>(ref_phi_minus_phi_s &lt; - epsilon_phi)\n    {\n      <span class=\"hljs-keyword\">return<\/span> <span class=\"hljs-number\">0<\/span>;\n    }\n  }\n \n  <span class=\"hljs-keyword\">return<\/span> previous_state;\n}\n \n<span class=\"hljs-function\">ap_uint&lt;3&gt; <span class=\"hljs-title\">ComputeSector<\/span><span class=\"hljs-params\">(<span class=\"hljs-keyword\">d_t<\/span> theta)<\/span>\n<\/span>{\n  <span class=\"hljs-keyword\">if<\/span>(theta &lt; <span class=\"hljs-number\">0<\/span>)\n    theta += (<span class=\"hljs-keyword\">d_t<\/span>)PI_FIXED * (<span class=\"hljs-keyword\">d_t<\/span>)<span class=\"hljs-number\">2<\/span>;\n   \n  <span class=\"hljs-keyword\">if<\/span>(theta &lt; (<span class=\"hljs-keyword\">d_t<\/span>)PI_FIXED\/(<span class=\"hljs-keyword\">d_t<\/span>)<span class=\"hljs-number\">6<\/span>)\n    <span class=\"hljs-keyword\">return<\/span> <span class=\"hljs-number\">0<\/span>;\n  <span class=\"hljs-keyword\">else<\/span> <span class=\"hljs-keyword\">if<\/span>(theta &lt; (<span class=\"hljs-keyword\">d_t<\/span>)PI_FIXED\/(<span class=\"hljs-keyword\">d_t<\/span>)<span class=\"hljs-number\">2<\/span>)\n    <span class=\"hljs-keyword\">return<\/span> <span class=\"hljs-number\">1<\/span>;\n  <span class=\"hljs-keyword\">else<\/span> <span class=\"hljs-keyword\">if<\/span>(theta &lt; (<span class=\"hljs-keyword\">d_t<\/span>)<span class=\"hljs-number\">5<\/span>*(<span class=\"hljs-keyword\">d_t<\/span>)PI_FIXED\/(<span class=\"hljs-keyword\">d_t<\/span>)<span class=\"hljs-number\">6<\/span>)\n    <span class=\"hljs-keyword\">return<\/span> <span class=\"hljs-number\">2<\/span>;\n  <span class=\"hljs-keyword\">else<\/span> <span class=\"hljs-keyword\">if<\/span>(theta &lt; (<span class=\"hljs-keyword\">d_t<\/span>)<span class=\"hljs-number\">7<\/span>*(<span class=\"hljs-keyword\">d_t<\/span>)PI_FIXED\/(<span class=\"hljs-keyword\">d_t<\/span>)<span class=\"hljs-number\">6<\/span>)\n    <span class=\"hljs-keyword\">return<\/span> <span class=\"hljs-number\">3<\/span>;\n  <span class=\"hljs-keyword\">else<\/span> <span class=\"hljs-keyword\">if<\/span>(theta &lt; (<span class=\"hljs-keyword\">d_t<\/span>)<span class=\"hljs-number\">3<\/span>*(<span class=\"hljs-keyword\">d_t<\/span>)PI_FIXED\/(<span class=\"hljs-keyword\">d_t<\/span>)<span class=\"hljs-number\">2<\/span>)\n    <span class=\"hljs-keyword\">return<\/span> <span class=\"hljs-number\">4<\/span>;\n  <span class=\"hljs-keyword\">else<\/span> <span class=\"hljs-keyword\">if<\/span>(theta &lt; (<span class=\"hljs-keyword\">d_t<\/span>)<span class=\"hljs-number\">11<\/span>*(<span class=\"hljs-keyword\">d_t<\/span>)PI_FIXED\/(<span class=\"hljs-keyword\">d_t<\/span>)<span class=\"hljs-number\">6<\/span>)\n    <span class=\"hljs-keyword\">return<\/span> <span class=\"hljs-number\">5<\/span>;\n  <span class=\"hljs-keyword\">else<\/span> <span class=\"hljs-keyword\">if<\/span>(theta &lt; (<span class=\"hljs-keyword\">d_t<\/span>)<span class=\"hljs-number\">2<\/span>*(<span class=\"hljs-keyword\">d_t<\/span>)PI_FIXED)\n    <span class=\"hljs-keyword\">return<\/span> <span class=\"hljs-number\">0<\/span>;\n   \n  <span class=\"hljs-keyword\">return<\/span> <span class=\"hljs-number\">0<\/span>;\n}<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">C++<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">cpp<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre><\/div><\/div><\/div>\n<\/div><\/div><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-vivado-hls-testbench\"><span class=\"ez-toc-section\" id=\"Vivado-HLS-testbench\"><\/span>Vivado HLS testbench<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Vivado HLS provides a C\/C++ simulator to validate designs. As illustrated in the figure below, a test bench has been developed to compare the PWM signals of the HLS fixed-point implementation against a floating-point model which is algorithmically equivalent to the Simulink implementation presented in&nbsp;<a href=\"https:\/\/imperix.com\/doc\/example\/direct-torque-control\">AN004<\/a>.<\/p>\n\n\n<div class=\"wp-block-image is-resized\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"656\" src=\"https:\/\/imperix.com\/doc\/wp-content\/uploads\/2021\/04\/image-128-1024x656.png\" alt=\"FPGA-based direct torque control testbench description\" class=\"wp-image-2125\" srcset=\"https:\/\/imperix.com\/doc\/wp-content\/uploads\/2021\/04\/image-128-1024x656.png 1024w, https:\/\/imperix.com\/doc\/wp-content\/uploads\/2021\/04\/image-128-300x192.png 300w, https:\/\/imperix.com\/doc\/wp-content\/uploads\/2021\/04\/image-128-768x492.png 768w, https:\/\/imperix.com\/doc\/wp-content\/uploads\/2021\/04\/image-128-1536x984.png 1536w, https:\/\/imperix.com\/doc\/wp-content\/uploads\/2021\/04\/image-128-2048x1312.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<\/div>\n\n\n<p>The test bench uses the following input signals:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Three-phase currents <code>I_a<\/code>, <code>I_b<\/code> and <code>I_c<\/code>: sinusoidal signals with a frequency of 1 kHz and an amplitude of 5 A. The signals are divided by ADC_GAIN to obtain 16-bit values representing the results of the ADCs.<\/li>\n\n\n\n<li>Rotor flux angle <code>theta_r<\/code>: a sawtooth with a frequency of 400 Hz and an amplitude of \u03c0.<\/li>\n<\/ul>\n\n\n\n<p>The estimated torque will be sinusoidal, with a frequency of 1 kHz &#8211; 400 Hz = 600 Hz, as verified later.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"900\" height=\"300\" src=\"https:\/\/imperix.com\/doc\/wp-content\/uploads\/2021\/04\/image-129.png\" alt=\"DTC testbench input signals\" class=\"wp-image-2126\" title=\"Technical notes &gt; TN133: FPGA-based direct torque control using Vivado HLS &gt; hls_input.png\" srcset=\"https:\/\/imperix.com\/doc\/wp-content\/uploads\/2021\/04\/image-129.png 900w, https:\/\/imperix.com\/doc\/wp-content\/uploads\/2021\/04\/image-129-300x100.png 300w, https:\/\/imperix.com\/doc\/wp-content\/uploads\/2021\/04\/image-129-768x256.png 768w\" sizes=\"auto, (max-width: 900px) 100vw, 900px\" \/><\/figure>\n\n\n\n<p>The following values are set to the other inputs:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><th><strong>input<\/strong><\/th><th><strong>C implementation<\/strong><\/th><th><strong>HLS implementation<\/strong><\/th><\/tr><tr><td>Ld<\/td><td>0.0243<\/td><td>0.0243 * 32768<\/td><\/tr><tr><td>p<\/td><td>3<\/td><td>3<\/td><\/tr><tr><td>Tem_ref<\/td><td>1<\/td><td>1 \/ ADC_GAIN<\/td><\/tr><tr><td>phi_ref<\/td><td>0.3<\/td><td>0.3 \/ ADC_GAIN<\/td><\/tr><tr><td>epsilon_Tem<\/td><td>0.095<\/td><td>0.095 \/ ADC_GAIN<\/td><\/tr><tr><td>epsilon_phi<\/td><td>0.005<\/td><td>0.005 \/ ADC_GAIN<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-observing-comparator-inputs\"><span class=\"ez-toc-section\" id=\"Observing-comparator-inputs\"><\/span>Observing comparator inputs<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Various intermediate signals are extracted and saved in CSV files. This allows for the easy plotting of the simulation results for visual verification, which greatly helps during the design phase. The estimator outputs (torque, flux and flux angle) are shown below. The zoomed graphs show the approximation stemming from the use of fixed-point arithmetic. These small differences sometimes lead to a hysteresis state difference between the two implementations when a signal is close to a comparator limit.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"900\" height=\"300\" src=\"https:\/\/imperix.com\/doc\/wp-content\/uploads\/2021\/04\/image-130.png\" alt=\"Testbench results for motor torque\" class=\"wp-image-2127\" srcset=\"https:\/\/imperix.com\/doc\/wp-content\/uploads\/2021\/04\/image-130.png 900w, https:\/\/imperix.com\/doc\/wp-content\/uploads\/2021\/04\/image-130-300x100.png 300w, https:\/\/imperix.com\/doc\/wp-content\/uploads\/2021\/04\/image-130-768x256.png 768w\" sizes=\"auto, (max-width: 900px) 100vw, 900px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"900\" height=\"300\" src=\"https:\/\/imperix.com\/doc\/wp-content\/uploads\/2021\/04\/image-131.png\" alt=\"Testbench results for motor flux\" class=\"wp-image-2128\" title=\"Technical notes &gt; TN133: FPGA-based direct torque control using Vivado HLS &gt; hls_phi_s.png\" srcset=\"https:\/\/imperix.com\/doc\/wp-content\/uploads\/2021\/04\/image-131.png 900w, https:\/\/imperix.com\/doc\/wp-content\/uploads\/2021\/04\/image-131-300x100.png 300w, https:\/\/imperix.com\/doc\/wp-content\/uploads\/2021\/04\/image-131-768x256.png 768w\" sizes=\"auto, (max-width: 900px) 100vw, 900px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"900\" height=\"300\" src=\"https:\/\/imperix.com\/doc\/wp-content\/uploads\/2021\/04\/image-132.png\" alt=\"Testbench results for motor flux angle\" class=\"wp-image-2129\" title=\"Technical notes &gt; TN133: FPGA-based direct torque control using Vivado HLS &gt; hls_theta_s.png\" srcset=\"https:\/\/imperix.com\/doc\/wp-content\/uploads\/2021\/04\/image-132.png 900w, https:\/\/imperix.com\/doc\/wp-content\/uploads\/2021\/04\/image-132-300x100.png 300w, https:\/\/imperix.com\/doc\/wp-content\/uploads\/2021\/04\/image-132-768x256.png 768w\" sizes=\"auto, (max-width: 900px) 100vw, 900px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-verifying-pwm-signals\"><span class=\"ez-toc-section\" id=\"Verifying-PWM-signals\"><\/span>Verifying PWM signals<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Due to the approximation mentioned in the last section, we expect and tolerate that the PWM signals have a one-period difference. With this in mind, the following self-test mechanism has been implemented:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-2\" data-shcb-language-name=\"C++\" data-shcb-language-slug=\"cpp\"><span><code class=\"hljs language-cpp\"><span class=\"hljs-keyword\">for<\/span> (<span class=\"hljs-keyword\">int<\/span> i = <span class=\"hljs-number\">0<\/span>; i &lt; ITERATIONS; i++)\n{\n \n  <span class=\"hljs-comment\">\/\/ ... some code<\/span>\n   \n  <span class=\"hljs-keyword\">int<\/span> pwm_float = dtc_float(tb_ins_float, tb_outs_float);\n   \n  <span class=\"hljs-comment\">\/\/ ... some code<\/span>\n   \n  <span class=\"hljs-keyword\">int<\/span> pwm_dut = dtc(tb_ins,tb_outs);\n \n  <span class=\"hljs-keyword\">if<\/span>((pwm_dut != pwm_float))\n  {\n    diffs++;\n    <span class=\"hljs-built_in\">printf<\/span>(<span class=\"hljs-string\">\"diff #%d at i = %d\\n\"<\/span>, diffs, i);\n \n    <span class=\"hljs-comment\">\/\/ error if PWM are different for two iterations<\/span>\n    <span class=\"hljs-keyword\">if<\/span>(last_diff){\n      errors++;\n      <span class=\"hljs-built_in\">printf<\/span>(<span class=\"hljs-string\">\"error #%d at i = %d\\n\"<\/span>, errors, i);\n    }\n    last_diff = <span class=\"hljs-number\">1<\/span>;\n  }\n  <span class=\"hljs-keyword\">else<\/span>\n  {\n    last_diff = <span class=\"hljs-number\">0<\/span>;\n  }\n}\n \n<span class=\"hljs-keyword\">if<\/span> (errors &gt; <span class=\"hljs-number\">0<\/span>)\n  <span class=\"hljs-built_in\">printf<\/span>(<span class=\"hljs-string\">\"------ Test failed ------\\n\"<\/span>);\n<span class=\"hljs-keyword\">else<\/span>\n  <span class=\"hljs-built_in\">printf<\/span>(<span class=\"hljs-string\">\"------ Test passed ------\\n\"<\/span>);\n   \n<span class=\"hljs-built_in\">printf<\/span>(<span class=\"hljs-string\">\"Iterations: %d\\n\"<\/span>, ITERATIONS);\n<span class=\"hljs-built_in\">printf<\/span>(<span class=\"hljs-string\">\"Differences: %d\\n\"<\/span>, diffs);\n<span class=\"hljs-built_in\">printf<\/span>(<span class=\"hljs-string\">\"Errors: %d\\n\"<\/span>, errors);<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-2\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">C++<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">cpp<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>The resulting output below confirms that the C++ and HLS implementation produce identical PWM outputs:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-3\" data-shcb-language-name=\"VHDL\" data-shcb-language-slug=\"vhdl\"><span><code class=\"hljs language-vhdl\"><span class=\"hljs-comment\">------ Test passed ------ <\/span>\nIterations: <span class=\"hljs-number\">1000000<\/span> \nDifferences: <span class=\"hljs-number\">1376<\/span> \nErrors: <span class=\"hljs-number\">0<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-3\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">VHDL<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">vhdl<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h2 class=\"wp-block-heading\" id=\"h-deployment-of-the-vivado-hls-code-on-the-b-box-rcp\"><span class=\"ez-toc-section\" id=\"Deployment-of-the-Vivado-HLS-code-on-the-B-Box-RCP\"><\/span>Deployment of the Vivado HLS code on the B-Box RCP<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-synthesis-result\"><span class=\"ez-toc-section\" id=\"Synthesis-result\"><\/span>Synthesis result<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>The HLS synthesis report shown below indicates that the latency of the module is 0.436 \u00b5s, which is more than <strong>13 times faster than the CPU-based implementation<\/strong>. It also predicts that the design can run at a clock frequency of 250 MHz.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"872\" height=\"519\" src=\"https:\/\/imperix.com\/doc\/wp-content\/uploads\/2021\/04\/image-133.png\" alt=\"HLS synthesis report of the DTC implementation\" class=\"wp-image-2131\" srcset=\"https:\/\/imperix.com\/doc\/wp-content\/uploads\/2021\/04\/image-133.png 872w, https:\/\/imperix.com\/doc\/wp-content\/uploads\/2021\/04\/image-133-300x179.png 300w, https:\/\/imperix.com\/doc\/wp-content\/uploads\/2021\/04\/image-133-768x457.png 768w\" sizes=\"auto, (max-width: 872px) 100vw, 872px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-integrating-the-vivado-hls-design-in-the-fpga-firmware\"><span class=\"ez-toc-section\" id=\"Integrating-the-Vivado-HLS-design-in-the-FPGA-firmware\"><\/span>Integrating the Vivado HLS design in the FPGA firmware<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>The IP generated from Vivado HLS is instantiated in a sandbox environment. Details on how to edit the firmware of the B-Box are given in\u00a0<a href=\"https:\/\/imperix.com\/doc\/help\/editing-the-fpga-firmware-using-the-sandbox\">PN116<\/a>. Instructions on how to set up the development environment are given in\u00a0<a href=\"https:\/\/imperix.com\/doc\/help\/getting-started-with-fpga-control-development\">PN159<\/a>.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"562\" src=\"https:\/\/imperix.com\/doc\/wp-content\/uploads\/2021\/04\/image-134-1024x562.png\" alt=\"Interfacing of the FPGA-based DTC and imperix IP\" class=\"wp-image-2132\" srcset=\"https:\/\/imperix.com\/doc\/wp-content\/uploads\/2021\/04\/image-134-1024x562.png 1024w, https:\/\/imperix.com\/doc\/wp-content\/uploads\/2021\/04\/image-134-300x165.png 300w, https:\/\/imperix.com\/doc\/wp-content\/uploads\/2021\/04\/image-134-768x421.png 768w, https:\/\/imperix.com\/doc\/wp-content\/uploads\/2021\/04\/image-134-1536x843.png 1536w, https:\/\/imperix.com\/doc\/wp-content\/uploads\/2021\/04\/image-134.png 1602w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Two simple VHDL modules have been created for the design to comply with the bock-level interface protocol defined in Vivado Design Suite User Guide <a href=\"https:\/\/www.xilinx.com\/support\/documentation\/sw_manuals\/xilinx2019_2\/ug902-vivado-high-level-synthesis.pdf\">UG902<\/a>.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"582\" height=\"395\" src=\"https:\/\/imperix.com\/doc\/wp-content\/uploads\/2021\/04\/image-135.png\" alt=\"Illustration of the VHDL module\" class=\"wp-image-2133\" srcset=\"https:\/\/imperix.com\/doc\/wp-content\/uploads\/2021\/04\/image-135.png 582w, https:\/\/imperix.com\/doc\/wp-content\/uploads\/2021\/04\/image-135-300x204.png 300w\" sizes=\"auto, (max-width: 582px) 100vw, 582px\" \/><\/figure>\n<\/div>\n\n\n<p>The <code>HLS_start.vhd<\/code> module asserts the <code>ap_start<\/code> signal when an <code>adc_done_pulse<\/code> is detected and clear it when <code>ap_done<\/code> is asserted.<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-4\" data-shcb-language-name=\"VHDL\" data-shcb-language-slug=\"vhdl\"><span><code class=\"hljs language-vhdl\">MY_PROCESS : <span class=\"hljs-keyword\">process<\/span>(clk_250_mhz)\n<span class=\"hljs-keyword\">begin<\/span>\n  <span class=\"hljs-keyword\">if<\/span> rising_edge(clk_250_mhz) <span class=\"hljs-keyword\">then<\/span>\n    <span class=\"hljs-keyword\">if<\/span> adc_done_pulse = <span class=\"hljs-string\">'1'<\/span> <span class=\"hljs-keyword\">and<\/span> ap_idle = <span class=\"hljs-string\">'1'<\/span> <span class=\"hljs-keyword\">then<\/span>\n      i_reg_ap_start &lt;= <span class=\"hljs-string\">'1'<\/span>;\n    <span class=\"hljs-keyword\">end<\/span> <span class=\"hljs-keyword\">if<\/span>;\n    <span class=\"hljs-keyword\">if<\/span> ap_done = <span class=\"hljs-string\">'1'<\/span> <span class=\"hljs-keyword\">then<\/span>\n      i_reg_ap_start &lt;= <span class=\"hljs-string\">'0'<\/span>;\n    <span class=\"hljs-keyword\">end<\/span> <span class=\"hljs-keyword\">if<\/span>;\n  <span class=\"hljs-keyword\">end<\/span> <span class=\"hljs-keyword\">if<\/span>;\n<span class=\"hljs-keyword\">end<\/span> <span class=\"hljs-keyword\">process<\/span> MY_PROCESS;\n \nap_start &lt;= i_reg_ap_start;<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-4\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">VHDL<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">vhdl<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>The <code>HLS_output.vhd<\/code> module samples the HLS IP <code>pwm<\/code> output when <code>ap_done<\/code> is asserted and apply them to the appropriate sb_pwm input.<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-5\" data-shcb-language-name=\"VHDL\" data-shcb-language-slug=\"vhdl\"><span><code class=\"hljs language-vhdl\">MY_PROCESS : <span class=\"hljs-keyword\">process<\/span>(clk_250_mhz)\n<span class=\"hljs-keyword\">begin<\/span>\n  <span class=\"hljs-keyword\">if<\/span> rising_edge(clk_250_mhz) <span class=\"hljs-keyword\">then<\/span>\n    <span class=\"hljs-keyword\">if<\/span> ap_done = <span class=\"hljs-string\">'1'<\/span> <span class=\"hljs-keyword\">then<\/span>\n      i_reg_pwm(<span class=\"hljs-number\">0<\/span>) &lt;= pwm_in(<span class=\"hljs-number\">0<\/span>);\n      i_reg_pwm(<span class=\"hljs-number\">2<\/span>) &lt;= pwm_in(<span class=\"hljs-number\">1<\/span>);\n      i_reg_pwm(<span class=\"hljs-number\">4<\/span>) &lt;= pwm_in(<span class=\"hljs-number\">2<\/span>);\n    <span class=\"hljs-keyword\">end<\/span> <span class=\"hljs-keyword\">if<\/span>;\n  <span class=\"hljs-keyword\">end<\/span> <span class=\"hljs-keyword\">if<\/span>;\n<span class=\"hljs-keyword\">end<\/span> <span class=\"hljs-keyword\">process<\/span> MY_PROCESS;\n     \npwm_out &lt;= i_reg_pwm;<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-5\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">VHDL<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">vhdl<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h2 class=\"wp-block-heading\" id=\"h-cpu-implementation-using-simulink-blockset\"><span class=\"ez-toc-section\" id=\"CPU-implementation-using-Simulink-blockset\"><\/span>CPU implementation (using Simulink blockset)<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>The following configuration is used:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>SBO register 00: <code>phi_alpha_r<\/code> (real-time register)<\/li>\n\n\n\n<li>SBO register 01: <code>phi_beta_r<\/code> (real-time register)<\/li>\n\n\n\n<li>SBO register 02: <code>Tem_ref<\/code> (real-time register)<\/li>\n\n\n\n<li>SBO register 03: <code>phi_ref<\/code> (real-time register)<\/li>\n\n\n\n<li>SBO register 04: <code>l<\/code> (configuration register)<\/li>\n\n\n\n<li>SBO register 05 <code>p<\/code> (configuration register)<\/li>\n\n\n\n<li>SBO register 06: <code>epsilon_Tem<\/code> (configuration register)<\/li>\n\n\n\n<li>SBO register 07: <code>epsilon_phi<\/code> (configuration register)<\/li>\n\n\n\n<li>SB_PWM: PWM channels 0 to 2 configured with dual outputs with a 1 \u00b5s dead time<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"559\" src=\"https:\/\/imperix.com\/doc\/wp-content\/uploads\/2021\/04\/image-136-1024x559.png\" alt=\"CPU implementation of the direct torque control algorithm, using Simulink\" class=\"wp-image-2134\" title=\"Technical notes &gt; TN133: FPGA-based direct torque control using Vivado HLS &gt; hls_dtc_simulink.png\" srcset=\"https:\/\/imperix.com\/doc\/wp-content\/uploads\/2021\/04\/image-136-1024x559.png 1024w, https:\/\/imperix.com\/doc\/wp-content\/uploads\/2021\/04\/image-136-300x164.png 300w, https:\/\/imperix.com\/doc\/wp-content\/uploads\/2021\/04\/image-136-768x419.png 768w, https:\/\/imperix.com\/doc\/wp-content\/uploads\/2021\/04\/image-136.png 1231w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>The PWM output configuration is the following:<\/p>\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"533\" height=\"679\" src=\"https:\/\/cdn.imperix.com\/doc\/wp-content\/uploads\/2021\/04\/image-99.png\" alt=\"Configuration dialog of the Sandbox PWM outputs\" class=\"wp-image-2067\" srcset=\"https:\/\/imperix.com\/doc\/wp-content\/uploads\/2021\/04\/image-99.png 533w, https:\/\/imperix.com\/doc\/wp-content\/uploads\/2021\/04\/image-99-235x300.png 235w\" sizes=\"auto, (max-width: 533px) 100vw, 533px\" \/><\/figure>\n<\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"418\" height=\"714\" src=\"https:\/\/imperix.com\/doc\/wp-content\/uploads\/2021\/04\/image-100-1.png\" alt=\"\" class=\"wp-image-38095\" srcset=\"https:\/\/imperix.com\/doc\/wp-content\/uploads\/2021\/04\/image-100-1.png 418w, https:\/\/imperix.com\/doc\/wp-content\/uploads\/2021\/04\/image-100-1-176x300.png 176w\" sizes=\"auto, (max-width: 418px) 100vw, 418px\" \/><\/figure>\n<\/div>\n<\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-experimental-results-of-the-vivado-hls-direct-torque-control\"><span class=\"ez-toc-section\" id=\"Experimental-results-of-the-Vivado-HLS-Direct-Torque-Control\"><\/span>Experimental results of the Vivado HLS Direct Torque Control<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>The FPGA-based approach has been implemented on a B-Box controller and compared with the CPU-based implementation. The setup is the same as in <a href=\"https:\/\/imperix.com\/doc\/example\/direct-torque-control\">AN004<\/a>.<\/p>\n\n\n\n<p>The following graphs show a significant reduction of the torque and flux ripples thanks to the shorter control delay enabled by the FPGA-based implementation.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"300\" src=\"https:\/\/imperix.com\/doc\/wp-content\/uploads\/2021\/04\/image-137.png\" alt=\"Motor torque experimental results of the FPGA-based direct torque control\" class=\"wp-image-2135\" title=\"Technical notes &gt; TN133: FPGA-based direct torque control using Vivado HLS &gt; torque-hysteresis-bands.png\" srcset=\"https:\/\/imperix.com\/doc\/wp-content\/uploads\/2021\/04\/image-137.png 800w, https:\/\/imperix.com\/doc\/wp-content\/uploads\/2021\/04\/image-137-300x113.png 300w, https:\/\/imperix.com\/doc\/wp-content\/uploads\/2021\/04\/image-137-768x288.png 768w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"300\" src=\"https:\/\/imperix.com\/doc\/wp-content\/uploads\/2021\/04\/image-138.png\" alt=\"Motor flux experimental results of the FPGA-based direct torque control\" class=\"wp-image-2136\" title=\"Technical notes &gt; TN133: FPGA-based direct torque control using Vivado HLS &gt; flux-hysteresis-bands.png\" srcset=\"https:\/\/imperix.com\/doc\/wp-content\/uploads\/2021\/04\/image-138.png 800w, https:\/\/imperix.com\/doc\/wp-content\/uploads\/2021\/04\/image-138-300x113.png 300w, https:\/\/imperix.com\/doc\/wp-content\/uploads\/2021\/04\/image-138-768x288.png 768w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/figure>\n\n\n\n<div class=\"wp-block-simple-alerts-for-gutenberg-alert-boxes sab-alert sab-alert-dark\" role=\"alert\">Back to\u00a0<a href=\"https:\/\/imperix.com\/doc\/help\/fpga-development-on-imperix-controllers\">FPGA development homepage<\/a><\/div>\n","protected":false},"excerpt":{"rendered":"<p>This technical note presents an FPGA-based Direct Torque Control (DTC) of a PMSM motor using Vivado HLS, coupled with the possibility to customize the FPGA&#8230;<\/p>\n","protected":false},"author":4,"featured_media":3055,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","footnotes":""},"categories":[4],"tags":[17,18],"software-environments":[106,103],"provided-results":[108,107],"related-products":[50,32,92,166,51,110],"guidedreadings":[],"tutorials":[131],"user-manuals":[],"coauthors":[70],"class_list":["post-1554","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-implementation","tag-fpga-programming","tag-motor-drives","software-environments-fpga","software-environments-matlab","provided-results-experimental","provided-results-simulation","related-products-acg-sdk","related-products-b-box-rcp","related-products-b-box-micro","related-products-b-box-rcp-3-0","related-products-cpp-sdk","related-products-tpi","tutorials-direct-torque-control-of-a-permanent-magnet-synchronous-motor"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>FPGA-based Direct Torque Control using Vivado HLS - imperix<\/title>\n<meta name=\"description\" content=\"This note presents an FPGA-based Direct Torque Control of an electric motor using Vivado HLS and the customizable FPGA firmware of the B-Box.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/imperix.com\/doc\/implementation\/fpga-based-direct-torque-control\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"FPGA-based Direct Torque Control using Vivado HLS - imperix\" \/>\n<meta property=\"og:description\" content=\"This note presents an FPGA-based Direct Torque Control of an electric motor using Vivado HLS and the customizable FPGA firmware of the B-Box.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/imperix.com\/doc\/implementation\/fpga-based-direct-torque-control\" \/>\n<meta property=\"og:site_name\" content=\"imperix\" \/>\n<meta property=\"article:published_time\" content=\"2021-04-02T12:29:15+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-04-16T09:11:59+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/imperix.com\/doc\/wp-content\/uploads\/2021\/04\/3_2_ratio_TN133.png\" \/>\n\t<meta property=\"og:image:width\" content=\"450\" \/>\n\t<meta property=\"og:image:height\" content=\"300\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Beno\u00eet Steinmann\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Beno\u00eet Steinmann\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"9 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/imperix.com\\\/doc\\\/implementation\\\/fpga-based-direct-torque-control#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/imperix.com\\\/doc\\\/implementation\\\/fpga-based-direct-torque-control\"},\"author\":{\"name\":\"Beno\u00eet Steinmann\",\"@id\":\"https:\\\/\\\/imperix.com\\\/doc\\\/#\\\/schema\\\/person\\\/a69a3bda75b05d0923cc76d7268cc94f\"},\"headline\":\"FPGA-based Direct Torque Control using Vivado HLS\",\"datePublished\":\"2021-04-02T12:29:15+00:00\",\"dateModified\":\"2026-04-16T09:11:59+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/imperix.com\\\/doc\\\/implementation\\\/fpga-based-direct-torque-control\"},\"wordCount\":1133,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/imperix.com\\\/doc\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/imperix.com\\\/doc\\\/implementation\\\/fpga-based-direct-torque-control#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/imperix.com\\\/doc\\\/wp-content\\\/uploads\\\/2021\\\/04\\\/3_2_ratio_TN133.png\",\"keywords\":[\"FPGA programming\",\"Motor drives\"],\"articleSection\":[\"Technical notes\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/imperix.com\\\/doc\\\/implementation\\\/fpga-based-direct-torque-control#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/imperix.com\\\/doc\\\/implementation\\\/fpga-based-direct-torque-control\",\"url\":\"https:\\\/\\\/imperix.com\\\/doc\\\/implementation\\\/fpga-based-direct-torque-control\",\"name\":\"FPGA-based Direct Torque Control using Vivado HLS - imperix\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/imperix.com\\\/doc\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/imperix.com\\\/doc\\\/implementation\\\/fpga-based-direct-torque-control#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/imperix.com\\\/doc\\\/implementation\\\/fpga-based-direct-torque-control#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/imperix.com\\\/doc\\\/wp-content\\\/uploads\\\/2021\\\/04\\\/3_2_ratio_TN133.png\",\"datePublished\":\"2021-04-02T12:29:15+00:00\",\"dateModified\":\"2026-04-16T09:11:59+00:00\",\"description\":\"This note presents an FPGA-based Direct Torque Control of an electric motor using Vivado HLS and the customizable FPGA firmware of the B-Box.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/imperix.com\\\/doc\\\/implementation\\\/fpga-based-direct-torque-control#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/imperix.com\\\/doc\\\/implementation\\\/fpga-based-direct-torque-control\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/imperix.com\\\/doc\\\/implementation\\\/fpga-based-direct-torque-control#primaryimage\",\"url\":\"https:\\\/\\\/imperix.com\\\/doc\\\/wp-content\\\/uploads\\\/2021\\\/04\\\/3_2_ratio_TN133.png\",\"contentUrl\":\"https:\\\/\\\/imperix.com\\\/doc\\\/wp-content\\\/uploads\\\/2021\\\/04\\\/3_2_ratio_TN133.png\",\"width\":450,\"height\":300,\"caption\":\"FPGA logic of the direct torque control\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/imperix.com\\\/doc\\\/implementation\\\/fpga-based-direct-torque-control#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Knowledge base\",\"item\":\"https:\\\/\\\/imperix.com\\\/doc\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Technical notes\",\"item\":\"https:\\\/\\\/imperix.com\\\/doc\\\/category\\\/implementation\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"FPGA-based Direct Torque Control using Vivado HLS\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/imperix.com\\\/doc\\\/#website\",\"url\":\"https:\\\/\\\/imperix.com\\\/doc\\\/\",\"name\":\"imperix\",\"description\":\"power electronics\",\"publisher\":{\"@id\":\"https:\\\/\\\/imperix.com\\\/doc\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/imperix.com\\\/doc\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/imperix.com\\\/doc\\\/#organization\",\"name\":\"imperix\",\"url\":\"https:\\\/\\\/imperix.com\\\/doc\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/imperix.com\\\/doc\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/imperix.com\\\/doc\\\/wp-content\\\/uploads\\\/2021\\\/03\\\/imperix_logo.png\",\"contentUrl\":\"https:\\\/\\\/imperix.com\\\/doc\\\/wp-content\\\/uploads\\\/2021\\\/03\\\/imperix_logo.png\",\"width\":350,\"height\":120,\"caption\":\"imperix\"},\"image\":{\"@id\":\"https:\\\/\\\/imperix.com\\\/doc\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/imperix.com\\\/doc\\\/#\\\/schema\\\/person\\\/a69a3bda75b05d0923cc76d7268cc94f\",\"name\":\"Beno\u00eet Steinmann\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/22a9252907f853f91d07b143dfcc84f6ec0cc31f6b72408b503a7026eed5b109?s=96&d=mm&r=g3b3f3d8e66019ebcb2848094940b98c0\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/22a9252907f853f91d07b143dfcc84f6ec0cc31f6b72408b503a7026eed5b109?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/22a9252907f853f91d07b143dfcc84f6ec0cc31f6b72408b503a7026eed5b109?s=96&d=mm&r=g\",\"caption\":\"Beno\u00eet Steinmann\"},\"description\":\"Benoit is an embedded systems expert and the leader of software and firmware developments at imperix. On the knowledge base, he is the author of numerous software reference documents.\",\"sameAs\":[\"https:\\\/\\\/www.linkedin.com\\\/in\\\/benoit-steinmann\\\/\"],\"url\":\"https:\\\/\\\/imperix.com\\\/doc\\\/author\\\/steinmann\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"FPGA-based Direct Torque Control using Vivado HLS - imperix","description":"This note presents an FPGA-based Direct Torque Control of an electric motor using Vivado HLS and the customizable FPGA firmware of the B-Box.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/imperix.com\/doc\/implementation\/fpga-based-direct-torque-control","og_locale":"en_US","og_type":"article","og_title":"FPGA-based Direct Torque Control using Vivado HLS - imperix","og_description":"This note presents an FPGA-based Direct Torque Control of an electric motor using Vivado HLS and the customizable FPGA firmware of the B-Box.","og_url":"https:\/\/imperix.com\/doc\/implementation\/fpga-based-direct-torque-control","og_site_name":"imperix","article_published_time":"2021-04-02T12:29:15+00:00","article_modified_time":"2026-04-16T09:11:59+00:00","og_image":[{"width":450,"height":300,"url":"https:\/\/imperix.com\/doc\/wp-content\/uploads\/2021\/04\/3_2_ratio_TN133.png","type":"image\/png"}],"author":"Beno\u00eet Steinmann","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Beno\u00eet Steinmann","Est. reading time":"9 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/imperix.com\/doc\/implementation\/fpga-based-direct-torque-control#article","isPartOf":{"@id":"https:\/\/imperix.com\/doc\/implementation\/fpga-based-direct-torque-control"},"author":{"name":"Beno\u00eet Steinmann","@id":"https:\/\/imperix.com\/doc\/#\/schema\/person\/a69a3bda75b05d0923cc76d7268cc94f"},"headline":"FPGA-based Direct Torque Control using Vivado HLS","datePublished":"2021-04-02T12:29:15+00:00","dateModified":"2026-04-16T09:11:59+00:00","mainEntityOfPage":{"@id":"https:\/\/imperix.com\/doc\/implementation\/fpga-based-direct-torque-control"},"wordCount":1133,"commentCount":0,"publisher":{"@id":"https:\/\/imperix.com\/doc\/#organization"},"image":{"@id":"https:\/\/imperix.com\/doc\/implementation\/fpga-based-direct-torque-control#primaryimage"},"thumbnailUrl":"https:\/\/imperix.com\/doc\/wp-content\/uploads\/2021\/04\/3_2_ratio_TN133.png","keywords":["FPGA programming","Motor drives"],"articleSection":["Technical notes"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/imperix.com\/doc\/implementation\/fpga-based-direct-torque-control#respond"]}]},{"@type":"WebPage","@id":"https:\/\/imperix.com\/doc\/implementation\/fpga-based-direct-torque-control","url":"https:\/\/imperix.com\/doc\/implementation\/fpga-based-direct-torque-control","name":"FPGA-based Direct Torque Control using Vivado HLS - imperix","isPartOf":{"@id":"https:\/\/imperix.com\/doc\/#website"},"primaryImageOfPage":{"@id":"https:\/\/imperix.com\/doc\/implementation\/fpga-based-direct-torque-control#primaryimage"},"image":{"@id":"https:\/\/imperix.com\/doc\/implementation\/fpga-based-direct-torque-control#primaryimage"},"thumbnailUrl":"https:\/\/imperix.com\/doc\/wp-content\/uploads\/2021\/04\/3_2_ratio_TN133.png","datePublished":"2021-04-02T12:29:15+00:00","dateModified":"2026-04-16T09:11:59+00:00","description":"This note presents an FPGA-based Direct Torque Control of an electric motor using Vivado HLS and the customizable FPGA firmware of the B-Box.","breadcrumb":{"@id":"https:\/\/imperix.com\/doc\/implementation\/fpga-based-direct-torque-control#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/imperix.com\/doc\/implementation\/fpga-based-direct-torque-control"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/imperix.com\/doc\/implementation\/fpga-based-direct-torque-control#primaryimage","url":"https:\/\/imperix.com\/doc\/wp-content\/uploads\/2021\/04\/3_2_ratio_TN133.png","contentUrl":"https:\/\/imperix.com\/doc\/wp-content\/uploads\/2021\/04\/3_2_ratio_TN133.png","width":450,"height":300,"caption":"FPGA logic of the direct torque control"},{"@type":"BreadcrumbList","@id":"https:\/\/imperix.com\/doc\/implementation\/fpga-based-direct-torque-control#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Knowledge base","item":"https:\/\/imperix.com\/doc\/"},{"@type":"ListItem","position":2,"name":"Technical notes","item":"https:\/\/imperix.com\/doc\/category\/implementation"},{"@type":"ListItem","position":3,"name":"FPGA-based Direct Torque Control using Vivado HLS"}]},{"@type":"WebSite","@id":"https:\/\/imperix.com\/doc\/#website","url":"https:\/\/imperix.com\/doc\/","name":"imperix","description":"power electronics","publisher":{"@id":"https:\/\/imperix.com\/doc\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/imperix.com\/doc\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/imperix.com\/doc\/#organization","name":"imperix","url":"https:\/\/imperix.com\/doc\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/imperix.com\/doc\/#\/schema\/logo\/image\/","url":"https:\/\/imperix.com\/doc\/wp-content\/uploads\/2021\/03\/imperix_logo.png","contentUrl":"https:\/\/imperix.com\/doc\/wp-content\/uploads\/2021\/03\/imperix_logo.png","width":350,"height":120,"caption":"imperix"},"image":{"@id":"https:\/\/imperix.com\/doc\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/imperix.com\/doc\/#\/schema\/person\/a69a3bda75b05d0923cc76d7268cc94f","name":"Beno\u00eet Steinmann","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/22a9252907f853f91d07b143dfcc84f6ec0cc31f6b72408b503a7026eed5b109?s=96&d=mm&r=g3b3f3d8e66019ebcb2848094940b98c0","url":"https:\/\/secure.gravatar.com\/avatar\/22a9252907f853f91d07b143dfcc84f6ec0cc31f6b72408b503a7026eed5b109?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/22a9252907f853f91d07b143dfcc84f6ec0cc31f6b72408b503a7026eed5b109?s=96&d=mm&r=g","caption":"Beno\u00eet Steinmann"},"description":"Benoit is an embedded systems expert and the leader of software and firmware developments at imperix. On the knowledge base, he is the author of numerous software reference documents.","sameAs":["https:\/\/www.linkedin.com\/in\/benoit-steinmann\/"],"url":"https:\/\/imperix.com\/doc\/author\/steinmann"}]}},"_links":{"self":[{"href":"https:\/\/imperix.com\/doc\/wp-json\/wp\/v2\/posts\/1554","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/imperix.com\/doc\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/imperix.com\/doc\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/imperix.com\/doc\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/imperix.com\/doc\/wp-json\/wp\/v2\/comments?post=1554"}],"version-history":[{"count":27,"href":"https:\/\/imperix.com\/doc\/wp-json\/wp\/v2\/posts\/1554\/revisions"}],"predecessor-version":[{"id":45299,"href":"https:\/\/imperix.com\/doc\/wp-json\/wp\/v2\/posts\/1554\/revisions\/45299"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/imperix.com\/doc\/wp-json\/wp\/v2\/media\/3055"}],"wp:attachment":[{"href":"https:\/\/imperix.com\/doc\/wp-json\/wp\/v2\/media?parent=1554"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/imperix.com\/doc\/wp-json\/wp\/v2\/categories?post=1554"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/imperix.com\/doc\/wp-json\/wp\/v2\/tags?post=1554"},{"taxonomy":"software-environments","embeddable":true,"href":"https:\/\/imperix.com\/doc\/wp-json\/wp\/v2\/software-environments?post=1554"},{"taxonomy":"provided-results","embeddable":true,"href":"https:\/\/imperix.com\/doc\/wp-json\/wp\/v2\/provided-results?post=1554"},{"taxonomy":"related-products","embeddable":true,"href":"https:\/\/imperix.com\/doc\/wp-json\/wp\/v2\/related-products?post=1554"},{"taxonomy":"guidedreadings","embeddable":true,"href":"https:\/\/imperix.com\/doc\/wp-json\/wp\/v2\/guidedreadings?post=1554"},{"taxonomy":"tutorials","embeddable":true,"href":"https:\/\/imperix.com\/doc\/wp-json\/wp\/v2\/tutorials?post=1554"},{"taxonomy":"user-manuals","embeddable":true,"href":"https:\/\/imperix.com\/doc\/wp-json\/wp\/v2\/user-manuals?post=1554"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/imperix.com\/doc\/wp-json\/wp\/v2\/coauthors?post=1554"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}