Team3266Spencer
04-02-2013, 22:50
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.
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.