This use case explains how to use the motion library functions of the axes when you want to detect the positive edge of the first 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 in the drive, and read its associated timestampA timestamp is a sequence of characters, denoting the date and/or time at which a certain event occurred. MLAxisIsTrigged can be used to accurately perform a homing procedure in a user-defined procedure.
A Setup sequence example.
Since tMLFI_FIRST and MLFI_SECOND correspond to the physical Fast InputsThe 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 1 and 2. Therefore the drive must be configured in order to link 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 1 with engine 0, and fast input 2 with engine 1.
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 sensorA sensor is 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 HomingThe Homing procedure allows, based on a position measurement, to set a position offset to the motor in order to ensure it is physically at the home position based on the drive's high speed capture mechanism is also supported by the following Kollmorgen KUDFBs in the IDE"Integrated development environment" An integrated development environment is a 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 BlockA function block groups an algorithm and a set of private data. It has inputs and outputs. Library: MLFB_HomeFindHomeFastInput, MLFB_HomeFindHomeFastInputModulo, , 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;
|
Copyright © 2015 Kollmorgen™ |
|