Go to Post My brain is borderline mush, I don't have much of a voice, and I don't think I could be much happier. - Billfred [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 28-01-2005, 21:54
neilsonster's Avatar
neilsonster neilsonster is offline
Registered User
AKA: Andrew Neilson
FRC #0772 (Sabre Bytes)
Team Role: College Student
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Waterloo, ON, Canada
Posts: 188
neilsonster is a name known to allneilsonster is a name known to allneilsonster is a name known to allneilsonster is a name known to allneilsonster is a name known to allneilsonster is a name known to all
Send a message via MSN to neilsonster
Unresponsive camera

Earlier today before we started working we just hooked up the camera to show people how the tracking worked. It was working fine but the calibration for yellow was a bit off so I decided to get a new exposure value for yellow. I (eventually) got it, and put the new exposure value in, loaded the code and ran it, but I was getting the blinking red PWM lights and "Camera is not responding" message in the Terminal window. The strange thing is that the camera has power (the lights come on) and if it isn't at its standard position its servos move it back.

I immediately figured the backup battery was low so I checked and it was okay, I then checked my connections, opened the camera case and checked its connections, and everything was in order.

I was stumped so I looked back at the code and noticed the lights are supposed to blink if:

(note: this is from the default code)
Code:
case 1:
      if (camera_init(64,85,50))  // Set the 3 exposure values yellow, green and red
      {
        cam_state_flag = 2;
        Pwm1_red = Pwm2_red = Relay1_red = Relay2_red = 0; 
      }
      else
      {
        cam_state_flag = 4;   //Issue continual retries until camera responds
        delay = 19;           //Set delay for 1/2 sec (26.2ms * 19 = ~.5s)
        Pwm1_red ^= 1;      //Flash All Color LED Indicators when camera is not responding
        Pwm2_red ^= 1; 
        Relay1_red ^= 1; 
        Relay2_red ^= 1; 
      }


I concluded that there must be something wrong with the exposure values, so I loaded the default code and got the same problem. I then figured it must be something wrong with the hardware, and since the servos and power were working then it must be something wrong with the TTL serial connection. I checked the connection with the ohmmeter and tried changing the wire between the adapter and the camera and nothing works!

My question is, what could have happened when I went to calibrate the camera?? Does the camera save the exposure values on its hardware somehow? Does anyone have any other ideas?? Please?!?!?

Thank you!
  #2   Spotlight this post!  
Unread 28-01-2005, 22:57
Code\\Pilot Code\\Pilot is offline
< Only smart people see my avatar
AKA: Rafael Estrada
FRC #1065 (Tatsu)
Team Role: Programmer
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Florida
Posts: 53
Code\\Pilot is an unknown quantity at this point
Send a message via AIM to Code\\Pilot Send a message via MSN to Code\\Pilot
Re: Unresponsive camera

Does your camera work with the GUI?
Cause if it doesn't, we have the same problem and cant figure it out. I think it has nothing to do with values you entered in the code, because we never entered any values and still the camera didn't work.
I'll be 2morrow testing the camera on another bot in another team workshop and pm you if i figure somthing out.
Catch ya later.
__________________
Join the Red revolution, give me some RED rep!!!!
if it doesn't work, don't force it. Go get a bigger hammer.

int run = 0;
int robot_chasing_you = 1;

if (robot_chasing_you)
{
run = 254;
}

I got 48 Gmail invites left, pm me with your e-mail so i can send you one.
  #3   Spotlight this post!  
Unread 28-01-2005, 23:09
neilsonster's Avatar
neilsonster neilsonster is offline
Registered User
AKA: Andrew Neilson
FRC #0772 (Sabre Bytes)
Team Role: College Student
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Waterloo, ON, Canada
Posts: 188
neilsonster is a name known to allneilsonster is a name known to allneilsonster is a name known to allneilsonster is a name known to allneilsonster is a name known to allneilsonster is a name known to all
Send a message via MSN to neilsonster
Re: Unresponsive camera

Quote:
Originally Posted by Code\\Pilot
Does your camera work with the GUI?
Cause if it doesn't, we have the same problem and cant figure it out. I think it has nothing to do with values you entered in the code, because we never entered any values and still the camera didn't work.
I'll be 2morrow testing the camera on another bot in another team workshop and pm you if i figure somthing out.
Catch ya later.
Yeah it works with the GUI just fine... I still appreciate any input though. But for your problem, did you leave the TTL serial cable from the processor plugged in to the camera when you tried to use the GUI? That's the general thing that makes it not work I think if for whatever reason you can't calibrate.
  #4   Spotlight this post!  
Unread 29-01-2005, 10:27
kjohnson's Avatar
kjohnson kjohnson is offline
Insert Clever Title Here
AKA: Kyle J.
FRC #1610 (BOT)
Team Role: Mentor
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Virginia
Posts: 575
kjohnson has a reputation beyond reputekjohnson has a reputation beyond reputekjohnson has a reputation beyond reputekjohnson has a reputation beyond reputekjohnson has a reputation beyond reputekjohnson has a reputation beyond reputekjohnson has a reputation beyond reputekjohnson has a reputation beyond reputekjohnson has a reputation beyond reputekjohnson has a reputation beyond reputekjohnson has a reputation beyond repute
Re: Unresponsive camera

We are having somewhat the same problem with our camera. The camera works fine with the GUI (takes pictures and calibrates correctly). The camera's demo mode also works fine with the servos mounted. The backup battery is charged and all cables have good connections.

We are using the default code version 2.4 and the master software version 10 with no changes.

Each time we reload the default code we get a print statement in the feedback window that says "Camera not found- check power and connections."

We think there could be a problem with the TTL-RS232 converter because that is the last thing left to check and we do not really know how to check if that is converting the code correctly.
  #5   Spotlight this post!  
Unread 31-01-2005, 18:50
neilsonster's Avatar
neilsonster neilsonster is offline
Registered User
AKA: Andrew Neilson
FRC #0772 (Sabre Bytes)
Team Role: College Student
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Waterloo, ON, Canada
Posts: 188
neilsonster is a name known to allneilsonster is a name known to allneilsonster is a name known to allneilsonster is a name known to allneilsonster is a name known to allneilsonster is a name known to all
Send a message via MSN to neilsonster
Re: Unresponsive camera

Ok we were positive the TTL 232 was the problem and we checked it with the oscillator and everything, then in the process of testing other things out the servos also stopped working. So yeah now our team needs to order a new camera. What a nightmare this little thing has become..
  #6   Spotlight this post!  
Unread 31-01-2005, 21:14
Mohsin's Avatar
Mohsin Mohsin is offline
building...building...bui lding...
FRC #0772 (Club Sandwhich)
Team Role: Alumni
 
Join Date: Feb 2004
Rookie Year: 2003
Location: Sandwich Secondary
Posts: 33
Mohsin is on a distinguished road
Send a message via MSN to Mohsin
Re: Unresponsive camera

no just a little pain, i think that we should take a hammer to it, that always works for mechanical
  #7   Spotlight this post!  
Unread 01-02-2005, 23:59
Joshua Lynn Joshua Lynn is offline
Registered User
FRC #0423 (SEC Mechanical Mayhem)
Team Role: Engineer
 
Join Date: Jan 2003
Rookie Year: 1999
Location: Elkins Park, PA
Posts: 16
Joshua Lynn is on a distinguished road
Lightbulb Re: Unresponsive camera

OK well I feel better that we're not the only ones with this problem.

Summary: camera works fine connected to a PC. Battery power good. All cables good. Still doesn't work although it did work at least once while on the bench but not while on the robot now.


During testing one of two things happened. All the Red PWM lights blinked which means the camera_init failed and about every half second you get the check the cables message. This means the camera_state_flag made it to at least 1.

However most of the time it never made it that far. Got the IFI Initialized message and the joysticks worked, which means the user loop is processing however, there was no camera not found or blinking red lights on the OI. This means that it never made it to camera_state_flag ==1.

Has this happened to anyone else??

The part I can't quite figure out is how camera_state_flag ==1 doesn't happen. But here are my thoughts:

There is new Serial_Write function which uses buffered writing unlike the printf function. (I could be wrong on that, it is what I thought I read somewhere) there is also the wait_for_data function, which may be doing a buffered read. Either way the question is what happens if they fail or time out or whatever they do. This leads me to suspect that the problem is the serial communication at the root of our troubles. So trouble shooting continues by re-verifying everything.

The only component that we didn't know how to test was the TTL-232 board. Magically IFI posted instructions on how to test the TTL serial and the TTL-232 board TODAY! It is on the ifirobotics CMUCam2 page. The document is here:

http://www.ifirobotics.com/docs/ttl-...2005-02-01.pdf

Haven't tried it yet but I believe it to the only part left to be a problem.


I posted a question to IFI in their forum about a replacement or extra TTL-232 board. The may have run out since you cannot purchase a CMUCam through them via their website today. You could a few days ago. Perhaps there is a note in the Team update today.

I may try some additional debugging code to se the history of the camera_state_flag and the delay. camera_state_flag gets set to 1 after the inital delay processed by camera_state_flag ==4.

Code:
case 4:
      if (delay)
        delay--;
      else
      {
        cam_state_flag = 1;
      }
      break;
I want to change the
Code:
 if (delay)
to an open ended condition such as:

Code:
case 4:
      if (delay>=delaycount)
        delay++;
      else
      {
        cam_state_flag = 1;
        delay = 0;
      }
      break;
Need to define a static variable for delaycount and change the case for case 0 and 1. This just seems a bit more robust. BTW this code is all in user_routines.c/Process_Data_From_Master_uP

Please let us know if anyone can come up with a solution for this issue as a whole.
  #8   Spotlight this post!  
Unread 04-02-2005, 08:01
capenga's Avatar
capenga capenga is offline
Penga boy
AKA: Giovane
#1156 (Under Control)
Team Role: Programmer
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Pio XII High School - Brazil
Posts: 33
capenga is an unknown quantity at this point
Send a message via ICQ to capenga Send a message via MSN to capenga
Exclamation Re: Unresponsive camera

We're having the same problem as you...

but following the procedures of the document .pdf for testing the TTL 232, we evidenced that the TTL port and the TTL 232 don't have any problem. But, when we reloaded the default code 2.4, the camera continues to not be found. Maybe the problem is not the TTL

We're really confused right here
__________________


Ignore alien orders.
  #9   Spotlight this post!  
Unread 04-02-2005, 09:28
Joshua Lynn Joshua Lynn is offline
Registered User
FRC #0423 (SEC Mechanical Mayhem)
Team Role: Engineer
 
Join Date: Jan 2003
Rookie Year: 1999
Location: Elkins Park, PA
Posts: 16
Joshua Lynn is on a distinguished road
Re: Unresponsive camera

We have conducted the prescribed test as well and found that the TTL-232 board was working.

Yet we continued to find that we had the camera not found problem.

We also discovered a few other things:

The trigger on the joystick attached to port 2 was not functioning. This explains why on occasion it would NOT give us the “camera not found error” but the lights on the OI to indicate which color to track would not change.

Currently, the camera is working with the robot on the bench in the workshop area.

However, I still don’t know why it is working.

When we started testing on the bench it was NOT working.

We retested every thing again including the TTL-232 board. All ok, still it didn’t work.

Then it did work.

The current hypothesis is that it is a problem in the connectivity. Each end is just fine but the connection is tenuous in between. It could be a loose connection or it could be RF interference with the power system based on the routing of the signal wire to the power distribution system.

It is frustrating because its working and I don’t know why!
  #10   Spotlight this post!  
Unread 17-02-2005, 08:51
capenga's Avatar
capenga capenga is offline
Penga boy
AKA: Giovane
#1156 (Under Control)
Team Role: Programmer
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Pio XII High School - Brazil
Posts: 33
capenga is an unknown quantity at this point
Send a message via ICQ to capenga Send a message via MSN to capenga
Re: Unresponsive camera

INCREDIBLE!!!


Here, in a desperated act, we turned the camera on the 2004 RC (It haves a TTL port), by updating the firmware and downloading the 2.4 code. It works.

So we tried to do everything by the beginning with the 2005 RC, downloading the 2.4 code clean on the IFI webpage, updating the firmware again, and then.... TADA!! THE CAMERA NOW IS WORKING!! Our team is very happy now.

I think that do everything by the beginning can help the teams with this problem.
__________________


Ignore alien orders.
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
Scripting Setup and the Camera + Serial Port Drivers CJO Programming 22 11-01-2006 17:42
Camera not found!!! Code\\Pilot Programming 11 02-02-2005 00:04
Kevin Watson's Kick-off Demo Code! Mr. Lim Programming 27 22-01-2005 03:38
Game Field Camera Calibration Matthew_H Regional Competitions 2 15-01-2005 23:09
CMUCam2 Camera Code - Are important parts commented out? Mr. Lim Programming 4 14-01-2005 12:11


All times are GMT -5. The time now is 15:28.

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