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.
🔹 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
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.
🔹 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.
(2) PositiveLimitSwitch LeftIndex
(3) PositiveHome LeftIndex
(4) PositiveHome RightIndex
(5) NegativeHome RightIndex
(6) NegativeHome LeftIndex
(7) RisingHome LeftIndex PositiveStart
(8) RisingHome RightIndex PositiveStart
(9) FallingHome LeftIndex PositiveStart
(10) FallingHome RightIndex PositiveStart
(11) FallingHome RightIndex NegativeStart
(12) FallingHome LeftIndex NegativeStart
(13) RisingHome RightIndex NegativeStart
(14) RisingHome LeftIndex NegativeStart
(17) NegativeLimitSwitch
(18) PositiveLimitSwitch
(19) PositiveHome NegativeMomentum
(20)PositiveHome PositiveMomentum
(21) NegativeHome PositiveMomentum
(22) NegativeHome NegativeMomentum
(23) RisingHome NegativeMomentum PositiveStart
(24) RisingHome PositiveMomentum PositiveStart
(25) FallingHome NegativeMomentum PositiveStart
(26) FallingHome PositiveMomentum PositiveStart
(27) FallingHome PositiveMomentum NegativeStart
(28) FallingHome NegativeMomentum NegativeStart
(29) RisingHome PositiveMomentum NegativeStart
(30) RisingHome NegativeMomentum NegativeStart
(33) Negative Index
(34) Positive Index
(35) Current Position
(36) Negative Hard Stop
(37) Positive Hard Stop
📜 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.");
}