Go to Post "Don't you wish your drill bit was hot like mine?" - BariSaxGuy [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 22-01-2005, 22:48
pi_guy578 pi_guy578 is offline
Programmer/Electrician
AKA: Jake
FRC #0578 (Blue Lightning)
Team Role: Programmer
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Fairport
Posts: 48
pi_guy578 has a spectacular aura aboutpi_guy578 has a spectacular aura about
Send a message via AIM to pi_guy578
The *BIG* CMU Howto

Because many people come here before reading the manual and the manual can be cryptic at some times I've decided to write this howto.

The Case/Assembly

The case is made out of a Radio Shack 4x2x1 Enclosure (#270-1802) in which the control board fits nicely into. The assembly suggested in the manual uses Robovation (aka EDUBot) parts to create a static tilt(w/o a servo) system. The exploded assembly drawing in the manual is either in correct or we missed something but we added a part to make it easier (See the picture below).



To create a dynamic tilt, the design can be modified slightly to accommodate a servo on the side.

It is also a BIG help to not mount any of the camera parts inside the case until you've finished everything else. It ends up getting in the way and you have to take it out.

Connectors

Most of the pin headers are marked with a capital letter 'B'. This marks where the black wire should go. On the DB9 serial port, only pins 1, 3, and 4 are used.

Power

The camera requires 7.2v of power. This is supplied by a PWM port, by the "backup battery". It works on both the EDUBot and the Full-size FRC.

Image

The image can be grabbed with either the GUI included with the camera docs, or by using the SF command* in a terminal window.

The image can be modified/fine tuned in a number of ways. First is the focus. To focus it there are two good ways. The first and harder way is to turn the lens a half turn and grab the image. If it gets better keep turning in that direction and grabbing the frame until its the best quality. If it doesn't get better turn it the other way until it gets good. Don't take the lens completely off. There is a sensitive CCD that I wouldn't want to get dust on or anything else...

The better and faster way is through NTSC output. Follow the directions below to get the NTSC working, hook it up to your television and easily focus it.

*The SF command will return an unrecognizable string of characters that is in a format that should easily be able to be translated into an image.

NTSC

The CMU CAM comes with the ability to output a black and white NTSC signal to your television. It requires hooking up the header on the board to an RCA jack. In order for it to start outputting, the camera must be set into YCrCb.

The first method is to set it through the GUI. Simply move over to the config tab and set the color space to YCrCb.

To set it manually in a terminal window you must set register 18 to a value below with the following syntax:

cr 18 <val>

Values:
RGB w/o White Balance - 40
RGB w/ White Balance - 44
YCrCb w/o White Balance - 32
YCrCb w/ White Balance - 36

If you don't have a TV near by. unplug it from the serial port and without unpowering it plug it into a TV. (Supposedly the registers are supposed to save, even when unpowered, but it hasn't worked for me.)

Note: To those not in the US, your TV might not support NTSC. If it has a "Multi-System" feature on the box or in the manual you should be fine.

Serial

The camera must be connected to a serial port to be commanded (but no necessarily functional, see Demo Mode Below). Either the DB9 port or the 3-pin header will work. To use the DB9, you can connect it to either your computer through a COM port:

Default settings (to change see below):
115200
8 Data bits
No parity
1 Stop bit
No flow control

or, you can connect it to the program port on the RC.

If your computer cannot support 115200 (for any reason) or you're connecting it to the RC (I think this does require a lower bitrate...?) you can try a lower bit rate by setting the jumpers on the board:

Pin
0 1 2 (These are the 3 right most jumper pins on the mode settings, refer to the manual for specific location)
_ _ _ 115,200 Baud
_ _ X 57,600 Baud
_ X _ 38,400 Baud
_ X X 19,200 Baud
X _ _ 9,600 Baud
X _ X 4,800 Baud
X X _ 2,400 Baud
X X X 1,200 Baud

X = Jumped

Demo Mode

The CMU CAM comes with a demo mode to autonomously track a given color. Hold down the user button while powering the cam and holding a colored piece of paper in front of the lens (8~12in) (very trick to do by yourself, get someone to help) you should now be able to move the paper and have the cam track it. If it doesn't work try the following:

-Make sure you're in a well lit room.
-If the servos spaz or go in the wrong direction, they may need to be reversed. This can be done by jumping the pins on the mode headers. Try alternating between the pan and tilt reverse and see which one needs to be reversed.

Links

Very good CMUCAMresources:
http://www-2.cs.cmu.edu/~cmucam/cmucam2/
Official IFI CMU docs and code:
http://www.ifirobotics.com/camera.shtml
And of course:
http://kevin.org/frc/


Hopefully this will help a lot of people, but it might take a few edits to get it perfect. PLEASE post comments on anything that needs clarification or correcting.

Also don't feel afraid of asking how to do various GUI commands in the terminal window, (esp. those who have slow machines w/o Java) I know a lot of them ;p

Edit tracker:
-Forgot to add the links to everywhere important
-Added some assembly notes and fixed the image

Last edited by pi_guy578 : 23-01-2005 at 21:39. Reason: Forgotten stuff, picture not appearing
  #2   Spotlight this post!  
Unread 22-01-2005, 23:06
the_undefined's Avatar
the_undefined the_undefined is offline
German FES
AKA: Felix Geisendörfer
#1648 (Gearbox Gangstas)
Team Role: Programmer
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Germany
Posts: 77
the_undefined has a spectacular aura aboutthe_undefined has a spectacular aura about
Re: The *BIG* CMU Howto

Nice Tutorial, that will be really usefull for our Team since we didn't had any time yet to mess around with that Camera, Thank you!
  #3   Spotlight this post!  
Unread 23-01-2005, 12:41
copertop's Avatar
copertop copertop is offline
Team President
AKA: JD
FRC #0578 (Blue Lightning)
Team Role: Leadership
 
Join Date: Jan 2005
Rookie Year: 2004
Location: Fairport
Posts: 16
copertop is an unknown quantity at this point
Send a message via AIM to copertop
Re: The *BIG* CMU Howto

Wow Jake. I know you had been doing some research on the CMU cam but you sure have out done yourself this time. I think you need to include some more information as to the problems that you encountered while assembling the unit and edubot parts. Also a little biit more of explination on the programming aspect of this would help. Other than that great post and I'm glad your on our team!
__________________
Team 578:
Second place in Pittsburg Regional 2004
Semi-Finalists in Buckeye Regional 2004
Winners of the controls award in 2004 at Buckeye

Who would like to design and impletment an Uber fan?
I DO!!!!!!!
And image!
<image code yo> opps </image code yo>
Programmer error!
  #4   Spotlight this post!  
Unread 24-01-2005, 01:36
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: The *BIG* CMU Howto

I am hoping someone will put up some kind of "programming with the CMU cam tutorial. I am going to try to figure it out myself, but I wish the default code was better set up for use in autonomous, rather than just the joystick button stuff.
  #5   Spotlight this post!  
Unread 24-01-2005, 02:06
Unsung FIRST Hero
Rich Wong Rich Wong is offline
NYC FIRST Planning Committee Member
no team (NYC FIRST)
Team Role: Mentor
 
Join Date: Jan 2002
Rookie Year: 1999
Location: Brooklyn, NY
Posts: 1,674
Rich Wong has a reputation beyond reputeRich Wong has a reputation beyond reputeRich Wong has a reputation beyond reputeRich Wong has a reputation beyond reputeRich Wong has a reputation beyond reputeRich Wong has a reputation beyond reputeRich Wong has a reputation beyond reputeRich Wong has a reputation beyond reputeRich Wong has a reputation beyond reputeRich Wong has a reputation beyond reputeRich Wong has a reputation beyond repute
Send a message via AIM to Rich Wong
Re: The *BIG* CMU Howto

This tutorial is excellent.
You should put it in as a whitepaper.

Thanks!
__________________
popularis de ob instinctus agnitionis scientia technologia
Home website: www.nycnjfirst.org
Member of NEMO & e^(i*pi)+1 Fraternity.
Member of Friends of Robots
Member of NYCFIRST Planning Committee
  #6   Spotlight this post!  
Unread 25-01-2005, 11:40
Anton's Avatar
Anton Anton is offline
Anton Povzner
#1581 (Element)
Team Role: Programmer
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Israel
Posts: 51
Anton can only hope to improve
Re: The *BIG* CMU Howto

My team has got a little technical problem: we know the measre unit of the x,y coordinates of the center of the mass of pixels on the "virtual picture" it sees, but we have no idea which measure unit is used by the servos- the "pan", "tilt" values.
could you please add these to the manual?
  #7   Spotlight this post!  
Unread 26-01-2005, 20:33
jedinite's Avatar
jedinite jedinite is offline
Programmer, Scapegoat, Gofer, etc
AKA: "Hey, you!"
#0250 (Dynamos)
Team Role: Programmer
 
Join Date: Feb 2004
Rookie Year: 2004
Location: New York
Posts: 2
jedinite is an unknown quantity at this point
Question Re: The *BIG* CMU Howto

Allright, our team has two rather big questions. Are there any specific rules regarding the case, and what is the correct way to mount the servos? I've been through USFirst and Innovation First, and I can't find anything regarding actual rules. So, are we allowed to make our own custom cases? And, how exactly do we mount the servos? We're frankly stumped. Everything we've tried is wrong.
  #8   Spotlight this post!  
Unread 07-02-2005, 17:58
devicenull devicenull is offline
Robot? We need a robot?
no team
 
Join Date: Sep 2004
Rookie Year: 1234
Location: n/a
Posts: 359
devicenull is just really nicedevicenull is just really nicedevicenull is just really nicedevicenull is just really nicedevicenull is just really nice
Re: The *BIG* CMU Howto

Quote:
Originally Posted by jedinite
Allright, our team has two rather big questions. Are there any specific rules regarding the case, and what is the correct way to mount the servos? I've been through USFirst and Innovation First, and I can't find anything regarding actual rules. So, are we allowed to make our own custom cases? And, how exactly do we mount the servos? We're frankly stumped. Everything we've tried is wrong.
Any way works.. you really only need a tilt servo, as you *can* just pan with the entire robot.. but its probably better to have a pan servo too.

One problem I've run into a lot is the camera tracking very slowly, or not at all, which is always caused by a low backup battery.
  #9   Spotlight this post!  
Unread 09-02-2005, 04:29
dlotts dlotts is offline
Registered User
FRC #1418 (Vae Victus)
Team Role: Mentor
 
Join Date: Dec 2004
Rookie Year: 2005
Location: Arlington, VA
Posts: 2
dlotts is an unknown quantity at this point
Send a message via ICQ to dlotts Send a message via AIM to dlotts Send a message via MSN to dlotts Send a message via Yahoo to dlotts
Re: The *BIG* CMU Howto

Quote:
Originally Posted by jedinite
...what is the correct way to mount the servos? ... Everything we've tried is wrong.
I found this in another thread (CMU easter eggs). it is a little movie demonstrating what looks like the "Demo mode" described above. It is mounted with Pan and tilt servos. I'm planning on watching this little movie a dozen more times myself:

http://www-2.cs.cmu.edu/~cmucam2/CMUcam2_demo.mov

CMU cam demo mode movie
  #10   Spotlight this post!  
Unread 19-02-2005, 01:25
SpeakerSilenced SpeakerSilenced is offline
Programming/Electrical Team Member
#0219 (Team Impact)
Team Role: Programmer
 
Join Date: Feb 2005
Rookie Year: 2005
Location: Hackettstown, NJ
Posts: 28
SpeakerSilenced is an unknown quantity at this point
Send a message via AIM to SpeakerSilenced
Re: The *BIG* CMU Howto

Is there a way to have the camera stream video onto a computer or a tv screen? By steam I mean live-feed, not clicking Grab Frame... Also is there a way to hook up a screen on the OI that can see the cam?
__________________
"I want to put a ding in the universe" - Steve Jobs
  #11   Spotlight this post!  
Unread 21-02-2005, 09:01
Nathan Pell's Avatar
Nathan Pell Nathan Pell is offline
Registered User
FRC #0233 (The Pink Alliance)
Team Role: Mentor
 
Join Date: Jan 2003
Rookie Year: 2003
Location: Rockledge, FL
Posts: 156
Nathan Pell is a splendid one to beholdNathan Pell is a splendid one to beholdNathan Pell is a splendid one to beholdNathan Pell is a splendid one to beholdNathan Pell is a splendid one to beholdNathan Pell is a splendid one to behold
Re: The *BIG* CMU Howto

Both of my cameras out of the blue started showing very "odd" frames when I used the GUI interface to grab a frame. Has any one else seen this?
Attached Thumbnails
Click image for larger version

Name:	cmu.jpg
Views:	159
Size:	84.1 KB
ID:	2987  
__________________

Florida First

Last edited by Nathan Pell : 21-02-2005 at 09:04.
  #12   Spotlight this post!  
Unread 21-02-2005, 10:42
SpeakerSilenced SpeakerSilenced is offline
Programming/Electrical Team Member
#0219 (Team Impact)
Team Role: Programmer
 
Join Date: Feb 2005
Rookie Year: 2005
Location: Hackettstown, NJ
Posts: 28
SpeakerSilenced is an unknown quantity at this point
Send a message via AIM to SpeakerSilenced
Re: The *BIG* CMU Howto

That happens to us too, clicking reset on the GUI fixes it
__________________
"I want to put a ding in the universe" - Steve Jobs
  #13   Spotlight this post!  
Unread 23-02-2005, 01:23
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: The *BIG* CMU Howto

Yeah, we get weird frames all the time. Sometimes they have a purplish tint, some are like that one, and others are just other weird random nonsense. We press reset on the RC to "fix" it.
  #14   Spotlight this post!  
Unread 29-03-2005, 21:19
Elgin Clock's Avatar
Elgin Clock Elgin Clock is offline
updates this status less than FB!
AKA: the one who "will break into your thoughts..."
FRC #0237 (Black Magic)
Team Role: Mentor
 
Join Date: May 2001
Rookie Year: 2001
Location: H20-Town, Connecticut
Posts: 7,773
Elgin Clock has a reputation beyond reputeElgin Clock has a reputation beyond reputeElgin Clock has a reputation beyond reputeElgin Clock has a reputation beyond reputeElgin Clock has a reputation beyond reputeElgin Clock has a reputation beyond reputeElgin Clock has a reputation beyond reputeElgin Clock has a reputation beyond reputeElgin Clock has a reputation beyond reputeElgin Clock has a reputation beyond reputeElgin Clock has a reputation beyond repute
Send a message via AIM to Elgin Clock
Re: The *BIG* CMU Howto

Having fun with the CMU cam yet?

Having lighting issues you need to resolve?

This may help:

http://www-2.cs.cmu.edu/~cmucam/Publ...s/lighting.pdf
__________________
The influence of many leads to the individuality of one. - E.C.C. (That's me!!)

  #15   Spotlight this post!  
Unread 26-09-2005, 20:06
Sparks333's Avatar
Sparks333 Sparks333 is offline
Robotics Engineer
AKA: Dane B.
FRC #1425 (Wilsonville Robotics)
Team Role: Alumni
 
Join Date: Feb 2004
Rookie Year: 2003
Location: Wilsonville, Oregon
Posts: 184
Sparks333 is a glorious beacon of lightSparks333 is a glorious beacon of lightSparks333 is a glorious beacon of lightSparks333 is a glorious beacon of lightSparks333 is a glorious beacon of lightSparks333 is a glorious beacon of light
Send a message via AIM to Sparks333
Re: The *BIG* CMU Howto

On the screwy image...
I have never tried resetting the GUI, that's not a bad idea though....
We always assumed that when that started happening, the backup battery was running low (IC's do wierd things when voltage is out of spec, you know) and replacing the backup battery or putting it on a permanent supply got rid of it. Whether or not that came from restarting the camera or not, I have no idea, but it was our solution.
We actually had one heck of a time getting it to interface with the TTL port. For some reason, it wouldn't complete the handshake properly, and we'd have to plug and unplug the thing to get it to work properly. There was probably just a coding glitch (blame the programmers!) but I wonder: did anyone else have that problem?

Sparks
__________________
ICs do weird things when voltage is run out of spec.

I love to take things apart. The fact that they work better when I put them back together it just a bonus.

http://www.ravenblack.net/random/surreal.html
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
Easter Egg in CMU Camera Manual David Foster Programming 8 10-01-2005 03:21
CMU Manual Easter Egg Rickertsen2 General Forum 4 09-01-2005 20:39
openFIRST Contributor's HOWTO Timothy D. Ginn FIRST-related Organizations 0 29-12-2004 21:11
HOWTO: Get a good color scheme Brandon Martus Website Design/Showcase 24 24-11-2004 21:52
New FIRST Team at CMU archiver 2001 4 24-06-2002 01:07


All times are GMT -5. The time now is 09:51.

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