Go to Post ...regardless of anything that happens, there should be no booing at competitions, only cheers. True, many of us want to win, but in the end, all of us are working to expand FIRST and to promote the inspiration and recognition of science and technology through gracious professionalism. - Aignam [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 08-01-2008, 19:39
dmlawrence dmlawrence is offline
MIT '14
FRC #1751 (Warriors)
Team Role: Alumni
 
Join Date: Jan 2007
Rookie Year: 2006
Location: Long Island
Posts: 63
dmlawrence is an unknown quantity at this point
Trig functions in C18 3.10

Hi,

I am aware that numerous trig lookup tables and algorithms are available for the RC. However, as far as I can tell, none of them are compatible with Kevin Watson's new code.

Does anyone know of a method to calculate trig functions that works under the new version of C18?

Thanks,

David
Team 1751
  #2   Spotlight this post!  
Unread 08-01-2008, 20:59
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: Trig functions in C18 3.10

Quote:
Originally Posted by dmlawrence View Post
I am aware that numerous trig lookup tables and algorithms are available for the RC. However, as far as I can tell, none of them are compatible with Kevin Watson's new code.
Can you point me toward code that doesn't work? I'll have a look to see what it would take to get it working.

Quote:
Originally Posted by dmlawrence View Post
Does anyone know of a method to calculate trig functions that works under the new version of C18?
Unless you need to do hundreds of trig calculations per second, I would just go ahead and use the built-in functions. If you're the adventurous type and just want to do it yourself, you could very easily get my eeprom code code moved over and then use the trig table generation and lookup code I wrote a few years back.

-Kevin
__________________
Kevin Watson
Engineer at stealth-mode startup
http://kevin.org
  #3   Spotlight this post!  
Unread 08-01-2008, 21:09
dmlawrence dmlawrence is offline
MIT '14
FRC #1751 (Warriors)
Team Role: Alumni
 
Join Date: Jan 2007
Rookie Year: 2006
Location: Long Island
Posts: 63
dmlawrence is an unknown quantity at this point
Re: Trig functions in C18 3.10

The code in this whitepaper doesn't seem to compile correctly.

-David
  #4   Spotlight this post!  
Unread 08-01-2008, 22:22
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: Trig functions in C18 3.10

Quote:
Originally Posted by dmlawrence View Post
The code in this whitepaper doesn't seem to compile correctly.

-David
It compiles for me using the attached file that calls sin().

-Kevin
Attached Files
File Type: c teleop.c (4.7 KB, 86 views)
__________________
Kevin Watson
Engineer at stealth-mode startup
http://kevin.org
  #5   Spotlight this post!  
Unread 09-01-2008, 10:54
dmlawrence dmlawrence is offline
MIT '14
FRC #1751 (Warriors)
Team Role: Alumni
 
Join Date: Jan 2007
Rookie Year: 2006
Location: Long Island
Posts: 63
dmlawrence is an unknown quantity at this point
Re: Trig functions in C18 3.10

Sorry, I linked to an old version of the math library.

The updated library is here.

Thanks,
David
  #6   Spotlight this post!  
Unread 09-01-2008, 21:54
dmlawrence dmlawrence is offline
MIT '14
FRC #1751 (Warriors)
Team Role: Alumni
 
Join Date: Jan 2007
Rookie Year: 2006
Location: Long Island
Posts: 63
dmlawrence is an unknown quantity at this point
Re: Trig functions in C18 3.10

Just to clarify, the new version does NOT compile under C18 3.10. (My previous post was a bit unclear).
  #7   Spotlight this post!  
Unread 11-01-2008, 19:06
psh psh is offline
Registered User
FRC #0166 (Chop Shop)
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 2004
Location: Merrimack, NH
Posts: 9
psh is on a distinguished road
Re: Trig functions in C18 3.10

From experience we stay away from PIC floating point in our team. Its emulated, bloated and problematic to debug. It was even worse in the 2004 and 2005 years when the processors only had 32KB.

How widespread is the use of floating point by the teams out there?

>Per
  #8   Spotlight this post!  
Unread 11-01-2008, 20:38
Guy Davidson Guy Davidson is offline
Registered User
AKA: formerly sumadin
FRC #0008 (Paly Robotics)
Team Role: Alumni
 
Join Date: Mar 2005
Rookie Year: 2005
Location: Ra'anana, Israel
Posts: 660
Guy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to behold
Send a message via ICQ to Guy Davidson Send a message via AIM to Guy Davidson Send a message via MSN to Guy Davidson
Re: Trig functions in C18 3.10

Quote:
Originally Posted by psh View Post
How widespread is the use of floating point by the teams out there?
We avoid it if at all possible, and never once have we found it impossible to avoid. In short, we haven't used it. We just make sure that we multiply two integers before diving them (ex in a PID calculation with Kp being 33 / 100 we do 33 * delta / 100 rather than 33 / 100 * delta).
  #9   Spotlight this post!  
Unread 11-01-2008, 21:33
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: Trig functions in C18 3.10

Quote:
Originally Posted by psh View Post
How widespread is the use of floating point by the teams out there?
In recent years, Team 95 has been around 50/50. Two years ago we prototyped an omnidrive that worked in field coordinates, and we did sin(), cos(), asin(), and acos() every loop, with no problems.

And last year, our infrared ranging system used lots of floating point as well, with no real problems, although I did help the students develop a fixed-point equivalent (we never subbed it in, however).
  #10   Spotlight this post!  
Unread 08-02-2008, 09:33
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: Trig functions in C18 3.10

did this ever get resolved? Could someone point me in the direction of one that does work with the new code?
__________________
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 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
Trig archiver 2001 4 23-06-2002 23:14
Return of the Inverse Trig Functions Leo M Programming 3 24-01-2002 08:12


All times are GMT -5. The time now is 00:51.

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