How to manually execute a homing movement using the registers

How to manually execute a homing movement using the registers

In this How-to guide, we will explain how to execute a homing movement by directly changing the register values, instead of using MotionLab or the dedicated macros for motion. 

We will consider any homing procedure. 

Changing registers can be done in motion lab, by using macros, or externally by using for example CAN-communication. This HowTo just focusses on the sequence of commands that need to be done for a movement. 

Changing directly the register values is only recommended for advanced users.

Background reading

  • All the documentation about relevant motion registers can be found in the EMCL documentation: Motion objects
  • The register values are always in counts: position is counts, velocity counts/sec etc. The conversions depend on the resolution, maximum stroke of a motor etc. In general, how to convert units can be found here: EMCL Units
  • A step by step guide explaining how to set up serial commanding: Serial commanding
  • Explanation of homing mode: Homing mode

Prepare movement

First, the movement should be prepared, meaning all the relevant parameters should be set:

Execute the movement

Starting the movement

Now that all the parameters are set correctly, we can start the movement by changing the controlword (register 0x6040). For more information about the control word, see 'Controlword in homing mode' explanation: Homing mode
Most important steps here are:
  • Set the driver status to Ready to Switch On -> controlword value to 6
  • Set the driver status to Switch On -> controlword value to 7
  • Set the driver status to Operation Enable -> controlword value to 15
  • Start the homing process -> controlword value to 31

During the movement

Once the homing process has started, there are 3 bits of the statusword whose value is important, see 'Statusword in homing mode' explanation: Homing mode
  • Bit 10 -> Target reached
  • Bit 12 -> Homing attained
  • Bit 13 -> Homing error
When the homing process ends, the sequence of bits 13-12-10 has 0-1-1 as values.

Serial code example

Homing procedures are many and here we present the steps to be done to be able to manually do a homing on the negative mechanical limit (with some made up values):

  • Set Modes of Operation to Homing:
    Write in modes of operation (0x6060) a value of 6
  • Set the driver status to Ready to Switch On:
    Write in the controlword (0x6040) a shutdown command (value 6)
  • Set the driver status to Switch On:
    Write in the controlword (0x6040) a switch on command (value 7)
  • Set the driver status to Operation Enable:
    Write in the controlword (0x6040) a switch on command (value 15)
  • Set the homing method to negative mechanical limit and index pulse:
    Write in homing method (0x6098) a value of -3
  • Set the homing speeds:
    Write the speed for the mechanical limit (0x6099, subindex 0x01) a value of 20000
  • Set the homing acceleration:
    Write the homing acceleration (0x609A), a value of 40000
  • Set the homing offset:
    Write the homing offset (0x607C), a value of 0
  • Set the homing timeout
    Write the homing timeout (0x2102, subindex 0x01) a value of 8000
  • Set the torque threshold
    Write the torque threshold (0x2102, subindex 0x02) a value of 100
  • Start the homing process
    Write in the controlword (0x6040) a homing start operation command (value 31)

In code: 
w 0x6060 6
w 0x6040 6
w 0x6040 7
w 0x6040 15
w 0x6098 -3
w 0x6099 20000
w 0x609A 40000
w 0x607C 0
w 0x012102 8000
w 0x022102 100
w 0x6040 31