Go to Post You never know when the GDC will slide in a rule about any robot with a laser must do a laser light show on the floor of the field or face a 50-point penalty :p. - EricH [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rating: Thread Rating: 31 votes, 5.00 average. Display Modes
Prev Previous Post   Next Post Next
  #8   Spotlight this post!  
Unread 28-01-2012, 03:25
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: Help Setting Up PID System for Tank Drive Train

Quote:
Originally Posted by l0stboy View Post
That makes sense. Would there be link anywhere for some sample code of that?
If you look at the GearsBot sample program included with the Netbeans install it should serve as an example. There are a few differences, it uses an ultrasonic rangefinder to drive its PID loop. And it uses 2 motors.

You can modify the RobotDrive constructor to take all 4 of your motors. one you do that, the rest will be unchanged.

And you only need to use a PID subsystem if you intend to use encoders. If you aren't installing encoders change the PIDSubsystem to a Subsystem and remove all the methods and code that pertain to the PID loop stuff (returnPIDInput and usePIDOutput).

If you do have encoders, then instead of using rangefinder.getVoltage() as the feedback element, you'll read the encoder value and use that. The PID constants (Kp, Ki, and Kd) will have to be adjusted to account for the range of values the encoders will return. And the set point will be in the same units that the encoder is returning, such as encoder count that represents the distance you need to drive.

Brad
__________________
Brad Miller
Robotics Resource Center
Worcester Polytechnic Institute
Reply With Quote
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 08:53.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi