View Single Post
  #2   Spotlight this post!  
Unread 18-02-2013, 09:39
ProgrammerMatt ProgrammerMatt is offline
Programmer-Electrical-Mechanical
FRC #0228 (Gus)
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2010
Location: Southington
Posts: 138
ProgrammerMatt is just really niceProgrammerMatt is just really niceProgrammerMatt is just really niceProgrammerMatt is just really nice
Re: PID Positional Control (Java)

Hi, PID is a great tool, I understand you are using jaguars, you may want to hook the encoders directly into the DSC, When in java use the encoder as a PID source and then start tuning your variables. We have had issues in the past with jaguars we no longer use them.

Above robot init
Code:
Victor motor;
Encoder encoder;
PIDController pid;
In your robot init
Code:
motor = new Victor(1); # or jaguar
encoder = new Encoder(1,2); # A channel B channel
enncoder.setPIDSourceParameter(Encoder.PIDSourceParameter.kDistance);
PID = new PIDController(0.01,0,0.01,encoder,motor);
In teleop ECT
Code:
PID.enable();
PID.setSetpoint(10.0);
Hope this helps, Please don't hesitate to PM me if you need anything,
-Matt
__________________
2015-2016 CSA
Software Engineering Student @ Johnson & Wales University
Team 228, Gus Robotics Inc.
Facebook
FLL Mentor for 1107, Edison Eagles!
2015- CT State Champions
2012- WPI Finalist(Thanks 1884 and 549), Spirt, Best Website
2011- WPI Chairman's award winners!
2010- WPI Champions! (thanks 230 & 20), WPI Engineering Inspiration, CT Best Website, CT VEX Champions (VRC228, VRC228b) (21-1-0)
2009- QCC VEX Champions (VRC228) (11-0-0), Innovate Award (VRC228)