View Single Post
  #15   Spotlight this post!  
Unread 19-03-2012, 12:48
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,034
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: PID control: need D values > 10000??

Quote:
Originally Posted by FrankJ View Post
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.


Reply With Quote