<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Normalized Floating Point Numbers and why we used them in MBD Toolbox in Model-Based Design Toolbox (MBDT)</title>
    <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/Normalized-Floating-Point-Numbers-and-why-we-used-them-in-MBD/m-p/702765#M1158</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just recently I've received an email with a few questions regarding one particular block (GMCLIB_SvmStd_FLT) from the MPC5744 MBD Toolbox exposed by the AMMCLIB, and I&amp;nbsp;thought it would be nice to share the knowledge here since other might face similar questions.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, here is the background (&lt;EM&gt;I've remove sensitive personal information from the email&lt;/EM&gt;):&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;SPAN style="font-family: verdana, geneva, sans-serif;"&gt;..., the SVM_STD_FLT block can accept whatever input value in the range of the floating 32 bits and then scale it internally to either [0,1] or [-1,1].!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: verdana, geneva, sans-serif;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: verdana, geneva, sans-serif;"&gt;But, from what I can see in my simulations, the Output of the SVM is &lt;SPAN style="text-decoration: underline;"&gt;&lt;EM&gt;not saturated only if the input to is a [-1,1] sin/cos inputs&lt;/EM&gt;&lt;/SPAN&gt;.&amp;nbsp; Which means that the SVM_STD_FLT does not really accept floating inputs..! Do I need to normalize the inputs to [-1,1] even for a floating input SVM?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: verdana, geneva, sans-serif;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: verdana, geneva, sans-serif;"&gt;Regarding the output of the SVM, should it be exactly changing from 0 to 1 in order to have proper operation of the power stage ? or it could be changing between any [min, max] values inside [0,1]!&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;As you can see there a few a good points here, therefore let us discuss upon those. It is not in my intention to provide a deep lecture on floating point but I just want to point out a few things to clarify the subject.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let us start with the most obvious one:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;SPAN style="background-color: #f6f6f6; color: #ff0000; font-family: verdana, geneva, sans-serif;"&gt;&lt;STRONG&gt;Do I need to normalize the inputs to [-1,1] even for a floating ...?&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;In my opinion, we should always do that when working with embedded systems and it has to do with precision.&lt;/P&gt;&lt;P&gt;Let me explain&amp;nbsp;why:&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any real number can be represented in binary form as:&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;I(m) I(m-1) ... I(2) I(1) I(0)&amp;nbsp;&lt;STRONG&gt;.&amp;nbsp;&lt;/STRONG&gt;F(1) F(2) ... F(n-1) F(n)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;where:&amp;nbsp;I(k) and F(k) is 0 or 1 of the Integer or Fraction parts respectively&lt;/P&gt;&lt;P&gt;The IEEE 754 binary representation defines the floating point on 32bit as single precision using this format:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;(-1)^s x c&amp;nbsp;x 2^e&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;where: s = sign (0 or 1), c&amp;nbsp;= significant coefficient/mantissa and e = exponent&lt;/P&gt;&lt;P&gt;In case of single precision representation on 32bit microprocessors we will have:&lt;/P&gt;&lt;P&gt;- 1 bit for sign&lt;/P&gt;&lt;P&gt;- 8 bits for exponent&lt;/P&gt;&lt;P&gt;- 23 bits for significant/mantissa&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="193738_193738.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/123144iE5FAA0130CCE61D1/image-size/large?v=v2&amp;amp;px=999" role="button" title="193738_193738.png" alt="193738_193738.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="IEEE_754_single_precision.svg.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/29955i949544738A22B0E6/image-size/large?v=v2&amp;amp;px=999" role="button" title="IEEE_754_single_precision.svg.png" alt="IEEE_754_single_precision.svg.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Let's take as an example the following fraction:&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;9/2(b10) = 4.5(b10) = 100.1(b2)&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;By definition the result said to be normalized if it is represented with leading 1 bit:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;100.1&lt;/STRONG&gt;(b2) -&amp;gt; normalized -&amp;gt; &lt;STRONG&gt;1.001&lt;/STRONG&gt;(b2) x &lt;STRONG&gt;2^2&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Since all hardware implementations are using the boolean algebra (...because transistors :-) ) and since normalized numbers means the left most bit it&amp;nbsp;must be 1 - then the logic question is: &lt;STRONG&gt;If it is always 1 then why should we actually store it ?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; background-color: #ffffff; font-size: 14px;"&gt;Many floating point representations have this implicit hidden bit in the mantissa. This is a bit which is present virtually in the mantissa, but not stored in memory because its value is always 1 in a normalized number.&amp;nbsp;&lt;SPAN&gt;&lt;SPAN style="text-decoration: underline;"&gt;This rule allows the memory format to have one more bit of precision&lt;/SPAN&gt;.&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; background-color: #ffffff; font-size: 14px;"&gt;&lt;SPAN&gt;The mantissa of a floating point number represents an implicit fraction whose denominator is the base raised to the power of the precision.&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #222222; background-color: #ffffff; font-size: 14px;"&gt;&lt;SPAN&gt;Since the largest representable mantissa is one less than this denominator(base raised to the power of the precision), the value of the fraction is always strictly less than 1.&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="background-color: #ffffff; color: #222222; font-size: 14px;"&gt;&lt;STRONG&gt;More bits in the mantissa = better precision of floating point&amp;nbsp;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #222222; font-size: 14px;"&gt;&lt;STRONG&gt;numbers&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; background-color: #ffffff; font-size: 14px;"&gt;&lt;SPAN&gt;Regarding the second aspect:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro" style="color: #3d3d3d; background: none #f6f6f6; border-left: 2px solid #cccccc; font-size: 15px; margin: 10px 0px; padding: 10px 20px;"&gt;&lt;P&gt;&lt;SPAN style="background-color: transparent; color: #ff0000; font-family: verdana, geneva, sans-serif;"&gt;&lt;STRONG&gt;&lt;SPAN style="background-color: #f6f6f6;"&gt;Output of the SVM is&amp;nbsp;&lt;/SPAN&gt;not saturated only if the input to is a [-1,1] sin/cos inputs&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN style="color: #222222; background-color: #ffffff; font-size: 14px;"&gt;&lt;SPAN&gt;The inputs to the &lt;STRONG&gt;Space Vector Modulation&lt;/STRONG&gt; block represents the 3-phase stator voltages Ua, Ub, Uc that are transformed via the Inverse Clarke Transformation into Ualpha, Ubeta 2-phase orthogonal coordinate system.&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; background-color: #ffffff; font-size: 14px;"&gt;&lt;SPAN&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="193770_193770.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/123145iBB20D18A8F3016BE/image-size/large?v=v2&amp;amp;px=999" role="button" title="193770_193770.png" alt="193770_193770.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_33.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/28901i39E70ACE3776AA1B/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_33.png" alt="pastedImage_33.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; color: #222222; font-size: 14px;"&gt;&lt;STRONG&gt;In general in embedded system - &lt;/STRONG&gt;and in particular in motor control application&lt;STRONG&gt; - all the variables are scaled relatively to maximum values supported by the system sensors.&lt;/STRONG&gt; In case of voltages, the shunts/opams/adc chains are design to support a maximum read out. Therefore all the quantities derived or that relates with the voltage are scaled to the [-1, 1] interval by max Vdc supported value.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; background-color: #ffffff; font-size: 14px;"&gt;&lt;SPAN&gt;Using Ualpha and Ubeta, the stator voltage vector Us is constructed with the appropriate combination of inverter switching patterns.&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #222222; background-color: #ffffff; font-size: 14px;"&gt;&lt;SPAN&gt;Based on the actual value needed for the stator voltage vector Us to control the rotor position, the 6 inverter switches must be controlled: &lt;STRONG&gt;ON or OFF for an amount of time - duty cycle/factor&lt;/STRONG&gt;.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; color: #222222; font-size: 14px;"&gt;So, the output of the SVM block represents the PWM duty cycle to control the inverter switches/transistors. &lt;STRONG&gt;Since the duty cycle represent the relative time of the transitor to be ON/OFF the only meaningful&amp;nbsp;values are between [0 and 1]&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; color: #222222; font-size: 14px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="193773_193773.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/123146i3F1383091D79CBFC/image-size/large?v=v2&amp;amp;px=999" role="button" title="193773_193773.png" alt="193773_193773.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_38.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/29042iE012A4CD5FC18EED/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_38.png" alt="pastedImage_38.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="color: #3d3d3d;"&gt;And finally:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro" style="color: #3d3d3d; background: none #f6f6f6; border-left: 2px solid #cccccc; font-size: 15px; margin: 10px 0px; padding: 10px 20px;"&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000; font-family: verdana, geneva, sans-serif;"&gt;&lt;STRONG&gt;...&amp;nbsp;the output of the SVM, should it be exactly changing from 0 to 1 in order to have proper operation of the power stage ? or it could be changing between any [min, max] values inside [0,1]!&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P style="color: #3d3d3d;"&gt;Yes, it should always be between [0=OFF ... 1=ON] interval since it is a PWM duty cycle value. Note that SVM also implement the 3rd harmonic injection to increase the actual phase voltage from Vdc/2 -&amp;gt; 0.155* Vdc/2 (see the curly waveform) - but that is a different topic.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px; color: #3d3d3d;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="color: #3d3d3d;"&gt;Attached is a Simulink model where you can play with the SVM block and MPC5744P Toolbox.&lt;/P&gt;&lt;P style="color: #3d3d3d;"&gt;Hope this helps clarifying some of the concerns around this special block.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; background-color: #ffffff; font-size: 14px;"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Original Attachment has been moved to: &lt;A _jive_internal="true" href="https://community.nxp.com/docs/DOC-338618"&gt;SVM_FLT.slx.zip&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 13 Sep 2017 13:50:33 GMT</pubDate>
    <dc:creator>Daniel_Popa</dc:creator>
    <dc:date>2017-09-13T13:50:33Z</dc:date>
    <item>
      <title>Normalized Floating Point Numbers and why we used them in MBD Toolbox</title>
      <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/Normalized-Floating-Point-Numbers-and-why-we-used-them-in-MBD/m-p/702765#M1158</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just recently I've received an email with a few questions regarding one particular block (GMCLIB_SvmStd_FLT) from the MPC5744 MBD Toolbox exposed by the AMMCLIB, and I&amp;nbsp;thought it would be nice to share the knowledge here since other might face similar questions.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, here is the background (&lt;EM&gt;I've remove sensitive personal information from the email&lt;/EM&gt;):&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;SPAN style="font-family: verdana, geneva, sans-serif;"&gt;..., the SVM_STD_FLT block can accept whatever input value in the range of the floating 32 bits and then scale it internally to either [0,1] or [-1,1].!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: verdana, geneva, sans-serif;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: verdana, geneva, sans-serif;"&gt;But, from what I can see in my simulations, the Output of the SVM is &lt;SPAN style="text-decoration: underline;"&gt;&lt;EM&gt;not saturated only if the input to is a [-1,1] sin/cos inputs&lt;/EM&gt;&lt;/SPAN&gt;.&amp;nbsp; Which means that the SVM_STD_FLT does not really accept floating inputs..! Do I need to normalize the inputs to [-1,1] even for a floating input SVM?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: verdana, geneva, sans-serif;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: verdana, geneva, sans-serif;"&gt;Regarding the output of the SVM, should it be exactly changing from 0 to 1 in order to have proper operation of the power stage ? or it could be changing between any [min, max] values inside [0,1]!&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;As you can see there a few a good points here, therefore let us discuss upon those. It is not in my intention to provide a deep lecture on floating point but I just want to point out a few things to clarify the subject.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let us start with the most obvious one:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;SPAN style="background-color: #f6f6f6; color: #ff0000; font-family: verdana, geneva, sans-serif;"&gt;&lt;STRONG&gt;Do I need to normalize the inputs to [-1,1] even for a floating ...?&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;In my opinion, we should always do that when working with embedded systems and it has to do with precision.&lt;/P&gt;&lt;P&gt;Let me explain&amp;nbsp;why:&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any real number can be represented in binary form as:&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;I(m) I(m-1) ... I(2) I(1) I(0)&amp;nbsp;&lt;STRONG&gt;.&amp;nbsp;&lt;/STRONG&gt;F(1) F(2) ... F(n-1) F(n)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;where:&amp;nbsp;I(k) and F(k) is 0 or 1 of the Integer or Fraction parts respectively&lt;/P&gt;&lt;P&gt;The IEEE 754 binary representation defines the floating point on 32bit as single precision using this format:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;(-1)^s x c&amp;nbsp;x 2^e&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;where: s = sign (0 or 1), c&amp;nbsp;= significant coefficient/mantissa and e = exponent&lt;/P&gt;&lt;P&gt;In case of single precision representation on 32bit microprocessors we will have:&lt;/P&gt;&lt;P&gt;- 1 bit for sign&lt;/P&gt;&lt;P&gt;- 8 bits for exponent&lt;/P&gt;&lt;P&gt;- 23 bits for significant/mantissa&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="193738_193738.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/123144iE5FAA0130CCE61D1/image-size/large?v=v2&amp;amp;px=999" role="button" title="193738_193738.png" alt="193738_193738.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="IEEE_754_single_precision.svg.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/29955i949544738A22B0E6/image-size/large?v=v2&amp;amp;px=999" role="button" title="IEEE_754_single_precision.svg.png" alt="IEEE_754_single_precision.svg.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Let's take as an example the following fraction:&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;9/2(b10) = 4.5(b10) = 100.1(b2)&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;By definition the result said to be normalized if it is represented with leading 1 bit:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;100.1&lt;/STRONG&gt;(b2) -&amp;gt; normalized -&amp;gt; &lt;STRONG&gt;1.001&lt;/STRONG&gt;(b2) x &lt;STRONG&gt;2^2&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Since all hardware implementations are using the boolean algebra (...because transistors :-) ) and since normalized numbers means the left most bit it&amp;nbsp;must be 1 - then the logic question is: &lt;STRONG&gt;If it is always 1 then why should we actually store it ?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; background-color: #ffffff; font-size: 14px;"&gt;Many floating point representations have this implicit hidden bit in the mantissa. This is a bit which is present virtually in the mantissa, but not stored in memory because its value is always 1 in a normalized number.&amp;nbsp;&lt;SPAN&gt;&lt;SPAN style="text-decoration: underline;"&gt;This rule allows the memory format to have one more bit of precision&lt;/SPAN&gt;.&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; background-color: #ffffff; font-size: 14px;"&gt;&lt;SPAN&gt;The mantissa of a floating point number represents an implicit fraction whose denominator is the base raised to the power of the precision.&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #222222; background-color: #ffffff; font-size: 14px;"&gt;&lt;SPAN&gt;Since the largest representable mantissa is one less than this denominator(base raised to the power of the precision), the value of the fraction is always strictly less than 1.&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="background-color: #ffffff; color: #222222; font-size: 14px;"&gt;&lt;STRONG&gt;More bits in the mantissa = better precision of floating point&amp;nbsp;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #222222; font-size: 14px;"&gt;&lt;STRONG&gt;numbers&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; background-color: #ffffff; font-size: 14px;"&gt;&lt;SPAN&gt;Regarding the second aspect:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro" style="color: #3d3d3d; background: none #f6f6f6; border-left: 2px solid #cccccc; font-size: 15px; margin: 10px 0px; padding: 10px 20px;"&gt;&lt;P&gt;&lt;SPAN style="background-color: transparent; color: #ff0000; font-family: verdana, geneva, sans-serif;"&gt;&lt;STRONG&gt;&lt;SPAN style="background-color: #f6f6f6;"&gt;Output of the SVM is&amp;nbsp;&lt;/SPAN&gt;not saturated only if the input to is a [-1,1] sin/cos inputs&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN style="color: #222222; background-color: #ffffff; font-size: 14px;"&gt;&lt;SPAN&gt;The inputs to the &lt;STRONG&gt;Space Vector Modulation&lt;/STRONG&gt; block represents the 3-phase stator voltages Ua, Ub, Uc that are transformed via the Inverse Clarke Transformation into Ualpha, Ubeta 2-phase orthogonal coordinate system.&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; background-color: #ffffff; font-size: 14px;"&gt;&lt;SPAN&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="193770_193770.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/123145iBB20D18A8F3016BE/image-size/large?v=v2&amp;amp;px=999" role="button" title="193770_193770.png" alt="193770_193770.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_33.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/28901i39E70ACE3776AA1B/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_33.png" alt="pastedImage_33.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; color: #222222; font-size: 14px;"&gt;&lt;STRONG&gt;In general in embedded system - &lt;/STRONG&gt;and in particular in motor control application&lt;STRONG&gt; - all the variables are scaled relatively to maximum values supported by the system sensors.&lt;/STRONG&gt; In case of voltages, the shunts/opams/adc chains are design to support a maximum read out. Therefore all the quantities derived or that relates with the voltage are scaled to the [-1, 1] interval by max Vdc supported value.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; background-color: #ffffff; font-size: 14px;"&gt;&lt;SPAN&gt;Using Ualpha and Ubeta, the stator voltage vector Us is constructed with the appropriate combination of inverter switching patterns.&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #222222; background-color: #ffffff; font-size: 14px;"&gt;&lt;SPAN&gt;Based on the actual value needed for the stator voltage vector Us to control the rotor position, the 6 inverter switches must be controlled: &lt;STRONG&gt;ON or OFF for an amount of time - duty cycle/factor&lt;/STRONG&gt;.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; color: #222222; font-size: 14px;"&gt;So, the output of the SVM block represents the PWM duty cycle to control the inverter switches/transistors. &lt;STRONG&gt;Since the duty cycle represent the relative time of the transitor to be ON/OFF the only meaningful&amp;nbsp;values are between [0 and 1]&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; color: #222222; font-size: 14px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="193773_193773.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/123146i3F1383091D79CBFC/image-size/large?v=v2&amp;amp;px=999" role="button" title="193773_193773.png" alt="193773_193773.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_38.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/29042iE012A4CD5FC18EED/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_38.png" alt="pastedImage_38.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="color: #3d3d3d;"&gt;And finally:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro" style="color: #3d3d3d; background: none #f6f6f6; border-left: 2px solid #cccccc; font-size: 15px; margin: 10px 0px; padding: 10px 20px;"&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000; font-family: verdana, geneva, sans-serif;"&gt;&lt;STRONG&gt;...&amp;nbsp;the output of the SVM, should it be exactly changing from 0 to 1 in order to have proper operation of the power stage ? or it could be changing between any [min, max] values inside [0,1]!&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P style="color: #3d3d3d;"&gt;Yes, it should always be between [0=OFF ... 1=ON] interval since it is a PWM duty cycle value. Note that SVM also implement the 3rd harmonic injection to increase the actual phase voltage from Vdc/2 -&amp;gt; 0.155* Vdc/2 (see the curly waveform) - but that is a different topic.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px; color: #3d3d3d;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="color: #3d3d3d;"&gt;Attached is a Simulink model where you can play with the SVM block and MPC5744P Toolbox.&lt;/P&gt;&lt;P style="color: #3d3d3d;"&gt;Hope this helps clarifying some of the concerns around this special block.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; background-color: #ffffff; font-size: 14px;"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Original Attachment has been moved to: &lt;A _jive_internal="true" href="https://community.nxp.com/docs/DOC-338618"&gt;SVM_FLT.slx.zip&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Sep 2017 13:50:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/Normalized-Floating-Point-Numbers-and-why-we-used-them-in-MBD/m-p/702765#M1158</guid>
      <dc:creator>Daniel_Popa</dc:creator>
      <dc:date>2017-09-13T13:50:33Z</dc:date>
    </item>
  </channel>
</rss>

