View Single Post
  #5   Spotlight this post!  
Unread 20-12-2011, 07:53
Jared Russell's Avatar
Jared Russell Jared Russell is offline
Taking a year (mostly) off
FRC #0254 (The Cheesy Poofs), FRC #0341 (Miss Daisy)
Team Role: Engineer
 
Join Date: Nov 2002
Rookie Year: 2001
Location: San Francisco, CA
Posts: 3,078
Jared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond repute
Re: JAVA PID with Encoders

The issue is with the encoder. Because you can use encoders to measure either speed or distance (or both), you need to tell the encoder which measurement to use when the PIDController calls pidGet().

You can do this by adding the line (assuming you want to use distance as your measurement):
Code:
LeftEncoder.setPIDSourceParameter(Encoder.PIDSourceParameter.kDistance);
...after you instantiate the encoder but before you instantiate the PIDController.
Reply With Quote