Referencing Configuration

From Wiki

Axes generally need to be referenced so that the robot control knows the correct positions. All standard robot axes come pre-configured but external axes do not since the customer's use is not known at the factory. This article guides you through the configuration of stepper axes.

Note that most of the referencing configuration is done in the firmware parameters that are saved on the axis modules and therefore are kept on updates and factory resets. The referencing sequence and delays is configured in the project configuration. Unless stated otherwise the following sections refer to the firmware parameters.

Important: Keep the emergency stop ready when testing, the axis may move in unexpected ways.

Referencing Indicator LED

The yellow referencing LED at each axis module is useful for understanding referencing issues. Depending on the referencing type it lights up when the referencing switch or the encoder pulse is triggered.

If you are using a referencing switch: Move the axis at the switch or hold a metal object (e.g. a screwdriver) at the sensor. The LED should light up. When you move the axis away the LED should turn off. If this is inverted you need to change parameter EndSwitchRising from True to False or the other way. If nothing happens either the referencing type is set wrong in the amp configuration or the switch is defective/not connected.

If you are using the encoder pulse without a referencing switch: The LED should shortly turn on once per rotation of the motor. If it is inverted change parameter EndSwitchRising. If there is no pulse the encoder may be defective or there may be an issue in the wiring.


Referencing Types

Referencing can be distinguished by the following types:

  • Referencing by a switch or sensor - all axis types, needs a referencing switch/sensor
  • Referencing by the encoder pulse - rotational axes that can turn infinitely
  • Referencing at the current position (set-to-zero) - rotational axes or conveyor belts that can turn infinitely and do not need a specific orientation.
  • Referencing at the current position by an absolute encoder - e.g. Rebel joints, not supported by stepper modules.

The following sections explain how to configure these modes.

Referencing using a switch

Most axes reference using a switch or sensor. In this mode the axis moves towards the switch, then a short distance back and slowly at the switch again.

To reference using a referencing switch set UseIndexAsRef to False. You may set UseIniAndIndexAsRef to True for extra precision, the axis will then first find the referencing switch and the encoder pulse after. If your motor has no index pulse of if it is defective set UseIniAndIndexAsRef to False.

Next check the yellow referencing indicator LED as explained in the section above. If its signal is inverted change EndSwitchRising (True/False).

Continue with section Referencing Motion.

Referencing using the encoder pulse

To reference using the encoder pulse without a referencing switch set UseIndexAsRef to True and UseIniAndIndexAsRef to False.

Next check the yellow referencing indicator LED as explained in the section above. If its signal is inverted change EndSwitchRising (True/False).

Continue with section Referencing Motion.

Referencing at the current position

In this mode the axis does not move, instead it simply sets the current position as 0.

To use this mode set RefStraight, RefSinus and RefHalf to False.


Referencing Motion

Depending on the axis type you will need to choose the correct referencing mode:

  • RefStraight: The axis will move in a defined direction until it finds the referencing switch or encoder pulse. This is for linear axes and rotational axes that can turn infinitely (i.e. will not wind up wires).
  • RefSinus: The axis will move back and forth multiple times with increasing angles until it finds the referencing switch or pulse. This is intended for rotational axes.
  • RefHalf: This is for rotational axes with a half disc that trigger the referencing switch at half of the motion range. The state of the switch tells in what direction to move to find the switch. This behavior prevents winding up.

Set only one of these modes to True and read the following sections on how to configure them.

RefStraight

No configuration needed. Set the referencing speed as explained in the section below.

RefSinus

Parameter SinusRefTics defines the number of encoder ticks to increase the referencing motion by each cycle (a whole rotation is 2000 ticks). SinusRefMaxCycles defines the maximum number of cycles before giving up.

Next set the referencing speed as explained in the section below.

RefHalf

No configuration needed. Set the referencing speed as explained in the section below.


Referencing Speed and Motion Direction

During referencing the axis first moves towards the referencing switch. This speed is defined by parameter RefSpeed. Then it backs off and slowly moves back to the switch for more precision. This second speed is defined by RefSpeedSlow.

The speed has no defined unit, you will need to try what works for your axis.

To change the motion direction negate both values (add/remove the minus sign).

Note: The value -1 is not allowed since the controller will reset it to the default value. Use -2 instead.


Referencing Offset

To precisely adjust the 0 position you can set the referencing offset. This is the position (in encoder ticks) that the axis is set to after referencing, normally 0.

Move the axis to the position that should be 0, then read the position from iRC and multiply it with the Gear Scale. Set parameter Offset to the negative of this value.


Referencing Sequence and Delay

To prevent collisions you may want to change the order in which axes are referenced or delay axes. This is explained in Referencing sequence.