Go to Post changing some 0 to 1s was a lot lighter and cheaper than most of the clutches I found. - IKE [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
  #12   Spotlight this post!  
Unread 12-02-2007, 10:58
charrisTTI charrisTTI is offline
Ramblin' Wreck
AKA: Charles Harris
FRC #0623
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2003
Location: Vienna, VA
Posts: 106
charrisTTI has a spectacular aura aboutcharrisTTI has a spectacular aura about
Send a message via AIM to charrisTTI
Re: Value of degree to calculate range?

First to clarify: Math functions in the C library work with radians, not degrees.

Here is excerpt from MPLAB C18 libraries manual:

tan
Function: Compute the tangent.
Include: math.h
Prototype: float tan( float x );
Remarks: Computes the tangent of x (in radians). A domain error occurs if the
argument is infinite or NaN. Both cases return NaN.
Return Value: The tangent of x.
File Name: tan.c


Attached is spread sheet for calculating a look-up table. Copy and paste the data from the Range Text column to create your array. See rangelu.c for example of completed array.

When you need to use the array declare as extern in that file.

extern const rom unsigned short targetRange[];


If you use Kevin's changes to increase resolution on the tilt axis. The number of table entries will need to increase and the PWM TO DEGREES factor will need to be changed.
Attached Files
File Type: xls TargetRange.xls (37.0 KB, 31 views)
File Type: c rangelu.c (857 Bytes, 34 views)
__________________
FRC 623 2003,2004,2005,2006,2007,2008, 2009, 2010, 2011
FRC 1900 2007
FVC 60 and 193 2006
FVC 3271 2007
FTC 226 and 369 2008, 2009, 2010, 2011
FTC 3806 2010
 


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