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?

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.

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.

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?

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).

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).