MLFB_HomeFindHomeFastInputModulo
Description
This Application Specific FunctionA function calculates a result according to the current value of its inputs. A function has no internal data and is not linked to declared instances. function block performs a single-axis home to a limit switch connected to a High Speed Input. The motor starts to move according to the direction setting. The home position has been found as soon as the fast inputThe inputs are taken into account at each cycle depending on the system periodicity (for example each millisecond). Under certain circumstances this can be insufficient when more accuracy is needed, or if a quick response is required from the system. To fill the gap, a drive may have some Fast Input connections (generally one or two). When an event happens that triggers a Fast Input (e.g. when a sensor sends a rising edge), the detection of a signal occurs faster (which can be 1000 times more accurate than the system periodicity). Then the timestamp associated with this input can be provided to the IPC to take corrective action selected is triggered on the edge selected.
An absolute move is made to the triggered position, and then the position value is set. The hardware limit switches are monitored during the homing procedure.
The drive behaves as follows in case that a hardware limit switch is active before the home-switch has been activated: The motor changes the direction until the home switch is crossed. This function is to be used when the axis is set-up in Modulo mode.
The following figure shows the function block I/O:
Figure 7-202: MLFB HomeFindHomeFastInputModulo
Arguments
Input
ibExecute |
Description |
Request the homing step procedure at rising edgeA rising edge is the transition of a digital signal from low to high. It is also called positive edge |
||||||
Data type |
BOOL |
|||||||
Range |
[0 , 1] |
|||||||
Unit |
n/a |
|||||||
Default |
— |
|||||||
iAxisID |
Description |
Name of a declared instance of the AXIS_REF library function |
||||||
Data type |
||||||||
Range |
[1 , 256] |
|||||||
Unit |
n/a |
|||||||
Default |
— |
|||||||
iPosition |
Description |
Offset Position Applied After Home Switch is found |
||||||
Data type |
LREAL |
|||||||
Range |
— |
|||||||
Unit |
User unit |
|||||||
Default |
— |
|||||||
ibDirection |
Description |
Define the axis homing direction
|
||||||
Data type |
BOOL |
|||||||
Range |
[0 , 1] |
|||||||
Unit |
n/a |
|||||||
Default |
— |
|||||||
iVelocity |
Description |
Commanded velocity for the homing move |
||||||
Data type |
LREAL |
|||||||
Range |
— |
|||||||
Unit |
User unit/sec |
|||||||
Default |
— |
|||||||
iAcceleration |
Description |
Commanded acceleration for the homing move |
||||||
Data type |
LREAL |
|||||||
Range |
— |
|||||||
Unit |
User unit/sec2 |
|||||||
Default |
— |
|||||||
iDeceleration |
Description |
Commanded deceleration for the homing move |
||||||
Data type |
LREAL |
|||||||
Range |
— |
|||||||
Unit |
User unit/sec2 |
|||||||
Default |
— |
|||||||
ibLimitSwitchMode |
Description |
Limit switch state to complete homing
|
||||||
Data type |
BOOL |
|||||||
Range |
[0 , 1] |
|||||||
Unit |
n/a |
|||||||
Default |
— |
|||||||
ibPosLimitSwitch |
Description |
The positive direction limit switch input I/O point |
||||||
Data type |
BOOL |
|||||||
Range |
[0 , 1] |
|||||||
Unit |
n/a |
|||||||
Default |
— |
|||||||
ibNegLimitSwitch |
Description |
The negative direction limit switch input I/O point |
||||||
Data type |
BOOL |
|||||||
Range |
[0 , 1] |
|||||||
Unit |
n/a |
|||||||
Default |
— |
|||||||
iTimeout |
Description |
Maximum time for homing move to complete. If exceeded the homing procedure will error out. 0= no time limit |
||||||
Data type |
TIME |
|||||||
Range |
— |
|||||||
Unit |
sec |
|||||||
Default |
— |
|||||||
ibFastInputNumber |
Description |
Limit switch state to complete homing.
|
||||||
Data type |
BOOL |
|||||||
Range |
[0 , 1] |
|||||||
Unit |
n/a |
|||||||
Default |
— |
|||||||
iCycleTime |
Description |
Ethercat Cycle Time 250, 500 or 1000 |
||||||
Data type |
LREAL |
|||||||
Range |
— |
|||||||
Unit |
microseconds |
|||||||
Default |
— |
Output
obDone |
Description |
Indicates the move completed successfully. The Command Position has reached the endpoint |
||||||||||||
Data type |
BOOL |
|||||||||||||
Unit |
n/a |
|||||||||||||
obActive |
Description |
Indicates this move is the active move |
||||||||||||
Data type |
BOOL |
|||||||||||||
Unit |
n/a |
|||||||||||||
obError |
Description |
Indicates an invalid input was specified or the move was terminated due to an error |
||||||||||||
Data type |
BOOL |
|||||||||||||
Unit |
n/a |
|||||||||||||
oErrorID |
Description |
Indicates the error if Error output is set to TRUE
|
||||||||||||
Data type |
DINT |
|||||||||||||
Unit |
n/a |
Usage
This homing procedure performs a homing function searching for sensorA sensor is a type of transducer that converts one type of energy into another for various purposes including measurement or information transfer using only High Speed Input Switches. (A High Speed Limit Switch has 1 “Off” (or “On”) area).
- Home is commanded by user in the desired homing direction at the selected Velocity
- If LimitSwitch is found ‘On’ on rising ‘Execute’, then the process is started in the opposite direction as specified, LimitSwitch is search for ‘Off’ (or On, depending on LimitSwitchMode setting) Edge (released), and process is restarted again in original direction. This ensures that the end conditions are always the same
- The Timeout can cause an error if exceeded
Related Functions
MLFB_HomeFindLimitFastInputModulo
Example
Structured Text
Direction:= 0; Position:=1000; Velocity:=1000; Acceleration:=10000; Deceleration:=10000; SwitchMode:=0; Timeout:=T#100; FastInputNumber:=0; CycleTime:=1000;
inst_fbHomeFindHomeFastInputModulo(True, Axis1, Position, Direction, Velocity, Acceleration, Deceleration, PosLimitSwitch, NegLimitSwitch, Timeout, FastInputNumber, CycleTime);
HomeComplete :=inst_fbHomeFindHomeFastInputModulo.Done; HomeActive :=inst_fbHomeFindHomeFastInputModulo.Active; HomeError :=inst_fbHomeFindHomeFastInputModulo.Error; HomeErrorID :=inst_fbHomeFindHomeFastInputModulo.ErrorID;
(* PosLimitSwitch and NegLimitSwtch are declared I/O points *)
|
Ladder Diagram
Function Block Diagram