View Single Post
  #1   Spotlight this post!  
Unread 14-01-2010, 16:26
BradAMiller BradAMiller is offline
Registered User
AKA: Brad
#0190 ( Gompei and the Herd)
Team Role: Mentor
 
Join Date: Mar 2004
Location: Worcester, MA
Posts: 590
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: RobotDrive + PIDController = possible?

Quote:
Originally Posted by oddjob View Post
Is it possible to use the RobotDrive class and the PIDController class together so that each drive wheel has PID control?
The PID class requires you to supply a PIDOutput object that actually sets the values. By default the standard motor objects like Jaguar and Victor are already PIDOutput objects. But you can create your own PIDOutput object that works with the PID class and control either the turn rate or the forward speed.

You can see an example of how to do that by looking at the 2010 Image Demo in the list of example programs with the 2010 update. Look at the MyRobot.cpp file and find the SamplePIDOutput class. It's pretty easy to do. The sample program uses the output of the PID loop to control the turn direction of the robot to keep the target centered in the camera field of view.
__________________
Brad Miller
Robotics Resource Center
Worcester Polytechnic Institute
Reply With Quote