CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

ANGLE CALCULATION

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
horizontech
Guest







ANGLE CALCULATION
PostPosted: Wed Jul 09, 2003 8:21 pm     Reply with quote

HI!

I try to get Angle from ADXL105 is analog output,
is very instable ..... i have connected to PIC16f876 in A0
analog input pin.. in 8 bit is not get wide range between 0 to 90 tilt.

in 16bit is moving right but is not stable ???

My question is what is the best way or sensor to get the right
tilt angle, i need .5 degre bettwen step

thank for your help

Alain Tanguay
___________________________
This message was ported from CCS's old forum
Original Post ID: 144515830
Kenny



Joined: 07 Sep 2003
Posts: 173
Location: Australia

View user's profile Send private message

Re: ANGLE CALCULATION
PostPosted: Wed Jul 09, 2003 11:21 pm     Reply with quote

<font face="Courier New" size=-1>:=HI!
:=
:=I try to get Angle from ADXL105 is analog output,
:=is very instable ..... i have connected to PIC16f876 in A0
:=analog input pin.. in 8 bit is not get wide range between 0 to 90 tilt.
:=
:=in 16bit is moving right but is not stable ???
:=
:=My question is what is the best way or sensor to get the right
:=tilt angle, i need .5 degre bettwen step
:=
:=thank for your help
:=
:=Alain Tanguay

I dont think it will be possible to get the performance you need, especially for high tilt angles.

In any case the signal must be amplified and filtered first using op-amps before going into the A/D of the PIC. Scaling should be 1g for full scale of the A/D and 10 bit sampling.
Most of the noise is high frequency so filtering to around 1Hz will give much better performance.

Regards
Kenny




</font>
___________________________
This message was ported from CCS's old forum
Original Post ID: 144515832
Bill Turnip
Guest







Re: ANGLE CALCULATION
PostPosted: Thu Jul 10, 2003 8:05 am     Reply with quote

Alain -
Even with an 8- or 10-bit ADC you can do OK, that's not the problem.
You will not get enough sensitivity at high angles with a single axis sensor. The output of the sesnor is proportional to Sin(angle), the sensitivity then goes as Cos(theta), which heads towards 0 as you approach +/- 90 degrees. Single axis devices are usually used when the angle is confined to +/- 60 degrees from the horizontal.
Good luck,
Bill

:=HI!
:=
:=I try to get Angle from ADXL105 is analog output,
:=is very instable ..... i have connected to PIC16f876 in A0
:=analog input pin.. in 8 bit is not get wide range between 0 to 90 tilt.
:=
:=in 16bit is moving right but is not stable ???
:=
:=My question is what is the best way or sensor to get the right
:=tilt angle, i need .5 degre bettwen step
:=
:=thank for your help
:=
:=Alain Tanguay
___________________________
This message was ported from CCS's old forum
Original Post ID: 144515845
Neutone



Joined: 08 Sep 2003
Posts: 839
Location: Houston

View user's profile Send private message

Re: ANGLE CALCULATION
PostPosted: Thu Jul 10, 2003 3:40 pm     Reply with quote

:=HI!
:=
:=I try to get Angle from ADXL105 is analog output,
:=is very instable ..... i have connected to PIC16f876 in A0
:=analog input pin.. in 8 bit is not get wide range between 0 to 90 tilt.
:=
:=in 16bit is moving right but is not stable ???
:=
:=My question is what is the best way or sensor to get the right
:=tilt angle, i need .5 degre bettwen step
:=
:=thank for your help
:=
:=Alain Tanguay

Use a input filter. An RC circuit will work or you can oversample and use a digital filter. Here is one that I like because it aproximates an RC circuit.

Filtered_input=Filtered_input-(Filtered_input/8)+(Raw_input/8)

This works very good for a noisy input. This method requires about 16 samples to become stable.
___________________________
This message was ported from CCS's old forum
Original Post ID: 144515859
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group