Skip to content

How it works

Huub Buis edited this page Aug 26, 2019 · 5 revisions

Threading is done by sending G33 commands to the controller. To start at the same spindle position when a G33 command is received, it:

  • waits until the planner buffer is empty so all moving will stop.
  • waits for 3 index pulses and calculates the initial feed rate (there may only be one index pulse per revolution).
  • waits for a synchronization pulse.
  • adds the G33 command to the planner buffer.
  • waits until the G33 command is finished before adding commands to the planner.

To compensate for spindle speed changes during threading, at every synchronization pulse:

  • the target position is calculated based on the number of synchronization pulses received.
  • the actual tool position is calculated based on information supplied by the planner.
  • the synchronization error (actual position - target position) is calculated.
  • the feed rate required to be at the right position at the next synchronization pulse is calculated.
  • this feed rate is set in the planner.

If there are no synchronization pulses, the index pulse is used to synchronize during threading.

To monitor the accuracy of threading, the synchronization status (synchronization error) can be reported as a feedback message ([Se x.xxx]) or at the next real time status update (|Se:x.xxx), depending on the $10 report options set. Beware that the synchronization error is high when threading starts (acceleration) and threading ends (deceleration). Depending on you grbl and lathe setup, it takes 2 to 8 synchronization pulses to synchronize the feed rate to the spindle speed, when threading starts.

A build option (X1) is added to the build information so GUI's can check if G33 is supported.