??? 03/28/07 19:50 Read: times |
#136052 - calculate sine, cosine in an 8051 |
I am trying to build a robot using a very common navigation system- the so called "dead reckoning" or "odometry". it uses the angular displacement and the distance traveled to update previous values of (x,y). my system uses two optical encoders coupled with right and left wheels. the problem i am facing is that i need to calculate sine and cosine of the angular displacement to deduce the x and y deviations. roughly the calculation in C would look like this:
distance=(left_wheel+right_wheel)/2; x+=distance*cos(a); y+=distance*sin(a); the real problem is i need to do this in 8051 and with a very high accuracy, requiring floating point arithmetic. constructing look up tables also seems unfeasible because of the large number of data needed. i even thought about using a math coprocessor for this but again interfacing with so few number of io pins is really too much for my brain. is there a simpler way to do this? |
Topic | Author | Date |
calculate sine, cosine in an 8051 | 01/01/70 00:00 | |
A couple of options | 01/01/70 00:00 | |
let\'s play a game... | 01/01/70 00:00 | |
pin1 is a dead give away | 01/01/70 00:00 | |
its upto you but this is a sincos function | 01/01/70 00:00 | |
Jez ,what is EPS2 constant? | 01/01/70 00:00 | |
SDCC | 01/01/70 00:00 | |
looks impressive | 01/01/70 00:00 | |
Yes | 01/01/70 00:00 | |
Lookup table + interpolation. | 01/01/70 00:00 | |
Lookup table and interpolation![]() | 01/01/70 00:00 | |
Don't overlook the obvious | 01/01/70 00:00 | |
What Compiler? | 01/01/70 00:00 | |
The answer | 01/01/70 00:00 | |
More Coprocessors & Libraries | 01/01/70 00:00 | |
Obligatory | 01/01/70 00:00 | |
You're too late | 01/01/70 00:00 | |
OOps | 01/01/70 00:00 |