Jump to content
Cyb

Altimer problem

Recommended Posts

Hi,

I've rebuild a altimeter using a PIC. It seems to work fine but I have a problem :

When I go from A(1) to B then B to A(2) , I expected to get the same altitude but I can't... image001.gif

and another test : image002.gif

and here's the (not totally complete) schema :

shema.jpg

I cannot see in the schema where the problem is ... or maybe it is normal ... ?

Share this post


Link to post
Share on other sites

From what I can see in your two charts, a 5-foot difference is occurring with readings that are over 10 minutes apart. What sort of accuracy (and resolution) do you need?

With designs like this, digital noise and temperature stability of the analog components needs to be considered. Perhaps you have already addressed that. If not, here are some things to consider: Does your firmware correctly use any data averaging techniques? Are the resistors 1% (temperature stable)? Have you thought about using a dedicated precision 5V regulator for the ADC & MPX circuits (isolated from digital circuits)? Is the PC board layout carefully routed to ensure a high degree of noise immunity? Is the sensor amp's gain correctly derived to provide the resolution you need with your 12-bit ADC?

Those are all common things that can affect accuracy. In the end, the device only needs to be as precise as the intended application requires.

Share this post


Link to post
Share on other sites

The graph is not in foots , these are meters , I've forgotten to change it in the graph.

In the pic , I'm doing an average from 10 values. I'm just using a single 7805 to power the circuit so digital and analog circuit are not isolated, maybe it is the problem..

Share this post


Link to post
Share on other sites

Is that sensor temp compensated ? I seem to remember it is not.

Terry

Share this post


Link to post
Share on other sites

Yes it is :

MPX4115 Features

* 1.5% Maximum Error over 0° to 85°C

* Ideally suited for Microprocessor or Microcontroller–Based Systems

* Temperature Compensated from –40° to +125°C

* Durable Epoxy Unibody Element or Surface Mount Package

Share this post


Link to post
Share on other sites

What does the resolution (not accuracy) work out to be when you calculate it? Does it compare to the observed resolution you experience during use?

BTW, if you place it on a stationary table and plot the data for an hour, what are the results? Is the plot a perfectly straight line?

Please keep in mind that achieving a full 12-bits on the ADC will require significant attention to board layout (noise immunity issues) and component choices. Sometimes it's tough to realize 10-bits above the noise floor (even with a simple 10-sample data average).

Share this post


Link to post
Share on other sites

Do you have any way to compensate for the temp drift of your circuit ? I know the sensor has but what about your componants ?

I remember seeing a pic altimeter in a mag a few years back that switched the adc between the sensor and some resistor network so the pic could compensate its self.

Terry

Share this post


Link to post
Share on other sites

I don't have any way to compensate the temp drift. I use classics components . Anyway how can I use the technic you're describing ?

Here's the graph when I log data on a table , without moving and temp change. Temperature might be the problem ...

post-6-1132745816_thumb.jpg

Share this post


Link to post
Share on other sites

I may be wrong but the graph seems to show dropouts and not drift ? The image is not very clear. Could it be a problem with your logging rather than the altimeter ?

I dont think I have the mag anymore but you may be able to get it from the EPE website, try asking at the chatzone http://www.chatzones.co.uk/discus/messages...html?1116303221

Terry

Share this post


Link to post
Share on other sites

Hi,

I am now sure that the problem is temperature : The altimeter was at ambient temperature the whole day. I pluged it indoor, then I diirectly put it on a table outdoor. The graph shows a curve, so I think this is the drift caused by the temperature difference. Maybe I should have left it more time outdoor and we would have see a curve folowwing by an horizontal line ...

post-6-1132764810_thumb.jpg

Share this post


Link to post
Share on other sites

The indoor table graph seems to hint that you have about 1.5 vertical units (feet or meters?) of resolution. If that is the resolution you have calculated, then this bit of observed error should not be a surprise. The spikes are probably just the low order data bit that is toggling in your averaged data.

The next graph appears to be temperature drift as the unit adapts to the outdoor temperatures. You'll need to review your choice of components to minimize that.

In addition, it is very important that the ADC's and MPX's Vref voltage remain absolutely stable (even a few millivolts of change will cause trouble). An LM7805 is not the best choice for precise/stable voltages. Use an isolated *precision* Voltage Reference instead. Firms like Linear Tech and National offer these special regulators.

Share this post


Link to post
Share on other sites

Are your resistors 1% metal film? If they are 5% carbon types then that will need to be changed.

Edit: BTW, you can use the heat from a hairdryer to see which components have the most effect. Cool spray comes in a can too. I think you will find that the MPX is a contributor to the problem.

Edited by Mr.RC-Cam

Share this post


Link to post
Share on other sites

Thank for the tip , I'll try.

Concerning resistors , I don't know which type they are. They are standard resistors I bought from an electronic shop... How can I know if they are carbon or metal ?

Share this post


Link to post
Share on other sites

Unless you went out of your way to specify metal film with 1% tolerances, they will be carbon type rated at 5% or 10%. You need temperature stable 1% parts, so the metal film resistor family is a good choice.

If you post a clear photo of an example resistor, then we may be able to tell you what it is. The photo will need to be very good though.

Share this post


Link to post
Share on other sites

Although it is a bit hard to totally confirm, I believe I see 1%, 2%, 3%, and 5% resistors in there. Most appear to be metal film, which is great. One glaring offender is the 180K in the OPAmp's feedback loop. You are using a 5% carbon at that spot -- it should be changed.

It should be helpful if you get out the hairdryer to see which parts contribute the most to the problem. Then change those that demonstrate the worst affects. Beyond that, you will need a more sophisticated design to achieve highest precision.

Share this post


Link to post
Share on other sites

Hi,all

:unsure: I've never seen any reference to the barometric ref. level variations ...

as this reference pressure varies most of time <_< , Im am not surprised by your "drift" curve.

this curve comprises the real electronics drift, plus the barometric ref variation... so, you should have recorded the "mercury column" height manually at same time, for precise mesurements.

Mesuring real altitude from the pressure is just a view of mind :angry: , it's only "not too false" if you go from point A to B in very little time, and quiet weather ( let's say a tenth of minutes ... no more ).

Here, the only way to catch your electronics drift :) is to use a 2.5 v or better 4.096 v ref, instead of the MPX sensor ... and then record.

But, altitude recordings, over a significative period ... will always be false, if you do not substract the ground level pressure !!!

Alain

Edited by Acetronics

Share this post


Link to post
Share on other sites
Mesuring real altitude from the pressure is just a view of mind mad.gif , it's only "not too false" if you go from point A to B in very little time, and quiet weather ( let's say a tenth of minutes ... no more ).

Yes, the 2 first graphs were taken in a very little time , 5 min or so.

I made another test , I connected the MPX directly to the ADC, without going through the op. amp. In this situation , no resistors were involved. But I also get a drift curve. I looked in the Max187 datasheet and I saw that it must be used in temperation range within 0 to 70 degrees. So this might be the problem.

Share this post


Link to post
Share on other sites

The 0 to 70 degree centigrade temp range is reasonable unless you are operating in below-freezing weather.

I suspect that part of the drift is from the LM7805 (it is not a precise Vref and will drift several millivolts). However, the MAX187 has a buffered temperature compensated 4.096VDC Vref output on Pin 4. I suggest you use that to power the MPX sensor. The MAX data sheet will tell you the requirements to do so.

Keep in mind that you are working with millivolt changes. Everything matters.

Share this post


Link to post
Share on other sites

Hi Mr-cam,

I've read the datasheet and it seems the ref from max187 cannot source enough current to power the mpx :

The output can be used as a reference voltage source for other com-

ponents and can source up to 0.6mA. Decouple REF

with a 4.7µF capacitor.

Share this post


Link to post
Share on other sites

You are correct, it is not enough current. And, to make matters worse, the MPX will not work on 4V.

There is a substantial advantage to using the same Vref on the sensor and ADC. If done correctly, it can offer ratiometric operation, and drift error due to voltage, can often be minimized. In your situation, this is not a convenient option.

The LM7805 is probably not a good choice for powering the MPX. You'll need to use a precise voltage source to reduce temperature induced errors. You can continue to use the LM7805 to operate the PIC though (as a separate "digital" supply, which is good too).

I think that you'll need to tweak a couple of things in your design to reduce the temperature drift. Start by using temperature stable resistors (not carbon comp) and install a precise 5.0V Voltage reference to operate the MPX. Beyond that the fixes will become more troublesome, so hopefully you can achieve the performance you need with these minor upgrades.

Share this post


Link to post
Share on other sites

Anyway I'll try changing resistors. Can you give me a part name I can use as a 5V precision VRef ?

Share this post


Link to post
Share on other sites

Hi, Cyb

2 x 1200s recordings in 5 minutes ... :blink: Woooaaahhhh, you're a bit magician, you !!!

5v refs : LT1236-5 ; MAX 875, LM 336 - 5.0 ; LT 1029 ACZ .

You could also buffer the MAX187 ref with a good OPA ...

for a regulator, LT 1086 CT -5 would be a good stable choice ... ( from CONRAD )

Alain

Share this post


Link to post
Share on other sites
2 x 1200s recordings in 5 minutes ...  :blink: Woooaaahhhh, you're a bit magician, you !!!

Hehe ;) Texts on the graphs are not correct. They came from an excel file I've downloaded somewhere and I did not change them . 1200 must be /2 ==> 600 seconds.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×