AKD Drive-based ASCII homing uses preloaded methods available on the drive. This allows for homing to be performed entirely in the drive without network latencies producing more accurate results. Drive homing is the recommended homing strategy.
DRV.OPMODE 2 - Set the drive to Position Operation Mode.
HOME.AUTOMOVE 0 - Make sure that automove is disabled. Unless you would like to trigger homing when amp/axis gets enabled.
Now, since we are running CANopen DS402 or EtherCAT, it is required that we set object/index 0x6060 through CAN/EtherCAT communication.
Index 0x6060 represents Mode of Operation. When homing we must specify the homing mode, and when homing is done we must go back to default mode.
We change the mode by writing to the SDO.
modeOfOpIndex = 0x6060; // Mode of Operation (DS402 Standard)modeOfOpSubindex = 0x0; // SubindexmodeOfOpByteSize = 1; // INTEGER8 (1 byte)modeOfOpValueToHOME = 6; // Hex value to determine Mode (6 = Homing mode)Axis.NetworkNode.ServiceChannelWrite(modeOfOpIndex, modeOfOpSubindex, modeOfOpByteSize, modeOfOpValueToHOME);
*** If you are not using limit switches skip this section.
In this example we are using: Homing Method 1: Find Limit Input.
The ‘Find Limit Input’ method creates a move to a limit input. This method can be used if you have a positive or negative limit switch available that you want to establish as a home reference point.
AKD Digital Input Parameters:
DIN5.MODE 18 // Sets the digital input modes. - DI5 is now our Positive Limit Switch.DIN5.INV 1 // Sets the indicated polarity of a digital input mode. - DI5 is now active when Low.DIN6.MODE 19 // Sets the digital input modes. - DI6 is now our Negative Limit Switch.DIN6.INV 1 // Sets the indicated polarity of a digital input mode. - DI6 is now active when Low.
Check the Kollmorgen AKD User Guide (www.kollmorgen.com) to learn about the different Homing methods.
RMP position units from the AKD will be in counts. For rotary motors, the counts per revolution will be defined by the AKD parameter FB1.PSCALE (primary feedback position scale). The default value is 20, which yields 2^20 counts/revolution.
AKD Homing parameters will be in AKD drive units and are different for rotary and linear motors. Units depend on UNIT.VROTARY or UNIT.VLINEAR which can be:
Rotary: rpm, rps, deg/s, Custom Units/s, rad/s
Linear: counts/s, mm/s, µm/s, Custom Units/s
Similarly, check or confirm UNIT.ACCROTARY and UNIT.ACCLINEAR are set as expected.
AKD Home Parameters:
HOME.MODE // Selects the homing method.HOME.V // Sets homing velocity.HOME.ACC // Sets homing acceleration.HOME.DEC // Sets homing deceleration.HOME.DIR // Sets homing direction. (0 = negative | 1 = positive)HOME.P // Sets home position.HOME.DIST // Sets homing distance.HOME.MAXDIST // Sets the maximum distance the motor is allowed to move during the homing routine. (Disabled when value = 0)HOME.IPEAK // Sets the current limit during homing procedure to a mechanical stop. Or use default.
Check the Kollmorgen AKD User Guide (visit www.kollmorgen.com) for all other Home parameters.
Abort() - Disable the Axis.
ClearFaults() - Clear any Faults.
AmpEnableSet(true) - Enable the axis to trigger the home start.
HOME.MOVE // Command to start homing
You can monitor the Status Word to determine if/when homing is complete:
Status Word - bit 12 = 1(HIGH), if Homing was attained.
Status Word - bit 13 = 1(HIGH), if there was a Homing error.
If the drive homed properly, it will have set the RMP Actual Position to zero.
Abort() - This will disable the Axis and it will automatically set Command Position equal to the Actual Position. This is a required step before changing the control mode and enabling the Axis.
Restore the mode of operation to the control mode you want to run in. (Only do this when Axis is DISABLED.)
modeOfOpIndex = 0x6060 // Mode of Operation (DS402 Standard)modeOfOpSubindex = 0x0 // SubindexmodeOfOpByteSize = 1 // INTEGER8 (1 byte)modeOfOpValueToDEFAULT = 7 // Hex value to determine Mode (7 = Interpolated position)Axis.NetworkNode.ServiceChannelWrite(modeOfOpIndex, modeOfOpSubindex, modeOfOpByteSize, modeOfOpValueToDEFAULT);
HOME.MODE 0: Home Using Current Position.
HOME.MODE 1: Find limit input.
HOME.MODE 2: Find input limit then find zero angle.
HOME.MODE 3: Find input limit then find index.
HOME.MODE 4: Find home input.
HOME.MODE 5: Find home input then find zero angle.
HOME.MODE 6: Find home input then find index.
HOME.MODE 7: Find zero angle.
HOME.MODE 8: Move until position error exceeded.
HOME.MODE 9: Move until position error exceeded, then find zero angle.
HOME.MODE 10: Move until position error exceeded, then find index.
HOME.MODE 11: Find index signal.
HOME.MODE 12: Home to home-switch, including mechanical stop detection.
HOME.MODE 13: Home to feedback position.
HOME.MODE 14: Home to home-switch for rotary applications.
HOME.MODE 15: Find next feedback zero position.
HOME.MODE 16: Find home input with dual edges.
HOME.MODE 17: Absolute Mode - Calculate and save offset.
HOME.MODE 18: Find home input, then find next feedback zero position.