Go to Post Yippee! Someone else that can have their every word over-analyzed, mis-read, inverted, converted, perverted, misinterpreted, reverted, and garbled besides just me! - dlavery [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 10-01-2005, 10:17
Mr. Lim Mr. Lim is offline
Registered User
AKA: Mr. Lim
no team
Team Role: Leadership
 
Join Date: Jan 2004
Rookie Year: 1998
Location: Toronto, Ontario
Posts: 1,125
Mr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond repute
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...
  #2   Spotlight this post!  
Unread 10-01-2005, 19:39
Squall Squall is offline
Registered User
#1382
 
Join Date: Jan 2004
Location: Brasil- São José dos Campos
Posts: 28
Squall is an unknown quantity at this point
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
__________________
Girafales - TEAM #1382
  #3   Spotlight this post!  
Unread 11-01-2005, 10:29
Squall Squall is offline
Registered User
#1382
 
Join Date: Jan 2004
Location: Brasil- São José dos Campos
Posts: 28
Squall is an unknown quantity at this point
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.
__________________
Girafales - TEAM #1382
  #4   Spotlight this post!  
Unread 11-01-2005, 10:51
russell's Avatar
russell russell is offline
Registered User
#1430 (WRONG)
Team Role: Electrical
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Anchorage AK
Posts: 402
russell is a name known to allrussell is a name known to allrussell is a name known to allrussell is a name known to allrussell is a name known to allrussell is a name known to all
Re: Kevin Watson's Kick-off Demo Code!

Is there not a gyro included in the kit?
  #5   Spotlight this post!  
Unread 11-01-2005, 11:02
Squall Squall is offline
Registered User
#1382
 
Join Date: Jan 2004
Location: Brasil- São José dos Campos
Posts: 28
Squall is an unknown quantity at this point
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.
__________________
Girafales - TEAM #1382
  #6   Spotlight this post!  
Unread 11-01-2005, 15:32
CJO's Avatar
CJO CJO is offline
Emeritus Pain in the $@#$@#$@#
AKA: Christopher J. O'Connell
None #1097 (Site 3 Engineering)
Team Role: Alumni
 
Join Date: Feb 2003
Location: Latrobe (over the rainbow), CA
Posts: 217
CJO will become famous soon enoughCJO will become famous soon enough
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:
This file contains an unsupported serial device driver for the 18F8520 micro. It was designed to be used with the Dynamic Debug Tool (DDT). The DDT is now apart of the IFI Loader (ver 1.8 or later) under the 'Options' menu. The DDT can be used to directly read and modify memory locations and registers of the user processor dynamically.
The camera quick start guide specifies the the PicSerialDrv.c as a required file. Furthermore, the PicSerialDrv.c specifies that :
Quote:
You can put your own callback routine inside CheckUartInts. This will allow you to parse data from another device in real time.
So, in fact, this is where I called Mr. Watsons code. The problem is, that the two drivers seem to be trying to do different things with the ports.

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:
if(camera_track_update()==1)
tracking = 1;
trakcing code
else
tracking = 0;
So, if I understand it correctly, what it is really doing is sitting in the autonomous space and waiting for an update. Is this really the best way to do this?

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:
camera_init ( yellow exposure, green exposure, red exposure )
The drawback to this is that it requires re-compiling and loading the code. Is there a way to set it so that you could use onboard switches to change the state of the exposure values without having to re-load the code? My only thouught so far was to have a pair of pushbuttons attached to the operator interface, and after pressing some button combination, the display byte gets set to the currently selected value and then the two buttons increment it up and down.
__________________
Team 1097 -- Site 3 Engineering
~~~~~~~~~~~~~~~~~~~~
2003 Sacramento Rookie All Star
2003 Silicon Valley Rookie All Star
2004 Sacramento Engineering Inspiration Award
2004 Sacramento Visualization Award
2004 Outstanding Volunteer Award (G. Glasser)
2004 Silicon Valley Sportsmanship Award
2004 National Visualization Runner Up
2004 Cal Games Finalist
2005 Sacramento Sportsmanship Award
2005 Sacramento #1 seed
2005 Sacramento Finalist

2005 Silicon Valley Sportsmanship Award
2005 Silicon Valley #1 Seed
2005 Silicon Valley Finalist


Last edited by CJO : 11-01-2005 at 15:34. Reason: Update
  #7   Spotlight this post!  
Unread 11-01-2005, 16:13
Kris Verdeyen's Avatar
Kris Verdeyen Kris Verdeyen is offline
LSR Emcee/Alamo Game Announcer
FRC #0118 (Robonauts)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 2001
Location: Houston, TX
Posts: 699
Kris Verdeyen has a reputation beyond reputeKris Verdeyen has a reputation beyond reputeKris Verdeyen has a reputation beyond reputeKris Verdeyen has a reputation beyond reputeKris Verdeyen has a reputation beyond reputeKris Verdeyen has a reputation beyond reputeKris Verdeyen has a reputation beyond reputeKris Verdeyen has a reputation beyond reputeKris Verdeyen has a reputation beyond reputeKris Verdeyen has a reputation beyond reputeKris Verdeyen has a reputation beyond repute
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.
__________________
...Only a few people are awake and they live in a state of constant total amazement. -JP Shanley, Joe vs. the Volcano
  #8   Spotlight this post!  
Unread 11-01-2005, 16:29
vtrehan's Avatar
vtrehan vtrehan is offline
Mentor - Controls & Programming
AKA: Vivek Trehan
FRC #1241 (Theory6)
Team Role: Mentor
 
Join Date: Oct 2004
Rookie Year: 2004
Location: Mississauga, ON
Posts: 38
vtrehan is on a distinguished road
Send a message via Yahoo to vtrehan
Re: Kevin Watson's Kick-off Demo Code!

Quote:
Originally Posted by Kris Verdeyen
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.
You can use the ADXRS300 from Analog devices, it costs arround $50 and can be used with Mr.Watsons code. Heres the link, http://www.analog.com/en/prod/0%2C28...S300%2C00.html
__________________
2006-GM Industrial Design Award - Greater Toronto Super Regional
2006-Engineering Inspiration Award - Arizona Regional
2006-Regional Finalist - Arizona Regional

2005-Best Defensive Robot - Wonderland Off-Season
2005-Regional Chairman's Winners - Greater Toronto Regional
2005-Regional Champions - Waterloo (Thanks 68 and 1305)
2005-Best Website - Greater Toronto Regional
2005-Team Spirit Award - Waterloo
2005-Entreprenuership Award - Waterloo

2004-Rookie All-Star award - Great Lakes Regional
2004-Rookie Highest Seed - Greater Toronto Regional
2004-Rookie All-Star award - Greater Toronto Regional
2004-Team Spirit award - Greater Toronto Regional
2004-Team Spirit award - National Championship


  #9   Spotlight this post!  
Unread 11-01-2005, 16:46
stephenthe1 stephenthe1 is offline
Registered User
#1008
 
Join Date: Dec 2004
Location: Ohio
Posts: 113
stephenthe1 is on a distinguished road
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.
  #10   Spotlight this post!  
Unread 11-01-2005, 17:08
CJO's Avatar
CJO CJO is offline
Emeritus Pain in the $@#$@#$@#
AKA: Christopher J. O'Connell
None #1097 (Site 3 Engineering)
Team Role: Alumni
 
Join Date: Feb 2003
Location: Latrobe (over the rainbow), CA
Posts: 217
CJO will become famous soon enoughCJO will become famous soon enough
Re: Kevin Watson's Kick-off Demo Code!

Also check out this guy . . .
http://www.drrobot.com/products_item...Number=DTA5102
__________________
Team 1097 -- Site 3 Engineering
~~~~~~~~~~~~~~~~~~~~
2003 Sacramento Rookie All Star
2003 Silicon Valley Rookie All Star
2004 Sacramento Engineering Inspiration Award
2004 Sacramento Visualization Award
2004 Outstanding Volunteer Award (G. Glasser)
2004 Silicon Valley Sportsmanship Award
2004 National Visualization Runner Up
2004 Cal Games Finalist
2005 Sacramento Sportsmanship Award
2005 Sacramento #1 seed
2005 Sacramento Finalist

2005 Silicon Valley Sportsmanship Award
2005 Silicon Valley #1 Seed
2005 Silicon Valley Finalist

  #11   Spotlight this post!  
Unread 12-01-2005, 11:09
Squall Squall is offline
Registered User
#1382
 
Join Date: Jan 2004
Location: Brasil- São José dos Campos
Posts: 28
Squall is an unknown quantity at this point
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 ?
__________________
Girafales - TEAM #1382
  #12   Spotlight this post!  
Unread 12-01-2005, 11:27
Mark McLeod's Avatar
Mark McLeod Mark McLeod is online now
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,825
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: Kevin Watson's Kick-off Demo Code!

Quote:
Originally Posted by Squall
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
Post the model gyro you are using and we might be able to help with those parameters.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
  #13   Spotlight this post!  
Unread 12-01-2005, 11:46
Anthony Kesich's Avatar
Anthony Kesich Anthony Kesich is offline
Programmer Turned Engineer
AKA: SonKenshin
#1097 (Site 3 Engineernig)
Team Role: Leadership
 
Join Date: Jan 2003
Rookie Year: 2003
Location: Sacramento, CA
Posts: 186
Anthony Kesich has a spectacular aura aboutAnthony Kesich has a spectacular aura about
Send a message via AIM to Anthony Kesich
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
__________________
C is screwing up my English--I'm ending all my sentences in semi-colons;

Horray for most things! -George Carlin

"Sure, I'll play rugby. Besides, I have a lot of experience running from really big guys who want to cream me." -Me, Freshman year
  #14   Spotlight this post!  
Unread 12-01-2005, 13:35
Squall Squall is offline
Registered User
#1382
 
Join Date: Jan 2004
Location: Brasil- São José dos Campos
Posts: 28
Squall is an unknown quantity at this point
Re: Kevin Watson's Kick-off Demo Code!

Quote:
Originally Posted by Mark McLeod
Post the model gyro you are using and we might be able to help with those parameters.
Hi, We're using this one :

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
__________________
Girafales - TEAM #1382
  #15   Spotlight this post!  
Unread 12-01-2005, 16:10
Kevin Watson's Avatar
Kevin Watson Kevin Watson is offline
La Cañada High School
FRC #2429
Team Role: Mentor
 
Join Date: Jan 2002
Rookie Year: 2001
Location: La Cañada, California
Posts: 1,335
Kevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond repute
Re: Kevin Watson's Kick-off Demo Code!

Quote:
Originally Posted by Squall
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 ?
Sorry, I haven't been around much. The hillside directly behind my house collapsed last Sunday and I've been dealing with the mess.

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
__________________
Kevin Watson
Engineer at stealth-mode startup
http://kevin.org
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Coding / Style Standards for sharing C code Joe Johnson Programming 33 01-05-2004 15:15
heres the code. y this not working omega Programming 16 31-03-2004 15:18
Conflict between "Initialize_Tracker()" and "pwm13 & pwm15"? Kevin? gnormhurst Programming 3 22-02-2004 02:55
EDU Demo Code: Encoder Interfacing Using Interrupts Kevin Watson Programming 4 08-01-2004 23:14
EDU Demo Code: Serial Data Transmitter Using a State-Machine Kevin Watson Programming 3 28-12-2003 22:56


All times are GMT -5. The time now is 10:58.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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