Registration Position Capture Example with Pipe Network Trigger Block

A Pipe Network Trigger block can be used for registration applications to capture a pipe positionClosed Position means a point in space which is described by different coordinates. Depending on the used system and transformation it can consist of a maximum of six dimensions (coordinates).This means three Cartesian coordinates in space and coordinates for the orientation. In ACS there can be even more than six coordinates. If the same position is described in different coordinate systems the values of the coordinates are different. based on a timestampClosed A sequence of characters, denoting the date and/or time at which a certain event occurred. which is set when a driveClosed In electrical engineering, a drive is an electronic device to provide power to a motor or servo. Control device for regulating the speed, torque and position of a motor. A unit controlling a motor using the current and timing in its coils.'s fast inputClosed The inputs are taken into account at each cycle depending on the system periodicity (i.e., 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. This can be 1000 times more accurate than the system periodicity. The timestamp associated with this input can be provided to the IPC to take corrective action. changes state. A Trigger block is placed in the Pipe Network precisely where the pipe position needs to be captured.

Figure 1: Example of using a Pipe Network Trigger block for position capture.

The Pipe Network motion engine captures the pipe position by using the timestamp received from the drive and interpolating two consecutive pipe position updates. The timestamp will have a delay getting into the pipe network from the drive (typically 1-2 cycles) due to sensorClosed A type of transducer that converts one type of energy into another for various purposes including measurement or information transfer. delay and the communication latency through the EtherCATClosed Ethernet ofr Control Automation Technology. EtherCAT® is an open, high-performance Ethernet-based fieldbus system. The development goal of EtherCAT is to apply Ethernet to automation applications which require short data update times (also called cycle times) with low communication jitter (for synchronization purposes) and low hardware costs. network (typically 1-2 cycles).

Corrected timestamp: = Fast input timestamp - DelayCompensation

To account for this delay, MLTrigWriteDelay provides delay compensation to the pipe position returned in MLTrigReadPos based on the expected delay.

The Trigger block is first configured by clicking on the block in a pipe network and setting the following parameters.

Function Description
INPUT_AXIS Defines the axis whose Fast Input is used.
This name is the same given to the corresponding axis block in the Pipe Network
INPUT_ID Indicates which one of the two available Fast Inputs in that particular axis is used.
The value can be MLFI_FIRST or MLFI_SECOND for the trigger block to be triggered on the arrival of the first or the second input respectively.

Specify one of the following constants:
MLFI_FIRST or MLFI_SECOND for the trigger block to be triggered on the arrival of the first or the second input respectively.
TRIGGER_MODE Indicates if the trigger block responds to the rising edgeClosed The transition of a digital signal from low to high. AKA: positive edge. or the falling edge of the Fast Input
Specify one of the following constants: MLFI_RISING_EDGE or MLFI_FALLING_EDGE

Figure 2: Configuration of the Trigger block

After configuring the Trigger block, the order of calls to its motion library functionsClosed A 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. is as follows:

  1. MLTrigWriteDelay(DINT,TriggerID,LREAL,delay)
    • This function sets the delay compensation, typically starting with a value of 2 usec + (1 or 2) EtherCAT cycles.
  2. MLTrigSetEdge(PipeNetwork.TRIGGER1,MLFI_FIRST,MLFI_RISING_EDGE)
    • This function reconfigures the edge of a trigger lock.
    • This function only needs to be called if the desired edge is different than the edge specified in configuration of the trigger block or if the edge is different than the previous capture.
  3. MLAxisCfgFastIn(PipeNetwork.AXIS1, MLFI_FIRST, MLFI_RISING_EDGE)
    • This function call is necessary at least one time, even if the Trigger pipe block is configured properly
  4. MLTrigIsTrigged(PipeNetwork.TRIGGER1)
    • This function returns TRUE if the Fast Input associated to the Trigger pipe block given as argument has been triggered
  5. MLTrigReadPos(PipeNetwork.TRIGGER1)
    • This function returns the position of the Pipe Network at the time that the Fast Input associated with the Trigger pipe block was issued



    • You have to correct the position by taking into account the delay due to the number of cycles needed to read the timestamp of the Fast Input. You can use MLTrigWriteDelay to address this issue.

  6. MLTrigReadTime(PipeNetwork.TRIGGER1)
    • This function returns the time associated with the Fast Input as explained in Interpret a Timestamp.
      Note that this function is of lesser importance compared to the previous one.
  7. MLTrigClearFlag(PipeNetwork.TRIGGER1)
    • This function rearms the Trigger pipe block
  8. MLAxisRstFastIn(PipeNetwork.AXIS1, MLFI_FIRST)
    • This function rearms the Axis pipe block

After the Trigger block pipe position is determined and calculations are made in the Registration programClosed The act of performing a sequence of instructions or commands., a corrective move is typically done using a Cam Pipe Network block for precision motion controlClosed Motion control is a sub-field of automation, in which the position and/or velocity of machines are controlled using some type of device such as a hydraulic pump, linear actuator, or an electric motor, generally a servo. Motion control is an important part of robotics and CNC machine tools. However, it is more complex than in the use of specialized machines, where the kinematics are usually simpler. The latter is often called General Motion Control (GMC). Motion control is widely used in the packaging, printing, textile, and assembly industries.