View Single Post
  #7   Spotlight this post!  
Unread 06-02-2013, 19:06
xmaams xmaams is offline
Registered User
AKA: Sam Dietrich
FRC #2587 (Discobots)
Team Role: Mentor
 
Join Date: Feb 2013
Rookie Year: 2012
Location: Houston
Posts: 12
xmaams will become famous soon enoughxmaams will become famous soon enough
Re: Encoder's PID functional but getRate method not-functional???

I think in your code you want to set the setpoint to rpm, not rpm over 60 or anything like that. Another problem could be that you set the PID controller to be continuous.
What kind of encoder are you using? is it an actual shaft encoder or a light sensor? I would be careful about using the getRate method, as this depends on the distance per pulse, which is not really defined for a shooter. In our code, we use the formula 60.0/getPeriod()/countsPerRev to find the rpm of the shooter and then use that in our PID input. It may be easier to implement all of this in a PIDSubsystem.

If you print spinnerEncoder.get() in your teleopPeriodic method, does it count now while the wheel is spinning, even if not with PID?
Reply With Quote