Circular interpolation (center position)
Pulses are output from two channels in accordance with the parameters in the specified DUT, so that the path to the target position forms an arc.The radius of the circle is calculated by specifying the center position and the end position.Pulses are output from the specified channel when the control flag for this channel is FALSE and the execution condition is TRUE.
Input
Pulse output channel: 0, 2
Input/output
Starting address of area containing the data table
Use the following predefined DUT: F176_PulseOutput_Center_DUT
The following parameters can be specified in the DUT:
Control code
Composite speed
X-axis target value
Y-axis target value
X-axis center value
Y-axis center value
The following parameters for each axis are calculated upon execution of the instruction and stored in the operation result area of the DUT.
Radius
Pulse output characteristics
(1) |
Rotation direction: from channel 0 (x-axis) to channel 2 (y-axis) (for a movement in positive direction on both channels)
|
(2) |
Rotation direction: from channel 2 (y-axis) to channel 0 ( x-axis) (for a movement in positive direction on both channels)
|
Fv: |
Composite speed | O (Xo,Yo): |
Center position |
Fx: |
X-axis speed | S (Xs,Ys): |
Current position (Start) |
Fy: |
Y-axis speed | P (Xp,Yp) |
Pass position |
r: |
Radius | E (Xe,Ye) |
Target position (End) |
Let channel 0 be the X-axis and channel 2 be the Y-axis.The position control mode is absolute value control.
The current position is (q=60°, Xs=5000, Ys=8660). The center position O (Xo=0, Yo=0) is used as a reference point. Pulses are output from the X-axis (channel 0) and the Y-axis (channel 2) at a speed of Fv=2000Hz until the target position (q=-30°, Xe=8660, Ye=-5000) is reached.
The execution condition for this instruction must be continually TRUE. When the execution condition is FALSE, pulse output stops.
The high-speed counter control flag (e.g. sys_bIsHscChannel0ControlActive) and the pulse output control flag (e.g. sys_bIsPulseChannel0Active) are assigned to the same special internal flag number (e.g. R903A). Therefore, when a high-speed counter instruction or a pulse output instruction is executed, both the high-speed counter control flag (e.g. sys_bIsHscChannel0ControlActive) and the pulse output control flag (e.g. sys_bIsPulseChannel0Active) for the channel used are TRUE. No other high-speed counter instruction or pulse output instruction can be executed as long as this flag is TRUE.
Executing the circular interpolation control instruction F176_PulseOutput_Center sets the circular interpolation control flag (sys_bIsCircularInterpolationActive) to TRUE. The status of this flag is maintained until the target value is reached (even if the execution condition is no longer TRUE). During this time, other pulse output instructions cannot be executed. To restart circular interpolation, perform a forced stop (stop pulse output) to set the circular interpolation control flag (sys_bIsCircularInterpolationActive) to FALSE.
If "Continue" has been selected for the operation connection mode, use a special flag (sys_bIsCircularInterpolationOverwritingPossible) to permit overwriting of the target value. The flag is TRUE for one scan when the circular interpolation instruction is executed.
The target value for each axis must be within the range of -8388608–8388607. When this instruction is used in combination with other pulse output instructions, e.g. F171_PulseOutput_Trapezoidal, the target value in these instructions must be within the same range.
The accuracy of circular interpolation may degrade if the scan time is too long.
Online editing during RUN mode is not available for this instruction.
If both the main program and the interrupt program contain code for the same channel, make sure both are not executed simultaneously.
If you specify the same value for the current position and the target position, a circle drawing operation will result.
As there is no interpolation function for the home return, the home return should be executed for each channel.
When using in applications requiring precision, test runs with the actual machine are necessary.
Set any high-speed counter allocated to a pulse output channel to "Unused" in the system registers.
We strongly recommend that you incorporate a forced stop option in your positioning program.
The status of the high-speed counter control flag or pulse output control flag may change while a scan is being carried out. For example, if the number of received bytes is read more than once different statuses may exist within one scan.
(1) |
Execution condition X0 |
(2) |
Pulse output control flag, channel 0 (sys_bIsPulseChannel0Active) |
(3) |
Pulse output control flag, channel 2 (sys_bIsPulseChannel2Active) |
(4) |
Circular interpolation control flag (sys_bIsCircularInterpolationActive) |
(5) |
Target value overwriting possible flag (sys_bIsCircularInterpolationOverwritingPossible) |
a |
Start |
b |
Execution condition FALSE |
c |
Target value reached |
d |
Start continue mode |
e |
1 scan |
All input and output variables used for programming this function have been declared in the POU header. The same POU header is used for all programming languages.
VAR
Trigger: BOOL:=FALSE;
dutCenterData: F176_PulseOutput_Center_DUT:=dwControlCode := 16#01012,
diSpeed := 15000,
diTargetPos_X := 8000000,
diTargetPos_Y := 5000000,
diCenterPos_X := 8300000,
diCenterPos_Y := 5500000;
(*Control code :
Digit 4: 0=Operation connection mode: stop
Digit 3: 1=Rotation direction: CCW (left)
Digit 2: 0=Fixed
Digit 1: 1=Absolute value control
Digit 0: 2=Pulse/direction (Forward FALSE)
*)
@'': @'';
END_VAR
BODY
WORKSPACE
NETWORK_LIST_TYPE := NWTYPELD ;
ACTIVE_NETWORK := 0 ;
END_WORKSPACE
NET_WORK
NETWORK_TYPE := NWTYPELD ;
NETWORK_LABEL := ;
NETWORK_TITLE := ;
NETWORK_HEIGHT := 7 ;
NETWORK_BODY
B(B_CONTACT,,Trigger,3,2,5,4,);
B(B_VARIN,,dutCenterData,10,4,12,6,);
B(B_VARIN,,0,10,3,12,5,);
B(B_F,F176_PulseOutput_Center!,Instance,12,1,27,6,,?DEN?Hn_iPulseOutputChannel?Ds_dutDataTable?As_dutDataTable?AENO);
L(1,3,3,3);
L(5,3,12,3);
L(1,0,1,7);
END_NETWORK_BODY
END_NET_WORK
END_BODY
IF DF(Trigger) then
F176_PulseOutput_Center(n_iPulseOutputChannel := 0,
s_dutDataTable := dutCenterData);
END_IF;