Test controller, math page

Math

This page is used to define math channels, this is values calculated from measured values.

Contents
    What is on the screen
    The columns
    Add a formula
    Remove a formula
    Calculation type
    Source formula
    Some examples
        Power, capacity & energy
        Decibel
        Temperature
        Removing noise
        Convert a value to digital
Functions for use in calculator and definitions
Main page



What is on the screen

Areas

In the above picture I have labelled the different areas of this page, in the following I will go more into details.



The columns


Add a formula

Add

Add a empty formula line.



Remove a formula

Delete

Remove one or more formula.



Calculation type


Source formula

MathMath

The formula part is where data is collected from the measured values and combined to a new value.

Edit

Click on the field and start typing or press F2 to enter edit mode.

It is possible to use all the normal operators and brackets in the formula.

Error

The formula is not checked for error while typing, first when trying to use the formula, i.e. enabling it and selected "Current values" or "Table" page. If there is an error the formula will be disabled again and marked with red.

Help

There is a help popup that shows the most common functions that can be used in formula, see the link above for a more complete function list.







Some examples

Power, capacity & energy

Example1

Power supplies seldom returns power, capacity or energy, but it is fairly easy to calculate.
The example uses a power supply called QL355



Decibel

Example2

Any voltmeter value can be converted to decibel with a simple formula. In the audio world the dBu value is based on 1mW in 600ohm or 0.775V. The first formula handles that.
The second formula calculated dB with 1 volt as reference.
The example uses a DMM called K34461



Temperature

Example3

Many DMM's can measure temperature, often with thermocouplers where the precision is within a couple of degrees. To make more precise temperature measurements on any DMM use a precision thermistor.
The first example uses the beta value (3950) and the reference point (10kOhm at 25C), it will be fairly precise around the reference point.
The second example can do much better but requires that the "ntc1" value is defined first. It is done with the expression:
Code:
globalvar ntc1=ntcCoef(24.94k,5,10k,25,4.363k,45)

That defines 3 reference points. These points are selected from the datasheet for the used ntc with values that covers the desired range.

The above expression can be executed in the calculator or on the command line with a = before it. The best place to put it is probably in the "...\Documents\TestController\Settings\autorun.txt" file with a = before it.



Removing noise

Example4

Sometimes it can be necessary to remove noise from a measurement, the LP filter can be used for that (A average would do nearly the same).
Adjust the samples to get the best filtering. With high values of samples output will change very slowly.



Convert a value to digital

Example5

All digital values only count as one curve on the chart, this makes it very useful to show some a couple of status values/curves.
The above formula will show 1 when the voltage is with 4.9V to 5.1V and 0 at all other times.