Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Autonomy: How Did You Guys Do It? (http://www.chiefdelphi.com/forums/showthread.php?t=93554)

vinnie 15-03-2011 23:55

Re: Autonomy: How Did You Guys Do It?
 
We use a combination of line tracking and ultrasonic rangefinding. Our robot follows the line at about 40% speed and then slows to 20% when it reaches around 60inches away from the wall. We have a lot of fun starting our robot totally crooked and watching it straighten itself out. Also we are using position control for the arm with the E4P encoder in the KOP

Kingofl337 17-03-2011 15:54

Re: Autonomy: How Did You Guys Do It?
 
Quote:

Originally Posted by Bethie42 (Post 1039344)
On another note, has anyone here worked on an autonomous mode that scores more than one tube?

We have, done two tubes.

We turn the robot into a rolling PID Loop and just start executing commands to the PID controllers.

Arm Length and Tilt PID for HighMiddle
Ultrasonic & Gyro PID to 36" from the wall.
Ultrasonic & Camera PID to the peg tube 1
Reverse Claw
Arm Length & Tilt PID to home
Arm Length and Tilt PID for Front Pickup Run Claw Intake
Strafe Wheel Pods & Encoder PID infront of tube 2
Drive FWD until the claw detects a tube
Arm Length & Tilt PID to HighEndPeg
Ultrasonic & Gyro PID 36" from the wall
Ultrasonic & Camera PID to the Peg
Arm Length & Tilt PID to home
Reverse Claw

If you watch the video you can see each step: Video

AlexD744 17-03-2011 17:46

Re: Autonomy: How Did You Guys Do It?
 
Quote:

Originally Posted by torihoelscher (Post 1038851)
We used Line Sensors, a sonar, a Gyro, and a backup way to make the auto move. Of course the Line Sensors gave us a hassle that we had to disable them and trust the sonar. it was great!!!

Are you using the gyro to keep you straight if the robot veers? I feel like that would be a common occurrence with the bumps in the field and a swerve drive.

theprgramerdude 17-03-2011 18:24

Re: Autonomy: How Did You Guys Do It?
 
I used a for loop that drove forward and raised the arm at set speeds. Piece of cake.

Grim Tuesday 17-03-2011 19:27

Re: Autonomy: How Did You Guys Do It?
 
We had the whole grand plan: Camera tracking, line following, PID loop. Unfortunately, none of our optical encoders could be coerced to work, despite constant replacements. And the camera made the C-RIO crash.

So now we have a "drive forward, lift up, open grabber" auto.

adf0221 19-03-2011 12:54

Re: Autonomy: How Did You Guys Do It?
 
are you using the newest camera? if so you need to use a non-crossover cable to connect it to the crio to prevent it from crashing..thats how we fixed our problem

PriyankP 19-03-2011 13:40

Re: Autonomy: How Did You Guys Do It?
 
We had many combinations of sensors to make the auto work but in the end, we went with line sensors, ultra sonic and pot on the arm.

We start the auto by line tracking at about 8ft/s and stopping the base at some distance away from the wall. While it's line tracking, our arm moves to the high goal preset. Once it reaches the target distance, it starts to orient the tube & de-suck it out of the rollers. And the arm is slightly lowered too. :)


I tried using gyro but due to sensor inefficiency, the gyro reading would keep increasing even if the robot's not moving. I was told that it happens with all gyros and it shouldn't make a big difference in the 15-20 second autos...

Michael DiRamio 19-03-2011 15:43

Re: Autonomy: How Did You Guys Do It?
 
Quote:

Originally Posted by PriyankP (Post 1042029)
I tried using gyro but due to sensor inefficiency, the gyro reading would keep increasing even if the robot's not moving. I was told that it happens with all gyros and it shouldn't make a big difference in the 15-20 second autos...


It will always drift slightly. If you're noticing big changes it's likely that the robot was moving when the gyro initialized and biased. If that happens it will constantly think it is in motion afterwards. Make sure that it's completely still during boot up.

PriyankP 20-03-2011 02:14

Re: Autonomy: How Did You Guys Do It?
 
Quote:

Originally Posted by Michael DiRamio (Post 1042067)
It will always drift slightly. If you're noticing big changes it's likely that the robot was moving when the gyro initialized and biased. If that happens it will constantly think it is in motion afterwards. Make sure that it's completely still during boot up.

I think the last time I got the gyro to work properly it was changing by a degree every 5 seconds... although it wouldn't have made a huge difference, I abandoned the idea of an auto with gyro to stay straight because it made our base oscillate when I programmed it to stay within +-1degree of the original heading. When I get back to the room again, I'm going to test it again with initialization in robotinit() function, but I doubt it will make a lot of difference because the the degree of change was measured in disabled mode.

On that note, how often do other programmers call for inputs from sensors during autonomous and teleop periods? I've always called it at the beginning of every iteration but not sure if calling it every other iteration would made a huge difference.

davidalln 20-03-2011 08:59

Re: Autonomy: How Did You Guys Do It?
 
Quote:

Originally Posted by PriyankP (Post 1042283)
On that note, how often do other programmers call for inputs from sensors during autonomous and teleop periods? I've always called it at the beginning of every iteration but not sure if calling it every other iteration would made a huge difference.

Calling it at the beginning of the loop is probably the best idea. If you call it at the end, and the code hangs up for whatever reason, then you'll be running with stale data the next loop iteration. But in reality, it shouldn't matter that much.

We ubertubed 15/16 matches at Peachtree. Line tracking is working great for us :D

MikeE 20-03-2011 13:21

Re: Autonomy: How Did You Guys Do It?
 
We developed camera tracking and have used gyro in previous years but this year we found that the line sensors were very reliable as long as they are calibrated properly to the field. The lights on the front of the sensors make them very easy to calibrate manually when sliding the robot from side to side over the lines.

Our robot has KoP quad encoders for each of the mechanum wheel modules, so we know how far the robot has travelled forward. There is code to detect if an encoder is providing unreliable values, hence excluding it from calculation. Typical problems are no signal due to wiring problems or physical encoder damage.

We do have an encoder on the elevator, but we have found the most reliable method is to drive the elevator to the top and check the current draw from the motor via CAN. As soon as the elevator gets to the top, the motor starts to stall, increasing current draw which we detect and stop the motor. This method also help if we are get too close and hit some other part of the peg grid structure since it will stop the elevator, rather than unsuccessfully trying to drive it through the grid to a preset point.

The code is written in Java in the autonomousPeriodic() method as a state machine, with timeouts on many states to allow for sensor failures.

Summarizing: line sensors for direction, quad encoders on drivetrain for distance travelled, current draw from elevator motor and timing for pneumatics. Ultrasonic range finding would be a helpful addition.

The biggest problem was lack of access to a real field to test out the system. In particular we had extremely limited access to the practice field during our Regional. Testing by watching the system perform during a match is a very public way of finding bugs, which I do not recommend for the thin-skinned.

siggy2xc 20-03-2011 21:54

Re: Autonomy: How Did You Guys Do It?
 
We recorded our joystick inputs to a file on the cRIO and played them back, it worked amazingly well. Heres a link to my program http://www.chiefdelphi.com/forums/sh...ad.php?t=93720

davidthefat 21-03-2011 19:25

Re: Autonomy: How Did You Guys Do It?
 
Sigh... I guess I will have to go with the blind man way... Autonomy with only encoders. Hey, but at least it is so easy to program that.

theprgramerdude 21-03-2011 19:58

Re: Autonomy: How Did You Guys Do It?
 
Did you write your own encoder code?

davidthefat 21-03-2011 20:11

Re: Autonomy: How Did You Guys Do It?
 
Quote:

Originally Posted by theprgramerdude (Post 1043379)
Did you write your own encoder code?

No, because I have no access to the FPGA. I read that all the encoder calculations basic are done on the FPGA and that the WPILib is just an interface with the FPGA. Even if I write my own program to interface with the encoders, the FPGA has to be the middle man. I can't do anything if the FPGA is doing the internal calculations all wrong.


All times are GMT -5. The time now is 23:41.

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