View Single Post
  #1   Spotlight this post!  
Unread 02-02-2017, 13:26
thejerishbrown's Avatar
thejerishbrown thejerishbrown is offline
Registered User
FRC #0190 (Gompei and the Herd)
Team Role: Mentor
 
Join Date: Apr 2015
Rookie Year: 2013
Location: United States
Posts: 5
thejerishbrown is an unknown quantity at this point
Setting PID constants in code for TalonSRX Velocity Control

I'm working with the CTRE Demo code for tuning closed-loop velocity control on the TalonSRX. When I set the PIDF constants in code (using _talon.setP, _talon.setI, etc), the values seem to not get set on the talon itself.

Here's what I'm seeing: When I run the code with any PID constants set, the system doesn't move whatsoever. No matter if I set any combination of P, I, D, or F, there is no response. If I go onto the roborio's web viewer (on http://roborio-<team>-frc.local) I can see the PID constants I set. If I manually re-enter and save the PID constants on the roborio web viewer, the system responds exactly as I would expect.

This only seems to be a problem when I set the control mode to TalonControlMode.Speed. I don't see the problem if I'm using TalonControlMode.Position. I've made sure all the firmware on the TalonSRXs, RoboRIO, and PDP are all up to date, as well as my wpilib and ctre lib installs.

Last edited by thejerishbrown : 02-02-2017 at 13:35.
Reply With Quote