This module can create a cam with which an event is triggered at a cam position. The cam can be pre-controlled for time to compensate for dead times.
In conjunction with the TB_MasterEngine function module, the dead time compensation can also be calculated exactly during the acceleration and braking phases. When using a real axis, only one velocity compensation can be used.
| Recommended task: | Event |
| Libraries used: | |
| Additional data type definitions: | ....todo |
| Use of Static-Variables: | ....todo |
| none |
| Marking: | Data type: | Default: | Data range: | Description: |
|---|---|---|---|---|
| x_Enable | BOOL | ... | ... | TRUE: Enabling of the module. Control is active. FALSE: Module is deactivated; the outputs are set to FALSE. |
| x_Start | BOOL | ... | ... | TRUE: Start of cam generation. With the positive edge, the position di_Pos is set to the position di_StartPos. |
| x_Ready | BOOL | ... | ... | TRUE: Actuator is ready. If a cam is to be output (x_CamOut = TRUE), the input must be TRUE. Otherwise, an error is output. |
| di_Vel | DINT | ... | ... | Actual velocity of the encoder in user units/Ts. |
| di_StartPos | DINT | ... | ... | Start or reference position of the encoder. If x_Start = TRUE, x_Pos is set to this position. |
| di_CamPos | DINT | ... | ... | Position of the encoder at which the cam is to take effect. This position minus the path ud_Travel, which is traversed during the dead time, yields the position at which the cam switches. |
| di_Period | DINT | ... | ... | Period of the position in user units. Whenever the cam switches, the position di_Pos is reset by di_Period. |
| u_Delay_ms | DINT | ... | ... | Dead time in ms. All deceleration times of the system are combined here. Maximum times up to 5,000 ms are possible. If a larger value is connected, it is limited to 5,000 ms internally. |
| ud_TimeAcc_ms | DINT | ... | ... | Remaining acceleration time in ms from the TB_MasterEngine module when using the virtual master. Otherwise, leave open. |
| di_VelSet_s | DINT | ... | ... | Setpoint velocity in user units/s from the TB_MasterEngine module when using the virtual master. Otherwise, leave open. |
| di_VelAct_s | DINT | ... | ... | Actual velocity in user units/s. This value must be connected for the dead time compensation. The actual velocity is either from a real master or a virtual master (TB_MasterEngine function module). |
| Marking: | Data type: | Description: |
|---|---|---|
| x_Active | BOOL | TRUE: Module is active. |
| x_Running | BOOL | TRUE: Cam calculation is active. x_Running is FALSE if x_Start = FALSE and the cam position of the last cam has been reached. This output can be used to determine whether all cams to be processed are ready. To stop a process, x_Start is set to FALSE. If all cams are processed, x_Running is FALSE. The axis can now be stopped. |
| x_CamOut | BOOL | Cam output. x_Running is TRUE for one cycle. |
| di_Pos | DINT | Position of the encoder in user units. |
| ud_Travel | UDINT | Path of the encoder during the deceleration time di_Delay_ms. This path depends on the velocity of the encoder and is recalculated cyclically. |
| x_Error | BOOL | TRUE: Error detected. |
| i_Error | INT | Error number of the module. See error table. |
| i_Error | Description: |
|---|---|
| 0 | No error. |
| -1 | Actuator not ready. This error occurs if the cam is to switch, but the x_Ready input is FALSE. |
| -2 | Overrun. This error occurs if StartPos is located more than one period after CamPos. |
| -3 | The cam position of the last cam has not been reached. This error occurs if x_Start = FALSE and the time u_Delay_ms has expired without the cam position having been reached as a result of di_Vel being too small or 0. |