Hi - I wanted to run this by yall before I attempted to code up the beast. I would like to do some fairly hefty float math at 50hz. Specifically, say I have floats X, Y, and Z. First I want to find S1, S2, S3, and H, all floats:
H = (X^2 + Y^2 + Z^2)^.5
S1 = tan-1(Y/X)
W = cos-1(H/12)
S3 = 2 * W
S2 = sin-1(Z/H) - W
After that, I want to multiply S1, S2, and S3, individually, by an unsigned int, then divide that by a (constant) float.
I want to do all of this in 12.5ms at 10Mhz, which is 125Khz. If necessary, I can switch to a 20Mhz crystal, so I'd have 250Khz to do all of this in. Will I be able to do all of this? I'm using AVR-GCC and an ATMEGA168. My code is currently taking up about 1/4 of the 16KB of flash on the ATMEGA168, so it'd be fine if the above code consumed most of the rest of that. My memory usage is fairly low - I think I'm using under 100 bytes of the 1KB RAM. Also, note that I believe all the math functions used above would return doubles, even though I don't need that much precision, Ias far as I know.
What do yall think? Thanks!