Analog comparator

image\block_ak_sn.gif

Short description

The output is set and reset depending on the difference Ax – Ay and on two configurable thresholds.

 

Connection

Description

Inputs Ax, Ay

Input the analog signals of which you want to determine the delta at the inputs Ax and Ay.

Use the analog inputs AI1...AI8, the analog flags AM1...AM6, the block number of a function with analog output, or the analog outputs AQ1 and AQ2.

AI1..AI8: 0 - 10 V corresponds with 0 - 1000 (internal value).

Parameter

A: Gain
Range of values: +- 10.00

B: Zero offset
Range of values: +- 10,000

On: On threshold
Range of values: +- 20,000

Off: Off threshold
Range of values: +- 20,000

p: Number of decimals
Range of values: 0, 1, 2, 3

Output Q

Q is set or reset depending on the set thresholds.

 

image\0ba3_logo_sn.gif

0BA4:

A: Gain

 Range of values 0.00...10.00

0BA0-0BA3:

The following parameters apply:

G : Gain in [%]

 Range of values: 0..1000 %

O : Offset

 Range of values: ±999

delta : Threshold

 

Q is set to 1 when the difference Ax-Ay exceeds the threshold.

Parameters On and Off

The on threshold On and the off threshold Off can be provided by the actual value of another already-programmed function:

You select the required function by the block number.

Parameter p (number of decimals)

Parameter p applies only to Ax, Ay, Delta, On and Off values displayed in a message text.

Parameter p does not apply to the comparison of on and off values. (The compare function ignores the decimal point.)

Timing diagram

image\block_ak_diagramm_sn.gif

Q for Ax – Ay > 200, On = Off = 200

Description of the function

The function reads the value of the signal at the analog input Ax.

This value is multiplied by the value of parameter A (gain). Parameter B (offset) is added to the product, hence

(Ax * gain) + offset = Actual value Ax.

(Ay * gain) + offset = Actual value Ay.

Output Q is set or reset depending on the difference of the actual values Ax – Ay and the set thresholds. See the following calculation rule.

Calculation rule

 

image\0ba3_logo_sn.gif

0BA2, 0BA3:

The following functions/calculation rules apply

The function adds the relevant specified offset to the analog values Ax and Ay. The sum is multiplied with the value of the gain parameter. The difference is formed from both calculated values.

Output Q is set if this difference between these values exceeds the threshold you have configured under delta.

Calculation rule:

Q = 1, if:

((Ax + offset) * gain) - ((Ay + offset)*gain)>threshold delta

Q is reset to 0 when the threshold reaches or drops below delta.

Reducing the input sensitivity of the analog comparator

You can delay the output of the analog comparator selectively by means of the "on delay" and "off delay" SFBs. By doing so, you determine that output Q is only set if the input trigger length Trg (= output of the analog comparator) exceeds the defined on delay time.

This way you can set a virtual hysteresis, which renders the input less sensitive to short changes.

Particular characteristics to be noted when configuring

For help on analog block parameters, refer to the Analog value processing section.

 

Overview