Home return
Input
Starting address of area containing the data table
Pulse output channel:
FP-S: 0,2
FP-X R: 0,1
FP-XC14T: 0,1,2
FP-X C30T/C60T: 0,1,2,3
After a drive system has been switched on, there is a difference between the internal position value (elapsed value) and the mechanical position of the axis; this difference cannot be predetermined. The internal value must be synchronized with the actual position value of the axis. This is done by means of a home return, during which a position value is registered at a known reference point (home).During execution of a home return instruction, pulses are continuously output until the home input is enabled. The I/O allocation is determined by the channel used.To decelerate movement when near the home position, designate a near home input and set bit 4 of the special data register storing the pulse output control code (sys_wHscOrPulseControlCode) to TRUE and back to FALSE again.The deviation counter clear output can be set to TRUE when home return has been completed.The value in the elapsed value area during a home return differs from the current value. When the return is completed, the elapsed value changes to 0.
Select one of two different operation modes:
Type 1: The home input is effective regardless of whether or not there is a near home input, whether deceleration is taking place, or whether deceleration has been completed.
Without near home input:
With near home input:
Type 2: The home input is effective only after deceleration (started by near home input) has been completed.
Use the following predefined DUT:
F171_PulseOutput_Home_DUT
The following parameters can be specified in the DUT:
Control code
Initial and final speed
Target speed
Acceleration/deceleration time
Deviation counter clear signal
Pulse output characteristics
The pulse output frequency changes according to the specified acceleration/deceleration time.
The difference between target and initial speed determines the slope of the ramps.
General programming information
Even when home input has occurred, executing this instruction causes pulse output to begin.
If the near home input is enabled while acceleration is in progress, deceleration will start.
If both the main program and the interrupt program contain code for the same channel, make sure both are not executed simultaneously.
The deviation counter clear signal is allocated to dedicated output numbers specific to each PLC type.
When programs are being edited in RUN mode, pulse output stops but resumes after the program changes have been downloaded.
FP-X: When a pulse output instruction is executed and pulses are being output, the pulse output control flag (e.g. sys_bIsPulseChannel0Active) of the corresponding channel is TRUE. No other pulse output instruction can be executed as long as this flag is TRUE.
FPS: 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.
FPS: Set any high-speed counter allocated to a pulse output channel to "Unused" in the system registers.
FP-X: Set "Pulse output" for the desired channel in the system registers.
FPS: 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.
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.
Channel no. |
Deviation counter clear output |
Home input |
0 | Y2 | X2 |
2 | Y5 | X5 |
The pulse output function is only available if the pulse I/O cassette (AFPX-PLS) has been installed.
Channel no. |
Deviation counter clear output |
Home input |
0 | ||
(cassette mounting part 1) | Y102 | X102 |
1 | ||
(cassette mounting part 2) | ||
(C30/60R only) | Y202 | X202 |
Channel no. |
Deviation counter clear output |
Home input |
0 | Y4 or Y8 | X4 |
1 | Y5 or Y9 | X5 |
2 | – | X6 |
3 (C30/60R only) | – | X7 |
In the global variable list you define variables that can be accessed by all POUs in the project.
The DUT F171_PulseOutput_Home_DUT is predefined in the FP Library.
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_EXTERNAL
X0_bMotorSwitch: BOOL:=FALSE;
(*at X0*)
END_VAR
VAR
dutHome: F171_PulseOutput_Home_DUT:=dwControlCode := 16#1125;
(*Control code:
Digit 3: 1= Duty ratio 25%
Digit 2: 1= Frequency range 48Hz-100kHz
Digit 1: 2 =Operation mode type 1
Ditig 0: 5= CCW + deviation counter clear signal*)
diInitialSpeed: DINT:=100;
diTargetSpeed: DINT:=2000;
diAccelerationTime: DINT:=300;
@'': @'';
END_VAR
BODY
WORKSPACE
NETWORK_LIST_TYPE := NWTYPELD ;
ACTIVE_NETWORK := 0 ;
END_WORKSPACE
NET_WORK
NETWORK_TYPE := NWTYPELD ;
NETWORK_LABEL := ;
NETWORK_TITLE := ;
NETWORK_HEIGHT := 16 ;
NETWORK_BODY
B(B_CONTACT,,X0_bMotorSwitch,4,1,6,3,R);
B(B_F,E_MOVE!,Instance,17,4,23,8,,?DEN?D?AENO?C);
B(B_F,E_MOVE!,Instance,17,8,23,12,,?DEN?D?AENO?C);
B(B_VAROUT,,dutHome.diTargetSpeed,23,6,25,8,);
B(B_VARIN,,diTargetSpeed,15,6,17,8,);
B(B_VAROUT,,dutHome.diAccelerationDecelerationTime,23,10,25,12,);
B(B_VARIN,,diAccelerationTime,15,10,17,12,);
B(B_F,E_MOVE!,Instance,17,12,23,16,,?DEN?D?AENO?C);
B(B_VAROUT,,dutHome.diDeviationCounterClearSignalOutputTime,23,14,25,16,);
B(B_VARIN,,10,15,14,17,16,);
B(B_F,E_MOVE!,Instance,17,0,23,4,,?DEN?D?AENO?C);
B(B_VAROUT,,dutHome.diInitialAndFinalSpeed,23,2,25,4,);
B(B_VARIN,,diInitialSpeed,15,2,17,4,);
L(7,2,7,6);
L(7,6,7,10);
L(1,2,4,2);
L(6,2,7,2);
L(7,2,17,2);
L(7,6,17,6);
L(7,10,17,10);
L(7,10,7,14);
L(7,14,17,14);
L(1,0,1,16);
END_NETWORK_BODY
END_NET_WORK
NET_WORK
NETWORK_TYPE := NWTYPELD ;
NETWORK_LABEL := ;
NETWORK_TITLE := ;
NETWORK_HEIGHT := 8 ;
NETWORK_BODY
B(B_CONTACT,,X0_bMotorSwitch,6,3,8,5,R);
B(B_VARIN,,dutHome,15,4,17,6,);
B(B_VARIN,,0,15,5,17,7,);
B(B_F,F171_PulseOutput_Home!,Instance,17,2,30,7,,?DEN?Ds_dutDataTable?Hn_iPulseOutputChannel?AENO);
B(B_COMMENT,,Example for home position return,1,1,18,2,);
L(1,4,6,4);
L(8,4,17,4);
L(1,0,1,8);
END_NETWORK_BODY
END_NET_WORK
END_BODY
IF DF(X0_bMotorSwitch) then
dutHome.diInitialAndFinalSpeed:=diInitialSpeed;
dutHome.diTargetSpeed:=diTargetSpeed;
dutHome.diAccelerationDecelerationTime:=diAccelerationTime;
dutHome.diDeviationCounterClearSignalOutputTime:=10;
END_IF;
(*Example for home position return*)
IF DF(X0_bMotorSwitch) then
F171_PulseOutput_Home(s_dutDataTable := dutHome,
n_iPulseOutputChannel :=0);
END_IF;