View Single Post
  #1   Spotlight this post!  
Unread 04-02-2013, 22:50
Team3266Spencer's Avatar
Team3266Spencer Team3266Spencer is offline
Team Captain and Lead Programmer
AKA: Spencer Lanman
FRC #3266 (Robots-R-US)
Team Role: Programmer
 
Join Date: Oct 2011
Rookie Year: 2012
Location: Richmond, Indiana
Posts: 280
Team3266Spencer is an unknown quantity at this point
Encoder's PID functional but getRate method not-functional???

I don't have my code to show you at the moment, but I set up a PID Controller from the WPI Java Library (wpilibj) and implemented PIDWrite and PIDOutput to take values and from an encoder on our frisbee shooter and write the value to the Victor controlling the shooter. I also took the data from the encoder and sent it to our SmartDashboard.

Everything seems to be working fine except for the SmartDashboard. I a little bit of troubleshooting and did a simple println of the encoder's getRate value instead. Both yielded zero yet are shooter still spends faster and slower in regards to our joystick. The obvious assumption would be that I have the wrong ports for the encoder or it's wired incorrectly, but since I'm using the joystick to set the set-point for the PID controller in RPMs (or RPS, depending on where you look at it in the code.) you would think that the shooter would spin full speed if it was receiving zero RPMs from the encoder, but it is certainly responding with variable speeds when I adjust the throttle of the joystick.

My current explanation is that perhaps the getRate method is being called too quickly in succession for the encoder class to be ready for it (in regards to whatever loop the library might be using?).

I know there's a lot typed above, but I'd really appreciate it if someone would take the time to clarify and ask some questions about what's been stated above, and show me what I'm doing wrong, as I'm completely clueless.
__________________
2012: Buckeye Regional, Queen City Regional, Human Player
2013: Queen City Regional, Buckeye Regional, Crossroads Regional
Shooter Operator
2014: Crossroads Regional, Queen City Regional
Catapult Operator
2015: Georgia Southern Classic Regional (Winner), Queen City Regional
Chainsaw Operator
Want to talk? TeamSpeak: team3266.noip.me
Reply With Quote