View Single Post
  #10   Spotlight this post!  
Unread 18-01-2015, 19:14
BradAMiller BradAMiller is offline
Registered User
AKA: Brad
#0190 ( Gompei and the Herd)
Team Role: Mentor
 
Join Date: Mar 2004
Location: Worcester, MA
Posts: 588
BradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant future
Re: How to program Encoders with PID Subsystem

Quote:
Originally Posted by admrialkunkka View Post
We need help programming our encoders with a PID subsystem because of lack of documentation. We intend to use the encoders for our drive train PID subsystem.
If you create an example java project in eclipse and choose GearsBot you can see some samples of PIDSubsystem classes. Look in the subsystem package (folder) and look at Elevator and Wrist. In both cases it shows how to write the PID subsystem uses a potentiometer as the sensor.

Then to control the height of the elevator or the angle of the wrist, look at the commands SetElevatorSetpoint and SetWristSetpoint. The idea is that the PIDController is embedded in the PID Subsystem and the setting of the set point is in the command. The command finishes when the mechanism actual value is at the stepping +/- the tolerance (set in the subsystem).

There is also a video that describes how to write that program from scratch that's here: http://wp.wpi.edu/wpilib/2012/02/15/...-videos-posted.

Hope that helps.
__________________
Brad Miller
Robotics Resource Center
Worcester Polytechnic Institute
Reply With Quote