This module determines the axis position of a cam at a specified master position.
The axis position of a cam at a specified master position is determined. The axis can thus traverse to this position, and then the cam can be started directly with the TB_CamStretch module. The master encoder must be at a standstill here!
The cam can thus be continued directly after a disturbance. Example: The machine has been stopped via an emergency stop, the axes (including the master) were without torque and changed their position. After acknowledgement of the emergency stop, all axes are brought under control. The valid cam position is then determined (TB_CamGetPos) for each axis and then assumed (TB_PosAbs). The cams are now restarted (TB_CamStretch).
A positive edge at x_Execute executes the calculation. Ensure here, that the offsets (di_xOffs and di_yOffs) and the stretch factors (di_xFact, di_yFact) correspond with the respective movement. The cam used (ui_CamId, i_kEndZ and ui_kEndN) must also be specified correctly.
Before the module can be used, the cam table is to be initialized by the TB_NormCamCreate module.
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 |
| Marking: | Data type: | Description: |
|---|---|---|
| a_CamTable | CAM_TABLE | Data point table of the normalized cams. |
| Marking: | Data type: | Description: |
|---|---|---|
| x_Execute | BOOL | Positive edge starts the cam. |
| 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. |
| i_kEndZ | INT | Slope numerator of the normalized cam at cam end. |
| ui_kEndN | UINT | Slope denominator of the normalized cam at cam end. |
| di_xPos | DINT | Position of the master axis in user units. |
| 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 |
| Marking: | Data type: | Description: |
|---|---|---|
| x_Error | BOOL | TRUE: The module has identified an error. |
| w_ErrorId | WORD | TRUE: The module has identified an error. |
| di_yPos | DINT | Setpoint position of the axis in 1/100th user units. This position can be connected directly to the di_yPosAdd input of the technology module TB_SyncLin or TB_SyncRot, for example. |
| w_ErrorId | Description: |
|---|---|
| 0 | No error active. |
| 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. |