The following describes the function of homing cycles and related Gcode. There seems to be no standard way to do homing, and machine variations complicate matters. TinyG's homing behaviors are adapted from Smid v3 and EMC2. TinyG supports a subset of EMC homing and does not cover all the cases EMC does (Note: if you are running a machine configuration that is not supported by TinyG's subset please let us know on the forum).
Return to Home can be carried out by using the G28 and G28.1 commands:
Some limitations / constraints in TinyG homing as currently implemented:
The following per-axis settings are used by homing. Substitute any of XYZABC for the 'x', below. The use of the settings is described in G28.1, below. See Configuring Homing Settings for how to set these.
$xTM Travel Maximum - travel limit for search phase
$xSV Homing Search Velocity - velocity for initially finding the homing switch. Set negative for travel in negative direction, positive for travel in positive direction
$xLV Homing Latch Velocity - velocity for homing second pass (latching phase) (same positive and negative rules apply)
$xLB Homing Latch Backoff -amount to back off switch prior to latch operation
$xZB Homing Zero Backoff - machine coordinate system zero position defined as backoff (offset) from homing switch
$xSM Switch Mode - sets mode for limit and homing switches (0=off, 1=homing only, 2=homing and limits - in any case they are always Normally Open)
G28 will move the machine to the home coordinates through an intermediate point, with the home position detemined by the latest G28.1 cycle. Movement will occur at the traverse rate (G0 rate). Format is:
G28 X0 Y0 Z0 A0 B0 C0
G28 will move to coordinates for any specified axis: axes that are not specified are ignored (not moved). The axis value is the intermediate point for that axis.
For example, G28 X10 Y0 will move to zero in the XY plane without affecting the Z or ABC axes. The movement will pass through point (10,0). Set all values to 0 for a homing move without an intermediate way point. A G28 command must have at least one axis word and is only valid if the system has been previously homed using a G30.
G28.1 is used to home to physical home switches. G28.1 will home to a switch then set the machine zero for that axis (absolute zero) at an offset from that switch location. Format is:
G28.1 X0 Y0 Z0 A0 B0 C0
If an axis is not present in the G28.1 command then that axis is ignored and it's zero value is not changed.
For example. G28.1 X0 Y0 will home the X and Y axes only. The values provided for X and Y don't matter, but something must be present.
Limit and homing switches are shared. For the duration of the homing cycle the limit switches act as homing switches. Once homing is complete they revert to being limit switches. (Note: If a limit switch is hit outside of a homing operation it will reset the machine).
At the curent time only normally open mechanical switches are supported. Support is planned for NC and opto switches, to be controlled by the $xSW parameter.
Dual gantry operation differs somewhat from single gantry homing as specified above. Dual gantry operation assumes each of the two motors in the gantry has its own limit switch that can be read independently. It also assumes that the axis is not racked so much that it cannot move. If this is the case the machine must be manually squared so that the axis can move before starting the homing operation.
[NOT IMPLEMENTED - INCLUDED FOR FUTURE REFERENCE ONLY]
G27 is used to verify table position and perform a Reset if table position tolerances are beyond specification. G27 will Home to a switch, record the switch location, and calculate the difference from this measured Home Location to the set Home Position. G27 should only be used after the machine has been Homed using G30. No Home Offset is performed during the G27 call.
Syntax of G27 is... G27 X0.001 Y0.002 Z0.003 F10
Where the axis values define the acceptable tolerance for table position error. The example above will Home all 3 axes simultaneously to the Home Switches. G27 is only available when doing a Hard Home to physical switches. If an axis is not called out in the G27 command, then that axis is ignored during execution. For example, G27 X0.001 Z0.005 will only home/verify the XZ axes. The axis value defines the acceptable tolerance. In the example, the X axis tolerance is set to 0.001. If the table position is off be more than 0.001 then the G27 command will put the machine in Reset.