Pages: 1 2 [3]   Go Down
Author Topic: Programming an almost linear graph  (Read 2697 times)
0 Members and 1 Guest are viewing this topic.
'round the world...
Offline Offline
Faraday Member
**
Karma: 42
Posts: 3330
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hehe yes you are right looking at the sequence of the 1st decimal place in the sequence of measurements: 0, 3, 5, 8, 0, 3, 5, 8, 0, 3, 5, 8.  And since the last value is 4.62 setting it to 4.82 will make it even more linear....

It is supposed to be a linear relationship i think, even the opamp i am using costs a bit in order to give linear results under large amplifications, since the orignal voltage are mV and these have been amplified to V having a gain of 1000 and more.

Thank you for the advice, i think I will use it as linear.  I will mention all these comments (errors) in my thesis
tnx smiley

You could use two op-amps... it would make the circuit a bit more complex, but you could also use them to filter the signal... if needed.

I think the best is to assume it as a linear load cell... What are the rated limits of the load cell? It is quite normal to see the load cell have some linearity problems in the beginning and end of the scale (like my teacher said: "Linearity is an illusion"). But with a 10 bit ADC, you'll probably get a bigger error from that.

What is the precision of the reading you're planning to have? 1,2,3 decimal places?

Since you have all the gear you need either way, do this. Program the Arduino to use a linear scale. Use one of the equations you found. Then compare readings with the scale you have and different values of sand and plot the results. You can then check if the "non-linearity", is really affecting your measurements or not.

From experience, having an R-squared of 0.9995 is as good as one. Especially considering you're using 10 bits...
Logged

Eu não sou o teu criado. Se respondo no fórum é para ajudar todos mediante a minha disponibilidade e disposição. Responder por mensagem pessoal iria contra o propósito do fórum e por isso evito-o.
Se realmente pretendes que eu te ajude por mensagem pessoal, então podemos chegar a um acordo e contrato onde me pagas pela ajuda que eu fornecer e poderás então definir os termos de confidencialidade do meu serviço. De forma contrária toda e qualquer ajuda que eu der tem de ser visível a todos os participantes do fórum (será boa ideia, veres o significado da palavra fórum).
Nota também que eu não me responsabilizo por parvoíces escritas neste espaço pelo que se vais seguir algo dito por mim, entende que o farás por tua conta e risco.

Dito isto, mensagens pessoais só se forem pessoais, ou seja, se já interagimos de alguma forma no passado ou se me pretendes convidar para uma churrascada com cerveja (paga por ti, obviamente).

Georgina Ontario
Offline Offline
Sr. Member
****
Karma: 5
Posts: 437
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Since nobody else picked up on this...

Daniel Said in an early post:

What I did was I got 20kgs of sand, and put 1kg, 1kg, 1kg ..... into separated plastic bags, so I have 20 plastic bags each 1kg. and exactly 1kg since I used a good electronic weighing scale to measure them.


"Good" is not an acceptable engineering or statistical term.

Saying that scale is accurate on a 1Kg measurement to +- 0.05 grams -- or whatever is  acceptable.

When you are dealing with numbers....

The Relative error adds absolutely
The absolute error adds absolutely...

Is the scale error given as a percent? Is it given as +- so many grams...

Regardless ... if each bag is off by 2 grams... then adding five bags gives an error of +- 10 grams...

If each bag is off by 2% -- because that is the rating on the scale... then if you have 5 bags in a bucket -- what is the error? (HINT: It is not 2%.)

If you always use the same bags for your 5Kg weight -- then you help to "constrain" the error.

If you always "randomize" the bags that is another issue.

If you choose the bags in a pattern -- that is another issue again.

Basic stats and engineering principles...

In your calculations -- if you multiply or divide -- the percentage error (relative error) adds absolutely. In additions or subtractions -- the absolute error adds absolutely.

In something like this you need to calculate the error at the same time you calculate your answer.
 
Edit: You can verify this by getting (access to) a weigh scale which can measure different combination of 5Kg bags -- you will likely get some different weights.

What I left out as well is another statistic about a measuring device... the repeatability. If you make the same measurement 10 times -- do you always get the same answer.

I have done this exercise many times in industrial and scientific environments... They are not trivial issues.

Best wishes...


« Last Edit: April 07, 2011, 01:54:27 am by WillR » Logged

Just another Hacker

0
Offline Offline
Full Member
***
Karma: 1
Posts: 110
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Well, the electronic scale used to put 1kg of sand wasn't that accurate.  It was just a weighing scale bought from ebay used for other purposes,  it doesn't have a datasheet or anything.....so that might be the problem as well.  Fortunately it seems to be a sensitive weighing scale since it displays a change in 1 gram for example but it aint specific.

tnx for your interest. tomorrow il set up anoither experiment and take the readings again.
Logged

0
Offline Offline
Sr. Member
****
Karma: 4
Posts: 329
KC4MM
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

There's a big difference between precision and accuracy...
Logged

Georgina Ontario
Offline Offline
Sr. Member
****
Karma: 5
Posts: 437
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You can buy (Or borrow) a set of standard weights used to calibrate scales.

They should be easy to find in the university. Getting them might be another issue as labs don't like to loan equipment.

Doing all this work and pretending that you knew the weights of the bags was not a great use of time. smiley-razz

Bringing the scale to the weights, calibrating the scale, and then returning it to where you work might upset the calibration.

You really need to have the calibration weights handy to test the scale as you proceed through the weighing session.
Logged

Just another Hacker

'round the world...
Offline Offline
Faraday Member
**
Karma: 42
Posts: 3330
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Getting them might be another issue as labs don't like to loan equipment.

There's a good reason for that...

Also, don't forget, if you have a plate on the scale, the measured value should remain the same regardless of where you set the weight. I have no idea of the name of this test... but it is used in scales verification and calibration too.
Logged

Eu não sou o teu criado. Se respondo no fórum é para ajudar todos mediante a minha disponibilidade e disposição. Responder por mensagem pessoal iria contra o propósito do fórum e por isso evito-o.
Se realmente pretendes que eu te ajude por mensagem pessoal, então podemos chegar a um acordo e contrato onde me pagas pela ajuda que eu fornecer e poderás então definir os termos de confidencialidade do meu serviço. De forma contrária toda e qualquer ajuda que eu der tem de ser visível a todos os participantes do fórum (será boa ideia, veres o significado da palavra fórum).
Nota também que eu não me responsabilizo por parvoíces escritas neste espaço pelo que se vais seguir algo dito por mim, entende que o farás por tua conta e risco.

Dito isto, mensagens pessoais só se forem pessoais, ou seja, se já interagimos de alguma forma no passado ou se me pretendes convidar para uma churrascada com cerveja (paga por ti, obviamente).

Pages: 1 2 [3]   Go Up
Jump to: