Go to Post But that is not all-FIRST is about teaching mentors what kids are like all over again. It's about closing the generation gap, creating bonds, life time friends, and skills that will last everyone involved a lifetime. - Team0 [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 18-01-2007, 18:45
josh291 josh291 is offline
Registered User
FRC #0291 (CIA)
Team Role: Programmer
 
Join Date: Jan 2007
Rookie Year: 2005
Location: Erie, Pennsylvania
Posts: 6
josh291 will become famous soon enoughjosh291 will become famous soon enough
Our two problems...

First and least important of all, is our problem with uploading the code. I've read through the entire thread on this problem and we're obviously not the only ones. =O

We use the IFI loader to upload the code as I am not very fond of easyC and every once and a while it would cease to upload and tell us that the controller is not there, whilst the function in the program that detects the controller says that it is there. It may be relevant that whenever we are having this problem the "Code Error" LED will light up and while the programming led will turn solid orange, it will stay that way forever as if the controller had locked up.

It works every once and a while on each and every computer then randomly stops. Since it occurs on every computer rather randomly I'm assuming it is a hardware/firmware problem. We've managed to get around this problem by switching between the 3 computers we have nearby whenever one stops, but it would eliminate a lot of stress if this problem could be solved.

======

Problem number two is far more important. The design team tells my fellow programmers and I that we need the camera this year. I've followed all the instructions for installing the camera, serial, and tracking code, however when we run the controller with all of the hardware attached correctly, the camera comes on, twitches, then stops. Last year our camera was tracking fine, although I did not do any of the programming and it was not included in our design.

We've tried inserting random printf statements to see where the code is and is not running and the window that pops up after loading the code prints the message. It is my understanding that when the Servo_Track() function is called it initializes the variables and then goes into the Tracking_Initialized if statement which sets the camera to its default position. We get the printf function from this section of the code but the servos till do not move.

Thanks in advance for any help, and sorry in advance for any conveniences this may cause during these very busy few weeks.
  #2   Spotlight this post!  
Unread 18-01-2007, 20:03
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: Our two problems...

Ok, this might be too obvious, but first: do you have a fully charged backup battery?

And second, are the #defines in tracking.h correct regarding the PWMs for the camera servos?
__________________
  #3   Spotlight this post!  
Unread 18-01-2007, 20:08
josh291 josh291 is offline
Registered User
FRC #0291 (CIA)
Team Role: Programmer
 
Join Date: Jan 2007
Rookie Year: 2005
Location: Erie, Pennsylvania
Posts: 6
josh291 will become famous soon enoughjosh291 will become famous soon enough
Re: Our two problems...

Yes, both batteries, main and backup, are fully charged and all of the header files are included in the correct places. The pwms match those set in the tracking header file.
  #4   Spotlight this post!  
Unread 18-01-2007, 23:22
team877's Avatar
team877 team877 is offline
Registered User
FRC #0877 (Cub Robotics)
Team Role: Programmer
 
Join Date: Jan 2007
Rookie Year: 2001
Location: North Dakota
Posts: 52
team877 is an unknown quantity at this point
Re: Our two problems...

I have the same problem you do and I don't know where to go from here...If you adjust the camera to the green light when its not programmed the red light should light up or turn off i dont know which one...when its pointing right at the green light that will atleast tell you its working, but as far as the servos and auto tracking I have no clue what else to do...
  #5   Spotlight this post!  
Unread 19-01-2007, 15:46
lynca's Avatar
lynca lynca is offline
Andrew Lynch
FRC #2587 (DiscoBots)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2001
Location: Houston, TX
Posts: 1,612
lynca has a reputation beyond reputelynca has a reputation beyond reputelynca has a reputation beyond reputelynca has a reputation beyond reputelynca has a reputation beyond reputelynca has a reputation beyond reputelynca has a reputation beyond reputelynca has a reputation beyond reputelynca has a reputation beyond reputelynca has a reputation beyond reputelynca has a reputation beyond repute
Send a message via AIM to lynca
Re: Our two problems...

Take a look at the streamlined kevin watson's code , it worked off the bat , except you might have to change a few constants in tracking.h to get the servos to move in a different direction.
http://www.kevin.org/frc/frc_camera_s_21.zip
__________________
History: 624 - Cryptonite --> 118 - Robonauts --> 2158 - AusTIN CANS --> 2587 DiscoBots
Bio: Andrew Lynch "How I Work" ---- LinkedIn , Facebook, Twitter
  #6   Spotlight this post!  
Unread 19-01-2007, 22:18
Eric Finn's Avatar
Eric Finn Eric Finn is offline
Registered User
FRC #0166 (Chop Shop)
Team Role: College Student
 
Join Date: May 2006
Rookie Year: 2005
Location: Merrimack, NH
Posts: 101
Eric Finn has a spectacular aura aboutEric Finn has a spectacular aura about
Send a message via AIM to Eric Finn
Re: Our two problems...

If your camera code from last year worked fine, couldn't you just use that? Sure, the more recent code has more features, but your old code works.
__________________
It always takes longer than you expect, even when you take into account Hofstadter's Law.
--Hofstadter's Law

  #7   Spotlight this post!  
Unread 19-01-2007, 22:42
teh_r4v3 teh_r4v3 is offline
Registered User
AKA: Rajeev Sharma
FRC #1511 (Rolling Thunder)
Team Role: Student
 
Join Date: Feb 2006
Rookie Year: 2005
Location: Penfield, NY
Posts: 15
teh_r4v3 is on a distinguished road
Send a message via AIM to teh_r4v3
Re: Our two problems...

You'll want to make sure the servos are on the default PWM outs 1 and 2. (This conflicts with the drive motors of Default_Routine(), by the way, so make sure that the call to Default_Routine() is commented out.) The fact that the servos are twitching upon activation makes it sound like they're just getting a 127 output to me. If you can't use PWMs 1 and 2, you can easily redefine them in tracking.h (for the Kevin.org streamlined code, I've never used anything else).
__________________
Rajeev Sharma

Team 1511 Rolling Thunder

hoojamomma?
  #8   Spotlight this post!  
Unread 20-01-2007, 14:03
josh291 josh291 is offline
Registered User
FRC #0291 (CIA)
Team Role: Programmer
 
Join Date: Jan 2007
Rookie Year: 2005
Location: Erie, Pennsylvania
Posts: 6
josh291 will become famous soon enoughjosh291 will become famous soon enough
Re: Our two problems...

Quote:
Originally Posted by teh_r4v3 View Post
You'll want to make sure the servos are on the default PWM outs 1 and 2. (This conflicts with the drive motors of Default_Routine(), by the way, so make sure that the call to Default_Routine() is commented out.) The fact that the servos are twitching upon activation makes it sound like they're just getting a 127 output to me. If you can't use PWMs 1 and 2, you can easily redefine them in tracking.h (for the Kevin.org streamlined code, I've never used anything else).
Thanks, I'll try commenting out that Default_Routine() when I go back on Monday... I'm sure the camera itself works, I can take snapshots on it when I use it with the computer...

Quote:
Originally Posted by Eric Finn
If your camera code from last year worked fine, couldn't you just use that? Sure, the more recent code has more features, but your old code works.
We didn't use the camera last year in the end, so the only people who have the old camera code are the college students who borred the camera for a few days...

Quote:
Originally Posted by lynca
Take a look at the streamlined kevin watson's code , it worked off the bat , except you might have to change a few constants in tracking.h to get the servos to move in a different direction.
http://www.kevin.org/frc/frc_camera_s_21.zip
That is the one that I've been using
  #9   Spotlight this post!  
Unread 21-01-2007, 00:11
TheOtherGuy's Avatar
TheOtherGuy TheOtherGuy is offline
Unregistered User
AKA: Kevin Forbes
FRC #4183 (Bit Buckets)
Team Role: Engineer
 
Join Date: Jul 2006
Rookie Year: 2006
Location: Tucson, AZ
Posts: 408
TheOtherGuy has a reputation beyond reputeTheOtherGuy has a reputation beyond reputeTheOtherGuy has a reputation beyond reputeTheOtherGuy has a reputation beyond reputeTheOtherGuy has a reputation beyond reputeTheOtherGuy has a reputation beyond reputeTheOtherGuy has a reputation beyond reputeTheOtherGuy has a reputation beyond reputeTheOtherGuy has a reputation beyond reputeTheOtherGuy has a reputation beyond reputeTheOtherGuy has a reputation beyond repute
Re: Our two problems...

we managed to get our camera working today. Here's what we did:

1. download the Kevin Watson's camera code (we used the bells and whistles version)

2. Make sure everything is plugged in. This includes the fully charged backup battery, main battery, pwm cable to the camera for power (plugged into any pwm port), pwm01 and pwm02 connected to pan and tilt respectively, and the TTL - RS232 converter chip is inserted correctly with a pwm cable running to the 3-pin RS232 port on the camera

3. make sure the lens cap is off of the camera and the camera switch is on.

4. turn on the microcontroller and, after building the camera code, download to the microcontroller.

5. press the reset button or turn off the microcontroller and turn it back on. You should see the green light and possibly the red one on the camera. At that point, if there is no target in sight, the camera should go into it's search mode.

6. check the terminal window on the computer (forgot to mention: make sure you leave the microcontroller connected so you can see the messages in the terminal window) If it says No camera data., you may need to check all the connections to make sure they work and then press the reset button. When we were working on the camera today, we found that the TTL - RS232 converter chip was somewhat loose, and after checking it and getting it on firmly, it seemed to work.

that's about all we did, and after much testing, it finally worked. You may find that it takes several days to locate the problem, but don't give up, the camera is very important (I think) in the game this year.
__________________
  #10   Spotlight this post!  
Unread 22-01-2007, 20:43
josh291 josh291 is offline
Registered User
FRC #0291 (CIA)
Team Role: Programmer
 
Join Date: Jan 2007
Rookie Year: 2005
Location: Erie, Pennsylvania
Posts: 6
josh291 will become famous soon enoughjosh291 will become famous soon enough
Re: Our two problems...

Okay, here is the update. Today I remembered to comment out the bit in the Default_Routine() with pwms 1 and 2 which got the camera to work, however it would seem not completely. I remember last year the camera would move around until it found the light, currently all our camera does is center itself to the home position.

This is quite a bit further than we were last meeting. Today was spent pouring over all of the tracking code to figure out how to get it to "search." The majority of our time was spent looking at the T_Packet code(whatever a T_Packet is ) trying to figure out how to get our camera to search.

I'm using the streamlined version of Kevin's camera code, our third and hopefully final problem: How to make it start searching?
  #11   Spotlight this post!  
Unread 22-01-2007, 22:19
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Our two problems...

Quote:
Originally Posted by josh291 View Post
I'm using the streamlined version of Kevin's camera code, our third and hopefully final problem: How to make it start searching?
One extremely important thing: make sure you have a fully charged backup battery plugged in. Without it, the camera won't talk, and the servos won't move.

Depending on which way you mounted the camera in the pan/tilt assembly, you might have to change the sign of the pan direction definition in the code. You can tell when this is necessary by seeing the camera "hide" from the light rather than seek it.
  #12   Spotlight this post!  
Unread 23-01-2007, 14:45
josh291 josh291 is offline
Registered User
FRC #0291 (CIA)
Team Role: Programmer
 
Join Date: Jan 2007
Rookie Year: 2005
Location: Erie, Pennsylvania
Posts: 6
josh291 will become famous soon enoughjosh291 will become famous soon enough
Re: Our two problems...

Quote:
Originally Posted by Alan Anderson View Post
One extremely important thing: make sure you have a fully charged backup battery plugged in. Without it, the camera won't talk, and the servos won't move.

Depending on which way you mounted the camera in the pan/tilt assembly, you might have to change the sign of the pan direction definition in the code. You can tell when this is necessary by seeing the camera "hide" from the light rather than seek it.
Our camera does not move at all. Whether we have the light in front of it or not. We've also made sure the backup battery is charged.


The only thing that I still do no understand is the T_Packets. Also, when I define which serial port the camera goes into... Serial Port 1 is the programming and Serial Port 2 is the tether correct?

And I just noticed the CMU cam sub-thread... should I have put this there instead?
  #13   Spotlight this post!  
Unread 23-01-2007, 15:03
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
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,856
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: Our two problems...

Serial port 2 is the one labeled "TTL" (not the tether) and depending on which camera port you connect to it usually requires the tiny TTL-converter chip that came packaged with, but separate from, the camera board.

You'll want to keep your PC connected to the Program port while you test the camera, so you can see the status messages displayed to tell you what's wrong (or right) with the camera.

Did you look at the T-packet description?
http://kevin.org/frc/CMUcam2_data_packets.pdf

Yea, CMUCam issues should be posted in the CMUCam sub-forum, but we'll forgive you.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 23-01-2007 at 15:17.
  #14   Spotlight this post!  
Unread 23-01-2007, 19:12
josh291 josh291 is offline
Registered User
FRC #0291 (CIA)
Team Role: Programmer
 
Join Date: Jan 2007
Rookie Year: 2005
Location: Erie, Pennsylvania
Posts: 6
josh291 will become famous soon enoughjosh291 will become famous soon enough
Re: Our two problems...

I've finally got it all working.

Quote:
Originally Posted by Mark McLeod View Post
Serial port 2 is the one labeled "TTL" (not the tether) and depending on which camera port you connect to it usually requires the tiny TTL-converter chip that came packaged with, but separate from, the camera board.
Okay ^_^ that could have prevented a lot of confusion before I fixed it... I had thought the serial mentioned in the code refered to the serial cable port on the camera, so I left it plugged in... until I re-read the FAQ on Kevin's website and took it off...


Quote:
Originally Posted by Mark McLeod View Post
Did you look at the T-packet description?
http://kevin.org/frc/CMUcam2_data_packets.pdf
I'll get right on that now that the camera works I've got time...


Quote:
Originally Posted by Mark McLeod View Post
Yea, CMUCam issues should be posted in the CMUCam sub-forum, but we'll forgive you.
Yeah, my first post on this forum...

Anyways, my primary problem, aside from leaving the serial cable plugged in was that I never included terminal.c and terminal.h. I re-read the insrtuctions and found no reference to either.

Thanks for your help everyone. ^_^
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
Two of our favorite people ... Stu Bloom General Forum 0 03-05-2006 15:49
Our pump has problems! waialua359 Pneumatics 7 24-01-2006 13:02
Problems with our school Team1726Nerds Chit-Chat 6 13-01-2006 23:55
Putting two and two together... Andy Grady General Forum 13 08-01-2004 18:29
problems with our programmer AlphaOmega870 Programming 12 31-01-2003 08:23


All times are GMT -5. The time now is 23:52.

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