Go to Post Back in MY day, we had full metal to metal contact. Not any of this wussy bumper stuff! - Michael Hill [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 11-01-2005, 15:31
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
Scripting Setup and the Camera + Serial Port Drivers

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

  #2   Spotlight this post!  
Unread 11-01-2005, 20:11
Unsung FIRST Hero
Mike Betts Mike Betts is offline
Electrical Engineer
no team
Team Role: Engineer
 
Join Date: Dec 2001
Rookie Year: 1995
Location: Homosassa, FL
Posts: 1,442
Mike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond repute
Re: Scripting Setup and the Camera + Serial Port Drivers

Quote:
Originally Posted by CJO
...trying to integrate the Camera control system into the scripting code is becoming a real nightmare. The difficulty is in the serial port driver...
In defense of Kevin, First, Woody, et al, I expected nothing less. Engineering is all about trade offs. You can design yor system to do A, B or C easily. Combining A abd C or A and B or B and C requires some effort. Combining A, B and C should be near impossible.

If you try to use every motor and actuator in the kit, you will be about 60 pounds overwieight.

Set your priorities. What does this robot NEED to do? Now look at options. What will give you a winning design?

To quote an Eagle: Get over it...
__________________
Mike Betts

Alumnus, Team 3518, Panthrobots, 2011
Alumnus, Team 177, Bobcat Robotics, 1995 - 2010
LRI, Connecticut Regional, 2007-2010
LRI, WPI Regional, 2009 - 2010
RI, South Florida Regional, 2012 - 2013

As easy as 355/113...
  #3   Spotlight this post!  
Unread 11-01-2005, 20:21
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: Scripting Setup and the Camera + Serial Port Drivers

No, no . . .

Kevin Watson has basically saved our program for the past two years, I am not trying to imply that he or FIRST has fallen down on the job in any way, rather, I am saying that there is a big challenge for the teams to overcome.

My post was not to complain about what is, but rather to elicit help for the serial driver problem, which frankly, has me stumped.
__________________
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

  #4   Spotlight this post!  
Unread 11-01-2005, 20:44
Unsung FIRST Hero
Mike Betts Mike Betts is offline
Electrical Engineer
no team
Team Role: Engineer
 
Join Date: Dec 2001
Rookie Year: 1995
Location: Homosassa, FL
Posts: 1,442
Mike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond repute
Re: Scripting Setup and the Camera + Serial Port Drivers

Likewise, so am I... It is one of the reasons I posted on another thread when people said that they had made the software too easy...

Resolving I/O and interrupts will also be a challenge for the team who wants to do everything...

Let the mayhem begin!
__________________
Mike Betts

Alumnus, Team 3518, Panthrobots, 2011
Alumnus, Team 177, Bobcat Robotics, 1995 - 2010
LRI, Connecticut Regional, 2007-2010
LRI, WPI Regional, 2009 - 2010
RI, South Florida Regional, 2012 - 2013

As easy as 355/113...
  #5   Spotlight this post!  
Unread 11-01-2005, 21:34
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: Scripting Setup and the Camera + Serial Port Drivers

Another question: The rules allow us to have secondary processors. So could you have a second processor which does nothing but service interrupts, and then passes bytes along to the FRC controller in a TTL type format.
__________________
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

  #6   Spotlight this post!  
Unread 11-01-2005, 22:12
Unsung FIRST Hero
Mike Betts Mike Betts is offline
Electrical Engineer
no team
Team Role: Engineer
 
Join Date: Dec 2001
Rookie Year: 1995
Location: Homosassa, FL
Posts: 1,442
Mike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond repute
Re: Scripting Setup and the Camera + Serial Port Drivers

Quote:
Originally Posted by CJO
Another question: The rules allow us to have secondary processors. So could you have a second processor which does nothing but service interrupts, and then passes bytes along to the FRC controller in a TTL type format.
Yes. Although timing and interrupt latency will be issues....
__________________
Mike Betts

Alumnus, Team 3518, Panthrobots, 2011
Alumnus, Team 177, Bobcat Robotics, 1995 - 2010
LRI, Connecticut Regional, 2007-2010
LRI, WPI Regional, 2009 - 2010
RI, South Florida Regional, 2012 - 2013

As easy as 355/113...
  #7   Spotlight this post!  
Unread 11-01-2005, 22:13
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: Scripting Setup and the Camera + Serial Port Drivers

Good Point
__________________
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

  #8   Spotlight this post!  
Unread 11-01-2005, 22:44
DanDon's Avatar
DanDon DanDon is offline
ohhh MY god
AKA: Dan Hoizner
FRC #0375 (The Robotic Plague)
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2004
Location: Staten Island, NY
Posts: 1,432
DanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond repute
Send a message via ICQ to DanDon Send a message via AIM to DanDon Send a message via MSN to DanDon
Re: Scripting Setup and the Camera + Serial Port Drivers

Hey,

Can someone point me to a tutorial regarding interrupts, and their implementation? I would much appreciate it, thanks in advance.

Dan
  #9   Spotlight this post!  
Unread 11-01-2005, 23:09
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: Scripting Setup and the Camera + Serial Port Drivers

I think that for the IFI controller, your best bet would be to go to www.kevin.org/frc, download the code, and read through the lengthy explanation at the beginning of the interrupts.c file. Also, just play around with the code a little, it will both give you a sens of interrupts, and show you how they work on the IFI controller.
__________________
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

  #10   Spotlight this post!  
Unread 11-01-2005, 23:16
DanDon's Avatar
DanDon DanDon is offline
ohhh MY god
AKA: Dan Hoizner
FRC #0375 (The Robotic Plague)
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2004
Location: Staten Island, NY
Posts: 1,432
DanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond repute
Send a message via ICQ to DanDon Send a message via AIM to DanDon Send a message via MSN to DanDon
Re: Scripting Setup and the Camera + Serial Port Drivers

Quote:
Originally Posted by CJO
I think that for the IFI controller, your best bet would be to go to www.kevin.org/frc, download the code, and read through the lengthy explanation at the beginning of the interrupts.c file. Also, just play around with the code a little, it will both give you a sens of interrupts, and show you how they work on the IFI controller.
Thanks CJO, just to supplement that, can you recommend any whitepapers on interrupts in general?

Thank you for your prompt reply,

Dan
  #11   Spotlight this post!  
Unread 11-01-2005, 23:19
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: Scripting Setup and the Camera + Serial Port Drivers

I cannot think of anything specific, however, the C tutorial on the FIRST website is quite good, it discusses programming in C for machines (read robots) in some detail. In addition, there is a 900+ page user manual on the PIC18 microprocessor (the one in the IFI controller) I would not reccomed this as recreational reading, however, I have never gone to it with a specific question and come away emptyhanded.
__________________
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

  #12   Spotlight this post!  
Unread 11-01-2005, 23:21
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: Scripting Setup and the Camera + Serial Port Drivers

To further that reply, check out the manual on the IFI website (www.ifirobotics.com) and on the Microchip website (www.microchip.com).

I have a mirror of the IFI documents section. If you have trouble finding what you need I can look through my dump.
__________________
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

  #13   Spotlight this post!  
Unread 11-01-2005, 23:34
DanDon's Avatar
DanDon DanDon is offline
ohhh MY god
AKA: Dan Hoizner
FRC #0375 (The Robotic Plague)
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2004
Location: Staten Island, NY
Posts: 1,432
DanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond repute
Send a message via ICQ to DanDon Send a message via AIM to DanDon Send a message via MSN to DanDon
Re: Scripting Setup and the Camera + Serial Port Drivers

Again, thank you for your reply. I will do as you say and read the tutorial on the FIRST site, though I think i might be able to skip chunks of it, and I will reference the PIC Manual as needed.

Again, thanks,

Dan
  #14   Spotlight this post!  
Unread 12-01-2005, 01:54
prograid's Avatar
prograid prograid is offline
Registered User
AKA: Ben Cherian
FRC #0254 (The Cheesy Poofs)
Team Role: Alumni
 
Join Date: Oct 2004
Rookie Year: 2004
Location: San Jose
Posts: 80
prograid will become famous soon enough
Re: Scripting Setup and the Camera + Serial Port Drivers

Check out the programming whitepapers on this site. There's one called Interrupts for Dummies. Excellent
  #15   Spotlight this post!  
Unread 12-01-2005, 16:31
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: Scripting Setup and the Camera + Serial Port Drivers

Quote:
Originally Posted by CJO
Another question: The rules allow us to have secondary processors. So could you have a second processor which does nothing but service interrupts, and then passes bytes along to the FRC controller in a TTL type format.
Yes! I would love to see a team(s) do this. This is one of the reasons I wrote the serial driver. You should be able to just hook up the TTL serial ports (Rx->Tx, Tx->Rx, Gnd->Gnd) and pass data between the computers. I specifically had the EDU-RC in mind for this.

-Kevin
__________________
Kevin Watson
Engineer at stealth-mode startup
http://kevin.org

Last edited by Kevin Watson : 12-01-2005 at 16:33. Reason: Icky spelling error.
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
UTC Hartford and the Pits in 2001. The same setup for this year??? Elgin Clock Regional Competitions 3 01-11-2002 19:11


All times are GMT -5. The time now is 17:47.

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