Go to Post Honesty and Integrity is the key to success. - team4384 [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

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 11-02-2007, 13:34
Ianuser Ianuser is offline
Registered User
FRC #0570
 
Join Date: Feb 2007
Location: new york
Posts: 64
Ianuser is an unknown quantity at this point
Value of degree to calculate range?

Hi everyone. I'm not sure if what I'm doing to get the degree for the tilt_servo to find the range of the bot to the rack is correct.
I wrote this in tracking.c at the very bottom:

Code:
unsigned float Find_Distance(void)
{
   float radian;
   float range;
   radian = ((((angle I will measure in degrees that the tilt servo has to offer from down to up) / 256) * pi) / 180) * pwm07(which is my tilt_servo pwm);
   range = (116 - (distance I have yet to measure between the floor and my camera because we haven't placed it yet)) / tan(radian);
   return(range);
}
I read on another thread that the angle has to be in radians for the Tan() function to take in. Also, does it matter in which source file I place this function? SO, my real questions are, Does anything about what I wrote make sense? And how does this compare to the:
pan angle = ((current pan PWM) - (pan center PWM)) * degrees/pan PWM step ?(other than I'm looking for tilt rather than pan). Do I have to subtract my pwm07 by something like you did in this one? Sorry if I'm being confusing, but I'm trying to understand all of this at once. (My team is made up of 5 people and I'm the only electrician and the only programmer and I don't have much experience as a junior in high school.)
 


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 calculate arm angles? SoD Programming 5 31-01-2007 14:17
White Paper Discuss: Spreedsheet to Calculate the Ranking of Teams Joe Johnson Extra Discussion 27 29-03-2005 11:16
How to calculate planetary gear ratios? sanddrag Technical Discussion 2 27-02-2005 11:55
How do you Calculate Belt Length? Gabriel Technical Discussion 7 08-11-2004 14:54
Microbiology Degree? Jillian B. Chit-Chat 1 26-09-2003 20:19


All times are GMT -5. The time now is 14:22.

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