On 22.12.2017 17:07, shall689 wrote:

> In what situations would I want to use the Interval Package?

>

> Would it be useful in determine the effect of ADC Quantization error?

>

> Thanks

> Stephen

Hi Stephen,

the interval package can be used to model all kinds of (worst case)

errors. For example, when I build a temperature sensor with my Arduino

One, I can use the internal ADC to measure the output of a TMP36

temperature sensor.

According to the specs, the ADC has a 10-bit resolution with an abolute

error of +-2 LSB. If the ADC returns a value of x = 153, we can compute

the corresponding voltage and temperatur (in °C) with error bounds for

the ADC:

>> x = 153;

>> pkg load interval

>> adc_err = infsup ("[-2, 2]");

>> voltage = (x + adc_err) / 1024 * 5

voltage ⊂ [0.7373, 0.75684]

>> temperature = (voltage - .5) * 100

temperature ⊂ [23.73, 25.684]

As you can see, the ADC quantization error already introduces an error

of 2°C. Now, we can add the error of the temperature sensor according

to its specs (around 25°C there is a max error of +- 2°C).

>> temperature + infsup ("[-2, 2]")

ans ⊂ [21.73, 27.684]

As you can see, such a temperature sensor is not very accurate without

calibration.

Best

Oliver

_______________________________________________

Help-octave mailing list

[hidden email]
https://lists.gnu.org/mailman/listinfo/help-octave