|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
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
|
||||
|
||||
|
Re: Trig functions in C18 3.10
Quote:
Quote:
-Kevin |
|
#3
|
|||
|
|||
|
Re: Trig functions in C18 3.10
|
|
#4
|
||||
|
||||
|
Re: Trig functions in C18 3.10
Quote:
-Kevin |
|
#6
|
|||
|
|||
|
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
|
|||
|
|||
|
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
|
|||
|
|||
|
Re: Trig functions in C18 3.10
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
|
||||
|
||||
|
Re: Trig functions in C18 3.10
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
|
|||
|
|||
|
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?
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
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 |