beautypg.com

4 user scaling, 5 example calculation, User scaling – Pilz PSSu E S 2AI U User Manual

Page 18: Example calculation

background image

Function description

Operating Manual PSSu E S 2AI U(­T)
21405­EN­03

18

The module always uses two's complement representation for internal processing, irre­
spective of the configured data format. The values from 0000

H

 to FFFF

H

 form a number

circle in the two's complement representation. 8000

H

 follows 7FFF

H

 (= 32 767

D

) and is inter­

preted as the lowest negative number (= ­32 768

D

). 32 767

D

 is never exceeded; the value

never falls below ­32 768

D

.

4.2.3.4

User scaling

User scaling is a second level of scaling. You can use this scaling to correct local influ­
ences. The function is the same as that of manufacturer scaling, but a different value is
used for amplification factor 1:

}

y = (a

2

 / 256

D

 * x) + b

2

 or

}

y = (a

2

 / 100

H

 * x) + b

2

a

2

 = Amplification factor * 256

D

User scaling is deactivated in the default setting. The default value for offset is 0. The de­
fault value for gain is 256

D

 (100

H

). That corresponds to amplification factor 1.

Key:

}

y: Digital value after user scaling

}

x: Digital value before user scaling

}

a

2

: Gain

}

b

2

: Offset

}

a

2

 / 1024

D

: Amplification factor

4.2.3.5

Example calculation

Task:

When there is 10 V at the input, the PII should show a decimal value of 10 000. User scal­
ing (Gain a

2

) should be used in this case. Manufacturer scaling should not be changed. All

numbers are decimals.

Solution:

Manufacturer scaling 
y = (a

1

 / 1024 * x) + b

1

and user scaling 
y = (a

2

 / 256 * x) + b

2

act consecutively, giving:
y = (a

2

 / 256 * ((a

1

 / 1024 * x) + b

1

)) + b

2

 or:

y = (a

1

 * a

2

 * x / 262144) + (a

2

 * b

1

 / 256) + b

2

With default values for a

1

 = 8194, b

1

 = 0 and the default value b

2

 = 0:

y = a

2

 / 32 * x

a

2

 = y * 32 / x

Due to the hardware calibration the converter's input range is divided so that the 10 V end
point is assigned the value x = 4095. With the default values x = 4095 and y= 10 000 the
result is:
Gain a

2

 = 78

This manual is related to the following products: