Go to Post Kit wheel? Someone probably has them. N-tooth IFI sprocket? You might get lucky. Part Made By A Local Company When You're Competing 800 Miles Away? Bring three. - Billfred [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rating: Thread Rating: 17 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 28-01-2015, 13:13
kmrchiefdelphi kmrchiefdelphi is offline
Registered User
FRC #3950 (Robo Gym)
Team Role: Mentor
 
Join Date: Jan 2015
Rookie Year: 2015
Location: North Shore High School
Posts: 5
kmrchiefdelphi is an unknown quantity at this point
Talon SRX PID parameters

Hi. First timer here.

We are attempting to use the PID functionality of the Talon SRX and am confused about the magnitude of the parameters to be used in the SetPID method. We are using a Quadrature Encoder.

From the 'Can Talon SRX PID' example C++ code it states, just before the call to SetPID:
// These values are in units of throttle / sensor_units where throttle ranges
// from -1023 to +1023 and sensor units are from 0 - 1023 for analog
// potentiometers, encoder ticks for encoders, and position / 10ms for
/ speeds.

And in the CanTalonSRX.h is states:
* P gain is specified in throttle per error tick. For example, a value of 102 is ~9.9% (which is 102/1023) throttle per 1
* ADC unit(10bit) or 1 quadrature encoder edge depending on selected sensor.

Since we are using a Quadrature Encoder are we correct in assuming that the values for P, I and D should be integer values, according to the comment above, 'encoder ticks for encoders'?

Our tests using integer values did not work. When we used PID values all less than 1.0 we had better results but the encoder never reached the set point. Any ideas?

Thanks in advance.
  #2   Spotlight this post!  
Unread 28-01-2015, 13:23
Joey1939's Avatar
Joey1939 Joey1939 is offline
Registered User
AKA: Joey Holliday
FRC #1939 (Kuhnigits)
Team Role: Programmer
 
Join Date: Jan 2014
Rookie Year: 2014
Location: Kansas City, Missouri
Posts: 142
Joey1939 has a spectacular aura aboutJoey1939 has a spectacular aura aboutJoey1939 has a spectacular aura about
Re: Talon SRX PID parameters

I messed around with it and, I had a lot of trouble. They don't have very much documentation on exactly what the methods in the class do and it didn't seem to work very well. We decided to plug the encoders into the Talons to save DIO ports but to run the PID loop on the roboRIO.
  #3   Spotlight this post!  
Unread 28-01-2015, 13:36
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,101
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: Talon SRX PID parameters

Quote:
Originally Posted by kmrchiefdelphi View Post
Since we are using a Quadrature Encoder are we correct in assuming that the values for P, I and D should be integer values
No.

P, I, and D are floating-point gains.

They are not encoder ticks. They are in units of throttle/sensor_units as stated in the comment section you posted.

Quote:
When we used PID values all less than 1.0 we had better results but the encoder never reached the set point. Any ideas?
Watch this video, especially PID tuning starting at at 9:03


  #4   Spotlight this post!  
Unread 28-01-2015, 13:55
ozrien's Avatar
ozrien ozrien is offline
Omar Zrien
AKA: Omar
no team
Team Role: Mentor
 
Join Date: Sep 2006
Rookie Year: 2003
Location: Sterling Heights, MI
Posts: 531
ozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond repute
Re: Talon SRX PID parameters

Joey1939, What was it that you needed that wasn't in the Talon SRX Software Reference Manual?

Also, the verbatim PIDF code used by Talon is in section 18 of the software reference manual. That was deliberate so programmers didn't have to guess at the implementation.

kmrchiefdelphi, if you want a specific answer about what's happening with a specific set of gains and error, you're best best is to screenshot capture the Self-Test results (and the gain values that are under the self-test results). That displays your throttle, the ClosedLoopErr, and sensor pos/vel.

ClosedLoopErr is what multiplied by Kp, and is your target - current sensor position (or velocity if that's selected). So yep if you are using quad encoder, then there is 4XCPR units per rotation where CPR=countsPerRotation. Talon is always in 4X mode.

Integral accum sums closedLoopErr every 1ms.
dErr is the change in ClosedLoopErr per 1ms.
  #5   Spotlight this post!  
Unread 28-01-2015, 14:15
kmrchiefdelphi kmrchiefdelphi is offline
Registered User
FRC #3950 (Robo Gym)
Team Role: Mentor
 
Join Date: Jan 2015
Rookie Year: 2015
Location: North Shore High School
Posts: 5
kmrchiefdelphi is an unknown quantity at this point
Re: Talon SRX PID parameters

Thanks for the replies. The video was very helpful in our understanding of the PID parameters.
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 21:08.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi