![]() |
Kevin Watson's Kick-off Demo Code!
Kevin's done a great job again this year! The IR and encoder code he supplied last year was outstanding, and I had a chance to quickly flip through his code providing gyro, PID, and navigation scripting. See http://kevin.org/frc/ the first link.
This year is going to be a LOT of fun! Thanks Kevin! A few quick questions/comments for anyone who's looked at the code: 1) I think you'll need to source two encoders (not in the kit) to work with this code. The gear tooth sensors included in the kit may not cut it, unless you buy two more, and are clever about aligning them to simulate a quadrature output. 2) There is no camera code in here. So for teams looking to use the some combination of camera navigation, navigation scripting, and position sensing via encoders and gyro, you'll need to fuse the two together. So don't get too excited about things being TOO easy. 3) Will the included gyro code work with the accelerometer provided in the kit? Plug and play I hope? I didn't pick up on what kind of gyro Kevin Watson used for the demo robot. Good luck to everyone! -SlimBoJones... |
Re: Kevin Watson's Kick-off Demo Code!
I'm trying to find out what Gyro he used, or if it isn't the acelerometer
My team is gonna buy two Encoders, we just have to adjust the code so that it can work with our Encoders and we need to find out what's the gyro we need |
Re: Kevin Watson's Kick-off Demo Code!
Hey, I've email kevin with this question and he answered :
"The software should work with quite a few gyros. We used one made by Silicon Sensing Systems, but you should be able to use the popular Analog Devices ADXLS150 or ADXLS300 gyros too by modifying the GYRO_RATE_SCALE_FACTOR and GYRO_ANGLE_SCALE_FACTOR #defines in gyro.h. We used two Grayhill 61K128 encoders on the gearbox output shaft." I think that this info can be of use to a lot of teams, and this way we don't have to botter Kevin so much asking the same question. |
Re: Kevin Watson's Kick-off Demo Code!
Is there not a gyro included in the kit?
|
Re: Kevin Watson's Kick-off Demo Code!
No, the sensor that's included in the kit is the accelerometer, it's similar but it's not the same thing.
The accelerometer gives you the instant acceleration, and the gyro gives you the angular velocity. |
Kevin Watson's Scripting code and the Camera System
P.S. I have re-posted this as a new thread here.
I have not had a chance to e-mail Mr. Watson yet, however, trying to integrate the Camera control system into the scripting code is becoming a real nightmare. The difficulty is in the serial port driver. The problem as I see it is thus: 1) There are really three different serial port drivers, they are: a) usr_SerialDrv.c b) serial_ports.c c) PicSerialDrv.c"a" is the defaut FRC driver, no need to worry about it just delete it. "b" is Mr. Watson's serial port driver, allowing LCD screens and printf functions from the FRC controller. "c" is the serial port driver which comes with the camera. "b" and "c" really do most of the same things, put are not intrinsically compatible. My immediate solution is to call some parts of "b" from within "c," thereby leaving the camera driver intact and just adding certain functionality from the seril ports driver. Problem is, in even limited testing on the controller it has been doing some really weird things. 2) What the is the "Dynamic Debug Tool?" This phrase was included in the camera software. In the PicSerialDrv.c file there was this comment: Quote:
Quote:
3) While trying to use interrupts (a switch attached to one of the digital ports) and the camera software at the same time, the controller keeps resetting itself, for no reason which I can identify. 4) Building on #3, the camera has what is esentially a state machine servicer (for lack of a better term) built into it; that is, calling camera_track_update() will tell you whether or not the camera has been successful in updating and tracking to a new position. To my mind, this should be handled almost like an interrupt, that is, when it returns 1, the camera track code is executed, but in the code provided, it sits in user_routines_fast in the sutonomous section, and simply says: Quote:
5) Finally, the camera needs to be calibrated before use. This is done by hooking a PC up to the camera and running a JAVA script program to get exposure values. You then have to send these values to the camera in "User_Initialization()" by including the line Quote:
|
Re: Kevin Watson's Kick-off Demo Code!
The CRS03-02 gyro "puck" costs $299 from newark: http://www.newark.com/NewarkWebComme...&Ntk=gensearch
That's over the $200 / part limit. If someone knows of a distributor that sells the chip itself for less, please post it. |
Re: Kevin Watson's Kick-off Demo Code!
Quote:
|
Re: Kevin Watson's Kick-off Demo Code!
will this code work for last years controller? (the whole scripting thing). also, what are the parameters for? do they have a definition somewhere else in a .h file? also, what is the default setup of the robot (motors, etc.) that these commands will work with? or is this what the parameters are for. either way, we'll need a description of the robot layout.
|
Re: Kevin Watson's Kick-off Demo Code!
Also check out this guy . . .
http://www.drrobot.com/products_item...Number=DTA5102 |
Re: Kevin Watson's Kick-off Demo Code!
Has anyone been able to substitute the gyro ?
I've been looking for info on how to do that, Kevin told me that I should change that two variables that I previously posted, but I can't understand them, and I can't find that info on my Gyro Datasheet Does anyone have an Ideia ? |
Re: Kevin Watson's Kick-off Demo Code!
Quote:
|
Re: Kevin Watson's Kick-off Demo Code!
Any teams that competed in the 2003 competition should already have a gyro. Its that ugly black rectangle they gave us. The spec sheets were not to hard to find (I'll post a link when I get it again) and it wasn't too hard to make a pwm adapter. Using it should save teams a lot of money.
-Tony K |
Re: Kevin Watson's Kick-off Demo Code!
Quote:
ADXRS150 from analog devices It's datasheet can be found here : http://www.analog.com/UploadedFiles/...ADXRS150_B.pdf We kind of understand the values that we have in the datasheet, but we really couldn't find one that could match the ones needed to alter in Kevin's code. Thanks for your attention |
Re: Kevin Watson's Kick-off Demo Code!
Quote:
Anyway, the two variables are GYRO_RATE_SCALE_FACTOR and GYRO_ANGLE_SCALE_FACTOR. GYRO_RATE_SCALE_FACTOR should be set to a value equal to the gyros sensitivity in units of angular rate per volt divided by the ADCs bits per volt. Set GYRO_ANGLE_SCALE_FACTOR to GYRO_RATE_SCALE_FACTOR divided by the update rate, which is 50Hz. So, for example, to use the Analog Devices' ADXRS150 evaluation board, which has a sensitivity of 12.5mV/degree/sec, take the inverse of that sensitivity (80 degrees/sec/volt) and divide by the number of ADC bits per volt (1024/5), which equals (80 x 5)/1024 = 400/1024 = 100/256. The GYRO_ANGLE_SCALE_FACTOR is then just (100/256)/50 = 2/256 = 1/128. In the coming days I'll be working on cleaning up not only my house, but the code too <grin>. -Kevin |
| All times are GMT -5. The time now is 06:27. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi