From: "Tony (remove \"_\" from email address)"
Subject: Re: Arctangent computation.
Date: Sun, 17 Nov 2002 16:15:02 +1000
References: <firstname.lastname@example.org> <email@example.com>
X-Newsreader: Forte Agent 1.92/32.572
There are sometimes good reasons to use arctangent rather than arcsine, the main
one being that it eliminates all sources of range error that are common to both
the sine and the cosine signals (eg the effects of variation of power supply,
ADC reference or temperature), and it is also way more accurate around
(2n+1)Pi/2, where Arcsine accuracy approaches none. You can get over this last
problem by switching between sin and cos signals, or better yet by selecting the
smaller of sin/cos or cos/sin.
That said, the path you take would depend a lot on the accuracy and speed you
require - perhaps an interpolated lookup table, a polynomial approximation or a
cordic algorithm (Cordic methods are good for processors like 8051 with no
On 16 Nov 2002 18:33:50 -0800, firstname.lastname@example.org (chris) wrote:
>email@example.com (Dan) wrote in message news:<firstname.lastname@example.org>...
>> I have a shaft position encoder that generates Sin and Cos signals, i
>> need to display the shaft's angular position in degrees using an
>> analog meter.
>> I need an analog circuit that will compute the arctangent of the
>> quotient of the Sin and Cos magnitudes.
>> Angular position = arctan sin/cos.
>> The Sin and Cos magnitudes have a +5V to -5V excursion.
>> Piece of cake, isn't it?
>> I could also use the code for an ADC + 8051 to do the math in
>> assembly (not in C please).
>> Any help on this subject will be greatly apppreciated.
>Hi, you seem to be trying to do this the hard way, maybe even the
>hardest way.All you need is aa arcsine lookup table for each adc
>value, so if you have a 10bit adc you need a 1024 entry table.Read the
>value from your sine pot and look up the value. Use the sign (+/-)
>from the sine and cosine values to dtermine which quadrant your in and
>add 90,180,270deg as appropriate.