SPRUHJ1I January 2013 – October 2021 TMS320F2802-Q1 , TMS320F28026-Q1 , TMS320F28026F , TMS320F28027-Q1 , TMS320F28027F , TMS320F28027F-Q1 , TMS320F28052-Q1 , TMS320F28052F , TMS320F28052F-Q1 , TMS320F28052M , TMS320F28052M-Q1 , TMS320F28054-Q1 , TMS320F28054F , TMS320F28054F-Q1 , TMS320F28054M , TMS320F28054M-Q1 , TMS320F2806-Q1 , TMS320F28062-Q1 , TMS320F28062F , TMS320F28062F-Q1 , TMS320F28068F , TMS320F28068M , TMS320F28069-Q1 , TMS320F28069F , TMS320F28069F-Q1 , TMS320F28069M , TMS320F28069M-Q1
Up until now we have assumed there are no limitations on the number format itself. If a floating-point processor is used, then there is no need to worry about the fractional component of the PI terms. But most motor control applications are implemented on fixed-point machines for cost reasons. The good news is that TI has developed a linkable library which is in ROM of most C2000 processors which solves this problem. It is called the "IQ Math" library which stands for "Integer Quotient". This allows the user to handle floating point values with ease on a fixed-point machine without suffering from the performance hit you typically get with a full floating-point support device. IQ math creates a new variable type in the code which is designated by an "IQ" followed by a number. For example, say you have a 32 bit variable which is typed as an "IQ24" variable type. This means that any variable of this type is assumed to have a 24-bit fractional component, and an 8-bit integer part. But what occasionally happens is that someone copies TI code into their design without realizing that the coefficients are represented in IQ format. For example, if the I-gain was calculated to be 10,000 (0x00002710 in IQ0 format), but it is not realized that the code assumed the variable to be in IQ24 format, you will end up with an integrator gain of 0.596E-3 instead of 10,000. The two values are obviously very different. If the same mistake is made for all of the PI coefficients, the motor will most likely just sit there and do nothing since all the gains are way too low. So, it is advised to make sure that the numerical format your coefficients are in is well known.