View Single Post
  #2   Spotlight this post!  
Unread 21-01-2006, 05:39
Eldarion's Avatar
Eldarion Eldarion is offline
Electrical Engineer / Computer Geek
AKA: Eldarion Telcontar
no team (Teamless Orphan)
Team Role: Alumni
 
Join Date: Nov 2005
Rookie Year: 2005
Location: Númenor
Posts: 558
Eldarion has a reputation beyond reputeEldarion has a reputation beyond reputeEldarion has a reputation beyond reputeEldarion has a reputation beyond reputeEldarion has a reputation beyond reputeEldarion has a reputation beyond reputeEldarion has a reputation beyond reputeEldarion has a reputation beyond reputeEldarion has a reputation beyond reputeEldarion has a reputation beyond reputeEldarion has a reputation beyond repute
Send a message via AIM to Eldarion Send a message via Yahoo to Eldarion
Re: Servo Values to Degrees... How?

Quote:
Originally Posted by mogunus
I don't know if this is because it's very early (4AM in RI) or if I'm just dense , I can't for the life of me figure out how to convert from the cmucam servo's values to degrees. I know that in terminal.c keven does what's explained by this comment:

// pan angle = ((current pan PWM) - (pan center PWM)) * degrees/pan PWM step
printf(" Pan Angle (degrees) = %d\r\n", (((int)PAN_SERVO - 124) * 65)/124);

To get the pan angle of the camera. I have no idea how this works, or why.

This is a problem for me, because I just finished implementing a feed-forward-ish style tracking algorithm, based on kevin's original code. I got the idea for it from his post here, and there's another great thread about it here.

I'm definately getting better results from the camera. At least, it looks like it's tracking the light better than before at approx 8 ft. distant in my room, have to test that on the 'bot tomorrow.

But the problem is, my code totally broke going from the servo values to degrees in terminal.c. I know that 128 is the "y-axis." So should I just grab a protracter, and "sv 0 whatever" until it looks like there's a 90 degree difference between the position at 128 and the current position, and divide (current - 128)/90 degrees travelled? And would that give me proper degrees/single servo pwm value?

Sorry if that was all really incoherant. Any help would be greatly appreciated.
That's all I did, except I just went to 45°

It works great!
__________________
CMUCam not working? Tracks sporadically? Try this instead: http://www.falconir.com!
PM me for more information if you are interested (it's open source!).

Want the FIRST Email blasts? See here: http://www.chiefdelphi.com/forums/sh...ad.php?t=50809

"The harder the conflict, the more glorious the triumph. What we obtain too cheaply, we esteem too lightly; it is dearness only that gives everything its value."
-- Thomas Paine

If it's falling apart it's a mechanical problem. If it's spewing smoke it's a electrical problem.
If it's rampaging around destroying things it's a programming problem.

"All technology is run on 'Magic Smoke' contained within the device. As everyone knows, whenever the magic smoke is released, the device ceases to function."
-- Anonymous

I currently speak: English, some German, Verilog, x86 and 8051 Assembler, C, C++, VB, VB.NET, ASP, PHP, HTML, UNIX and SQL