5 CalcGraf - Graphical Formula Editor
5 CalcGraf - Graphical Formula Editor
AT2653E, Rev. 07
User´s Guide
CALCGRAF
GRAPHIC AL FORMULA EDITOR
Copyright 2013 AVL List GmbH, Graz - Austria
The contents of this document may not be reproduced in any form or communicated to any third party without the
prior written consent of AVL. While every effort is made to ensure its correctness, AVL assumes no responsibility
neither for errors and omissions which may occur in this document nor for damage caused by them.
All mentioned trademarks or registered trademarks are owned by their respective owners.
Table of Contents
1 Introduction ...................................................................................................................... 7
3.7 Compiling................................................................................................................................ 16
4 Special Features.............................................................................................................. 17
4.1 Multicylinder Evaluations ........................................................................................................ 17
6 Settings ............................................................................................................................ 23
6.1 calgraf.ini File ......................................................................................................................... 23
8.1.30 TDC_Adjustment............................................................................................................... 45
8.1.31 Thermodynamics1 and Thermodynamics1_A .................................................................. 45
8.1.32 Thermodynamics2 and Thermodynamics2_A .................................................................. 47
8.1.33 Thermodynamics2OP ....................................................................................................... 50
8.1.34 Thermodynamics2Mass.................................................................................................... 50
10.2 Calculations with Moving Means and Other Recursive Algorithms ........................................ 71
10.3 Using Existing SoftRTP Models in AVL CONCERTO and AVL IndiCom Offline .................... 72
11 InjectionRate .................................................................................................................... 77
11.1 Analysis of Fuel Injection in Diesel Engines Based on Pressure Curves Measured on the
Injection Line .......................................................................................................................... 77
11.1.1 Calculation Bases .............................................................................................................77
11.1.2 Parameterization ...............................................................................................................79
11.1.3 Editing the Parameter File.................................................................................................80
11.1.4 Calculation of the Nozzle Needle Lift ................................................................................81
11.1.4.1 Single-Spring Holder .........................................................................................81
11.1.4.2 Two-Spring Holder ............................................................................................82
11.1.5 Calculation of the Injection Rate .......................................................................................82
11.1.6 Examples of Calculations ..................................................................................................84
Index.............................................................................................................................................................. 87
1 Introduction
CalcGraf is a graphical editor designed to create your own calculation models,
You may call CalcGraf in one of the following ways:
Workflow bar: via Calculations | CalcGraf
2 Scope of Functions
A number of function elements are available for building calculation models.
These are available via the auto hide bars in the left-hand section of the applica-
tion window and can be dragged to the drawing window.
The following types of function blocks are available:
Base Functions
(see also Standard Blocks on page 25)
– Terminals (symbols for inputs and outputs)
– Operators (+, -, *, /)
– Basic mathematical functions (square root, power, etc.)
Library Functions
(see also Library Functions on page 29)
Library Functions are macro functions (special evaluation functions
which themselves are defined as CONCERTO macro functions.
They usually need further parameters such as calculation range, resolution,
etc.).
The Library Functions tab contains a number of folders that can be
changed or extended arbitrarily by providing an entry in the calcgraf.ini con-
figuration file.
For further information, see calgraf.ini File on page 23.
The folder structure in CalcGraf is as follows:
– StdLib-Indicating
Contains all library functions relevant for indicating applications.
– StdLib-Timebase and NVH
Contains all library functions relevant for time-based signals.
– MyLib
Alle user-defined macros stored in the MyLib\Macros\CalcGraf folder
are displayed in this folder.
– WorkEnvironment
If your Work Environment contains CalcGraf macros, these are dis-
played in this folder.
– Exported from models
If a model is loaded in which macros were used that are not available
in any of the folders StdLib-Indicating, StdLib-Timebase and MyLib,
these macros are automatically exported from the model to this
working folder.
SoftRTP library functions
(see also section SoftRTP Calculations on page 71)
Only available with the AVL IndiCom indicating system software and in con-
junction with GigaBit indicating systems and streaming measurements.
Channel Browser on the right-hand side of the application window displays all
loaded files/tests with all their channels as well as the formulas that have been
defined using CalcGraf (virtual channels) in a channel list. You can drag chan-
nels from this channel list to the inputs of the calculation model.
For further information, see Assigning Input and Output Names on page 15.
NOTICE
2. Then click in the window where you want to insert the text and input it.
Information
Type a full stop (or period ".") as the decimal point! Commas are converted to
periods.
If it is a selection field, a list appears from which you can make your selec-
tion.
Information
When you move the mouse pointer over a function block, the parameters are
shown as a tooltip.
Information
Do not click on the terminal icon to select a terminal text, but click on the text
itself!
You can also drag channels to the input terminals from Channel Browser.
You do not therefore have to enter the names manually.
Dragging only inserts the channel name. In some cases, however, it is also
necessary to use the data block type (CA, CAO...) to exactly indicate the channel
to be used (in ambiguous cases, the first channel encountered is taken).
If you want to indicate the data block type in addition to the channel name, keep
the [Ctrl] key pressed while dragging the channel to the terminal.
For further information, see Input Signals on page 59.
Input terminals need to contain the name of a measurement signal or of a result
signal from a different loaded calculation model.
Output terminals must be given a name that has not yet been used. This name is
made known to the rest of the application.
3.7 Compiling
When your graphical model is ready you have to compile it. Click the following
button on the toolbar:
The model is then compiled and for every output a formula is created with the
same name. These formulas appear as virtual channels in the channel list and
may be inserted in diagrams and tables. The calculation itself is triggered by the
display process.
If there are multiple windows open all of them are compiled automatically. That
may take a while.
In connection with AVL IndiCom the following applies: With models of type
Soft-RTP (for streaming measurements), SoftRTP functions enabling you to
perform real-time calculation of characteristic values in streaming mode are also
created apart from normal formulas.
Compiling a Grouping type model creates a macro which is then available in the
library list. This does not affect any other windows.
With regard to formula creation, type Standard and type Generic are identical.
Information
If you make any changes to the number of inputs and output terminals, you have
to delete the original macro from the model and then refresh the library list via
the context menu option Refresh Macro List before dragging the modified
macro into the model again.
4 Special Features
2. Then append an asterisk * to the input and output names as a wildcard for
the trailing cylinder numbers (e.g. PCYL* and dQ*).
3. To define the number of cylinders to be evaluated, set the cylinder number
input field in the toolbar accordingly.
During compilation, CalcGraf will automatically create the same formulas for
all calculated results ending with * for all cylinders (e.g. dQ1 from PCYL1,
dQ2 from PCYL2, and so on).
Information
4.3 Statistics
Very often, indicating data is measured for a higher number of engine cycles.
Statistical information such as maximum, minimum, mean value and coefficient
of variance, can also be derived from the result values for each cycle.
CalcGraf creates these statistic formulas automatically. The following button has
to be activated:
Different suffixes are appended to the output names for the statistical informa-
tion. which are defined in the calcgraf.ini file (see calgraf.ini File on page 23).
The suffix defined in the calcgraf.ini file for the engine average is appended to
the output names (see calgraf.ini File on page 23).
The default setting is 0.
This entry is used to calculate formulas even if the required dataset is not avail-
able. A dataset containing one point (which is marked as invalid) is created
instead and it is the macro's task to handle it accordingly.
Saving a model to a file is not absolutely necessary. All models are automatically
saved to the layout file (parameter file). When you open the layout file later on, it
is extracted from there and compiled. All defined calculations are therefore
immediately available after compilation. Formulas originating from the previous
layout file are automatically deleted.
If you have also saved the model to a separate file, you can easily reload it later
by clicking the toolbar button shown below or selecting File | Open in the menu
system and thus make its contents available for your current evaluations and for
saving along with the current layout file.
6 Settings
NOTICE
Never place your own formulas in these folders because they are emptied before
each compilation stage!
The formulas created from generic models are automatically stored in the
temporary folder in a structure composed of file alias and data key where they
are automatically identified by Data Explorer. No entry in the calcgraf.ini file is
needed.
EnableCGCyl- This entry is not available after installation.
Check=1
If this entry is set, formulas for cylinders for which no channels are available are
automatically hidden.
This convenient function should be deactivated if formulas are used as inputs for
the model which were not created using CalcGraf.
Statistic Suffixes
Minimum = mn
Maximum = mx
Average = av
COV = cv
Std = st
These entries define the name extensions CalcGraf will append to result names
for statistics.
Engine Average
CylinderAverage = 0
For total engine average results CalcGraf replaces the cylinder number with the
character defined here.
Two types of mean values are possible:
The engine average is calculated as the average of the cylinder means.
The quantity is identified by the text set under "CylinderAverage". This text
replaces the cylinder number in the result name.
The engine average is calculated from the collective value of all the
result values from all cylinders. This quantity is identified by the text set
under "CylinderMergeChar" as an appendix to the result name. This text
replaces the cylinder number in the result name.
Both types of mean values can also be calculated in parallel.
All other entries are managed by CalcGraf independently, some of them
reflecting settings in the user interface (toolbar).
7 Standard Blocks
Fig. 1
It is possible to use a numerical value as the input value for the Constant
terminal. That can make sense for special macro functions where you want the
value to be visible in the model instead of a parameter that is set in the proper-
ties dialog. You can select one of the Constant buttons depending on whether
the line connection point is to be at the bottom (vertical) or on the right (hori-
zontal).
Fig. 2
Square root, Power and Absolute value can be applied to values and to
curves. The other functions can only be used for curves.
The Derivative is arrived at by floating determination of the differential quotients
at intervals of +/-1 point.
Smoothing is produced by moving average calculation based on the point on
the left and the point on the right.
Fig. 3
This means that unlike in the other standard functions, these macros allow you
to also retrieve parameters. If you double-click the macro (or choose the Proper-
ties context menu option), an input dialog opens where you can preset the
required parameters.
TrendCurve_Linear:
This macro creates a best-fit line (first order) calculated according to the
least-squares method.
TrendCurve_Spline:
This macro creates a cubic spline (of third order).
TrendCurve_Polynomial:
This macro creates a polynomial best-fit curve. The order of the polynomial
can be defined as a parameter.
HistogramPercent:
This macro creates a percentage-based, one-dimensional classification of
the input dataset.
Functionality and parameters are identical to the value distribution
described below.
Histogram:
This macro creates a one-dimensional classification of the input dataset. In
addition to the defined classes, two outlier classes are created for the points
which are outside of the defined classification limits.
Parameters:
Min = lower classification limit
Max = upper classification limit
Step = class width
If 0 (= pre-set value) is passed for all three parameters, 10 classes are auto-
matically created between the dataset minimum and the dataset maximum.
Thresh:
This macro is used to determine all points of a curve which intersect a hori-
zontal threshold curve. To this end, you have to set the threshold and the
edge orientation in the parameter input dialog. With the latter value you can
set whether you want to determine only upper threshold deviations (positive
edge), lower threshold deviations (negative edge), or both. Please note that
no interpolation is carried out but the curve points nearest to the thresholds
are returned. The result dataset consists of as many points as intersecting
points have been found. The X track contains the X values of the these
points. Such a dataset can be visualized as a curve (typically only as points
without connecting line) or as a table with a base column.
LocMax:
With this macro you can determine all local maxima of a curve. You can set
a detection tolerance in the parameter input dialog, i.e. the value specifying
the distance for the maxima and minima to be recognized separately. By
specifying a meaningful value for this quantity you can prevent any noise
superimposed on the curve from being detected as undesired maxima. The
result dataset consists of as many points as maxima have been found. The
X track contains the X values of the maxima. Such a dataset can be visual-
8 Library Functions
The macro functions described below may be inserted as elements into a
window of the graphical calculation editor. Many functions need additional
parameters for the calculation. They can be edited in the properties dialog of the
element (Properties context menu option or double-click). Default values have
been assigned to the parameters to avoid accidental errors. Nevertheless we
recommend that you check and adapt these values as necessary.
Very often a calculation range and calculation resolution are required because
different input signals may have been acquired for different durations and may
also include sample rate switchings. The resulting output signal, providing it is a
curve, will start at exactly the beginning of the calculation, finish at the end of the
calculation and consist of a number of points as defined by the calculation reso-
lution.
The different brackets in the description below have the following significance:
( ) Default parameter settings
[ ] Physical unit
{ } Parameter choice in drop-down list box
Revisions Macros can be given a revision number which is displayed with the macro
comment as a tool tip.
context menu A library function's context menu provides the following options:
Refresh Macro List
Use this option after you have created a new macro (to refresh the macro
list) or if you have changed the number of inputs and outputs (see Editing
the Model on page 16).
Properties
This option is used to call a property page containing the default parameters
of the given macro. Here, the parameters are not editable. See Parameter-
izing Function Blocks on page 15).
Edit macro
See Editing the Model on page 16.
Optional Inputs Unlike outputs, where it is sufficient if just one is used, it is usually necessary to
apply signals or constants to all inputs. Only if a function is specially designed for
this purpose, may inputs also remain open. This is marked by square brackets
around the name of the input.
Dataset Arrays Some functions deliver a dataset array back to their output. This is marked by an
output name that ends with "#".
If you connect an output terminal to such an output and assign another name,
make sure that the name ends with a "#" symbol. This symbol signals to Channel
Browser that this is a dataset array.
Use Channel Browser to access to the contained component datasets.
In case you combine array outputs with multi cylinder functionality, the cylinder
wildcard "*" is inserted in front of the array symbol "#".
Function inputs may also demand dataset arrays. Here, too, this is marked by
the symbol "#" at the end of the input name.
8.1.1 CycleVariation
Cycle averaging and envelopes.
Result Curves
Mean Mean curve
uEnv Upper envelope curve
lEnv Lower envelope curve
StdDev Standard deviation curve
Parameters
Start of Calculation [deg. CA] (-360)
End of Calculation [deg. CA] (360)
Calc. Resolution [deg. CA] (1)
Description This function permits statistical evaluation of signal curves (e.g. cylinder pres-
sure) of a large number of engine cycles.
8.1.2 CompressionCurve
This function is used to determine the pressure curve of a motored engine by
extrapolation from the compression curve.
Result Curves
Pcomp Pressure curve of a motored engine
Parameters
Start of extrapolation The extrapolation starts from this angle and is
[deg. CA] (-20) inserted in front of the curve.
Polytropic coefficient The estimated polytropic coefficient needed for the
(1.32) calculation.
Description The function expects a fired cylinder pressure curve at the input. The pressure
curve of the motored engine is calculated from the crank angle defined as the
start of extrapolation using the adiabatic equation and added to the first part of
the cylinder pressure curve.
8.1.3 Derivation
Calculation of the first or second derivative of a curve.
Result Curves
D1P 1st derivative
D2P 2nd derivative
Parameters
Start of Calculation
[deg. CA] (-360)
End of Calculation
[deg. CA] (360)
Calc. Resolution
[deg. CA] (1)
Interval Width Moving window to determine differential quotient.
{1,2,3,...20} (1)
Δy y( i + n ) – y( i – n )
y' i = ------ = ------------------------------------
Δx x( i + n ) – x( i – n )
n Interval width
The interval width must not be confused with the calculation resolution. The
calculation resolution determines the resolution of the result curve.
The actual differential quotient, however, is not computed from the two adjacent
curve points but from two points spaced at ± interval width x calculation resolu-
tion. As a result, the differentiation interval is 2 x interval width x calculation reso-
lution.
This means that curves that have been captured with fine abscissa resolution
can be derived cleanly also with fine calculation resolution by selecting an
accordingly higher interval width. Basically this number acts like an integrated
automatic smoothing algorithm.
8.1.4 DigitalFilter
High- and low pass filtering using FIR filters
Result Curves
LP Low pass
HP High pass
Parameters
Start of Calculation [deg. CA] (0)
End of Calculation [deg. CA] (70)
Calc. Resolution [deg. CA] (0.1)
Cut-off Frequency [Hz] (4000)
Description This is a simple digital filtering process which permits filtering without the Fourier
analysis calculation. The filter is identified by the order number which in turn
represents the number of points used. The filter cut off frequency can be set in
Hz. The polynomial coefficients necessary for the calculation are derived inter-
nally. The speed is used to determine a mean sampling frequency for indicating
data.
i+n
y FIR ( i ) = ∑ k( j ) ⋅ y( j )
j = i–n
i Current abscissa
n Order (ORD)
This calculation is very similar to that of a mean value filter but all the values
involved are now multiplied by specific coefficients. These coefficients are a
function of the type of filter, limit frequency, scanning rate and order.
To obtain a finite pulse response for the filters, the coefficients are evaluated
using a Hanning window.
Low pass:
fc
c ( j ) = sin ⎛ 2 ⋅ π ⋅ ---- ⋅ j⎞ ⁄ ( π ⋅ j )
⎝ fs ⎠
fc
c ( 0 ) = 2 ⋅ ----
fs
High pass:
fc
c ( j ) = – sin ⎛ 2 ⋅ π ⋅ ---- ⋅ j⎞ ⁄ ( π ⋅ j )
⎝ fs ⎠
fc
c ( 0 ) = 1 – 2 ⋅ ----
fs
Hanning window:
1
h ( j ) = --- ( 1 + cos ( 2 ⋅ π ⋅ j ⁄ ( 2n + 1 ) ) )
2
Coefficient:
k( j ) = h( j ) ⋅ c ( j )
fc Cut-off frequency
fs Sampling rate
n Order
To achieve a high filter effect, the filter order for FIR filters is automatically
adjusted to the ratio sampling frequency to cut-off frequency. To prevent long
calculation times, the internal order value is limited to 100. Limiting the filter
order when the ratio between scanning frequency and cut-off frequency is large
can result in signal damping due to the filter characteristic. This effect can be
avoided by adjusting the calculation (= scanning frequency). With FIR filters,
damping at the cutoff frequency is 6 dB.
Adjustment of the filter order to the cut off frequencies:
To achieve a higher filter effect for low pass, the calculation resolution is
decreased by 3 or 5 if the ratio of the frequencies is too high. This means that for
calculation of a certain point the third or fifth adjoining point is taken for calcula-
tion instead of the very next one. In addition the signal is smoothed using a mean
value filter (order 3 or 5).
8.1.5 Distribution
Classification of result values
Result Curves
Dist Frequency distribution
Sum Cumulative distribution
Parameters
Minimum (0) The minimum signal amplitude expected.
Maximum (100) The maximum signal amplitude expected.
Class width (5) The range is divided into classes and the number of
result values is determined whose value lies within one
of these classes.
Description These evaluation functions are used mainly for the statistical assessment of fluc-
tuations in result values.
They therefore always require measurements over a large number of engine
cycles. The frequency distribution is represented as a curve from which the
frequency with which a specific result value occurs can be read. In order to
calculate a frequency distribution, the amplitude range of the output signal, e.g.
peak pressure, IMEP, etc., has to be divided into classes.
The cumulative frequency shows how many result values lie below a specific
result value amplitude. The distribution values always refer to the total number of
cycles in %.
8.1.6 EngineAverage
Averaging over all cylinders and cycles.
Result Curves
Mean Engine average
Parameters
Start of Calculation
(deg. CA) (-360)
End of Calculation
(deg. CA) (360)
Calc. Resolution
(deg. CA) (1)
Description An averaged curve is calculated from all cylinders and their cycles.
8.1.7 FFTAnalysis
Frequency transformation of a curve section.
Result Curves
FFT Frequency spectrum
Parameters
Start of Calculation
[deg. CA] (0)
Calc. Resolution [deg. CA] (0,1)
[deg. CA] (0,1)
Samples Number of points taken from the start of the
{256, 512, 1024, 2048, calculation with the defined calculation resolution.
4096, 8192, 16384} (256)
Hanning Window Multiplication of the signal section with the
{Off, On} (On) Hanning function (Cosine function) for avoiding
border effect.
Spectrum Type
{Amplitudes, RMS, Power}
(Amplitudes)
DC Portion
{Off, On} (Off)
Description A Fast Fourier Transformation (FFT) is used for calculating the spectrum. This
algorithm needs a number of samples equal to a power of two. These samples
are extracted from the input signal starting from the defined start of calculation at
the set resolution. The calculation determines the harmonics of the section of the
input signal and the duration of the base harmonics correlates exactly to the
section of the input signal defined by the number of samples multiplied by the
calculation resolution. For crank angle-based signals, the spectrum can be
converted to time based using the average engine speed of the engine cycle.
The FFT algorithm basically assumes periodic signals. We therefore recommend
using the Hanning window (Cosine function) which forces that the first and the
last values of the signal sections both approach 0 thus avoiding any signal jumps
between first and last point. Such jumps would result in showing higher frequen-
cies in the spectrum which are not actually available in the input signal. On the
other hand, the Hanning window results in a certain widening up of the frequency
lines.
A frequent application for the FFT function is the investigation of knock oscilla-
tions. A small section of the cylinder pressure signal around TDC is used for this
purpose.
This function is not suitable for rotary analysis for which the entire engine cycle
has to be converted. The Order Analysis function is designed for that applica-
tion.
8.1.8 IMEP
Indicated Mean Effective Pressure
Result Values
IMEP Indicated mean effective pressure over the entire engine cycle
IMEPH High pressure part of the IMEP
PMEP Gas exchange part of the IMEP
Parameters
Calc. Resolution This is where the resolution for the IMEP calculation
[deg. CA] (1) can be defined. Normally, 1 deg. should be specified.
Finer calculation resolutions will slow down the
calculation process without any significant increase
in accuracy. The exact determination of the top dead
center has a far greater influence on IMEP accuracy
(0.1 deg. TDC error results in approx. 1% error in
IMEP).
Calculation range This field is only relevant for the calculation of the
{180 deg., pV loop)} high pressure and gas exchange IMEPs. When set
(180 deg.) to 180 deg., the calculation is carried out from one
BDC (bottom dead center) to the next BDC. When
set to pV loop, the exact point of intersection
between the two pV curve loops is determined and
the integration oriented in such a way as to produce
the exact contents of the high pressure loop under
IMEPH and the gas exchange loop under PMEP.
Description The indicated mean effective pressure corresponds to the area contents of the
two loops of the pV curve. With a fired engine, the high pressure loop is always
oriented positively (energy is generated) and the gas exchange loop negatively
(energy is required).
It is not necessary to specify a calculation range here.
The IMEP calculation starts at the beginning of the measuring range and covers
the entire engine cycle.
IMEPH is either calculated from –180 ... +180 deg.or between the pV curve loop
intersections.
PMEP is always calculated as IMEP-IMEPH.
Information
An IMEP calculation is only correct if data is available over the entire engine
cycle. Ensure that the measurement table covers a complete engine cycle.
If IMEP is to be calculated from smoothed cylinder pressure curves, make sure
that the smoothing also covers the entire engine cycle.
8.1.9 Imep_CY
See Imep_CY on page 51.
8.1.10 InjectionRate
See InjectionRate on page 77.
8.1.11 InjectionTiming
Determining the leading and trailing edges and duration of injection pulses
Result Values
Begin Position of the nth leading edge
End Position of the nth trailing edge
Dur Pulse width in deg. CA
Durms Cycle duration in ms (conversion from degrees to
ms by means of speed)
Parameters
Start of Calculation
[deg. CA] (-40)
End of Calculation
[deg. CA] (40)
Calc. Resolution
[deg. CA] (0,1)
Foot Point Threshold The threshold for exact calculation of the edge’s
(5) foot points. A value has to be input in % or an abso-
lute value (in the same unit as the input signal)
depending on the Threshold Unit.
Edge Detection Threshold for rough detection of the edge positions.
Threshold (50) A value has to be input in % or an absolute
value (in the same unit as the input signal)
depending on the Threshold Unit.
Threshold Unit Sets the unit for the Foot Point
{%, Signal Unit} (%) and Edge Detection Threshold fields.
Pulse Orientation For positive pulses the leading edge is a rising
{+, -} (+) edge.
Pulse Number: For selecting one of several injection pulses.
{1,2,3,4,5,6,7,-} (1) If no pulse number is specified (-), the first and the
last edge within the calculation range are used.
Edge Detection If the edge detection is set to Off , there is no
{On, Off} (On) primary edge detection. The original signal is then
immediately cut at the defined threshold level. This
setting is used if general detection of threshold
crossings only is required.
Edge Smoothing This defines a smoothing of the order 1 to 20 (in
{Off, 1...20} (Off) steps of the calculation resolution) for edge detec-
tion. That effectively eliminates interference peaks
that exceed the edge detection threshold.
Smoothing is also important when the level is
defined in percent. 0% is assigned to the base line,
100% to the signal amplitude of the accordingly
smoothed signal; the system automatically takes
positive or negative amplitudes into account.
i.e. the first leading and the last trailing edge within the calculation range are
taken. That allows unwanted portions in the signal curve to be skipped.
Having detected the edges in this manner, the calculation proceeds up to the
actual threshold (now always using the unsmoothed original signal) and only this
abscissa is returned as the result. This method precludes any possible effects of
interference.
Should the direction of the edge change during this search process (from edge
detection threshold to the intersection with the foot point threshold) calculation is
terminated and the point of changing direction is taken as the result. One appli-
cation for this would be the separate analysis of pre- and post-injection, for
example, between which the signal does not return to the base line.
If, however, the basic edge detection is switched off, e.g. for general detection of
threshold crossings, this property is also suppressed. search process will then
proceed up to the threshold without allowing for any change in direction of the
signal. On the other hand, that allows signals with unclean edges to be cut.
Calculation with digital signals (UTC):
No inputs relating to edge detection and threshold values are necessary here.
8.1.12 Integral
Calculation of an integral curve or integral value.
Result Curves
IntCrv Integrated curve
Result Values
IntVal Integral value
Parameters
Start of Calculation [deg. CA] (-360)
End of Calculation [deg. CA] (360)
Calc. Resolution [deg. CA] (1)
Description The integral value represents the area between the specified curve section and
the x-axis (Y=0). The trapezoid rule is used.
The curve is calculated by continuously summing up small pieces of the area
that have the width of the specified calculation resolution. The pieces of area are
assigned to the right-hand curve point.
The curve always starts therefore with 0.
8.1.13 KIValue
This function calculates the Mahle KI value (Knock Index) from the knock peaks
of all available cycles.
Result Values
KI Mahle KI value
Description The RTP result curve, Knock Maximum, should be applied to the function input.
It contains the peak value of the overlaid knock oscillation for each measured
cycle. Mahle correlates the damage to the piston with the frequency of high
knock peaks. The amplitude range of up to 64 bar is divided accordingly into
categories for the knock peaks and each category is given a weighting which
increases as the knock amplitude increases. A weighting is assigned to each
cycle in this way, the sum of all the weightings is calculated and divided by the
number of cycles.
The categorization and weighting can be adapted to the specific requirements by
editing the macro function (see Creating Macro Functions on page 57).
8.1.14 MaximumRise
Determination of maximum pressure rise.
Result Values
Rmax Maximum rise
ARmax Position of maximum rise
Parameters
Start of Calculation
[deg. CA] (-60)
End of Calculation
[deg. CA] (60)
Calc. Resolution
[deg. CA] (1)
Interval Width
[± points] {0.5, 1, 2 ...20}
Unit You can define whether the output is in
{1/deg., 1/ms} (1/deg.) maximum pressure rise per degree or per
ms. In the latter case, the engine cycle speed
is used for the conversion from degrees to
ms.
Description The maximum rise is calculated by determining the differential quotient. The
interval width allows the width of the x-interval to be defined in relation to the
calculation resolution. Width 2, for example, would mean that the adjacent points
next but one to the left and next but one to the right would be used to determine
the differential quotient. The rise can therefore be determined cleanly even with
fine resolution.
Interval width 0.5 would mean that the rise is always calculated from two adja-
cent measuring points. The position (ARmax) would then be placed midway
between the two points.
Information
8.1.15 MaximumRise_CY
See MaximumRise_CY on page 51.
Parameters
Threshold [%] (2) Intersection threshold with integral heat
release
8.1.17 MeanValueFilter
Signal smoothing (low pass) and high pass using moving averages.
Result Curves
LP Low pass
HP High pass
Parameters
Start of Calculation
(deg. CA) (-360)
End of Calculation
(deg. CA) (360)
Calc. Resolution
(deg. CA) (1)
Order Determines the smoothing effect.
{1, 2, ... 20} (4)
Spike Filter Eliminates max. and min. values in smoothing window
{On, Off} (Off)
Description Signal smoothing is based on the moving average procedure. In other words,
each value is calculated from the linear mean value of the adjacent values to the
left and right. The number of adjacent values (per side) represents the order and
can be varied from 1 to 20.
i+n
1
y TM ( i ) = --------------- ⋅
1 + 2n ∑ y( i )
i–n
i Current abscissa
n Order (ORD)
The high pass is determined by subtraction from the original signal and the
low-pass filtered curve (moving average).
8.1.18 Misfires
This function defines the number of ignition faults within the acquired cycles from
the indicated mean effective pressure (IMEP).
Result Values
Count No. of cycles with misfire
Count% No. of cycles with misfire as a percentage of the
total no. of cycles
Parameters
Lower limit for IMEP (0.5) Value of the indicated mean effective pressure
(IMEP) below which the cycle is defined as a
misfire cycle.
Description The result value, Indicated Mean Effective Pressure (IMEP), should be
connected at the function input. Misfiring is assumed if it is below a certain value.
The number of such cycles is returned.
8.1.19 NoiseAnalysis
Calculation of combustion noise from the cylinder pressure.
Result Curve
Third Third octave
Result Values
Noise Total noise level in dB/dB A
Parameters
Filter Defines whether the power spectrum is to
{None, CAV, A, A+CAV} undergo further filtering after the third-octave
(A+CAV) band analysis. An A-filter curve, a CAV-filter
curve or a combination of both can be selected.
The A-curve represents filtering to the sensitivity
of the human ear (auditory curve).
The CAV-curve represents the translation of
combustion chamber pressure to airborne noise
pressure outside the engine.
Description A power spectrum is calculated from the cylinder pressure signal for the noise ana-
lysis. The reference level is 2 x 10-10 bar. The normal Fourier transformation is
followed by a conversion to a third-octave spectrum. The spectral lines then
define the mean signal level in dB within each third-octave band.
8.1.20 NoiseAnalysis_dyn
Calculation of combustion noise from the cylinder pressure by taking into
account the instantaneous speed and, thus, cyclic irregularities in the calcula-
tion.
Result Curve
Third Third octave
Result Values
Noise Total noise level in dB/dB A
Parameters
Filter Defines whether the power spectrum is to
{None, CAV, A, A+CAV} undergo further filtering after the third-octave
(A+CAV) band analysis. An A-filter curve, a CAV-filter
curve or a combination of both can be selected.
The A-curve represents filtering to the sensitivity
of the human ear (auditory curve).
The CAV-curve represents the translation of
combustion chamber pressure to airborne noise
pressure outside the engine.
Description A power spectrum is calculated from the cylinder pressure signal for the noise ana-
lysis. The reference level is 2 x 10-10 bar. The normal Fourier transformation is
followed by a conversion to a third-octave spectrum. The spectral lines then
define the mean signal level in dB within each third-octave band.
Being an extension to the NoiseAnalysis macro, dynamic noise analysis takes
into account the instantaneous speed within a cycle. As an important feature of
this function, it simultaneously measures the crank angle marks via a delta-t
channel in the mode Rotation. This delta-t channel is expected as second input
dataset in addition to the cylinder pressure curve.
If the rotational signal is superimposed by strong noise or measurement errors
(e.g. caused by contaminations on the marker disk), a mean value filter with acti-
vated spike filter should be inserted upstream of this input.
It is recommended to use a measurement resolution of 0.1° CA for the two input
channels Cylinder Pressure and Delta-t.
8.1.21 OrderAnalysis
Fourier transformation for determining the vibration order of the torsional anal-
ysis. The angle deviation signal from a rotary or torsional analysis is usually used
as the input signal.
Result Curves
FFT Fourier spectrum
Parameters
Base unit {Hz, order, crank shaft order} (order)
DC Portion {Off, On} (Off)
Description An FFT is used as the algorithm to calculate the spectrum. This algorithm needs
a number of samples equal to a power of two. There are 256 interpolated fixed
points which are evenly distributed over the whole signal curve. The algorithm
determines the harmonics of the signal. The base harmonics corresponds to the
total signal length. For an order analysis the signal supplied has to be available
for the entire engine cycle.
If the base unit is set to Hz, then the harmonics will be converted to frequency
using the average engine speed. If the base unit is set to Crank Shaft Orders,
the orders will be referenced to one revolution which is half an engine cycle for a
four-stroke engine. The spectrum will therefore also show values at 0.5, 1.5, etc.
The FFT always calculates the peak values of the harmonics.
8.1.22 PeakValue
Determination of the peak value of a curve and its position.
Result Values
Pmax Maximum (peak value)
APmax Position of the maximum
Parameters
Start of Calculation [deg. CA] (-60)
End of Calculation [deg. CA] (60)
Calc. Resolution [deg. CA] (0=Auto)
Description The peak value of the curve is determined within the defined section. If the
calculation interval is set to 0 (Auto) all the curve points within that range are
investigated.
8.1.23 PeakValue_CY
See PeakValue_CY on page 51.
8.1.24 PolytropicCoefficient
Result Values
POLY Polytropic coefficient of compression (negative X values) or
expansion (positive X values)
Parameters
Angle1 [deg. CA] (-110)
Angle2 [deg. CA] (-60)
Description The polytropic coefficient is calculated from the adiabatic equation using two set
points X1 and X2.
In ( p ( x1 ) ) – In ( p ( x2 ) )
χ = --------------------------------------------------
-
In ( V x2 ) – In ( V ( x1 ) )
Information
8.1.25 PolytropicCoeffCurve
Polytropic coefficient curve over the crank angle.
Result Curve
POLC Polytropic coefficient curve
Parameters
Start of Calculation [deg. CA] (-120)
End of Calculation [deg. CA] (120)
Calc. Resolution [deg. CA] (2)
Description The polytropic coefficient is calculated for every degree from the adiabatic equa-
tion. A pole occurs in the TDC.
Inp ( i – n ) – Inp ( i + n )
π i = --------------------------------------------------
-
InV ( i + n ) – InV ( i – n )
8.1.26 ResultFrequency
This function determines the number of cycles in which a predefined result value
lies inside or outside certain limits.
Result Values
Count No. of cycles
Count% No. of cycles as a percentage of the total no. of cycles
Parameters
Upper limit (0)
Lower limit (10) These parameters define the band that is checked.
Logic Defines whether the number of cycles inside or
{inside, outside} outside the band is returned.
(inside)
Description The result curve to be checked should be connected to the function input. If the
name only is specified, the system automatically accesses the result curve over
the cycle. The result specifies the number of cycles or the frequency with which
the result value lies inside or outside the defined band.
8.1.27 RotaryAnalysis
The rotary oscillation analysis can be used for signal curves which are inversely
proportional to the instantaneous speed and which have the unit µs/deg.
These are Delta-T inputs on the indicating device.
When using the AVL 3069 Crank Angle Calculator with the Speed Output on
DAC function, the incoming engine speed signal is calculated continuously. It
has to be converted to µs/deg. before the rotary analysis is run.
Result Curves
Avel Angular velocity
Aacc Angular acceleration
ADev Angle deviation
ISpd Instantaneous speed
Parameters
Interval Width As with normal differentiation, here too an interval
[+/- points] {1 ... 20} (1) width can be input (1 ... 20). This number again spec-
ifies how many points (in calc. resolution) to the left
and the right of the current point are to be used to
form the differential quotient. That also causes a
certain smoothing effect which becomes more inten-
sive as the number of points increases.
Start of Calculation
[deg. CA] (-360)
End of Calculation
[deg. CA] (360)
Calc. Resolution Normally the full engine cycle (720 degrees) should
[deg. CA] (1) be used as the calculation range. The recommended
calculation resolution is 1 degree.
v = dphi
-----------
dt
Angular acceleration:
a = dv
------
dt
Angle deviation
ph = phi – vm ⋅ t
[deg. CA]
The angle deviation is the difference between the actual crank angle at a specific
point in time and the ideal value determined from time and mean angle speed.
This produces the oscillations in deg. CA superimposed upon the uniform rota-
tion of the engine at the position of the crank shaft where the angle marker is
mounted.
Very often, the angle deviation is used as the output signal for an order analysis
(see Order Analysis above). That produces the individual oscillation amplitudes
via the oscillation order.
If two crank angle markers are available (e.g. an optical encoder mounted to the
free shaft end and an inductive pick-up at the starter gear of the flywheel –
external digital conditioning) the angle deviation can be calculated for both ends
and the torsion between the two points of inspection can be determined by
subtracting the two curves. Unlike with the real torsional vibration analysis, this
simplified method can only determine the AC portion of the torsion but not the
DC portion.
8.1.28 Section
Cuts out part of a curve at the predefined resolution
Result Curves
Sct Cut-out part of curve
Parameters
X0 Start abscissa
[deg. CA] (-180)
X1 End abscissa
[deg. CA] (180)
dX Desired resolution
[deg. CA] (1)
Description The function is used to cut out a part of a specific curve. The desired result reso-
lution is also specified at the same time. To this end, the input curve values are
either subsampled or interpolated accordingly. The result curve therefore always
has a constant resolution irrespective of the input curve.
8.1.29 SingleValues
Determining a curve value at a given position.
Result Values
Y Val Curve value
Parameters
X Val (-120) Abscissa value (X) to be defined.
8.1.30 TDC_Adjustment
Retrospective cylinder-specific TDC correction.
Result Curves
PCylc TDC-adjusted curve
Parameters
OffsetCyl1 Cylinder-specific TDC adjustment for up to 12
[deg. CA].... OffsetCyl12 cylinders (positive value = shift to the right).
[deg. CA]
Description The function is used to adjust TDC retrospectively. It can be applied to all crank
angle-based signal curves. The magnitude of the TDC adjustment must be spec-
ified as a parameter. The appropriate fields are provided for up to 12 cylinders.
This means that you can make different adjustments without a separate function
block having to be used for each cylinder. Instead you can simply work with the
cylinder number wildcard "*" (see also Multicylinder Evaluations on page 17).
When this function is executed, the cylinder number is extracted from each input
signal and the corresponding offset value used for the adjustment.
Result Values
MBF5% Crank angle value for 5% mass burned fraction
MBF10% Crank angle value for 10% mass burned fraction
MBF50% Crank angle value for 50% mass burned fraction
MBF90% Crank angle value for 90% mass burned fraction
SOC Start of combustion (only with Thermodynamics1)
BEND End of combustion (only with Thermodynamics1_A)
Parameters
Start of Calculation
[deg. CA] (-30)
End of Calculation
[deg. CA] (+70)
Calc. Resolution Using finer resolutions may lead to noisy result
[deg. CA] (1) signals.
Polytropic Coeffi- If set to 0 (Auto Determination) a value of 1.32 is used
cient for standard gasoline, 1.35 for DI gasoline and 1.37
(0 = Auto) for diesel engines.
(only with
Thermodynamics1)
Unit Defines whether the heat release is to be standard-
{kJ/m3, %} (kJ/m3) ized to the volume or the maximum cumulated heat
release.
Smoothing There are two smoothing possibilities that can be
{Off, On, SpikeFilter}} applied to the cylinder pressure signal prior to the
(Off) calculation. Both use a moving smoothing window of
±2 deg. but the second one suppresses the maximum
and minimum values within the moving window. The
resultant smoothing effect is somewhat less but spikes
are filtered out.
Poly.Coeff. The polytropic coefficient is assumed to be constant.
Compression However you can enter different values for the
(0=Default; 1=Auto) compression phase (before TDC) and the expansion
Poly.Coeff. Expan- phase and thereby recreate the actual fact that the
sion (0=Default; burned gas is characterized by a lower polytropic
coefficient than the fresh gas. This can prevent the
1=Auto)
integral heat release curve from having the tendency
(only with to rise slightly after the obvious end of combustion,
Thermodynamics1_A) depending on the cycle, which may lead to an inaccu-
rate determination, specifically of the 90% mass frac-
tion burned.
If you enter the value 0, the system will use the default
values shown in the table below.
If you enter the value 1 for the polytropic coefficients,
these are automatically generated for each cycle from
the pressure curve. This makes it even easier for the
cycle-based variations to be corrected, so that the
maximum quality of the 90% mass fraction burned is
achieved.
Tab. 1
End of burn when dQ With this option you can separately determine an 'end
curve (smoothed) of combustion' from the first zero-crossing of the differ-
becomes 0 ential (smoothed) heat release curve after its
maximum. This angle is also used as the 100% point
On(no smoothing)
On(+/-1 deg) for calculating the mass fraction burned.
On(+/-2 deg)
On(+/-3 deg)
On(+/-4 deg)
Description A simplified process is used to calculate the heat release which computes the
energy effectively delivered to the gas from the cylinder pressure. Surface losses
(approx. 20%) are neglected, the displayed heat release is therefore accordingly
lower than the actual energy released. The calculation is based on the first law of
thermodynamics.
C
Q i = ------------ [ κ ⋅ p i ⋅ ( V i + n – V i – n ) + V i ⋅ ( p i + n – p i – n ) ]
κ–1
n Interval (1 degree)
κ Polytropic coefficient
p Cylinder pressure
V Volume
C Constant (=100 due to conversion to SI units)
The polytropic coefficient necessary for the computation represents the relation-
ship between the specific temperature at constant pressure and constant
volume.
⎛ κ = cp
------⎞
⎝ cv⎠
The algorithm automatically detects the pressure unit which may be bar, psi, kPa
or MPa.
Due to vaporization effects the heat release curve will typically adopt negative
values before combustion for direct injection gasoline and diesel engines. The
start of combustion (SOC) is taken as the angle value dQ becomes positive
again. The algorithm calculates backwards from the heat release peak down to
the zero level. For indirect injection gasoline engine the MBF 5% value is used
as start of combustion.
Result Values
MBF5% Crank angle value for 5% mass burned fraction
MBF10 Crank angle value for 10% mass burned fraction
%
MBF50 Crank angle value for 50% mass burned fraction
%
MBF90 Crank angle value for 90% mass burned fraction
%
SOC Start of combustion
AGX Center of gravity of differential heat release.
The center of gravity of the area lies between MBF5% and MBF90%
for gasoline and SOCDI and MBF90% for diesel engines. This is a
historic value.
We recommend using the MBF50% for engine mapping which
should be at approx. 8 deg. after TDC.
Parameters
Start of Calculation
[deg. CA] (-30)
End of Calculation
[ deg. CA] (+90)
Calc. Resolution Using finer resolutions may lead to noisy result
[deg. CA] (1) signals.
Intake Manifold Pres- If set to 0 (Auto), the mean value of the cylinder
sure pressure signal in the range from 180° to 170°
(0 = Auto) before TDC is used as the intake manifold pressure.
If no data is available here, an intake manifold pres-
sure is extrapolated from the compression curve.
Intake Manifold
Temperature
(25 °C)
Volumetric Efficiency The volumetric efficiency is the ratio of the air mass
(0.9) remaining in the cylinder to the theoretical air mass
of swept volume multiplied by gas density.
The system assumes a default value of 0.9. The
volumetric efficiency value is also about 0.9 at partial
load because the reduced air mass/intake manifold
pressure has already been allowed for.
Unit This defines whether the heat release is to be stan-
[kJ/m3], [kJ/kg], [%], [J] dardized to the gas mass, to the volume or to the
(kJ/m3) maximum cumulated heat release.
Smoothing There are two smoothing possibilities that can be
(Off, On, SpikeFilter) applied to the cylinder pressure signal prior to the
(Off) calculation. Both use a moving smoothing window of
±2 deg. but the second one suppresses the
maximum and minimum values within the moving
window. The resultant smoothing effect is somewhat
less but spikes are filtered out.
End of burn when dQ With this option you can separately determine an
curve (smoothed) 'end of combustion' from the first zero-crossing of
becomes 0 the differential (smoothed) heat release curve after
On(no smoothing) its maximum. This angle is also used as the 100%
On(+/-1 deg) point for calculating the mass fraction burned.
On(+/-2 deg)
On(+/-3 deg)
On(+/-4 deg)
(only with
Thermodynamics2_A)
ps
m = l ⋅ m th = l ⋅ V H ⋅ ρ = l ⋅ V H ⋅ --------------
R ⋅ Ts
K Vi – n κi
Q i = ------------- V i + n p i + n – p i – n ⎛ -------------⎞ ( X i + 1 )
κi – 1 ⎝ V i + n⎠
Q0=0, X0=0
κi Polytropic coefficient
n Interval (1 degree)
C Constant
p Pressure
V Volume
–3
Cv i = 0, 7 + T i ⋅ ( 0, 155 + A i ) ⋅ 10
0, 2888
κ i = ------------------ + 1
Cv i
i–1
∑ Qn ⋅ 28
n=0
x i = -----------------------------
Ps
pi ⋅ Vi
T i = --------------
m⋅R
The basis equation () corresponds to pure dry air; the coefficient was empirically
determined and takes into account the modified mixture properties because
exhaust gas or fuel was added. For gasoline engines, coefficient A takes into
account the interal EGR rate; for diesel engines, the coefficient A takes into
account the added fuel and thus the modified air/fuel ratio during combustion. In
both cases, the value A is determined empirically.
Due to vaporization effects the heat release curve will typically adopt negative
values before combustion for direct injection gasoline and diesel engines. The
start of combustion (SOC) is taken as the angle value dQ becomes positive
again. The algorithm calculates backwards from the heat release peak down to
the zero level. For indirect injection gasoline engine the MBF 5% value is used
as start of combustion.
8.1.33 Thermodynamics2OP
This macro is the same as the "Thermodynamics2" macro but with the following
differences:
The quantities IntakeManifoldPressure (PMAN), IntakeManifoldTempera-
ture (TMAN) and VolumetricEfficiency (VOLEFF) are not macro parameters
but inputs. That makes it easy to connect Operating Parameters stored in
the data file to the inputs. No parameters then need to be changed when dif-
ferent files are evaluated in succession and you do not want to have the
values estimated automatically.
The macro itself contains selection fields for defining the units of IntakeMan-
ifoldPressure and IntakeManifoldTemperature. If they are set to auto, the
unit is taken from the channel connected to the input. If there is no unit
there, bar and deg. Centigrade are used.
The macro also has another parameter that Thermodynamics2 does not
have, namely 'stop calculation at end of combustion'. If it is activated, the
first zero-crossing of the smoothed, differential heat release curve after TDC
is used as the 'end of combustion' and the calculation is halted there.
8.1.34 Thermodynamics2Mass
This macro is the same as the "Thermodynamics2" macro but with the following
differences:
Instead of the intake manifold pressure, the intake manifold temperature and the
volumetric efficiency, the resulting gas mass (which corresponds to the air mass
because in this simplified calculation the fuel is ignored) can be used as an input
quantity. The unit is gram.
The mass could be taken, for example, from an operating parameter saved in
the data file.
The macro also has another parameter that Thermodynamics2 does not have,
namely 'Stop calculation at end of combustion'. If it is activated, the first
zero-crossing of the smoothed, differential heat release curve after TDC is used
as the 'end of combustion' and the calculation is halted there.
NOTICE
8.2.1.1 Imep_CY
Calculation of the IMEP and the high pressure/low pressure part.
For parameters and algorithm, see IMEP on page 35.
8.2.1.2 PeakValue_CY
Calculation of maximum, position of maximum, minimum and position of
minimum of a crank angle-based curve.
For parameters and algorithm, see PeakValue on page 41.
8.2.1.3 MaximumRise_CY
Calculation of the maximum rise per degree and per ms, and its position. The
mean speed is used to calculate the rise in ms.
For parameters and algorithm, see MaximumRise on page 38.
8.2.1.4 Thermo2ResultsOP_CY
Calculation of 5%, 10%, 50 and 90% mass fraction burned levels, of start of
combustion, end of combustion, center of gravity, maximum as well as position
of maximum of differential and integral heat release.
For parameters and algorithm, see Thermodynamics2OP on page 50.
8.3.1 TM_Compare
This function compares an input quantity with a threshold and creates a Boolean
output quantity which switches to 1 if the condition is met, otherwise it stays at 0.
Parameters
Threshold Comparison threshold
8.3.2 TM_CutRange
This function cuts out a range from a signal with no change being made to the
signal resolution (no interpolation/subsampling).
Parameters
T0 Start of range
T1 End of range
8.3.3 TM_CutSpeedRamp
This function cuts out a range from a signal while a speed ramp was run (rising
or falling).
Its use is recommended in connection with TM_MovingWindowFFT to cut out
the particular range of a transient signal in which speed changes in the shape of
a ramp. Depending on the measurement, the time spent on calculation can be
significantly shortened if ranges of no interest are cut off.
Inputs Signal and speed as time-based curves.
Parameters
Start speed [1/min] Start speed of ramp
End speed [1/min] End speed of ramp
Ramp type Up Defines whether it is a rising or falling ramp.
Ramp type Down In the case of a falling ramp, Start speed must
have a greater speed value.
8.3.4 TM_DigitalFilter
This function carries out high- and low-pass filtering, depending on which output
is used.
Parameters
Cut Off Frequency Cut-off frequency of filter in hertz
8.3.5 TM_ExtractBit
This function extracts a bit from a status word. The result dataset is thus a curve
over time which consists of the values 0 and 1 only.
Typical application: Extraction of a single status bit from a status channel (e.g.
from INCA files).
Parameters
Bit number Defines the bit number.
The bottommost bit is given the designation 0.
8.3.6 TM_Logic
This function performs a Boolean operation with two Boolean input quantities.
At the outputs, both an AND and an OR operation are available.
Different sampling rates are automatically considered.
Typical application: Boolean operation applied to two bit curves which were
created via the function TM_Compare or TM_ExtractBit.
8.3.7 TM_MovingWindowFFT
This function performs a spectral analysis of a signal curve over time. Moving
signal ranges, which may overlap each other, are taken from the signal and
subjected to a Fast Fourier Transformation (FFT). The resulting spectra are
collected in a dataset array which is returned as result.
Signal The signal to be analyzed.
Inputs Speed: optional input.
If a speed signal is applied here, the mean speed for each partial spectrum is
stored in the result dataset array too, so that it can be used to draw a Campbell
diagram over frequency and speed.
Parameters
Number of points for FFT Calculation window for the FFT calculation in
(1024, 2048, 4096, 8192, points.
16384)
Calculation resolution Calculation step width
(0= finest) The input signal is interpolated to this interval.
Window overlapping Overlapping factor for moving windows (0%
factor [%] means no overlapping, 50% means overlapping
by half the window width.
Output type Return type (Peak-Peak, RMS)
(Peak-Peak, RMS) The amplitude correction factor of 2 needed for
the used Hanning window is taken into account.
Output in dB (No, Yes) To determine whether or not the return values are
to be converted into dB.
dB reference value Reference value for conversion into dB.
8.3.8 TM_Resample
This function carries out an interpolation/subsampling of the input quantity with a
definable resolution.
Parameters
New Interval Desired new time-based signal resolution.
The time unit is changed. For this reason, always
enter the interval in this unit.
8.3.9 TM_Section
This function cuts out a section of a signal while, at the same time, carrying out
an interpolation/subsampling of the input quantity using a definable resolution.
Parameters
T0 Start of range
T1 End of range
dT Desired new resolution (if 0 is entered, the finest
resolution possible is used).
8.3.10 TM_SplitToCycles
This function extracts those time ranges from one or more time-based curves
which are marked by a control input (bit channel, e.g. from the function
TM_ExtractBit) applied to the control input CrtlBit and converts these sections
into cycles. As a result, the output data contain sections of the input data in cyclic
form.
If such data are displayed in a diagram, a cycle bar is shown. The diagram
shows the respective cycle (= section of data) only.
Please note that the time axes are not changed.
So to ensure that a section is always on display, activate AutoRange (check box
in the x-axis' Properties dialog).
Parameters
Control Bit Prehistory The cycles are defined by the control bit with one
Control Bit Posthistory cycle representing a connected time range in
which the control bit has the value 1. You can use
the two parameters to extend these time ranges
by one pre- and one posthistory.
But if a range that was extended this way
reached beyond the next control bit or below the
previous control bit, the range would be limited,
i.e. the cycles would never have overlapping time
ranges.
Optional Inputs You can convert up to 4 signal curves into cycles. Each output corresponds to
one signal input. Only the first signal, however, needs to be actually assigned,
the others are optional. No output may be defined for unused inputs.
Characteristic You can append further calculations that deliver characteristic values (e.g.
Values maximum, mean value, integral value, etc.) to the cyclic outputs. These charac-
teristic values are then also only calculated from the shown set cycle.
8.3.11 TM_XYClassification
This function performs a classification in two dimensions (x and y) and returns
the duration per class.
If no time-based data are transferred, only the points are counted.
Typical application: How long were you at which operation points (identified by
speed and torque) during a test drive?
Inputs x, y time-based curves. These are divided into classes.
Parameters
First X class value Defines the class midpoint of the first class.
First Y class value
Last X Class value Defines the class midpoint of the last class. If you
(0=Auto) leave this value as 0, the last class is automati-
Last Y Class value cally calculated from the existing data.
(0=Auto)
Width of X classes Defines the width of class.
Width of Y classes A class thus extends from the class midpoint -
half the class width to the class midpoint + half
the class width.
8.3.12 TM_XYZClassification
This function performs a classification in two dimensions (x and y) and returns
the mean value or the integral of a third dataset (z) for each class.
Typical application: Determine how much fuel was consumed in which operating
mode with the operating mode being defined by speed and torque classes.
Inputs x, y, z time-based curves. x, y determine the classes, the result is determined
from z.
Parameters
First X class value Defines the class midpoint of the first class.
First Y class value
Last X Class value Defines the class midpoint of the last class.
(0=Auto) If you leave this value as 0, the last class is auto-
Last Y Class value matically calculated from the existing data.
(0=Auto)
Width of X classes Defines the width of class.
Width of Y classes A class thus extends from the class midpoint -
half the class width to the class midpoint + half
the class width.
Tab. 2
The output type Cyclic Result Value applies to standard result definitions which
are calculated from cyclic signals (like peak pressure from cylinder pressure).
This generates formulas into the VAL folder which are also cyclic. That means, if
this value is displayed in a table, it is always updated to current cycle. In addition
a formula is generated which calculates a cycle based curve. This is just a
formula which calculates the result value for every cycle in a loop thus gener-
ating a result curve over the cycle number (rather like RTP data). This formula is
stored under the CYF folder. Finally statistic formulas are also generated and
stored in folder STA. They use the cyclic curve from the CYF folder, and
generate formulas for the minimum, maximum, average, coefficient of variation
and standard deviation. For this purpose, the output names get some statistics
suffixes, which are also defined in the calcgraf.ini file:
Minimum = mn
Maximum = mx
Average = av
COV = cv
Std = st
The Cyclic Result Value Curve is a special case of the Cyclic Result Value
type which may be used only when all inputs are cyclic result values. Perfor-
mance-optimized formulas can then be generated.
The Cycle Based Curve type should be used when you want to evaluate
cycle-based curves, such as RTP data, and obtain new cycle-based curves as
the result.
The Non Cyclic Result Value type is for results that are not cyclic, such as the
mean value of a cyclic curve.
In multicylinder evaluations, an engine average formula is also created where
the cylinder number is replaced by 0. This formula automatically produces an
average all the cylinders.
Tab. 3
This behavior can however be changed. If you prefer to see crank angle based
formulas only under CAF, for example, and not mixed with the acquired data just
remove the CA entry in the formula page in the IFile file group properties dialog.
Example
You calculate the result value SMAX from a pressure curve. This is a cyclic result
value. An SMAX formula is therefore generated under VAL which determines the
result value for the current cycle. In addition a formula with the same name is
generated in folder CY or CYF which calculates the SMAX for all cycles. If you
now wish to determine a further characteristic value from this cyclic curve (e.g. a
square mean value), you need to define an input for the square mean value in
front of the function block and label it specifically as CY'SMAX.
In addition to manual labeling, you can also drag SMAX from the CY block to the
input while holding down the Ctrl key.
9.2.1 Principle
CalcGraf macros are normal CONCERTO macros with an argument line and a
return quantity. They are stored in the IndiMacro folder (or in the folder defined
under the entry MacroPath in the calcgraf.ini file). After adding a new macro, just
select Refresh Macro List from the context menu in CalcGraf and the list will be
refreshed.
The graphical appearance of the macros in the model is derived from the
contents of the macro. Their size depends on the number of input/outputs. A
parameter dialog is also generated. Input quantities and parameters are written
into the formula and passed to the macro as arguments of the call. Although a
macro can contain several outputs, only one result or curve is activated, i.e.
returned, for each macro call. The necessary algorithm is passed to the macro
as an argument of the macro call.
The head of the macro consists of comment lines, which are not relevant for the
execution, but are used by CalcGraf to generate the automatic properties dialog.
Due care should therefore be taken when creating your own library functions. A
corresponding assignment must be made after each keyword.
9.2.2 Example
Example
This is a macro which calculates the maximum and position of the maximum of a
curve. A filter can be defined to eliminate high frequency spikes as an option.
//_comment = Peak Values and Position of Maximum with filtering (if any)
//_comp = Alg. | Peak Value (C), Position of Peak Value (C)
//_defnames = Pmax, APmax
//_src1 = Signal|P_CYL
//_from = Calculation Start [deg CA]
//_to = Calculation End [deg CA]
//_int = Calculation Resolution [deg CA]
//_cnt = Smoothing (Order) |OFF,1,2,3,4,5,6,7,9,10
a=range(_src1,_from,_to,_int)
if _cnt >0 then
Fig. 4
Must be there as the first line. Defines the info in the properties dialog.
//_comp = any name | output description1 (type), output description 2 (type), ...
Defines all outputs of the macro. Usually there is a related algorithm associated
with each output. The description, at present, has no special use, but make sure
to set the output types (within brackets) correctly to allow CalcGraf to determine
where to store the created formulas. If an output terminal is connected straight to
the output, it automatically receives the type of the macro output (if not set differ-
ently). This in turn defines the category under which the generated formula is
displayed.
Types
A Crank angle based curve
T Time based curve
C Cyclic result value
V Non-cyclic result value
M Other base type ("Any Base")
Y Pure cycle based curve
B Cyclic result value curve
Has to be defined for each input. The short input name is shown in the graphic
as the name of the input and is also used as the default name when input termi-
nals are connected automatically.
If there are several inputs, an appropriate _srcn line (n= input number) has to be
defined for each input.
//_defnames = names
A default name has to be assigned for each output. This is shown in the graphic
as the name of the output and these names are used as default names for the
outputs.
//_varname = parameter name [unit]
Defines a variable for the properties dialog which creates an input field. The
Parameter name acts as the identification text of the line in the properties dialog.
The unit [ ] can also be set here. The name (_varname) is used in the arg line of
the macro.
//_varname = Parameter name | Text11, Text2, ...
Defines a variable for the properties dialog, which allows a selection dialog. The
Parameter name acts as the identification text of the line in the properties dialog.
The possible selections listed after the separator "|" are entered as text1, text2..
separated by commas. In the variable you then receive the position of the text in
the definition, starting with 0.
The name (_varname) is used in the arg line of the macro.
Fig. 5
2. Define the macro name and select a storage location from the drop-down
list. You may also enter a comment and choose between three presentation
widths.
3. Click Next.
The second page of the wizard opens:
Fig. 6
Fig. 7
6. Define the macro's output channels and, via a drop-down list, select their
base type (see Output Types on page 58).
The preset Name and Description can be changed after clicking into the
line.
You may also specify a unit, if required.
If you activate the Return outputs as array check box, the macro returns
all outputs as a dataset array (see Library Functions on page 29).
With the Insert Output button you can add an output, with Delete last
Output you can remove the new output again.
7. Click Next.
The fourth page of the wizard opens:
Fig. 8
Fig. 9
Fig. 10
A dialog opens.
Fig. 11
3. Define the name of the grouping macro (macro names must not contain
blanks) and select a storage location from the drop-down list. You may also
enter a comment.
4. Click OK.
Another window opens.
5. Select Paste from the window's context menu:
Fig. 12
The model is inserted from the clipboard. As an alternative, you may also
start by creating an empty grouping model and build a calculation structure
out of function blocks in the usual way.
Information
Fig. 13
Fig. 14
The macro may now also be used in the usual manner in other models.
Fig. 15
3. Click OK.
After compilation, the parameter dialog for the resulting macro is shown as
defined above:
Fig. 16
10 SoftRTP Calculations
With AVL IndiCom indicating system software and in connection with GigaBit
indicating systems and streaming measurements (raw data are transferred to the
PC in real time), CalcGraf also enables you to define so-called SoftRTP calcula-
tions. Cyclic characteristic values are calculated during acquisition from indi-
cating measurement channels which appear in the measured data as real RTP
channels and are automatically saved with these too.
10.3 Using Existing SoftRTP Models in AVL CONCERTO and AVL IndiCom
Offline
SoftRTP models contained in parameter files can be loaded either in
CONCERTO or in IndiCom Offline. When compiling, normal formulas are
created.
Due to the different processing sequence, however, models containing moving
averages cannot be calculated correctly.
This also applies for IndiCom if you evaluate loaded files.
10.4.1 R_Compare
R_Compare compares two input quantities and creates a Boolean output quan-
tity (consists of 0 or 1 only).
Typical application: Comparison of a result value with a constant or another
result value.
Parameters
Operation Defines the relational operation A>B, A<B, A=B.
10.4.2 R_Derivation
R_Derivation calculates the first derivative of a crank angle-based signal.
Parameters
Interval width [+/- points] Defines the interval width for the derivative in
points.
10.4.3 R_EventCount
R_EventCount counts continuously all cycles that have a value of 1 (Boolean
quantity).
This is a recursive method. At the first input (Event), a Boolean quantity must be
applied (typically the output of an R_Compare macro). If this is 1, an event has
occurred in the current engine cycle and requires to be counted.
The resulting counter output has to be fed back to the second input. However, no
direct wiring is allowed, a separate input terminal using the output name has to
be used.
If you wish to perform a continuous count of the events in the current continuous
measurement buffer, use the function R_Sum (see R_Sum on page 76).
10.4.4 R_ExtractRange
R_ExtractRange extracts a section from a curve without an interpolation being
performed. So the provided grid points remain unaffected.
Typical application: Extraction of a range from an FFT spectrum to locate the
local maximums in a certain part only.
Parameters
From [deg] Start of range
To [deg] End of range
10.4.5 R_FFT
R_FFT carries out a fast Fourier transformation of the applied crank angle-based
signal.
Parameters
Number of points for FFT Defines the number of points that are interpolated
(256,512,1024,2048,4096, into the signal (power of two).
8192,16384) The higher the number of points, the finer the
frequency resolution, however the calculation
time increases accordingly.
Hanning Window Defines whether the input signal is multiplied by a
(no,yes) Hanning function before the FFT analysis.
This is only recommended if curve sections are
used in which the values at the boundaries
clearly differ.
10.4.6 R_Filter_BP
R_Filter_BP performs bandpass filtering of the input signal.
Parameters
Lower Cutoff Frequency Lower cut-off frequency of the bandpass filter
[Hz]
Upper Cutoff Frequency Upper cut-off frequency of the bandpass filter
[Hz]
10.4.7 R_Filter_HP
R_Filter_HP performs high-pass filtering of the input signal.
Parameters
Cutoff Frequency [Hz] Cut-off frequency of the high-pass filter
10.4.8 R_Filter_LP
R_Filter_LP performs low-pass filtering of the input signal.
Parameters
Cutoff Frequency [Hz] Cut-off frequency of the low-pass filter
10.4.9 R_Filter_MV
R_Filter_MV performs filtering of the input signal by using a mean value filter. In
this case, no cut-off frequency can be defined, instead each point is merely
replaced by the mean value of the points preceding and succeeding it. Conse-
quently, it is a smoothing with a definable order.
Parameters
Type (LowPass,High- In the case of a high pass, a low pass is calcu-
Pass) lated first which is deducted from the input curve.
Order [+/- samples] ( 1, 2, Number of points to be used for averaging to the
3, 4, 5, 6, 7, 8, 9, 10, 11, left and to the right of the current point.
12, 13, 14, 15, 16, 17, 18,
19, 20)
10.4.10 R_IntegralValue
R_IntegralValue calculates the integral of the input curve and returns the integral
value.
Information
10.4.11 R_LastValue
R_LastValue returns the last valid value of a result curve (CY).
The input must always be connected with an input terminal of its own.
If a real RTP result is supplied, R_LastValue delivers the value of the current
cycle (because RTP is calculated before SoftRTP). If a SoftRTP result is applied
to the input, a value from the previous cycle is obtained.
10.4.12 R_Limiter
R_Limiter limits the input curve to an upper and a lower limit (any values outside
of these limits are replaced by the limit values).
Parameters
Lower Limit Lower limit value
Upper Limit Upper limit value
10.4.13 R_LocalMax
R_LocalMax finds the nth local maximum of a curve.
Typical application: Determine the amplitudes of the main frequency compo-
nents of an FFT analysis.
Parameters
Detection threshold This value indicates how much a maximum must
(max-min) differ from a previous minimum to be able to be
recognized as such. Always make this value
higher than the noise component. In doing so,
you prevent signal noise peaks from being
detected as local maximums.
n (n-th Maximum) Number of the maximum to be detected
10.4.14 R_LocalMaxLocation
R_LocalMaxLocation finds the nth local maximum of a curve and returns its posi-
tion.
Typical application: Determine the determining frequency components of an FFT
analysis.
Parameters
Detection threshold This value indicates how much a maximum must
(max-min) differ from a previous minimum to be able to be
recognized as such. Always make this value
higher than the noise component. In doing so,
you prevent signal noise peaks from being
detected as local maximums.
n (n-th Maximum) Number of the maximum to be detected
10.4.15 R_Logic
R_Logic performs a Boolean operation with two Boolean input quantities.
Typical application: Link two events that are detected by the R_Compare func-
tion.
Parameters
Operation AND, OR
10.4.16 R_MaxMin
R_MaxMin calculates maximum or minimum of a curve.
Parameters
Type Upper limit value
(Maximum,Minimum)
10.4.17 R_MeanValue
R_MeanValue calculates the mean value of a curve.
As an alternative, the base function Average Value can be used, however
please note that in this case the output type has to be set to Cyclic Result Value
manually.
10.4.18 R_MovingAvg
R_MovingAvg continuously calculates a moving average from the last n points of
a result curve (see Calculations with Moving Means and Other Recursive Algo-
rithms on page 71).
Parameters
Window Width (points) Number of points from which the mean value is
calculated. If there are fewer points, the window
is automatically reduced.
Initial Value (for Soft RTP In the case of moving averages of SoftRTP
data only) results, no usable value is yet available at the
time of the first cycle. The initial value entered
here is returned.
10.4.19 R_Section
R_Section extracts a section from a crank angle-based curve with it being
possible to change the resolution.
Parameters
From [deg] Start of range
To [deg] End of range
Interval (0 = finest) Desired new resolution.
If 0 is entered, the finest available resolution is
used to perform interpolation.
10.4.20 R_Section_dyn
R_Section_dyn extracts a section from a crank angle-based curve with the limits
being supplied as inputs which enables them to be derived from other character-
istic values.
If a limit should remain constant, simply apply a constant terminal to the limit
input. It is also possible to make a change to resolution.
Parameters
Interval (0 = finest) Desired new resolution.
If 0 is entered, the finest available resolution is
used to perform interpolation.
10.4.21 R_Sum
R_Sum adds up all values of the input quantity.
Application example: Summation of characteristic values or events during the
measurement window.
This function must not be confused with the R_EventCount.
If R_Sum is applied to a characteristic event value, you will continuously obtain
the current number of events in the continuos measurement buffer.
If_EventCount is used, the events are counted from measurement start onward,
irrespective of the number of cycles defined for the continuous measurement.
10.4.22 R_Switch
R_Switch is used to implement a multiplex function.
Depending on the third input (control) either the first input (at 0) or the second
input (at 1) is directly connected to the output.
10.4.23 R_Xshift
Shifts a crank angle-based curve in x direction.
Parameters
Shift by Shift offset
10.4.24 R_XValueAt
R_XValueAt determines the x value for a given y value.
In this respect, the y value is supplied as a separate input so that it could also be
dynamically derived from a different characteristic value. To this end, the input
signal must be cut by the y value. This may result in several intersection points.
Parameters
Slope(Rising,Falling) Defines whether the rising or falling intersection
points are to be used.
Number of crossing from Defines which of the resulting intersection points
left( 0=all) is to be used
10.4.25 R_YValueAt
R_YValueAt determines the y value of a curve at a given position (x value). In
this respect, the x value is supplied as a separate input so that it could also be
dynamically derived from a different characteristic value.
11 InjectionRate
Information
Option "J" is required to open this program! The current installation can be
checked under Help | Info Options.
The system expects the pressure at the pump end and the needle end as input
quantities.
Fig. 17
In the second stage, the calculated fuel speed at the nozzle holder end of the
injection line vLD can be used for the calculation of the fuel pressure at the entry
into the nozzle chamber pLD, again using the Allievi equations.
pDE is required before the nozzle needle lift y(t) can be calculated.
The nozzle needle and the nozzle needle spring are modeled as a mechanical
spring/mass/damper system with a degree of freedom. This equation of motion
is a non-linear, ordinary differential equation for the spatial variable of the needle
lift y(t), which contains pDE as a time-dependent boundary condition. The differ-
ential equation is solved by an extended Runge-Kutta method.
The nozzle needle lift determines the start and end of injection as well as the
open nozzle hole area. The fuel injection rate is calculated from this information.
The two line pressure measurements pLD and pLP are always required (nozzle
holder end and pump end; specifications in bar!) which are conveniently avail-
able as an I-file. A number of additional parameters also have to be specified if
use the functions are applied as listed above.
The nozzle needle lift is calculated by using a numerical solver algorithm. The
computation time may be anything from a few seconds to several minutes
depending on the processor.
The start of injection for a single-spring nozzle holder is determined approxi-
mately by means of the SI function. The first relative maximum of this function
curve shows you the angle for start of injection.
Fig. 18
11.1.2 Parameterization
Parameterization is performed by the InjectionRate macro in CalcGraf.
Generally speaking, a calculation range of about -20 .... +50 deg CA and a calcu-
lation resolution of 0.1 deg CA are recommended.
Fig. 19
Fig. 20
Information
If a resolution greater than 0.5 deg CA is specified, the program will not be able
to produce a meaningful calculation of the injection rate and nozzle needle lift
because of the minimum iteration interval that has to be observed!
We recommend using one of the sample files and adjusting the parameters
where required.
Using an editor you can open and work with the ASCII files.
Fig. 21
Fig. 22
VARIANT 2 If the number 1 (for sac nozzle) or 2 (for seat hole nozzle) appears to the right of
DUESE=, the following geometrical data is transferred to the program.
2
DFL = MYWERT ⋅ CROSSECTION ⋅ ⋅ ΔP
RHO
Fig. 23
Fig. 24
Fig. 25
Fig. 26
Index
Symbols cyclic data, link … 18
# cylinder
in CalcGraf … 29 acquire several cylinders … 17
cylinder number … 17
A cylinder pressure evaluation … 51
absolute value … 25
accelerated macros … 51
D
accelerated result function … 51 data
Allievi equations … 77 cyclic, linking … 18
angle deviation … 44 dataset
any base … 17 array … 29
argument line … 62 decrease … 14
assign input and output names … 15 defining number of ignition faults … 39
automatic delta-T inputs … 43
insert input and output terminals … 13 derivation … 30
averaging derivative … 25
over cylinders and cycles … 33 determining injection pulses … 36
Distribution … 33
B drawing grid … 13
base functions … 9
base type … 17 E
assign … 18 engine average … 19, 24, 33
best-fit curve
polynomial … 26 F
best-fit line … 26 fast fourier transformation … 27
FFT … 27
C FFTAnalysis … 34
CalcGraf filter … 27
macros … 60 FIR filter … 31
formula
calcgraf.ini entries
hide formulas with no input … 23
EnableCGCylCheck … 23
formula presentation … 59
FormulaRoot … 23
frequency transformation … 34
LibraryNames … 23
function blocks
MacroPath … 23, 57, 60 cut, copy, insert … 14
ModelPath … 23 parameterize … 15
calculation of mass fraction burned … 38 function elements … 9
classification
of result values … 33
G
combustion noise … 40
comment text … 14 generic (CalcGraf model type) … 11
compile algorithm … 57 grids … 13
compiling … 16 grouping
CompressionCurve … 30 CalcGraf function blocks … 66
constant … 25
convenience functions … 13 H
copy … 14 heat release
crank angle based curve … 17 with constant polytropic coefficient … 45
create calculation model … 11 with variable polytropic coefficient … 47
curve high- and low pass filtering … 31
cut … 27 Histogram … 26
maxima … 26 histogram … 26
move … 27 percentage-based … 26
curve section … 44 HistogramPercent … 26
cut … 14
cycle averaging and envelopes … 30 I
cycle-based curve … 17 IMEP … 35
CycleVariation … 30 increase … 14
cyclic indicated mean effective pressure … 35
result value … 17 InjectionRate … 77
result value curve … 18 input name … 62
T
TDC
adjustment … 45
correction … 45
terminal … 25
Thresh … 26
time based curve … 17
timing … 36
TM_Compare … 52
TM_CutRange … 52
TM_CutSpeedRamp … 52
TM_DigitalFilter … 53
TM_ExtractBit … 53
TM_Logic … 53
TM_MovingWindowFFT … 53
TM_Resample … 54
TM_Section … 54
TM_SplitToCycles … 54
TM_XYClassification … 55
TM_XYZClassification … 55
trend curve … 26
TrendCurve_Linear … 26
TrendCurve_Polynomial … 26
TrendCurve_Spline … 26
V
vibration order … 41
X
xShift … 27