Camming

The property provides two options: Camming.Pos for position camming and Camming.Velo for velocity camming. To do this, two classes of the same type are instantiated, but with different parameterizations.

Both types of camming use a guiding value to identify a control value within a camming lookup table. For more information, see CammingLookUp.
Any useful information can serve as a guiding value. Common options are a time (LREAL variable that starts with 0 and is cyclically updated by adding the cycle time of the PLC tasks) or the position of another axis.
| |
Unexpected responses of the controlled axis Unsuitable guiding values or table points can lead to unexpected reactions of the controlled axis. Consequently, these can lead to accidents or damage. |
Using camming requires several steps:
- The camming lookup table must be initialized. If you use the internal table (recommended), you must specify at least the interpolation type and define the number of points in the table. You can find an example of initialization either here or in the example below.
- The table must be defined by specifying all table points. Make sure that the point data corresponds to the camming type (position, velocity) for which they are to be used.
- In the case of equidistant points, a minimum and maximum value must also be assigned to the
GuidingValuein the table. - An initial reference value should be specified using the
GuidingValueproperty before enabling camming. - At the right time use
DoCamming(TRUE)to enable the function. Make sure that the axis is in a state (position, velocity) that matches the guidance value of the camming table. - Make sure that the guiding value is updated cyclically.
- At the right time use
DoCamming(FALSE)to disable the function. Pay attention to the state (position, velocity) of the axis.
Syntax:
FUNCTION_BLOCK FB_Camming EXTENDS FB_CorefunctionFeedback
Properties
Name | Type | Access | Description |
|---|---|---|---|
InitState | BOOL | Get, Set | The core function is not completely and successfully initialized. |
FB_Camming | |||
GuidingValue | LREAL | Get, Set | The current guiding value of the camming. This value should be updated by the application at the same frequency as the axis cycle time. |
I_CammingLookUp | Get, Set | The camming lookup table used for the design. After initialization, or as soon as | |
Overrun | BOOL | Get | TRUE, if the current guiding value is not in the range of the camming lookup table. |
Synchronize | BOOL | Get, Set | With |
Synchronized | BOOL | Get | TRUE if |
[ | BOOL | Get, Set | This property defines the camming rule. A TRUE causes the Corefunction to act as position camming. A FALSE will cause it to act as velocity camming. This property is set during startup. The application must not change its setting. |
FB_CorefunctionFeedback | |||
AbortedState | BOOL | Get, Set | Signals the abort of a command by another Corefunction. |
BusyState | BOOL | Get, Set | Signals the active execution of a command. |
DoneState | BOOL | Get, Set | Signals the successful execution of a command. |
IdleState | BOOL | Get, Set | The Corefunction is ready for operation and commandable. |
IsCommanded | BOOL | Get | Signals the pending of a command. |
FB_Corefunction | |||
FailedState | BOOL | Get, Set | If IsActivated is TRUE at the same time: Signals the failure of an accepted command. If IsActivated is FALSE at the same time: Signals the rejection of a command. |
HasFeedback | BOOL | Get | The core function has responded to a pending command. |
IsActivated | BOOL | Get | The core function has an accepted command pending. |
IsLocalCmd | BOOL | Get | Signals that the axis is assigned with a command of this core function. |
ReadyState | BOOL | Get, Set | The Corefunction is ready for operation, but is not commandable at this time. Possible reasons are: |
Methods
Name | Description |
|---|---|
[ | This method is called cyclically by the axis. |
FB_Camming | |
This method is used to enable and disable the camming. | |
This method is used to update the guiding value. Alternative: | |
This method can be used to connect a camming table. Alternative: | |
1 Obsolete
Interfaces
Type | Description |
|---|---|
I_Corefunction | Standard interface on FB_Corefunction. |
I_Camming | Standard interface on FB_Camming |
I_CorefunctionFeedback | Standard interface on FB_CorefunctionFeedback. |
Example:
// For this example, the axis should currently be in the fCenter position
CASE nState OF
0: // Define camming curve
fCenter := 100.0; // [mm]
fAmplitude := 100.0; // [mm]
fCycleTime := 0.002; // [s]
// parameterise the lookup table
iAxisBase.Camming.Pos.LookUp.Equidistance := TRUE;
iAxisBase.Camming.Pos.LookUp.Interpolation := E_LookupMode.eSecondOrder;
iAxisBase.Camming.Pos.LookUp.SetPoints(401);
iAxisBase.Camming.Pos.LookUp.MinGuidingValue := 0.0;
iAxisBase.Camming.Pos.LookUp.MaxGuidingValue := 15.0;
// Create a sinusoidal curve over 15 seconds
FOR i := 1 TO 401 DO
fCamTime := 15.0 * (i - 1) / 400.0;
fPoint := fCenter + fAmplitude * SIN(2.0 * PI * fCamTime / 15.0);
IF FAILED(iAxisBase.Camming.Pos.LookUp.SetPoint(i, fPoint, 35.0)) THEN
nState := -1;
END_IF;
END_FOR
// check table validation
IF NOT iAxisBase.Camming.Pos.LookUp.Valid THEN
nState := -1;
END_IF
// assign initial camming value
iAxisBase.Camming.Pos.GuidingValue := 0.0;
fTime := 0.0;
IF nState >= 0 THEN
nState := nState + 1;
END_IF
1: // start camming
IF FAILED(iAxisBase.Camming.Pos.DoCamming(TRUE)) THEN
nState := -1;
END_IF
IF nState > 0 THEN
nState := nState + 1;
END_IF
2: // operate camming
fTime := MIN(fTime + fCycleTime, 15.0);
iAxisBase.Camming.Pos.GuidingValue := fTime;
IF iAxisBase.Camming.Pos.FailedState THEN
nState := -1;
ELSIF fTime >= 15.0 THEN
nState := nState + 1;;
END_IF
3, // camming done
-1: // error
fTime := 0.0;
iAxisBase.Camming.Pos.DoCamming(FALSE);
END_CASERequirements
Development environment | Target platform | PLC libraries to include |
|---|---|---|
TwinCAT v3.1.4024.71 | PC or CX (x64, x86) | Tc3_PlasticFunctions (>= v12.14.0.0) |
