Go to Post We do a disservice as mentors if we simply complain. We must inspire our students by showing them how we rise to the challenge and solve the problems we face. - Jon236 [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
  #16   Spotlight this post!  
Unread 21-01-2006, 14:01
Windward's Avatar
Windward Windward is offline
Registered User
FRC #1452
Team Role: Programmer
 
Join Date: Nov 2005
Rookie Year: 2004
Location: So Cal
Posts: 88
Windward is an unknown quantity at this point
Re: Camera to motor setup

Acutally, I was thinking of mounting the camera on top of the turret, and setting up the motors so that it would automatically swing the turret until the camera reads 0 pan and 0 tilt without any code modification. Would that work?
  #17   Spotlight this post!  
Unread 21-01-2006, 17:30
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: Camera to motor setup

Quote:
Originally Posted by Windward
Acutally, I was thinking of mounting the camera on top of the turret, and setting up the motors so that it would automatically swing the turret until the camera reads 0 pan and 0 tilt without any code modification. Would that work?
It should, but you need to recognize something that might make it work less well than you expect. The camera code doesn't move the tilt or pan servos until the vision target gets "far enough" from the center of the view.
  #18   Spotlight this post!  
Unread 23-01-2006, 20:29
Windward's Avatar
Windward Windward is offline
Registered User
FRC #1452
Team Role: Programmer
 
Join Date: Nov 2005
Rookie Year: 2004
Location: So Cal
Posts: 88
Windward is an unknown quantity at this point
Re: Camera to motor setup

Quote:
Originally Posted by Alan Anderson
It should, but you need to recognize something that might make it work less well than you expect. The camera code doesn't move the tilt or pan servos until the vision target gets "far enough" from the center of the view.
What do you mean by this?
  #19   Spotlight this post!  
Unread 23-01-2006, 22:23
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: Camera to motor setup

Look at tracking.c in the camera code provided by Kevin Watson. In the servo_track() function, it checks to see how many pixels off-center the target is. Only if it's more than Pan_Allowable_Error left or right, or Tilt_Allowable_Error up or down, does it actually move the servo to recenter the target in the camera's field of view.

So if you want to be as accurate as possible, you need to move the turret to zero the pan/tilt servo values and also cause the mx/my values returned from the camera to match the target pixel values.
  #20   Spotlight this post!  
Unread 25-01-2006, 17:47
Windward's Avatar
Windward Windward is offline
Registered User
FRC #1452
Team Role: Programmer
 
Join Date: Nov 2005
Rookie Year: 2004
Location: So Cal
Posts: 88
Windward is an unknown quantity at this point
Re: Camera to motor setup

Quote:
Originally Posted by Astronouth7303
Closed loop



An encoder is a digital sensor that detects regular "ticks" on a wheel. The purpose of it is to detect either velocity or position. You count ticks and compare them to the time. In this case, an encoder can either be a tooth counter, the banner sensors, or the grayhill encoders.
sorry. I meant gyro.
  #21   Spotlight this post!  
Unread 25-01-2006, 18:32
devicenull devicenull is offline
Robot? We need a robot?
no team
 
Join Date: Sep 2004
Rookie Year: 1234
Location: n/a
Posts: 359
devicenull is just really nicedevicenull is just really nicedevicenull is just really nicedevicenull is just really nicedevicenull is just really nice
Re: Camera to motor setup

Quote:
Originally Posted by Windward
Acutally, I was thinking of mounting the camera on top of the turret, and setting up the motors so that it would automatically swing the turret until the camera reads 0 pan and 0 tilt without any code modification. Would that work?
If you mean 127 pan and 127 tilt, then yes, it works very, very nicely
  #22   Spotlight this post!  
Unread 17-02-2006, 23:24
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 to motor setup

Did you or anyone ever get the Camera to Motor setup working?
__________________
-= 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
  #23   Spotlight this post!  
Unread 18-02-2006, 00:05
Salik Syed Salik Syed is offline
Registered User
FRC #0701 (RoboVikes)
Team Role: Alumni
 
Join Date: Jan 2003
Rookie Year: 2001
Location: Stanford CA.
Posts: 514
Salik Syed has much to be proud ofSalik Syed has much to be proud ofSalik Syed has much to be proud ofSalik Syed has much to be proud ofSalik Syed has much to be proud ofSalik Syed has much to be proud ofSalik Syed has much to be proud ofSalik Syed has much to be proud ofSalik Syed has much to be proud of
Send a message via AIM to Salik Syed
Re: Camera to motor setup

Our team used a heavily modified version of Kevin's PID code,
basically all you have to do is add another motor to the motor_info data struct, and change the get_encoder_value function so that it returns PAN_SERVO when the argument is 2
now simply call set_pos(2,127)
and set your left and right drive motors to =motor_info[2].pwm+127; and 127-motor_info[3].pwm; (this may need to be change depending on your wiring and robot setup)

you may have to tweak the P, I, D constants

We had it working beautifully until we did some other stuff and screwed it up...
(we used our own custom PID software... but i think i'm gonna switch back to kevins because i can't figure out whats wrong with ours... and I didn't write it so I don't understand it 100%)
__________________
Team 701

Last edited by Salik Syed : 18-02-2006 at 00:07.
  #24   Spotlight this post!  
Unread 18-02-2006, 13:18
Windward's Avatar
Windward Windward is offline
Registered User
FRC #1452
Team Role: Programmer
 
Join Date: Nov 2005
Rookie Year: 2004
Location: So Cal
Posts: 88
Windward is an unknown quantity at this point
Re: Camera to motor setup

Quote:
Originally Posted by Salik Syed
Our team used a heavily modified version of Kevin's PID code,
basically all you have to do is add another motor to the motor_info data struct, and change the get_encoder_value function so that it returns PAN_SERVO when the argument is 2
now simply call set_pos(2,127)
and set your left and right drive motors to =motor_info[2].pwm+127; and 127-motor_info[3].pwm; (this may need to be change depending on your wiring and robot setup)

you may have to tweak the P, I, D constants

We had it working beautifully until we did some other stuff and screwed it up...
(we used our own custom PID software... but i think i'm gonna switch back to kevins because i can't figure out whats wrong with ours... and I didn't write it so I don't understand it 100%)

We don't have encoders working and it is far too late to implement them into our bot.


On a side note, we did the zero point method making the servo's and motor values equal to the search value, it works beautifully when we implemented. Basically the human player controls the turret until the "find target" button is pressed. Then the camera re-aligns the turret to aim for the green.
__________________
  #25   Spotlight this post!  
Unread 18-02-2006, 20:29
Salik Syed Salik Syed is offline
Registered User
FRC #0701 (RoboVikes)
Team Role: Alumni
 
Join Date: Jan 2003
Rookie Year: 2001
Location: Stanford CA.
Posts: 514
Salik Syed has much to be proud ofSalik Syed has much to be proud ofSalik Syed has much to be proud ofSalik Syed has much to be proud ofSalik Syed has much to be proud ofSalik Syed has much to be proud ofSalik Syed has much to be proud ofSalik Syed has much to be proud ofSalik Syed has much to be proud of
Send a message via AIM to Salik Syed
Re: Camera to motor setup

Quote:
Originally Posted by Windward
We don't have encoders working and it is far too late to implement them into our bot.


On a side note, we did the zero point method making the servo's and motor values equal to the search value, it works beautifully when we implemented. Basically the human player controls the turret until the "find target" button is pressed. Then the camera re-aligns the turret to aim for the green.

you don't need encoders, you can fake the system.... just put the camera pan servo value in place of the encoder count, the PID math is the same
__________________
Team 701
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
How To Use the Google Camera generalbrando Kit & Additional Hardware 2 07-02-2006 16:00
Camera pointing error? Craig Putnam Programming 14 21-01-2006 02:52
Scripting Setup and the Camera + Serial Port Drivers CJO Programming 22 11-01-2006 17:42
Unresponsive camera neilsonster Programming 9 17-02-2005 08:51
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:53.

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