Modifying a T41U5XBB for lathe spindle sync
Supporting threading on a lathe with grblHAL
The Teensy 4.1 based T41U5XBB is a good board for controlling a lathe with grblHAL but does not have the ability to synchronize with the spindle. That is, unless you modify the board. Two cuts and two "bodge" wires are all it takes. You will need to load different firmware built with the web builder. This modification will support and encoder that has 2 outputs, a once per revolution index pulse and a high speed pulse (many per revolution). So, diving in...
There are 3 general steps:
Move ST3 to pin 14. (One cut, one added wire.)
Move Halt to pin 35. (One cut, one added wire.)
Build grblHAL to support the changes.
Material and Tools.
You will need
a sharp knife with a pointed blade
a soldering iron with a fine tip
fine needle nose pliers
a multimeter for continuity testing
a hot glue gun
26 gauge insulated solid core wire.
ST3 to Pin 14
Start on the top of the breakout board. You will need to cut one trace and add a bodge wire. This requires care - there is little margin for error. Study the photos below before you start cutting. Cut the trace indicated in the photo for your version. Be careful to make sure you can cut through completely and there are no stray copper bits. Also take care not to cut or damage adjacent wires or components. Verify that you have no connectivity between pin 35 of the Teensy (labeled on the Teensy) and the bottom left pin of the IC as shown in the photo. If you still have continuity, your cut was not successful, revisit it.
Now, measure a length of small wire (26 ga solid is ideal) for bodge 1. Strip a short length of insulation off one end and a bit longer off the other. Do not use uninsulated wire. Tin both ends with solder. Carefully solder the short end to the bottom left pin of IC14 as shown in the photo. (Using needle nose pliers, hold the tinned end to the pin and place the soldering iron tip on it. When it melts remove the iron but hold the wire in place until the solder hardens.) Then solder the other end to the leftmost pin (labeled Hlt) on the 6 pin I2C header as indicated in the photo. Take care that no bare wire can contact any other pins, vias or solder pads. Test continuity between the IC pin you soldered the wire to and pin 14 of the Teensy (labeled on the Teensy). If you do not have continuity, recheck your soldering. Also verify again that you do not have continuity between the IC14 pin and pin 35 of the Teensy. Secure the bodge wire with some hot glue.
Halt to Pin 35
Turn the breakout board over and locate the area in the photos below. Cut the trace indicated in the photo. There should be no continuity between the pin directly above Cut 2 and the via where Bodge 2 starts. Make up a bodge wire as in the first step including stripping and tinning. Solder one end to the via and the other end to pin 35 of the Teensy (third pin from the left as indicated in the photo. Take care that no bare wire can contact other vias, pins or solder pads. Secure the bodge wire with hot glue.
Build a version of the firmware to support the board changes
Open up the grblHAL Web Builder site. Select Driver iMXRT 1062 (Teensy 4.1) and Board T41BB5XPro. Make any other selections you need for your machine, Save your configuration with Save Board and then Generate and download firmware. Use teensy.exe to upload the firmware file to the Teensy. If you are not familiar with the grblHAL Web Builder, see this blog entry. Chrome may show some rendering differences but it works ok.
You will connect your spindle's high speed encoder pulse to ST3 and the index pulse to ST2. Setting up your lathe is beyond the scope of this blog post but the grblHAL Wiki's Spindle Sync section goes into a fair amount of detail.
There is a grblHAL/Discussions topic on this in the old grblHAL archives that contains are fair amount of information. Some of it is out of date (building grblHAL, for example) but it is worth looking through.
I'm Phil Barrett, a long time CNC enthusiast. I run a small company, Brookwood Design, that makes several breakout boards for grblHAL and love to help people get the most out of their CNC machines.