Fast Homing Example with the Pipe Network Motion Engine Axis Pipe Block

This use case explains how to use the 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. of the axes when you want to detect the positiveClosed 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. edge of the first 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. in the 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., and read its associated timestampClosed A sequence of characters, denoting the date and/or time at which a certain event occurred.. MLAxisIsTrigged can be used to accurately perform a homingClosed The homing procedure allows, based on a position measurement, to set a position offset to the motor to ensure it is physically at the home position. procedure in a user-defined procedure.

A Setup sequence example.

  1. MLAxisCfgFastIn(PipeNetwork.AXIS1, MLFI_FIRST, MLFI_RISING EDGEClosed The transition of a digital signal from low to high. AKA: positive edge.)
    • Configure Fast Input 0 of AXIS1 to be triggered on the positive edge.

      • Since tMLFI_FIRST and MLFI_SECOND correspond to the physical Fast Inputs 1 and 2. Therefore the drive must be configured in order to link fast input 1 with engine 0, and fast input 2 with engine 1.

    • The first argument indicates the Axis pipe block in the Pipe Network that represents the drive to be configured
    • The second argument identifies which of the two Fast Inputs of the drive is configured (can be 0 or 1)
    • The third argument can indicate detection of positive edge when set to 1 and detection of negative edge when set to 2
      Note that if set to 0, Fast Input is disabledClosed Removal of the ENABLE signal. Disables power stage.
  2. MLAxisIsTrigged(PipeNetwork.AXIS1, 0, 1)
    • This function returns true if Fast Input 0 of AXIS1 has been triggered on the positive edge.
    • The meaning of the arguments is the same as in MLAxisCfgFastIn
  3. MLAxisTimeStamp(PipeNetwork.AXIS1, 0, 1)
    • This function returns the time in microseconds when the Fast Input was triggered on the positive edge
      This time is relative to the start of the drive cycle time and its value is explained in the section Interpret a Timestamp.
    • The meaning of the arguments is the same as in MLAxisCfgFastIn
  4. MLAxisRstFastIn(PipeNetwork.AXIS1, MLFI_FIRST)
    • This function resetsClosed New start of the microprocessor. the Fast Input 0 of AXIS1. The reset keeps the configuration of the Fast Input, but it rearms it so it can be triggered again
    • The meaning of the first two arguments is the same as in MLAxisCfgFastIn
  5. Follow-up Motion

The following is typical code used in a homing procedure.

CASE StepCounter OF

0:

MLAxisRstFastIn(PipeNetwork.Feeder,MLFI_FIRST);

MLAxisMoveVel(PipeNetwork.Feeder,250.0); //Jog Feeder Axis to search for sensorClosed A type of transducer that converts one type of energy into another for various purposes including measurement or information transfer. input

StepCounter := 1;

1:

IF MLAxisIsTrigged(PipeNetwork.Feeder,MLFI_FIRST,MLFI_RISING_EDGE) THEN MLAxisAbs(PipeNetwork.Feeder,MLAxisCmdPos(PipeNetwork.Feeder)); //Stop motion when sensor is reached
StepCounter := 2;
END_IF;

2:

IF MLAxisGenIsRdy(PipeNetwork.Feeder) THEN MLAxisWritePos(PipeNetwork.Feeder,0); //Set Feeder Axis position to zero
StepCounter := 3;
END_IF;

Fast Homing based on the drive's high speedClosed Speed is the absolute value of the velocity without direction. capture mechanism is also supported by the following Kollmorgen KUDFBs in the IDEClosed Integrated Development Environment - An type of computer software that assists computer programmers in developing software. IDEs normally consist of a source code editor, a compiler and/or interpreter, build-automation tools, and a debugger. Function BlockClosed A function block groups an algorithm and a set of private data. It has inputs and outputs. Library: MLFB_HomeFindHomeFastInput, MLFB_HomeFindHomeFastInputModulo, MLFB_HomeFindLimitFastInput, and MLFB_HomeFindLimitFastInputModulo.

The Axis Position can also be derived from the Time Stamp by with the following code:

TimeStamp := any_to_lreal(MLAxisTimeStamp( iAxisID, any_to_dint(ibFastInputNumber), 1+any_to_dint(ibHomeSwitchMode) ))/1000000;
CalculatedTriggerPosition := (CurrentVelocity-PreviousVelocity)/2/iCycleTime*TimeStamp*TimeStamp+PreviousVelocity*TimeStamp+PreviousPosition;