Quote:
Originally Posted by FrankJ
From the TI 2012 FAQ on the jags Question 41 addresses it. The file name is spma033a.pdf.
|
Excerpt from Q41:
Quote:
|
Most fixed-point values used in the motor controller are contained in a 32-bit integer and are a 16.16 format.
|
It doesn't explicitly say that the D gain is fixed point, or if it is fixed-point, if it is 16:16.
Here's an excerpt from the Jag firmware source code that I linked to in an
earlier post:
Code:
// Compute the new control value.
//
llOutput = (((long long)psState->lPGain * (long long)lError) +
((long long)psState->lIGain *
(long long)psState->lIntegrator) +
((long long)psState->lDGain *
(long long)(lError - psState->lPrevError)));
I'm not a C++ guru. I can't tell from that snippet what data type DGain is. The naming convention may be a clue though. There's a leading "l" in the lDGain variable name.