first year team - cant get camera programmed

We are a first year team having trouble getting camera to work. We have created a test bed to test devices, and now trying to get camera to track. We have tested that the camera will move when told to by using the joy stick, but we cant get the easy c code to work. We tried the 2007 sample code and nothing happens, the camera does not turn at all. We tried our own code just to see if we had any values, and when we do a data capture and print, we have some values, but the camera does not move or track at all. My students are familiar with easy c, but not sure how to convert kevins code to easy c. Also since the easy c demo 2007 code didnt work, we are wondering if the camera has some other problem. We keep reading and looking but so far havent come up with a solution. We tried downloading the camera.hex code from kevin and when we get that we get a message no camera data. Any suggestions on what to try next???

You say you have values; what are the servos connected to?

I have seen probably 15 threads on the camera not working. I plan on writing up an FAQ because it would appear we really need one. I also need to learn EasyC.

JBot

we have the pan connected to pwm 1, tilt to pwm 2
we get the output values for the centroid x,y; values for the region x,y (i cant remember what they were, I am at home now and dont have them). I guess I am wondering how we tell the camera to tilt or pan in the c code so that we can prove it is working. we tried to use the set servo to reposition the x, y locations multiple times within a loop, started the camera each time, and never saw the camera move. I am thinking we are really off track on somehting here. We just want to confirm the camera will move and we cant seem to get anything to happen. Should we go back and use kevin code through the mplab and just forget easy c for now?

If you are using the 2007 kickoff easyC code, it expects the pan servo to be connected to pwm 10 and the tilt to be connected to pwm 11. You can change the settings for these with the macros/constants dialog in easyC by pressing F6.

Edit: If you use the SetServoPosition() function, it only works if the servos are connected to the camera board. Since this is impossible with this year’s camera, it will not work. To move the servos, use the SetPWM() function (look under the “Output” node on the function block treeview).

Do you have the backup battery connected to the controller?

Yes, the PWM ports are powered using the backup battery, so no backup no tracking.

Yes, the PWM ports are powered using the backup battery. We have downloaded kevin’s code the camera now says
searching
searching
gives data readout
searching
searching
about 25 times and sometimes gives another readout, sometimes does not.
We have tried moving the greenlight around, and the camera does not track it and does not move towards it. Are we missing something else?

Here’s a check list:

  1. You have to have a backup battery/7.2 volt source connected to the robot controller in the backup battery place.
  2. As said before: this year you can’t use the Servo Tracking function in easyC.
  3. Try downloading the online code in easyc (in order to download the code press and hold for about a second the program button that is on the robot controller until the light turns orange, and download). Try moving the servos over there (in the online terminal). If still the servos aren’t moving there is probably a power problem.
  4. The OI (operator interface) has to be connected to the RC (robot controller) either by the red tether cable (if it’s your first time connecting it) or by the radios (with the radio connections).
  5. In order to make the program work you have to have at least one joystick connected to the OI.
  6. Check that you have connected the top cable of the camera board to a PWM port on your RC, and that the bottom cable of the camera board is connected to the TTL card that is connected to the RC.
  7. Be sure that when you programed the camera you first initialized it (when the camera initializes it puts on the red and green light, when the initialization is over, only the green light is lid, and when the camera finds an object with the color you programed it to see then the red light lights to). Be sure you used the Start Camera function too.
  8. Put the green light in the same conditions of light that would be in the FIRST competition.

Well, that’s what I could think of, if I’ll have more I’ll add:rolleyes:

:eek:
So it’s the top PWM to the TTL and the bottom to the PWM RC pin area???

You’re right. I accidentally wrote bottom instead of top.
The power switch has to be on the top in the pan/tilt stand. The top connection connects to a free PWM on the robot controller and the bottom one connects to the TTL port. Be sure to connect it right (black in the side that is written B, or BLK on the TLL card).
Chek out this drawing for more information: http://www.ifirobotics.com/docs/cmu-cam2-reva-assembly.pdf

According to the pdf (and according to me) you are supposed to connect between the RS-232 connection to the TTL that is connected to the RC.

hi peoples,

i’m just having difficulty understanding how the TTL port is hooked up on the 2007 robot. i see lots of documents and discussion about the 2006, but that was different connection i think… right?

ifirobotics has this to say:

“The assembly comes with an RS-232 converter board to interface with the FRC Robot Controller. A 3 wire PWM cable is used to connect the converter board to the camera. The RS-232 converter board is design to mount directly onto the Robot Controller, no cable is required. You can also modify a PWM cable to connect power from the Robot Controller to the camera assembly.”

so the TTL to RS-232 Converter Board plugs into the robot controller, not the camera. then a PWM cable is connected between the converter board and the camera. if this is true, why does their website say “no cable is required”? also why do they say that a “modify a pwm cable to connect power” when you don’t need to modify the cable at all, its perfect right out of the bag. just plug it in between any PWM output channel and your camera and ::poof:: you have power (assuming you have battery backup installed on RC).

finally, if all i want to do is track green colour, then i need the converter board assembled correctly and wired (or not…?) and i do NOT want to plug in any DB9 between camera and PC…

it seems simple enough, yet its not entirely clear. can someone dumb it down a little more for me?

thanks
slloyd

Sniggle,

One thing I haven’t seen anyone mention here yet is to make sure you run through the calibration procedure using Labview. This will make sure you have the right settings for your camera to track the green light. This will also result in making sure your camera is focused.

I haven’t quite figured out everything on the cam yet this year, but what i think the best thing to do is read the tutorials in help menu. read and try doing all of them accept the gyros and other sensors that a few people don’t have. it instructs you on how to do many things and will also allow you to test your camera…i think its in the graphic display section…if you have anymore questions you can email me at [email protected]

Adam, Programming
Cub Robotics
Team 877
Cando, ND