Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   CMU2Cam Degrees & more (http://www.chiefdelphi.com/forums/showthread.php?t=51643)

Lablabla 12-01-2007 09:18

CMU2Cam Degrees & more
 
Hi,
I'm Using the streamlined version downloaded for kevin.org/frc
Is there a way to find out the degrees the pan and tilt are in relation to the horizontal and vertical zeros? (i.e camera looking straight forward)

Plus, the zip file downloaded contains everything, the user_routines.c and all that. should i use this as the default code for 2007 and add my autonomous mode and joy controls and all that to that files? or is there a way to add the camera thingies to the 2007 Default code?

Thanks,
Carmel

itsme 12-01-2007 09:24

Re: CMU2Cam Degrees & more
 
Well, I can answer only your first question because I am programing in easyC and I don't know MPlabs as well.
for calculating the degrees you need to do the following:
1 degree=Tilt_range/Number_of_PWM

same thing for the pan.

The tilt range is the range of degrees the tilt/pan server can turn.
Number of PWM is 256 (0...255).

Lablabla 12-01-2007 09:29

Re: CMU2Cam Degrees & more
 
Thanks alot for that,
How can I find out the Tilt/Pan Ratio?

itsme 12-01-2007 09:33

Re: CMU2Cam Degrees & more
 
you need to see the the documentation about your servo, see how much it can turn in degrees.
Oh, and remember when calculating this way: the starting position (the middle of the range) is half of the ratio. For example: if the ratio is 180, then 1 degree equals about 0.7 PWM, and the starting position is in the middle, witch is 90 degrees, witch is about 127 PWM

Lablabla 12-01-2007 09:36

Re: CMU2Cam Degrees & more
 
It's the servos we recieved from FIRST, we didn't get any docs with it

itsme 12-01-2007 09:52

Re: CMU2Cam Degrees & more
 
To tell you the truth I'm not sure either. I can't find any documentations for this, no place writes how much degrees it has. So please someone answer our common question: how much degrees does it turn?

JSonntag 12-01-2007 12:54

Re: CMU2Cam Degrees & more
 
It has a rotation of approximately 90 degrees

http://www.servocity.com/html/hs-322...rd_deluxe.html

itsme 12-01-2007 18:19

Re: CMU2Cam Degrees & more
 
Quote:

Originally Posted by JSonntag (Post 555028)
It has a rotation of approximately 90 degrees

http://www.servocity.com/html/hs-322...rd_deluxe.html

So this means that each PWM is 256/90=2.8444... degrees.
And each degree is 90/256=0.3515625 degrees.

:::EDIT:::
It's not 90 degrees for sure, you can buy one with 180 degrees and one with 360 degrees.
So can anybody tell how much degrees it is in the FIRST kit of parts?

Greg Marra 12-01-2007 18:20

Re: CMU2Cam Degrees & more
 
Or, you can always drive the servo to 0, mark its position, drive it 255, mark its position, and then bust out a protractor.

We did a lot of testing to find the camera field of view and servo ranges in 2005. If I find them later, I will post them, although they may not be exactly the same.

TEAM1949 13-01-2007 05:02

Re: CMU2Cam Degrees & more
 
http://www.acroname.com/robotics/inf.../mod322hd.html

look at 'step 4', first two lines


more than 180:
http://www.phidgetsusa.com/forums/ar...php?t-553.html

jdejoannis 29-01-2007 12:02

Re: CMU2Cam Degrees & more
 
Quote:

Originally Posted by Greg Marra (Post 555257)
Or, you can always drive the servo to 0, mark its position, drive it 255, mark its position, and then bust out a protractor.

We did a lot of testing to find the camera field of view and servo ranges in 2005. If I find them later, I will post them, although they may not be exactly the same.

How do you drive the servos? This would be very useful for us to debug something.

Jason

Donut 29-01-2007 13:47

Re: CMU2Cam Degrees & more
 
Quote:

Originally Posted by Lablabla (Post 554847)
Hi,
I'm Using the streamlined version downloaded for kevin.org/frc
Is there a way to find out the degrees the pan and tilt are in relation to the horizontal and vertical zeros? (i.e camera looking straight forward)

In Kevin's code he lists the degrees for each range if using the pan/tilt mechanism for FIRST in tracking.h (for example, the pan servo goes from 0 to 248, and has a total range of 130 degrees). To determine the value your 0's are at, you will have to manually control the camera until it is in the position you want to be considered "center".

Quote:

Originally Posted by jdejoannis (Post 567473)
How do you drive the servos? This would be very useful for us to debug something.

The servos are driven with standard pwms, so instead of having the camera code create the pan & tilt pwms, have a joystick control the value of the pwm. Comment out servo_track() so the camera has no control of the servos, then do pwm01 = p1_y (with whatever pwms and joystick you want to use inserted there).

Kevin Watson 29-01-2007 19:50

Re: CMU2Cam Degrees & more
 
Quote:

Originally Posted by jdejoannis (Post 567473)
How do you drive the servos? This would be very useful for us to debug something.

Jason

If you're using the "bells & whistles" camera code, you can step the servos to any value using the interactive PWM sub-menu found in the main tracking menu.

-Kevin

jdejoannis 30-01-2007 15:40

Re: CMU2Cam Degrees & more
 
Great, thanks!

Bomberofdoom 01-02-2007 09:11

Re: CMU2Cam Degrees & more
 
So in order to find the range from, for example, the rack, I need to calculate the # of degrees to the target from the servos and then calculate Tan(the angel)and devide the hight of the target from the camera by the Tan(angel)?


All times are GMT -5. The time now is 01:27.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi