View Single Post
  #2   Spotlight this post!  
Unread 15-01-2015, 16:08
Thad House Thad House is offline
Volunteer, WPILib Contributor
no team (Waiting for 2021)
Team Role: Mentor
 
Join Date: Feb 2011
Rookie Year: 2010
Location: Thousand Oaks, California
Posts: 1,106
Thad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond repute
Re: PIDController help

There are a few things causing that. With the distance per count of 1, and a P of 1, that means anytime the encoder is off by more then 1 tick, it will run full output. I would start by setting distance per count to a real unit, such as either rotations, or inches. I would need more information to help you calculate this, but its not too difficult. Just figure out how far your device travels when you rotate the encoder 1 full rotation, then divide that number by the CPR of the encoder. I would then set your P to about 0.01, and start working it up or down from there depending on how you device is set up.
__________________
All statements made are my own and not the feelings of any of my affiliated teams.
Teams 1510 and 2898 - Student 2010-2012
Team 4488 - Mentor 2013-2016
Co-developer of RobotDotNet, a .NET port of the WPILib.