Conversion via the L_CamSetPosition function block

Which products are affected?
ESP-SPAC-CAM1 – Software Package Cam V1.5 (LenzeCamControl1V0105.lib library)

What happens?
If position values in user units are converted in incremental position values via the L_CamSetPosition function block, the conversion result is sporadically exceeded by 1 increment.

When does the problem occur?
The problem occurs if the result comprises a decimal place when the position values in user codes are converted in incremental position values according to the following equation:

 s [incr.] = s [units] * Zi / Ni * 65536 [incr./rev] / FeedConstant [units/rev]

with Zi = Gearbox ratio numerator
       Ni = Gearbox ratio denominator
       FeedConstant = Feed constant
       s[units] = Position value in user units
       s[incr.] = Position value in increments

Example: A position value of 125.0000 [s_units] is to be converted in an incremental position value. The cam axis has a gearbox ratio of Zi : Ni = 1978 : 189 and a feed constant of 250.0000 [s_units/rev]. According to the equation mentioned above the following position value arises: 342937,058201...  In case of this calculation the result comprises a decimal place of 0,058201... auf. Since the L_CamSetPosition function block can only indicate integer results, the incremental result calculated is indicated as 342937 or 342938.
The average value calculated over the number of task sequences corresponds to the same mathematically exact value as calculated by means of the equation mentioned before!

Possible diagnostics?
If the L_CamSetPosition function block is called cyclically, the behaviour can be detected via the online monitoring function included in the DDS. The incremental result calculated deviates sporadically by 1 increment.

Short-term measures/recommendations?
Use a calculation method based on floating point arithmetic (note: floating point arithmetic must only be used in cyclic tasks) instead of the L_CamSetPosition function block. The equation mentioned before serves as basis for the conversion to be programmed.

Evaluation:
Usually the deviations in the conversion result of the L_CamSetPosition function block do not influence the machine behaviour since this block is mostly used for converting target positions, offset values, TP positions, etc. Thus the inaccuracy of 1 increment has virtually no consequences.
In case of multi-axis applications, in which the L_CamSetPosition function block is used to recalculate complete profiles in several drives (selection of incremental x/y position values at the L_CamEditProfileData function block), different incremental calculation results may arise despite identical x-inputs values when the last point (xmax) is converted. Since in this case the maximum x-length of a profile in two drives may be calculated differently an x-drift between the drives occurs. In this case the ConvRealInc function block mentioned under 'Short-term measures/recommendations' is to be used instead of the L_CamSetPosition function block.

Instead of the L_CamSetPosition function block from the LenzeCamControl1V0105.lib library the ConvRealInc function block described in AKB article with Doc-ID 200407240 can be used alternatively, too.
Information taken from Service Message No. 10/2006, chapter 1.3.2.

URL for linking this AKB article: https://www.lenze.com/en-de/go/akb/200601003/1/
Kontaktformular