TECH TIP VISION Calibration and Data Acquisition Software May 2016 Using Calculated Channels in VISION Calculated channels are data items created in a Recorder file whose values are calculated from other data items in the Recorder file (.rec) using a mathematical expression. Unlike the virtual data items that are added to the Recorder object prior to the data acquisition process, calculated channels are added to the recorder file after the data acquisition process has taken place. Calculated channels are easy to create, and the list of operators and functions available for use to generate calculated channels has recently been expanded. Notes: Calculated Channels are a feature of the Data Viewer and Analysis toolkit. Calculated channels are saved in layout templates. Examples of what a calculated channel is used for are: Creating a channel that represents a reference value. For example, transmission output speed times a gear ratio is the engine rpm while in a given gear. Creating a channel that represents a physical parameter that cannot be directly measured. For example, calculating the amount of slip that occurs on a clutch element in an automatic transmission can be done. This slip expression combined with a calculation for the pressure on the clutch can be used to calculate the amount of power being dissipated in the clutch. Page 1 of 5
Verifying control equations. Equations can be setup to externally calculate from measured variables, and some calculations occur internal to a controller. This externally calculated value could be compared to the internal calculation as a means of verification. Create a Calculated Channel 1. In an open Recorder file (.rec), go to "Edit -> Add calculated channel" or right-click on the Graph Legend and select "Add calculated channel" from the context menu. 2. Enter the name of new calculated channel on the 'Data Item Name' dialog window. The name should be unique and cannot contain spaces. The new Calculated Channel appears only as part of the Data List. 3. In the 'Calculated Scalar Properties' dialog window, click the Description tab. 4. Click on the Formula sub-tab in the Description tab, and create the scalar: Page 2 of 5
a. Define an equation using custom mathematical formulas. b. Define the engineering units for the data item. For example, volts. c. Set the time in seconds to offset the calculated channel values from source data if needed. For more details regarding the composition of the equation for the Virtual Scalar value, see the next section. 5. Click on the Parameter sub-tab and specify any parameters that apply: Specify decimal places (for calibration Data Items only). Specify text color and value warning thresholds. 6. Click "OK." Creating Equations for the Virtual Scalar Value The Equation for Virtual Scalar value can be a variable or an expression: Variable a single data item variable from the Recorder file such as EMX16AI.pedal_voltage_ch03. To add a variable to the equation, use the Insert Data Item button to select individual variables. Expression a valid mathematical expression containing one or more data item variables such as (EMX16AI.pedal_voltage_ch03 + EMX16AI.act_voltage_ch04) * 2 Use standard mathematical operators (+, -, *, /) and wide range of other functions (for a complete list, see section "Operators and Functions for Virtual and Calculated Channels" in the VISION manual). Over ten additional functions have recently been added to VISION including global minimum and maximum data item values. Use all functions in the following table for Calculated channels (and Virtual Data Items and Trigger expressions): Page 3 of 5
Function int(x) Description Convert x to integer (floor of x). ln(x) Natural logarithm of x (for x > 0). log(x) Logarithm of x (for x > 0). exp(x) Exponential value for (all real) x. sqrt(x) Square root of x. abs(x) Absolute value of x. max(x, y) min(x, y) Count(expression) Sum(expression) Ave(expression) MAve(expression, count) RMS(expression, count) dv(expression) dt(variable) Maximum of x and y (Where 'y' can be any constant values). Minimum of x and y (Where 'y' can be any constant values). Returns number of times the expression is evaluated. Returns historical sum of expression values. Returns historical average value of expression values. Returns moving average of expression. Up to last count values are used. If less than count values are available, the average of the available values is used. Returns root mean square of expression. Up to last count values are used. If less than count values are available, the RMS of the available values is used. Returns change in value since prior evaluation of the formula. Returns change in time since prior evaluation of the formula. Calculates the rate of change of the value. dv(expression)/dt(variable) Example: Calculates acceleration from vehicle speed: dv(pcm.vehicle_speed)/dt(pcm.vehicle_speed) g_min (D) Global minimum of the dataitem D. g_max (D) Global maximum of the dataitem D. stds(d) Sample standard deviation (sample type) of the data item D. ms_min(d,n) ms_max(d,n) ms_stds(d,n) mt_sum(d,t) mt_min(d,t) mt_max(d,t) mt_mean(d,t) mt_stds(d, t) Moving sample minimum of the dataitem D (the minimum over the last n samples). Moving sample maximum of the dataitem D (the maximum over the last n samples). Standard deviation (sample type) of the dataitem D over the last n samples. Sum over the time interval [0,t] seconds. Min over the time interval [0,t] seconds. Max over the time interval [0,t] seconds. Mean over the time interval [0,t] seconds. Standard deviation (sample type) of the dataitem D over the last n seconds. Page 4 of 5
Function Description The following Functions take parameters or return values in radian units (not degrees). sin(x) cos(x) tan(x) sinh(x) cosh(x) tanh(x) asin(x) acos(x) atan(x) or atn(x) Sine of x Cosine of x Tangent of x Hyperbolic sine of x Hyperbolic cosine of x Hyperbolic tangent of x Arcsine of x Arccosine of x Arctangent of x The following Functions take parameters or return values in degrees. sind(x) cosd(x) tand(x) sinhd(x) coshd(x) tanhd(x) asind(x) acosd(x) atand(x) Sine of x Cosine of x Tangent of x Hyperbolic sine of x Hyperbolic cosine of x Hyperbolic tangent of x Arcsine of x Arccosine of x Arctangent of x Note: These advanced operators and functions are available for not only Calculated Channels, but also Virtual Channels, Find in Files equations, and Recorder Trigger functions. They are not available for data item conversion formulas (returns ERR values if entered), or toolbar formulas (shows This formula is invalid dialog is entered). For more information, see the VISION Manual installed with VISION or on the ATI support portal at https://www.accuratetechnologies.com/support. For additional questions, contact ATI support at support@accuratetechnologies.com. Page 5 of 5