View Single Post
  #9   Spotlight this post!  
Unread 06-02-2017, 23:03
AustinH's Avatar
AustinH AustinH is offline
Registered User
FRC #4918 (The Roboctopi)
Team Role: Coach
 
Join Date: Apr 2013
Rookie Year: 2013
Location: Port Townsend
Posts: 91
AustinH is a splendid one to beholdAustinH is a splendid one to beholdAustinH is a splendid one to beholdAustinH is a splendid one to beholdAustinH is a splendid one to beholdAustinH is a splendid one to behold
Re: Setting PID constants in code for TalonSRX Velocity Control

Quote:
Originally Posted by rwood359 View Post
This is our first time use of the SRX. We are programming in LabView and using the velocity example program..
We have followed the example for Java velocity closed-loop with interpretations for what LV wants.
I am confused about F-gain. We go through the process. Our motor is running at about 6000 RPM maximum. We get a velocity of 39136 from self-test. Using the formulas we compute F-gain as .026139. If we put that value in the F-gain field in the example, the motor runs to full speed when we set the requested output to -25600 (-3750RPM). Both SRXs are showing Green LEDs.

We have tried bringing down F-gain then setting PID values that get us close to what we want. But with our tuning, the SRX doesn't really regulate. When we start other motors, the speed drops 250 RPM, when we put in a fresh battery, the speed goes up 400 RPM.

I think that we are doing something fundamental wrong. Does F-gain need to change based on the speed we are running.

We are using two motors with one in slave mode. Occasionally the SRXs get out of sync after we download and will buck (one showing RED the other showing GREEN) each other.
I'm assuming you're using a CTRE Magnetic Encoder?
We solved this by deleting the 6.8 multiplier and trying a raw rpm value. Once we did that, the F-gain started to make sense and we were able to tune sensible PID numbers.

See if this helps:
http://imgur.com/a/Ljv4H


Edit: I forgot to add, have you checked to make sure your encoder and your motor controllers have the same polarity?
__________________
3826: 2013 Seattle Regional Industrial Design Award & Semi-Finalists
4918: 2014 PNW Glacier Peak District Event Rookie Inspiration Award & Quarter-Finalists, 2014 PNW Mount Vernon District Event Highest Rookie Seed Award, Rookie All Star & Semi-Finalists, 2015 PNW West Valley District Event Engineering Excellence Award & Semi-Finalists, 2015 PNW Mount Vernon District Event Semi-Finalists





Visit us on the web at www.team4918.org

Last edited by AustinH : 06-02-2017 at 23:05. Reason: Forgot about encoder polarity
Reply With Quote