Go to Post Reading Andy Bakers post- priceless :D - thoughtful [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 06-02-2006, 10:25
cmurdoch cmurdoch is offline
Registered User
AKA: Caroline Murdoch
FRC #1208 (Metool Brigade)
Team Role: Programmer
 
Join Date: Jan 2005
Rookie Year: 2004
Location: O'Fallon, IL
Posts: 17
cmurdoch is on a distinguished road
Camera Troubles

I'd like to say there's a problem with the camera itself causing our problems. Unfortunately, the camera was working fine until I attempted to adapt the tracking and search code to manipulate the pwm output for our rotating turret instead of the pan servo. I tried my best to leave the tilt tracking code intact. When we tested, however, the panning code worked as anticipated, while the tilt code didn't work at all (well... it tried to work, but failed miserably resulting in a subtle twitching motion). It seems as though the camera is trying to change the tilt servo value and remain in home position simultaneously. I'd appreciate any ideas anyone might have to solve my problem. Thanks
  #2   Spotlight this post!  
Unread 06-02-2006, 11:14
Jared Russell's Avatar
Jared Russell Jared Russell is offline
Taking a year (mostly) off
FRC #0254 (The Cheesy Poofs), FRC #0341 (Miss Daisy)
Team Role: Engineer
 
Join Date: Nov 2002
Rookie Year: 2001
Location: San Francisco, CA
Posts: 3,078
Jared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond repute
Re: HELP!!! Camera with mental issues...

If you post the part of your code that isn't working, we'll be better able to help.
  #3   Spotlight this post!  
Unread 06-02-2006, 11:22
Kevin Watson's Avatar
Kevin Watson Kevin Watson is offline
La Caņada High School
FRC #2429
Team Role: Mentor
 
Join Date: Jan 2002
Rookie Year: 2001
Location: La Caņada, California
Posts: 1,335
Kevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond repute
Re: HELP!!! Camera with mental issues...

Quote:
Originally Posted by cmurdoch
I'd like to say there's a problem with the camera itself causing our problems. Unfortunately, the camera was working fine until I attempted to adapt the tracking and search code to manipulate the pwm output for our rotating turret instead of the pan servo. I tried my best to leave the tilt tracking code intact. When we tested, however, the panning code worked as anticipated, while the tilt code didn't work at all (well... it tried to work, but failed miserably resulting in a subtle twitching motion). It seems as though the camera is trying to change the tilt servo value and remain in home position simultaneously. I'd appreciate any ideas anyone might have to solve my problem. Thanks
There are a few FAQ entries discussing spastic cameras.

-Kevin
__________________
Kevin Watson
Engineer at stealth-mode startup
http://kevin.org
  #4   Spotlight this post!  
Unread 06-02-2006, 16:24
cmurdoch cmurdoch is offline
Registered User
AKA: Caroline Murdoch
FRC #1208 (Metool Brigade)
Team Role: Programmer
 
Join Date: Jan 2005
Rookie Year: 2004
Location: O'Fallon, IL
Posts: 17
cmurdoch is on a distinguished road
Re: Camera Troubles

Here's my updated camera search code. So, if anyone has any insights I'd appreciate it.

Code:
                                        //turn the turret to the right for a specified
					//number of loops if direction is equal to 1
	                                if (direction == 1)
					{
						pwm12 = 255;
						loop_number++;
						//when it reaches the end of the time, 
						//change tilt value, change direction 
						//and reset loop counter
						if (loop_number > 50)
						{
							if(temp_tilt_servo >= (int)Tracking_Config_Data.Tilt_Max_PWM)
							{
								temp_tilt_servo = (int)Tracking_Config_Data.Tilt_Min_PWM;
							}
							else
							{
								// step the tilt servo to its next destination
								temp_tilt_servo += (int)Tracking_Config_Data.Tilt_Search_Step_Size;
			
								// make sure its new position isn't beyond
								// the maximum value set in tracking.h
								if(temp_tilt_servo >= (int)Tracking_Config_Data.Tilt_Max_PWM)
								{
									temp_tilt_servo = (int)Tracking_Config_Data.Tilt_Max_PWM;
								}	
							}
							direction = 0;
							loop_number = 0;
						}
					}
					//turn the turret to the left for a specified 
					//number of loops if direction is equal to 0
					else if (direction == 0)
					{
						pwm12 = 0;
						loop_number++;
						//when it reaches the end of the time, 
						//change tilt value, change direction 
						//and reset loop counter
						if (loop_number > 50)
						{
							if(temp_tilt_servo >= (int)Tracking_Config_Data.Tilt_Max_PWM)
							{
								temp_tilt_servo = (int)Tracking_Config_Data.Tilt_Min_PWM;
							}
							else
							{
								// step the tilt servo to its next destination
								temp_tilt_servo += (int)Tracking_Config_Data.Tilt_Search_Step_Size;
			
								// make sure its new position isn't beyond
								// the maximum value set in tracking.h
								if(temp_tilt_servo >= (int)Tracking_Config_Data.Tilt_Max_PWM)
								{
									temp_tilt_servo = (int)Tracking_Config_Data.Tilt_Max_PWM;
								}	
							}
							direction = 1;
							loop_number = 0;
						}
					}
					//if direction isn't left or right
					//there is a code error and the
					//motor is set to neutral
				//	else
				//		pwm12 = 127;
				}

				// update the pan and tilt servo PWM value
				//PAN_SERVO = (unsigned char)temp_pan_servo;
				TILT_SERVO = (unsigned char)temp_tilt_servo;
			}
		}
	}
}
  #5   Spotlight this post!  
Unread 06-02-2006, 17:45
scitobor 617's Avatar
scitobor 617 scitobor 617 is offline
More nerd than you can handle!
AKA: Alan Meekins
FRC #0617 (HSHS 617 "DUKE")
Team Role: Programmer
 
Join Date: Nov 2003
Rookie Year: 2003
Location: Richmond, VA
Posts: 153
scitobor 617 will become famous soon enoughscitobor 617 will become famous soon enough
Send a message via AIM to scitobor 617
Re: Camera Troubles

Nothing in your code jumps out at me but I just don't like the fact that you type cast temp_tilt_servo as an int when you change the servo position then change it back to a unsigned char when finally setting the actual tilt variable. I would suggest however, that you use some sort of sensor to find the actual position of the pan device, at the very least you should use a limit switch or keep track of how many times you have turned left, or right, to be sure you do not break something.
__________________
Beta testers needed!
http://www.nullagent.no-ip.com

Your kidding, there are other operating systems besides Linux?!
  #6   Spotlight this post!  
Unread 08-02-2006, 10:25
cmurdoch cmurdoch is offline
Registered User
AKA: Caroline Murdoch
FRC #1208 (Metool Brigade)
Team Role: Programmer
 
Join Date: Jan 2005
Rookie Year: 2004
Location: O'Fallon, IL
Posts: 17
cmurdoch is on a distinguished road
Re: Camera Troubles

ok what tells the camera to go to home position or stay in home position. Is that on the camera itself and if so is there a portion of the code that overrides that? Basically, I'm wondering what could be causing the camera to try to stay in home position even when it's receiving new tilt servo values. I really don't know where to start.
  #7   Spotlight this post!  
Unread 08-02-2006, 23:57
sparkydp sparkydp is offline
Registered User
AKA: David Page
FRC #0435 (Robodogs)
Team Role: Mentor
 
Join Date: Apr 2005
Rookie Year: 2002
Location: Raleigh, NC
Posts: 32
sparkydp is on a distinguished road
Re: Camera Troubles

we had problems with the servo pwm cable being attached to the wrong input on the RC, if it is hooked up to the wrong PWM, it tries to stay on neutral, triple check to make sure PAN and TILT are hooked up to the pwm's stated in tracking.h


Quote:
Originally Posted by cmurdoch
ok what tells the camera to go to home position or stay in home position. Is that on the camera itself and if so is there a portion of the code that overrides that? Basically, I'm wondering what could be causing the camera to try to stay in home position even when it's receiving new tilt servo values. I really don't know where to start.
  #8   Spotlight this post!  
Unread 11-02-2006, 11:24
cmurdoch cmurdoch is offline
Registered User
AKA: Caroline Murdoch
FRC #1208 (Metool Brigade)
Team Role: Programmer
 
Join Date: Jan 2005
Rookie Year: 2004
Location: O'Fallon, IL
Posts: 17
cmurdoch is on a distinguished road
Re: Camera Troubles

I've just discovered something. I was testing the tracking code again and found that when we ran it without the driving code, it worked fine, but when we ran it in the combined code we had problems with the tilt servo. So, my problem isn't in tracking.c; it must be somewhere else but I don't know where. Any idea what the problem could be?
  #9   Spotlight this post!  
Unread 11-02-2006, 11:29
Bharat Nain's Avatar
Bharat Nain Bharat Nain is offline
Registered User
no team
Team Role: Alumni
 
Join Date: Jan 2004
Rookie Year: 2003
Location: New York
Posts: 2,000
Bharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond repute
Send a message via AIM to Bharat Nain Send a message via MSN to Bharat Nain
Re: Camera Troubles

Do a search for all the pwm's, inputs and outputs the camera uses and see if any other code interferes.
__________________
-= Bharat Nain =-

Whatever you do, you need courage. Whatever course you decide upon, there is always someone to tell you that you are wrong. There are always difficulties arising that tempt you to believe your critics are right. To map out a course of action and follow it to an end requires some of the same courage that a soldier needs. Peace has its victories, but it takes brave men and women to win them. - Ralph Waldo Emerson
  #10   Spotlight this post!  
Unread 11-02-2006, 11:34
cmurdoch cmurdoch is offline
Registered User
AKA: Caroline Murdoch
FRC #1208 (Metool Brigade)
Team Role: Programmer
 
Join Date: Jan 2005
Rookie Year: 2004
Location: O'Fallon, IL
Posts: 17
cmurdoch is on a distinguished road
Re: Camera Troubles

yup that was the problem. In the drive code, the drive motors are on pwms 1 and 2 and the camera also uses those outputs in the camera code. When I combined them I forgot to change the outputs for the drive motors. Man is my face red ... oh well at least it works now. Thank you everyone for your help.
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
CMU Camera kills robot controller if not found. Chris_Elston Programming 21 27-03-2006 14:30
How To Use the Google Camera generalbrando Kit & Additional Hardware 2 07-02-2006 16:00
Camera Is Spazzing Out! BrittanyV Programming 15 04-02-2006 13:39
Scripting Setup and the Camera + Serial Port Drivers CJO Programming 22 11-01-2006 17:42
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 01:37.

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