Fast Homing Example with the PLCopen Motion Engine

This example shows how to use the axes' 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. 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 position. MC_TouchProbe and the Trig_Ref library function are 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.

  1. Set up an instance of the TrigRef function in the Dictionary. For this example, the name A1_TrigRef is used.
  2. Define the TrigRef values.
    A1_TrigRef.InputID := 0;    // configure Drive Capture Engine Used
    A1_TrigRef.TrigID := 0;     // configure which Drive to capture an input
    A1_TrigRef.DirectionClosed The orientation components of a vector in space. := 1;  // configure Signal transition Direction of capture
    A1_TrigRef.TrigMode := 1;   // configure Time or Position Capture
  3. Activate the TouchProbe function
    Inst_MC_TouchProbe( True, AxisID, A1_TrigRef, FALSE, 0, 0 );

  • The position capture can be time-based ( A1_TrigRef.TrigMode := 0 ) or position-based ( A1_TrigRef.TrigMode := 1 ).