|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools |
Rating:
|
Display Modes |
|
|
|
#1
|
|||||
|
|||||
|
Re: Programming tricks (and former trade secrets)
I made the robot fight gravity
actually it was a code w/ the accelerometer that would try and push back, but with no testing it made driving impossible because I got the direction that it corrects wrong, so it fights itself, oopsIn the way of useful things I did this year, I got our omniwheel bot to drive mostly straight(still have to tune that) using a gyro chip that hopefully will self calibrate. The drive code also very nicely allows us to drive it FPS style with one joystick for translation and the x axis on the other for spin. |
|
#2
|
||||
|
||||
|
Re: Programming tricks (and former trade secrets)
Our programer made our lift motor a 20000 position servo with a program that state level 1 is between position 5000, and 7500 and so forth. He also got most of our operational programing done first time ever for that.
|
|
#3
|
||||
|
||||
|
Re: Programming tricks (and former trade secrets)
I've been working on a library that will work with version 3.0 of the C18 compiler. I'm almost there...
-Kevin |
|
#4
|
|||
|
|||
|
Re: Programming tricks (and former trade secrets)
Quote:
If you're using a DAA to control an arm, you might consider using a quadrature encoder. DAAs are prone to drift, and aren't very accurate when you integrate them twice to get position. |
|
#5
|
|||||
|
|||||
|
Re: Programming tricks (and former trade secrets)
I had to slow down the speed of our spin because at full speed the spin is roughly 2 rev/sec, not drivable at all, the YRG is on there to adjust the spin so that we spin reliably and dont over spin.
the DAA was intended to push back against another robot when they bump us, sadly it ended up fighting itself so thats something I'm going to try and fix on thursday otherwise it will just be scrapped. |
|
#6
|
||||
|
||||
|
Re: Programming tricks (and former trade secrets)
We were just proud to get so many systems to work together:
The adc is now working in conjunction with the gyro code to integrate 400 times a second (which needs a long long, but we made it reset every 360 degrees to prevent overflow). I'm soon to add in the Dual Axis Accelerometer to account for tilt so that I can kill the gyro integration if the tilt exceeds a certain angle. We used the eeprom and trig funtions in order to make field-oriented holonomic (which I almost had working perfectly when they tore it out of my hands to ship it... hardware team didn't get the robot done until yesterday... sadness). And we're working on sticking the gyro bias into the eeprom as well in order to prevent recalculation every time you turn on the robot. The encoder (a banner IR sensor) counts the number of times a wheel turns in order to keep track of the height of the arm. And we were going to do the camera, but the autonomous ended up being so enormous, that we had to abandon it. We made the whole thing with multiple light tracking, and we had a plan, but it was just too difficult to get it running straight without a working Dual Axis Accelerometer and perfect camera code that we had to give up. 15 seconds is not very much time. Although it's not particularly useful code, anyone who wants it can PM me for the accelerometer and gyro code we made. It's a little too processor intensive if your planning on doing the camera, but it can integrate up to 6200 times a second to keep really close track of the gyro angle or velocity. For whatever reason, we couldn't seem to make it keep track of the velocity very well, but we cut the error on the angle down to .5 degrees for a full spin on the bot. Last edited by kitscuzz : 20-02-2007 at 20:54. |
|
#7
|
|||||
|
|||||
|
Re: Programming tricks (and former trade secrets)
I wrote a two-shot arm control module--if the arm's potentiometer value is more than a certain amount, it will send full speed out to that joint, otherwise, it will send a slower value until it is within a "deadband". Unfortunately, I didn't get as much testing in as I wanted to because the gear that meshes with the worm-tooth kept losing teeth and the robot dentist got more and more agitated as the night went on...I nicknamed our 'bot "gear muncher" because I broke 3 gears yesterday and 2 the day before. Little brass teeth are littering the floor. Not Good. We have some hardened steel gears coming, though.
I also have an EEPROM solution in place--you move the arm to where you want it, then hold a button combo on the handheld and the robot saves that position to the EEPROM and will recall it when that button is pressed. Of course, our code still isn't done. It's...functional...which is an improvement over last year. JBot |
|
#8
|
||||
|
||||
|
Re: Programming tricks (and former trade secrets)
Quote:
Well now I have a solution for resetting the arm position before each match. The banner IR encoder solution I talked about is arbitrary, this will keep it in place. |
|
#9
|
||||
|
||||
|
Re: Programming tricks (and former trade secrets)
I'd recommend against doing this. The gyro bias can vary quite a bit based on a number of factors like temperature, voltage, etc. It's completely possible for it to be different every time you turn the machine on.
|
|
#10
|
|||
|
|||
|
Re: Programming tricks (and former trade secrets)
We wrote some code that eliminates the need for a programmer...
![]() |
|
#11
|
|||||
|
|||||
|
Re: Programming tricks (and former trade secrets)
In addition to debuting the scripting system I wrote in the pre-season 2006 (that we ended up not needing -- it was a very strange robot), I tried a few structural things.
The scripting is based on preprocessing direct calls to functions, instead of Kevin Watson's structure-based navigation code. (The preprocessing is so that the script will abort when autonomous ends.) It follows the idea of a lot of little loops: every command calls HEARTBEAT at least once, and that handles getdata() and putdata() calls. This all makes C-like syntax: Code:
SCRIPT drive_half_field()
{
CMD_UNFURL(NO_WAIT);
CMD_DRIVE(FEET(20));
CMD_TURN(DEGREES(90), RIGHT);
CMD_WAIT(SECONDS(2));
CMD_HOME_IN(); // Drives towards the light
CMD_DROP(); // Drop that keeper!
CMD_DRIVE(INCHES(-18));
CMD_TURN(DEGREES(90), LEFT);
CMD_DRIVE(FEET(20)); // And maybe crash into someone!
}
One of the big ones this year was that every mechanism followed a standard interface. Every mechanism had the following macros or functions:
I also had my usually tools, namely pinouts.h (a configuration file of all the hardware I/O aliases and tweaking constants), Eclipse, and old code. Also, I'm the operator this year, so I can make it as complex as I want. (Because I know how it all goes!) Ok, not really. There is a backup driver that I have to keep up-to-date. Amongst the things I may do between now and our competitions:
Quote:
Isn't that ironic? Writing code to keep you from writing code? |
|
#12
|
||||||
|
||||||
|
Re: Programming tricks (and former trade secrets)
Me being the main programmer on a rookie team and not knowing what to expect, and not programming in over 10 years, I incorporated the following "different" features:
1. Neutral control/Panic button: Before we knew about the v14 fix for the run on condition, I was concerned about the robot running out of control as we had encountered this problem, so I added some code that puts both motors in Neutral by pressing either joystick trigger button. (we have a 2 wheel drive CIM motor system). I left this feature in the code in case in the heat of the moment, the operator needs to stop. Quote:
Incidently, because the turbo mode is set for each drive wheel independently with the thumbwheel on its joystick, some pretty quick and possibly uncontrolled turns can be made. Also, testing confirmed that if the operator holds down the triggers (neutral and puts both joysticks forward with both the turbo buttons on and then releases the trigger buttons that we could do a "hole shot" and a "wheelie"... well it looks cool anyhow... The Y axis code (p1_y = (p1_y /speed) + plus_speed; & p1_y = (p2_y /speed) + plus_speed; ) is in there as we originally set this up for single joystick control and it works for that as well so I left the code in there. Here is what my crude code for that looks like: Quote:
Quote:
Quote:
Quote:
Quote:
Some of these ideas that I used, I am sure you pros have figured out better methods for or used something similar and I am hoping that you share those ideas with me... I just wanted to share a few of my ideas with you all... Good luck to all in your competition! |
|
#13
|
||||
|
||||
|
Well, This year I was set on programming autonomous, but I am hardly sure we will have a robot that needs it
. It is 19% complete, and still in alpha stage, but I had promised myself that I would continue even though the robot is shipped (having problems trying to get the Controller to work without an OI, but I believe that that is default), and what I have now may interest some.As I said, it is VERY incomplete, and not altogether working. It is a terminal interface to the controller (mainly for debugging purposes) that eventually will replace most programming that a team would need to do (as far as autonomous and some others, PWM mappings and others will still need to be modified every now and then ).I have already integrated Kevin's Camera Processing routines, Serial IO routines, and EEPROM (still unverified, sigh) routines, and the interface is kinda cool. If you want some more info, check out the attachment. The main features are (/will be): - Easy autonomous programming by the end-user (a.k.a. the non-programmers) using the terminal interface - Easy Drive controls altering/setting using the terminal interface - QuickView info on various IO's (like pwms, DigIO, AnaIO, Battery voltage) through the terminal - On-the-fly Calculation of field placement using camera, accelerometers, gyros, IR, yada yada... - Easy autonomous programming... (wait, did I already say that?) using a (slightly) intuitive terminal interface Did I mention that all of this is through the terminal interface? Unfortunately, I haven't coded the IFI loader's interface menu yet, but HyperTerminal works absolutely fantastic for now, with auto-updating information on the fly and a much more user-friendly menu (I tried implementing a line-by-line menu; didn't work out at all, updated information tended to cause the menu to disappear rather quickly, yada yada.) Still in Beta! If anyone could assist writing autonomous action code (read about it in the documentation) please PM me! BTW, does anyone have a memory free count for the default code? I would like to post how much memory my "add-on" will take, and I forgot .Also, I would like to add code for things like Gyros and Accelerometers, but since We do not have such things (working or not) I cannot possibly program for it. At the current time almost none of my program uses timers (forgot how, :stupidme and If I cannot use data from sensors, the code would be blind. anyways...Like I said, 19% complete, still need LOTS of code, see attachment for more info. Catch you all later! ![]() |
|
#14
|
||||
|
||||
|
Re: Programming tricks (and former trade secrets)
Quote:
|
|
#15
|
|||
|
|||
|
Re: Programming tricks (and former trade secrets)
Hm... We used mecanum wheels. We coded the usual translation routines, then used a third axis on the joystick (twist) for rotation.
We didn't design it this way, but what emerged was that driving in circular arcs was VERY easy, which the drivers love because of the design of the rack. Other features...the arm's motion is limited by a pot, but if the pot fails (becomes disconnected), the arm will still be usable. I wish I could say we thought of this BEFORE the pot failed (wiring problem).... I'd love to restructure the First code...I really don't like their coding style, but 6 weeks isn't enough time for that, so making the robot work was priority #1 --buddy |
![]() |
| 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 |