|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools |
Rating:
|
Display Modes |
|
#12
|
|||
|
|||
|
Re: Programming tricks (and former trade secrets)
I'm something of a rookie to the programming field, particularly robotics programming. Heck, I didn't really know C until the beginning of the season, and I had no CLUE what a PD or PID loop was until a mentor showed me the ins and outs of it...
However, one of our team rules being that only the students may produce the final product, I was drafted into the job--especially since I was the only guy on the team that knew a #define from an int. Thankfully, I had an older robot to practice on, and I'm fairly well up on my higher math algorithms, so it wasn't all that bad... Our robot is a 2-wheel drive, caster steering lightweight--not designed for pushing matches, but fast enough to get out of the way should one begin. Given that information, I quickly realized that even though our team used NO gearbox except the KOP transmission, we needed to have both very high speed and enough precision to control the 'bot at low speed. To combat this discrepancy, I eventually resorted to a math trick I'd learned long ago... Exponential control. The code goes something like this: Quote:
Of course, this is a little different than the code we used, as it's not mixed for multiple drive motors or anything. A couple other cool things we did: -Position-based arm: Position is controlled by a shaft encoder; if the arm is knocked off position it will automatically try to return to that position -Simple drive system--the robot can be controlled completely using only two joystick axis, the top hat, and a trigger -Automated function for "return to home"--resets the robot, brings the arm and wrist back into folded positions and readies it for another round -Automated function for "drop ringer"--we determined a precise sequence of motions that are very efficient for hanging a ringer on a post once positioned properly, then assigned a button to perform all these motions simultaneously. The result is rather cool--the robot drops the ringer on the rack in one smooth (though rather noisy--it's running 3-4 elements simultaneously!) motion, much faster than any of our drivers could perform the task, and gets the arm out of the way of the ringer entirely. We tinkered around with autonomous code, and with the use of 2 PD positioning algorithms got the robot to drop a ringer successfully. However, we'll need a couple things tweaked before competition--the building team crated the robot before I could manage to get the code to raise the arm to the proper scoring position in! ![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Former FIRST student and mentor dies in a tragic rocket attack in Iraq today. | Munkaboo | General Forum | 48 | 19-04-2005 12:21 |
| Off-season competetions and former teams | Venkatesh | Off-Season Events | 5 | 10-12-2004 17:23 |
| Harry Potter and the Chamber of Secrets | Ryan Dognaux | Chit-Chat | 33 | 01-12-2002 19:57 |
| scouting tips and tricks | Rick | Scouting | 1 | 08-01-2002 00:52 |