Go to Post So many possibilities so many different meanings and soo many different opinions. LOL but i guess this is what FIRST is all about. - Bcahn836 [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: 2 votes, 3.00 average. Display Modes
Prev Previous Post   Next Post Next
  #16   Spotlight this post!  
Unread 09-09-2013, 01:22 PM
otherguy's Avatar
otherguy otherguy is offline
sparkE
AKA: James
FRC #2168 (The Aluminum Falcons)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2009
Location: CT
Posts: 429
otherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to behold
Re: Java Autonomous Help

Quote:
Originally Posted by TenaciousDrones View Post
Another question, this time about PIDs. I somewhat understand what they are, but do I need them? I know that they hook up to the analog breakout board. If so where can I get some? Would you use them for autonomous and for like setting an angle for a shooter?
I think you have a few things confused. PID stands for Proportional Integral Derivative. It is a type closed loop control algorithm. This algorithm is typically implemented in software, so it wouldn't be an analog device.

What I think you're referring to though, as far as sensors go, are encoders. These can be digital or analog components. Basically what they are there for is to feed information back in to your software (like the speed or rotational position of a wheel, or setting the angle of a shooter mechanism). Adding these sensors can allow the robot's code to compensate for real world effects on a commanded output. They can be particularly helpful in autonomous mode. They can allow you to target specific travel speeds or distances on your drivetrain, target specific wheel speeds on your shooter, etc. They're also helpful in teleoperated mode as it can allow single button presses to set repeatable and reliable positions/speeds on your devices, or to verify speeds/positions are within an acceptable range (like making sure your shooter wheel is above xxx RPM before shooting a disc).

To answer your question about whether or not you need them... It really depends on your design. They may not be particularly helpful on pneumatically operated mechanisms since their positions are usually pretty reliably set. Mechanisms which are motor driven can often be made more reliable or at least easier to operate with the help of sensors and some code.

As an exercise, write an autonomous mode that attempts to drive in a square, that ends in the same position that it started. All you have to do is drive straight and make a few 90 degree turns. Sounds simple enough. If you run that code repeatedly though, you will see how much variability there is in your final position. The differences in your battery voltage, wheel slippage, frictional forces at the wheels, variability in code timing between runs will all contribute to a pretty lackluster positional accuracy. Adding in sensors can allow your code to adjust for these inevitably inconsistent factors.

I would highly suggest playing around with some code that uses an encoder on the drivetrain, as well as the gyro sensor. Both come in the kit of parts, so you should have them on hand from last year's competition. Code as simple as: drive at set voltage until the encoder moves xxx", or turn at some set voltage until the gyro reaches xxx degrees, will perform significantly better than a time based algorithm. No speed/position controllers required, so it's pretty simple to write and is quite a powerful tool to have in your back pocket.

Things to read up on:
This article gives a pretty good overview of what a PID controller does and why: PID Without a PHD
CD User Ether has a good paper on how to set up a bang bang speed controller (simple alternative to using PID). This would be best suited for a shooter wheel, not drivetrain.
Wiki page on Encoders
__________________
http://team2168.org
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 07:45 AM.

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