TB_CamStretch

Representation in FBD

General Information

With this module, synchronous movements can be generated from scalable cams. The axis then moves in sync to a master position.

Note: Before the module can be executed, the cam data points of the normalized cam must be created. The TB_NormCamCreate module can be used for this purpose.

Recommended task: EVENT
Libraries used: ARITHMETIC_xxbd00 or higher
TECH_TYPES_xxbd05 or higher
TECH_TOOLS_xxbd00 or higher

Functionality

InOut Parameter

Marking: Data type: Description:
di_xPos DINT Position of the master axis in user units.
di_yPos DINT Position of the master axis in user units.
a_CamTable CAM_TABLE Data point table of the normalized cams.

Input Parameter

Marking: Data type: Description:
x_Enable BOOL TRUE: Enabling of the module.
x_Execute BOOL Positive edge starts the cam.
x_Break BOOL TRUE: Cam execution is canceled immediately.
di_yPosAdd DINT An additional setpoint in 1/100th units of the axis can be connected here. The TB_PosAdd and TB_CamAdd modules are available for this purpose.
ui_CamId UINT Specifies the cam to be executed. User cams can also be saved in the a_CamTable data point table. The first cam should be saved from position 8192. The position of the first data point is then specified at ui_CamId. A cam must fulfill the following criteria: It must be normalized to 0 to 16,777,216 in the x- and y-directions. The curve at the beginning and end must be zero. 512 data points for the x-positions 0, 32,768, 65,536, …, 16,744,448 are specified, and the accompanying y-value is saved in the _SyncCam table. The x-value is not saved.
di_xOffs DINT Start position of the master axis for movement in user units.
di_yOffs DINT Offset of the axis up to start of the cam in user units. The current position of the axis should be specified for di_yOffs so that the axis does not change its position abruptly after the cam start.
di_xFact DINT Stretch factor of the master axis in user units of the master axis. Specification of the master path while the cam is executed.
di_yFact DINT Stretch factor of the axis in user units. Specification of the axis path to be traversed with the cam.
di_yEnd DINT End position of the cam in user units. If the input is not connected, di_yEnd = di_yOffs + di_yFact is set. The input must only then be used if the maximum position is not at the end of the cam.
i_kEndNum INT Slope numerator of the normalized cam at cam end.
ui_kEndDenum UINT Slope denominator of the normalized cam at cam end.
di_xSetPos DINT Set value of the position of the master axis in user units of the master axis.
di_ySetPos DINT Set value of the position of the axis in user units.
us_SetPosMode USINT Specifies how the positions are to be changed.
ui_CamId Description: k_EndNum k_EndDenum
0 Rest-in-rest cam with no velocity plateau 0 1
1 Start cam. Rest-in-velocity 2 1
2 Straight 1 1
3 Stop cam, velocity-in-rest 0 1
4 Rest-in-rest cam with 1/3 acceleration, 1/3 const. velocity and 1/3 deceleration 0 1
5-15 Reserved
8192 1st User cam
8704 2nd User cam
: :
15872 16th User cam
us_SetPosMode Description: di_xPos after execution di_yPos after execution
0 No setting unchanged unchanged
1 yPos relative unchanged di_yPos+di_ySetPos
2 yPos absolute unchanged di_ySetPos
3 xPos relative di_xPos+di_xSetPos unchanged
4 Both relative di_xPos+di_xSetPos di_yPos+di_ySetPos
5 xPos relative, yPos absolute di_xPos+di_xSetPos di_ySetPos
6 xPos absolute di_xSetPos unchanged
7 xPos absolute, yPos relative di_xSetPos di_yPos+di_ySetPos
8 Both absolute di_xSetPos di_ySetPos

Output Parameter

Marking: Data type: Description:
x_Active BOOL TRUE: Module is enabled (x_Enable = TRUE) and active.
x_CamActive BOOL TRUE: Cam being processed.
x_CamDone BOOL TRUE: Cam ended. x_CamDone is TRUE for exactly one cycle
di_Vel DINT Setpoint velocity of the axis in 1/100th user units/Ts. Ts is the cycle time of the setpoint event task.
di_Acc DINT Setpoint velocity of the axis in 1/100th user units/Ts2. Ts is the cycle time of the setpoint event task.
x_Error BOOL TRUE: The module has identified an error.
w_ErrorId WORD Error number of the module. See table below.
w_ErrorId Description:
0 No error active.
1 Unknown SetPosMode.
2 Cam data error. TM_NormCamCreate must be executed and the cam table connected before use.
3 di_xFact negative. The x-factor must be positive.
999 No technology license. Use PLC with technology license.