Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Java (http://www.chiefdelphi.com/forums/forumdisplay.php?f=184)
-   -   Java Autonomous Help (http://www.chiefdelphi.com/forums/showthread.php?t=118905)

TenaciousDrones 09-09-2013 09:32

Re: Java Autonomous Help
 
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?

otherguy 09-09-2013 13:22

Re: Java Autonomous Help
 
Quote:

Originally Posted by TenaciousDrones (Post 1290590)
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


All times are GMT -5. The time now is 11:34.

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