Homing modes
Overview
Axes without an absolute encoder can use the homing function to restore the position to a previously defined location.
Homing methods
SOMANET supports the following methods as defined in CiA 402 profile specification (IEC61800-7-201:2015):
| Method Number | Description |
|---|---|
| 1 | Homing on a negative limit switch and index pulse |
| 2 | Homing on a positive limit switch and index pulse |
| 3 | Homing on a positive home switch inactive and index pulse |
| 4 | Homing on a positive home switch active and index pulse |
| 5 | Homing on a negative home switch inactive and index pulse |
| 6 | Homing on a negative home switch active and index pulse |
| 7 | Homing on a home switch (inactive) and index pulse with positive initial direction. Reverse if positive limit switch is hit |
| 8 | Homing on a home switch (active) and index pulse with positive initial direction. Reverse if positive limit switch is hit |
| 9 | Homing on an opposite home switch (active) and index pulse with positive initial direction. Reverse if positive limit switch is hit |
| 10 | Homing on an opposite home switch (inactive) and index pulse with positive initial direction. Reverse if positive limit switch is hit |
| 11 | Homing on a home switch (inactive) and index pulse with negative initial direction. Reverse if negative limit switch is hit |
| 12 | Homing on a home switch (active) and index pulse with negative initial direction. Reverse if negative limit switch is hit |
| 13 | Homing on an opposite home switch (active) and index pulse with negative initial direction. Reverse if negative limit switch is hit |
| 14 | Homing on an opposite home switch (inactive) and index pulse with negative initial direction. Reverse if negative limit switch is hit |
| 33 | Homing on an index pulse with negative initial direction |
| 34 | Homing on an index pulse with positive initial direction |
| 35/37 (identical) | Homing on the current position |
There are also some manufacturer specific homing modes implemented:
| Method Number | Description |
|---|---|
| -1 | Homing on Negative End stop and Index Pulse. |
| -2 | Homing on Positive End stop and Index Pulse. |
| -3 & -4 | Similar to methods -1 and -2, but instead of Homing on Index pulse, homing is done at an offset from end stop. |
Homing methods 1-14 (Homing on limit switches)
In all switch based homing methods the axis moves to search the switch (Home Switch or Limit Switch).
The following images represent the direction of movement and the starting position of each homing method.
The respective method is indicated by the encircled number.
Homing Method 1 : Homing on a Negative Limit Switch and Index Pulse
-
The initial direction of movement shall be leftward if the negative limit switch is inactive.
-
The home position is the first index to the right when the negative limit switch changes state.
Homing Method 2 : Homing on a Positive Limit Switch and Index Pulse
-
The initial direction of movement shall be rightward if the positive limit switch is inactive.
-
The home position is the first index to the left when the positive limit switch changes state.
Homing Method 3,4 : Homing on a Positive Home Switch and Index Pulse
-
The initial direction of movement is dependent on the state of the home switch: leftward if positive home switch active and rightward if it’s inactive.
-
Method 3: the home position is the first index to the left when the positive home switch changes state (home switch inactive).
-
Method 4: the home position is the first index to the right when the positive home switch changes state (home switch active).
Homing Method 5,6 : Homing on a Negative Home Switch and Index Pulse
-
The initial direction of movement is dependent on the state of the home switch: leftward if negative home switch inactive and rightward if it’s active.
-
Method 5: the home position is the first index to the right when the negative home switch changes state (home switch inactive).
-
Method 6: the home position is the first index to the left when the negative home switch changes state (home switch active).
Homing Method 7 to 10 : Homing on a Home Switch and Index Pulse , Positive Limit Switch Required to revert direction
-
The initial direction of the movement is rightward except if home switch is initially active.
-
If the home switch is initially active then the direction of movement depends on the homing method.
-
The direction will be reversed when encountering the positive limit switch.
Homing Method 11 to 14 : Homing on a Home Switch and Index Pulse , Negative Limit Switch Required to revert direction
-
The initial direction of the movement is leftward except if home switch is initially active.
-
The direction will be reversed when encountering the negative limit switch.
-
If the home switch is initially active then the direction of movement depends on the homing method.
Homing method 33/34 (move to next or previous single-turn position or “index pulse”)
-
Methods 33 and 34 can be used to center on the sensor’s reference position (in positive or negative direction).
-
The shaft will rotate less than one rotation.
Homing method 35/37 (zero the current position)
-
Methods 35 and 37 are used to define the current position as home position.
Note: Homing method 35/37 can be performed in any operational state. All other homing methods require the drive to be in “operation enabled” state.
Use case:Homing on current position while operation is not enabled
If the axis is moved to a desired homing position by external force (for example manually), Homing Mode 35/37 can be used to determine the current position as home.
Use case:Relative position command
The current position can be taken as the reference point.
Use case:Homing on current position
When the motor is moved to the desired position in CSP the position can be taken as homing position.
Note: Homing method 35/37 can be performed in any state, as the motor is not controlled there. All other homing methods require the drive to be in “operation enabled” state.
Homing method -1,-2,-3 and -4 (Homing on mechanical endstop)
Methods -1,-2,-3 and -4 homes the axis near (or at) the mechanical end stop. For all these methods, first a holding torque is determined in the beginning of the homing routine. To calculate the holding torque, the drive holds the position of the axis for a duration of 500 ms just after the homing start-bit in controlword is set and the holding torque is determined by saving the torque demand value at the end of this time.
Method -1 moves the motor in the negative direction with velocity value defined in (0x6099:1). End stop is detected when
abs(demand_torque - holding_torque) >= torque threshold
The value of the torque threshold is defined in 0x2005:03. Upon detection of Mechanical endstop axis moves to the index pulse location in opposite direction with.the speed specified in object (0x6099:2). Axis is then homed at the index pulse.
Method -2 is similar to method -1, It just moves the axis in a positive direction towards the positive end stop and then home at the index pulse just before the endstop.
Methods -3 and -4 are similar to methods -1 and -2 respectively, but they work without index pulse. So upon detection of the Endstop, axis moves in the opposite direction by the offset position specified in 0x2005:04 and homes there. If value of 0x2005:04 is zero, then axis homes at the end stop.
Settings for homing mode
State for homing modes
All homing methods except for methods 35/37 require the drive to be in the “operation enabled” state. After the home position is found, the position controller stays active, holding the motor at that position (except for method 35/37).
Homing method
You can select the desired homing method in object 0x6098: Homing Method.
|
Mode |
Description |
|---|---|
| -3 & -4 | Similar to methods -1 and -2, but instead of Homing on Index pulse. Homing occurs at an offset from end stop. |
| -2 | Homing on Positive End stop and Index Pulse. |
| -1 | Homing on Negative End stop and Index Pulse. |
|
0 |
No homing method assigned (Default) |
|
1 |
Homing on negative limit switch and index pulse |
|
2 |
Homing on positive limit switch and index pulse |
|
3,4 |
Homing on positive home switch and index pulse |
|
5,6 |
Homing on negative home switch and index pulse |
|
7 to 14 |
Homing on the home switch with an index pulse |
|
17, 18 |
Similar to method 1 & 2, but without index pulse. Homing is done at switch transition |
|
19 to 22 |
Similar to methods 3 to 6, but without index pulse. Homing is done at switch transition |
|
23 to 30 |
Similar to method 7 to 14, but without index pulse. Homing is done at switch transition |
|
33 |
Homing on negative index pulse |
|
34 |
Homing on positive index pulse |
|
35 |
Homing on current position. (deprecated, please use method 37) |
|
37 |
Homing on current position. (identical with method 35) |
Homing speeds
Two homing speeds must be selected in object 0x6099: Homing Speed: in a typical cycle, the faster speed is used to find the home switch and the slower speed is used to find the index pulse.
Note: Homing speeds are not required in method 35/37.
Homing acceleration
In object 0x609A: Homing Acceleration a value for acceleration during homing must be defined.
Note: An acceleration is not needed in method 35/37.
Setting digital I/Os for Homing
Object 0x2210 (GPIO Pin configuration) is used to configure the digital inputs for homing and limit switches. Switches can be configured in both active high and active low configuration. But only one GPIO can be assigned to one switch whether active high or active low. For example If Pin 3 is configured as Active High Limit Switch, then configuring any other pin as Limit Switch Active High or Active Low will raise the error IvldGpio (Invalid GPIO error) in the error report object.
Further details about configuring digital I/Os can be found in Digital GPIO
Object 0x60FD (Digital inputs) reports the state of the digital inputs which can be configured for limit switches, interlock, etc.
How to perform homing
The following diagram shows the steps that are necessary to perform the homing function.
After the home position is found, the position controller stays active, holding the motor at that position (except for method 35/37).
Using the Halt bit
The halt bit (bit 8 of the Controlword 0x6040 can be used to stop the drive without disabling the controller:
-
Set the halt bit to 1 to stop the motion.
-
When the halt bit is reset to 0, the bit 4 becomes enabled. If bit 4 is set to 1, motion resumes.
Status of the homing process
Bits 10, 12, 13 of the Statusword 0x6041 are used to indicate the current state of the homing process:
-
Bit 10: Target reached
-
Bit 12: Homing attained
-
Bit 13: Homing error
|
Bit 13 |
Bit 12 |
Bit 10 |
Status |
|---|---|---|---|
|
0 |
0 |
0 |
Homing is performed |
|
0 |
0 |
1 |
Homing is interrupted or not started |
|
0 |
1 |
0 |
Homing confirmed, but target not yet reached |
|
0 |
1 |
1 |
Homing completed |
|
1 |
0 |
0 |
Error detected, motor still turning |
|
1 |
0 |
1 |
Error during homing, motor at standstill |
Hitting a limit switch in homing mode
Homing modes are meant to be used with homing switches whereas limit switches are considered as physical end points.
When a limit switch is activated in a homing mode other than method 1-14 (which rely on limit switches), this is considered a fault and the drive transitions to “Drive disabled” state.
Operation Mode dependent Bits of Status- and Controlword
Controlword
Homing mode uses some bits of the controlword for mode specific purposes which are indicated in yellow. The figure shows the structure of the controlword. For the general structure and usage, see Application note on Status- and Controlword.
| 15-9 | 8 | 7-5 | 4 | 3-0 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| N/A | Halt | N/A | Homing operation start | basic | |||||||||||
-
Halt: If halt is triggered (Bit 8 of control word is set as 1) during homing, independent of the step the homing routine is in, Axis begins to ramp down to go to zero velocity. The axis stays at zero velocity as long as the halt remains active. When the halt bit is lifted, the homing routine is resumed from the same step it was in before halt.
-
Homing operation start: set the homing operation start bit to 1 to start the homing procedure.
Statusword
The mode specific bits of the statusword can be used to monitor the performance of the operation. For further information, please refer to the section on Control Supervision.
| 15-14 | 13 | 12 | 11 | 10 | 9-8 | 7-0 | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| N/A | Homing error | Homing attained | Internal limit active | Target reached | N/A | basic | |||||||||
Parameters
| Object ID | Name | Description |
|---|---|---|
| 0x6098 | Homing Method | Specifies the homing method that shall be used |
| 0x607C | Home Offset | Offset from user’s zero position to the home position |
| 0x6099 | Homing Speeds | Speed with which to move during homing |
| 0x609A | Homing Acceleration | Acceleration used during homing |
| 0x6040 | Controlword | Set bit 8 to 0 and bit 4 to 1 to start homing |
| 0x6041 | Statusword | Indicates the current state of the homing process |
| 0x60FD | Digital inputs | Indicates the current state of the digital inputs |
| 0x2210 | GPIO Pin configuration | Configures the digital inputs for homing and limit switches |
| 0x2005 | Homing | Options configures different options for homing modes |
Note: Switches can be configured in both active high and active low configuration. But only one GPIO can be assigned to one switch, whether active high or active low. For example, if Pin 3 is configured as Active High Limit Switch, then configuring any other pin as Limit Switch Active High or Active Low will raise IvldGpio (Invalid GPIO error).