Function to bring the controlled variable (typically an axis) to the specified target with the specified velocity.
The function, runtime, checks that the maximum speed and acceleration specified for the controlled variable are not exceeded.
The function also checks, again runtime, that the controlled variable does not go outside the specified end of strokes by performing a controlled stop on them.
To override the control of strokes set them to the same value.
|
i32 tracking (stru_track stru)
|
|
Structure of type stru_track for data exchange
|
|
Returns:
|
|
-9
|
Parameter delta <= 0
|
-6 [M_IN_ALARM]
|
acc parameter null
|
-5 [M_ILLEGAL_ARGS]
|
maxspeed parameter null
|
5 [M_FOLLOWING]
|
Target not reached - tracking in progress
|
6 [M_REACHED]
|
Target reached - one of the two position limits reached
|
8 [M_SYNCHRONIZED]
|
Target reached - moving in torque
|
9 [M_ACCEL_LIMITED]
|
Target not reached - tracking in progress - acceleration limitation
|
10 [M_SPEED_LIMITED]
|
Target not reached - tracking in progress - speed limitation
|
17 [M_DECEL]
|
Target not reached - deceleration to reach either position limit
|
19 [M_OUT_OF_LIMITS]
|
Target not reached - attempt to move further out of position limits
|
|
|
Rule
|
|
If you want to disable limits control, impose them the same value
|
Example of use:
RULE R_AUTO_2
axes(AX_2)
motion
if(first_time())
endif
if(trakka)
trk.delta = SI
trk.desspeed = IV(AX_1)
trk.despos = IP(AX_1)
trk.actpos = IP(AX_2)
trk.actspeed = IV(AX_2)
trk.maxspeed = MAX_SPE(AX_2)
trk.acc = MAX_ACC(AX_2)
trk.posmin = MIN_STR(AX_2)
trk.posmax = MAX_STR(AX_2)
reso = tracking(trk)
IP(AX_2) = trk.actpos
else
IV(AX_2) = ramp(IV(AX_2), 0, MAX_ACC(AX_2))
endif
end_motion
END_RULE
|
|