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.
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.
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…
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
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…
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…
we managed to get our camera working today. Here’s what we did:
download the Kevin Watson’s camera code (we used the bells and whistles version)
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
make sure the lens cap is off of the camera and the camera switch is on.
turn on the microcontroller and, after building the camera code, download to the microcontroller.
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.
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.
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?
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?
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.
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…
I’ll get right on that now that the camera works I’ve got time…
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.