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

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

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

The columns

- Name: The name of this value, "Math." is added before this name when it is used on the different pages.
- Enable: When checked the formula will be calculated for each value. A "Math" column in the table will not be removed when this value is unchecked, but it will not be recalculated either.
- Unit: Optional unit.
- Type: Perform a advanced operation of the calculated value, often involving multiple samples.
- Samples: How many samples is used for the operation specified above (in a few cases samples is not samples, but have a different meaning).
- Source formula: The formula calculated the value, this formula can use data from all measured columns.

Add a formula

Add a empty formula line.

Remove a formula

Remove one or more formula.

Calculation type

- Formula: Use the result from the formula directly
- Average: Calculate a rolling average over the specified number of samples. See also RollingSum
- Slope: Calculate slope using a least square method over the specified number of samples.
- Min: Find the minimum value over the specified number of samples.
- Max: Find the maximum value over the specified number of samples.
- RollingSum: Calculate a rolling sum over the specified number of samples. See also Average
- TotalSum: Calculate the sum of all samples. See also RollingSum
- SumTimeSec: Calculate the sum of all samples and weight by time. This is used to get As, Ws or similar. See also SumTimeMin, SumTimeHour
- SumTimeMin: Calculate the sum of all samples and weight by time. This is used to get Am, Wm or similar. See also SumTimeSec, SumTimeHour
- SumTimeHour: Calculate the sum of all samples and weight by time. This is used to get Ah, Wh or similar. See also SumTimeSec, SumTimeMin
- Change: Returns the difference between the first and last sample over the specified number of samples.
- Delta: Returns the larges difference between two successive samples over the specified number of samples.
- Range: Return the difference between min and max over the specified number of samples.
- RMS: Calculates a Root Means Square (RMS) value over the specified number of samples. I.e. squares all samples, add all squares, divide by number of samples and then takes the square root.
- FilterLP: Remove higher frequencies from the data. Math: (sum*(samples-1)+lastValue)/samples. See also FilterHP, Average
- FilterHP: Remove lower frequencies from the data. Math: (sum*(samples-1)+lastValue)/samples. Returns the difference between lastValue. and the sum. See also FilterLP
- Digital: Convert a value to digital channels, samples specifies number of digital channels. It is using the bits from the integer part of the value. The operators == > < can be useful for a single channel
- DropOutFilter: Tries to eliminate a few samples that is well outside the average of the specified number of samples. It do that by using a average when the last values is outside 3 time the variance in the data.
- StdDev: Calculate standard deviation for all data.
- StdDevRunning: Calculate standard deviation for specified number of samples.

Source formula

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

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.

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.

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

Power supplies seldom returns power, capacity or energy, but it is fairly easy to calculate.

The example uses a power supply called QL355

Decibel

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

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 25°C), 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

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

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.