Dynamics
The IPlcDynamicConstraint interface is accepted by many positioning commands as an optional input to constrain the permitted values for velocity, acceleration, deceleration or jerk during motion. There are different types of constraints, often combinations of different types are accepted, which are combined in a DynamicConstraint_Container:
- Constraints of individual coordinates
- Constraints in the direction of travel
- Constraints symmetrical in all directions
If several constraints act at the same time, all of them will be respected. Therefore, there is no need for the user to calculate which constraint will have the most limiting effect on the dynamics during the motion. Ineffective constraints, for example a constraint to the Z coordinate during a pure XY movement, are ignored.
The following special values are supported:
- MC_DEFAULT: Is replaced by the recipient of the positioning command with the corresponding default value, if available.
- MC_IGNORE: Does not lead to any constraint. This can be useful, for example, if you want to limit acceleration and jerk of a coordinate, but not the velocity.
Example plot for acceleration in 2D
2D velocity (not plotted, in direction of travel):
2D acceleration:
Tangential acceleration in the direction of travel:
Possible constraints for acceleration:
DynamicConstraint_CartesianXY:
DynamicConstraint_Coordinates:
Example PLC
PROGRAM MAIN
VAR
ConstraintPath : DynamicConstraint_PathXY;
ConstraintCoords : DynamicConstraint_Coordinates;
ConstraintCombined : DynamicConstraint_Container;
END_VAR
// Velocity in XY is limited to 1000, the derivative of this velocity with respect to time is limited to 5000.
// No restriction on the jerk.
ConstraintPath.SetValuesVADJ(V := 1000, A := 5000, D:= 5000, J := MC_IGNORE);
// Acceleration, deceleration and jerk of the X-coordinate are limited to their default values.
ConstraintCoords.SetLimit(Coordinate := Coord_Mcs_X, V := MC_IGNORE, A := MC_DEFAULT, D := MC_DEFAULT, J := MC_DEFAULT);
// The velocity of the C-coordinate is limited to its default value. Acceleration, deceleration and jerk are limited to specific values.
ConstraintCoords.SetLimit(Coordinate := Coord_Mcs_C1, V := MC_DEFAULT, A := 1000, D := 1000, J := 10000);
// The constraints on path and coordinates are combined into a single object.
ConstraintCombined.AddConstraint(ConstraintPath);
ConstraintCombined.AddConstraint(ConstraintCoords);