Implement drive-based homing with DS402-compliant drives, utilizing built-in homing methods, ensuring accurate and network latency-free positioning, easily configured via our API or tools.
🔹 What is DS402 Drive Based Homing?
Drive-based homing uses preloaded methods available on your drive. This allows for homing to be performed entirely in the drive without network latencies producing more accurate results. Drive-based homing is the recommended homing strategy.
DS402 is a set of profile specifications that standardize the functional behavior of controllers for servo drives, frequency inverters, and stepper motors.
- Note
- It is important to follow your drive’s specific instructions on how to home. Most drive’s include documentation on homing procedures, limit switch configuration, etc.
🔹 DS402 Drive Based Homing with RapidCode
The following figure shows the relationship between the input objects and the output objects in the Homing Mode. You can specify the speeds, acceleration rate, and homing method. You can also use home offset to offset zero in the user coordinate system from the home position.
![Image](https://support.roboticsys.com/assets/0 (10).png)
🔹 STEPS
Configure
Using the NetworkNode.ServiceChannelWrite(index, subindex, byteSize, value) method from the Axis class, you can configure the following options:
Home Offset – Optional as it is normally zero.
| |
Index | 0x607C |
Subindex | 0x0 |
byteSize | 4 |
Home Method
| |
Index | 0x6098 |
Subindex | 0x0 |
byteSize | 1 |
Home Speed (when searching switch)
| |
Index | 0x6099 |
Subindex | 0x1 |
byteSize | 4 |
Home Speed (when searching zero)
| |
Index | 0x6099 |
Subindex | 0x2 |
byteSize | 4 |
Home Acceleration
| |
Index | 0x609A |
Subindex | 0x0 |
byteSize | 4 |
Change Mode of Operation to 6 - Homing Mode
| |
Index | 0x6060 |
Subindex | 0x0 |
byteSize | 1 |
Value | 6 |
Ready Axis
Axis.Abort();
Axis.ClearFaults();
Axis.AmpEnableSer(true);
MotionController.NetworkOutputOverrideSet(..);
Ensure people and objects are clear of motion.
Home
Start Homing by setting bit 4 of the Control Word to 1. (Control Word from 15 -> 31).
MotionController.NetworkOutputValueSet(..);
Evaluate Homing Success
You can monitor the Status Word to determine if/when homing is complete
Status Word bit 10 = 1(HIGH), if Homing is Complete..
Status Word bit 12 = 1(HIGH), if Homing Target was attained.
Status Word bit 13 = 1(HIGH), if there was a Homing error.
Clean Up
Axis.AmpEnableSer(false);
Axis.ClearFaults();
MotionController.NetworkOutputOverrideSet(..);
Restore the mode of operation to the control mode you want to run in.
modeOfOpIndex = 0x6060
modeOfOpSubindex = 0x0
modeOfOpByteSize = 1
modeOfOpValueToDEFAULT = 8
ServiceChannelWrite(modeOfOpIndex, modeOfOpSubindex, modeOfOpByteSize, modeOfOpValueToDEFAULT);
🔹 Drive Based DS402 Homing with RapidSetup
RapidSetup also allows you to home your DS402 EtherCAT Drive.
New RapidSetup
![Image](https://support.roboticsys.com/assets/2 (8).png)
Home Method: A combobox which lists the DS402 Home Methods. Not all methods may be supported by a drive.
Speed to Switch: The initial speed used to find the Home Switch.
Speed to Zero: The second speed used to find the Index or Edge.
Acceleration: Acceleration used during Homing.
Home Offset: Any post Discovery Offset which you’d like used in the process.
- Units are in Drive Units rather than User Units.
Old RapidSetup
Value: 2 - Homing with the positive limit switch and index pulse.
![Old RapidSetup](https://support.roboticsys.com/assets/1.png)
🔹 Drive Based DS402 Homing Methods
- Warning
- Drive Based Homing uses functions defined in firmware by the drive manufacturer. Below are diagrams of the DS402 standard but exact implementation by the manufacturer may differ.
![Old RapidSetup](https://support.roboticsys.com/assets/Key.png)
(2) PositiveLimitSwitch LeftIndex
![Image](https://support.roboticsys.com/assets/DS402Actual 1-2.png)
(3) PositiveHome LeftIndex
(4) PositiveHome RightIndex
![Image](https://support.roboticsys.com/assets/DS402Actual 3-4.png)
(5) NegativeHome RightIndex
(6) NegativeHome LeftIndex
![Image](https://support.roboticsys.com/assets/DS402Actual 5-6.png)
(7) RisingHome LeftIndex PositiveStart
(8) RisingHome RightIndex PositiveStart
![Image](https://support.roboticsys.com/assets/DS402Actual 7-8.png)
(9) FallingHome LeftIndex PositiveStart
(10) FallingHome RightIndex PositiveStart
![Image](https://support.roboticsys.com/assets/DS402Actual 9-10.png)
(11) FallingHome RightIndex NegativeStart
(12) FallingHome LeftIndex NegativeStart
![Image](https://support.roboticsys.com/assets/DS402Actual 11-12.png)
(13) RisingHome RightIndex NegativeStart
(14) RisingHome LeftIndex NegativeStart
![Image](https://support.roboticsys.com/assets/DS402Actual 13-14.png)
(17) NegativeLimitSwitch
(18) PositiveLimitSwitch
![Image](https://support.roboticsys.com/assets/DS402Actual 17-18.png)
(19) PositiveHome NegativeMomentum
(20)PositiveHome PositiveMomentum
![Image](https://support.roboticsys.com/assets/DS402Actual 19-20.png)
(21) NegativeHome PositiveMomentum
(22) NegativeHome NegativeMomentum
![Image](https://support.roboticsys.com/assets/DS402Actual 21-22.png)
(23) RisingHome NegativeMomentum PositiveStart
(24) RisingHome PositiveMomentum PositiveStart
![Image](https://support.roboticsys.com/assets/DS402Actual 23-24.png)
(25) FallingHome NegativeMomentum PositiveStart
(26) FallingHome PositiveMomentum PositiveStart
![Image](https://support.roboticsys.com/assets/DS402Actual 25-26.png)
(27) FallingHome PositiveMomentum NegativeStart
(28) FallingHome NegativeMomentum NegativeStart
![Image](https://support.roboticsys.com/assets/DS402Actual 27-28.png)
(29) RisingHome PositiveMomentum NegativeStart
(30) RisingHome NegativeMomentum NegativeStart
![Image](https://support.roboticsys.com/assets/DS402Actual 29-30.png)
(33) Negative Index
(34) Positive Index
![Image](https://support.roboticsys.com/assets/DS402Actual 33-34.png)
(35) Current Position
![Image](https://support.roboticsys.com/assets/DS402Actual 35.png)
(36) Negative Hard Stop
(37) Positive Hard Stop
![Image](https://support.roboticsys.com/assets/DS402Actual 36-37.png)
📜 Sample Code
- C#
const int AXIS_NUMBER = 0;
const int offsetIndex = 0x607C;
const int offsetSubindex = 0x0;
const int offsetByteSize = 4;
const int offsetValue = 0;
const int methodIndex = 0x6098;
const int methodSubindex = 0x0;
const int methodByteSize = 1;
const int methodValue = 24;
const int targetSpeedIndex = 0x6099;
const int targetSpeedSubindex = 0x1;
const int targetSpeedByteSize = 4;
const int targetSpeedValue = 2;
const int originSpeedIndex = 0x6099;
const int originSpeedSubindex = 0x2;
const int orignSpeedByteSize = 4;
const int originSpeedValue = 10;
const int accelerationIndex = 0x609A;
const int accelerationSubindex = 0x0;
const int accelerationByteSize = 4;
const int accelerationValue = 100;
const int CONTROL_WORD_TO_PREP_HOMING = 15;
const int CONTROL_WORD_TO_START_HOMING = 31;
const int ACCEPTABLE_DELAY_IN_MS = 20;
const int STATUS_WORD_TARGET_REACHED_BIT = 0x400;
const int STATUS_WORD_HOMING_ATTAINED_BIT = 0x1000;
const int STATUS_WORD_HOMING_ERROR_BIT = 0x2000;
UInt16 statusWordValue;
bool cancelHome = false;
while ((!cancelHome) && ((statusWordValue & STATUS_WORD_TARGET_REACHED_BIT) == 0))
{
}
if ((statusWordValue & STATUS_WORD_HOMING_ATTAINED_BIT) == STATUS_WORD_HOMING_ATTAINED_BIT)
{
Console.WriteLine("Axis homed.");
}
else if ((statusWordValue & STATUS_WORD_HOMING_ERROR_BIT) == STATUS_WORD_HOMING_ATTAINED_BIT)
{
Console.WriteLine("Error Occured during homing.");
}