Go to Post One of my management professors taught me this: At all times you are holding a bucket in each hand, one full of water, and one full of gasoline. Management is knowing when to throw which bucket. - Barry Bonzack [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
  #1   Spotlight this post!  
Unread 17-01-2008, 23:11
baop858 baop858 is offline
Registered User
FRC #0069 (Hyper)
Team Role: Programmer
 
Join Date: Jan 2007
Rookie Year: 2002
Location: Quincy, MA
Posts: 25
baop858 will become famous soon enough
Send a message via AIM to baop858
Possiblity of using a few trig functions

Do you guys think there will be an problems if I used like 4 trig function on 28.6 ms loop? If I put the trig functions in the spin function functions would it work better? Would using a look up table for sin cos trig and arctan use up a lot of space?
  #2   Spotlight this post!  
Unread 17-01-2008, 23:36
Kevin Watson's Avatar
Kevin Watson Kevin Watson is offline
La Caņada High School
FRC #2429
Team Role: Mentor
 
Join Date: Jan 2002
Rookie Year: 2001
Location: La Caņada, California
Posts: 1,335
Kevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond repute
Re: Possiblity of using a few trig functions

Quote:
Originally Posted by baop858 View Post
Do you guys think there will be an problems if I used like 4 trig function on 28.6 ms loop?
This won't be a problem if you aren't doing anything else time consuming.

-Kevin
__________________
Kevin Watson
Engineer at stealth-mode startup
http://kevin.org
  #3   Spotlight this post!  
Unread 17-01-2008, 23:53
comphappy comphappy is offline
Registered User
AKA: Brennan Ashton
FRC #2605 (A2D_16)
Team Role: Leadership
 
Join Date: Jan 2008
Rookie Year: 2008
Location: Bellingham, WA
Posts: 157
comphappy is a splendid one to beholdcomphappy is a splendid one to beholdcomphappy is a splendid one to beholdcomphappy is a splendid one to beholdcomphappy is a splendid one to beholdcomphappy is a splendid one to beholdcomphappy is a splendid one to behold
Send a message via AIM to comphappy
Re: Possiblity of using a few trig functions

Quote:
Originally Posted by baop858 View Post
Do you guys think there will be an problems if I used like 4 trig function on 28.6 ms loop? If I put the trig functions in the spin function functions would it work better? Would using a look up table for sin cos trig and arctan use up a lot of space?
I would say that for most things actual trig functions are overkill, a look up table will good enough. As for space, it depends on how many values you need to calculate, and how many places you need them.
__________________
A2D Solving the Imaginary Error Function...
  #4   Spotlight this post!  
Unread 18-01-2008, 10:23
kaszeta's Avatar
kaszeta kaszeta is offline
Registered User
FRC #0095 (Grasshoppers)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2002
Location: Lebanon, NH
Posts: 334
kaszeta is a glorious beacon of lightkaszeta is a glorious beacon of lightkaszeta is a glorious beacon of lightkaszeta is a glorious beacon of lightkaszeta is a glorious beacon of light
Re: Possiblity of using a few trig functions

Quote:
Originally Posted by baop858 View Post
Do you guys think there will be an problems if I used like 4 trig function on 28.6 ms loop? If I put the trig functions in the spin function functions would it work better? Would using a look up table for sin cos trig and arctan use up a lot of space?
Team 95 had done quite a few test bots using field coordinates, where every time through the loop we'd do calls to sin(), cos(), abs(), and atan2(), all while using shaft encoders and the gyro, and it's never been an issue. I wouldn't get carried away, however.
  #5   Spotlight this post!  
Unread 18-01-2008, 23:55
comphappy comphappy is offline
Registered User
AKA: Brennan Ashton
FRC #2605 (A2D_16)
Team Role: Leadership
 
Join Date: Jan 2008
Rookie Year: 2008
Location: Bellingham, WA
Posts: 157
comphappy is a splendid one to beholdcomphappy is a splendid one to beholdcomphappy is a splendid one to beholdcomphappy is a splendid one to beholdcomphappy is a splendid one to beholdcomphappy is a splendid one to beholdcomphappy is a splendid one to behold
Send a message via AIM to comphappy
Re: Possiblity of using a few trig functions

I would not expect abs to be take very many processors cycles, could be written as such,
int abs (int num)
{
if(num<0)
{
num=(-1)*num;
}
return(num);
}
__________________
A2D Solving the Imaginary Error Function...
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
Trig functions in C18 3.10 dmlawrence Programming 9 08-02-2008 09:33
Trig. Functions in EasyC miketwalker FIRST Tech Challenge 5 07-12-2006 23:27
speed of math.h trig functions? Jared Russell Programming 4 07-02-2006 07:13
Trig functions and type conversion kaszeta Programming 6 14-01-2006 23:34
Return of the Inverse Trig Functions Leo M Programming 3 24-01-2002 08:12


All times are GMT -5. The time now is 18:43.

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