View Single Post
  #2   Spotlight this post!  
Unread 17-01-2015, 15:12
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: 521
ozrien has a brilliant futureozrien has a brilliant futureozrien has a brilliant futureozrien has a brilliant futureozrien has a brilliant futureozrien has a brilliant futureozrien has a brilliant futureozrien has a brilliant futureozrien has a brilliant futureozrien has a brilliant futureozrien has a brilliant future
Re: Talon SRX QuadEncoder PID Loop

Quote:
At this point we've wired up a quad encoder to the analog breakout
How did you do that?

Are you trying to use the internal PID(F) closed-loop in the Talon SRX? In which case use ::Set() to set the set point after selecting the mode (Position or Velocity).

PIDWrite is part of the wpilib implementation that runs in the RIO, not in the Talon. For that to work you need to source the encoder position/velocity into it by providing a PIDInput to a PIDController.

If you are using the internal PIDF closed-loop in the talon firmware...
Check the signal values mentioned in section 11.2 of the Talon SRX software reference manual. "Closed-loop Error" is the main signal you care about. That's the target set pt minus the current pos/vel. The Self test is very helpful for seeing what's happening. Check that the selected sensor is what you want and that the sensor position and sensor velocity signals seem right before trying to closed-loop to a position/speed.

The actual math is in section 18 (the actual code in the talon for pidf), that might help.

I would test quadrature encoder first. There is an upcoming Talon firmware update with some fixes for analog encoder specifically.