Quantcast
Channel: Microcontrollers
Viewing all articles
Browse latest Browse all 236809

Forum Post: RE: c2000 piccolo launchpad evaluation kit launchxl F28027F with Drv8301

$
0
0
gMotorVars.Torque_Nm is the floating point value represented in IQ24 number format When you view this variable in CCS Expressions as IQ24 format, you will see it as the correct floating point value of Newton-Meters of torque. If you are trying to use this value outside of CCS and display as a floating point value you need to process it. Here is the exact function we use to display it in the GUI Composer based interface: function Divide_by_Q24_five_precision(oldValue) { var toQ24 = new Number(oldValue/(Math.pow(2,24))); var n = toQ24.toPrecision(6); var s = n.toString(); return (s) } So yes, we simply divide the "long value" of this variable by 2^24 to put it into IQ24 format. In this case we truncate to 6 bits of decimal and then return the string. are you using TI EVM right now with standard currents? If so, you should be getting valid Torque #s. If you are using custom HW with much higher currents your values could be rolling over the available fix point range. In that case you need to modify everything to KA, KV, etc. to be able to fit into the IQ24 format.

Viewing all articles
Browse latest Browse all 236809

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>