Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 17 of 17

Thread: Teensy 4.1 Based CNC Controller

  1. #1
    Senior Member
    Join Date
    Mar 2016
    Posts
    167

    Teensy 4.1 Based CNC Controller

    I have finished my grblHAL CNC Motion Controller board for Teensy 4.1.

    Completed board
    Click image for larger version. 

Name:	R6268724_DxO-1.jpg 
Views:	56 
Size:	256.8 KB 
ID:	20816

    Unkit Version
    Click image for larger version. 

Name:	R6288808_DxO-1.jpg 
Views:	39 
Size:	337.6 KB 
ID:	20817
    Features:
    • 5 Axis control outputs – 5V compatible.
    • Independent enables for each axis.
    • 10 Opto-isolated inputs including standard GRBL controls and limit switches for all axes.
    • 7 Relay Outputs – Spindle, Mist Coolant, Flood Coolant, Dust Collector and 3 auxiliary relays. Each output can control a relay coil directly or 5V TTL (SSR compatible) devices.
    • Dust Collector relay support. Activated by spindle enable.
    • Separate control of Dust Collector relay via pin header.
    • Relay coil voltage switchable between 5V and 12V.
    • Standard GRBL spindle control outputs – 5V compliant.
    • 0-10V spindle control output for driving VFDs.
    • Screw Terminals for reliable connections available for most I/O.
    • 4 Digital Inputs – EMI protected, 15.9KHz low pass filter, Schmitt Trigger.
    • I2C header.
    • EEPROM footprint for SOIC8 devices.
    • LED indicators for 5V and 12V.
    • USB interface.
    • Ethernet interface.
    • Serial I/O Header


    This runs grblHAL, a 32 bit ARM port of GRBL. The source code is here.

    Schematics can be found here.

    I've uploaded a shared board to OSHPark here.

    Though, to be honest, it would be cheaper to take the gerbers and order the board from a Chinese fab like JLCPCB. Gerbers can be found here.

    I have a small number of boards with all the surface mount components (except the eeprom) already soldered on - AKA the Unkit Version. If interested, you can get one here.

    I have a manual near completion and will post it on the github page here when done. It includes a BOM and assembly instructions.

    In addition, the PCB has the footprint for an Ethernet MagJack. The hardware works but Ethernet for grblHAL on the T4.1 is not completed. I am hoping to get that working within a week or so. Check the github page for status.
    Last edited by PhilB; 07-01-2020 at 05:36 AM.

  2. #2
    wow, that is a piece of art.

  3. #3
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    22,270
    Awesome board. Have you connected to any machines yet? Any chance for a photo of it in "action"?

  4. #4
    Junior Member
    Join Date
    Apr 2020
    Location
    Brazil
    Posts
    8
    So nice !! What is the maximum step clock frequency ? Have you tested with Mach3 ?

  5. #5
    Junior Member
    Join Date
    Apr 2020
    Location
    Brazil
    Posts
    8
    Runs over ethernet ?

  6. #6
    Senior Member
    Join Date
    Mar 2016
    Posts
    167
    Quote Originally Posted by PaulStoffregen View Post
    Awesome board. Have you connected to any machines yet? Any chance for a photo of it in "action"?
    I've tested it against steppers. An earlier version is running several machines and grblHAL is running quite a few machines with various processors (STM32, ESP and others). I'll be doing a "pretty build" in the next few days.

  7. #7
    Senior Member
    Join Date
    Mar 2016
    Posts
    167
    Quote Originally Posted by Logs View Post
    So nice !! What is the maximum step clock frequency ? Have you tested with Mach3 ?
    Mach 3 isn't needed. grblHAL takes it place and is free. And, better. This uses a PC mainly for feeding G-Code. grblHAL running on the T4.1 does all the motion control, planning and manages the inputs. It is possible to run it off-line with an SD card supplying the G-Code though that's problematic for physical card reader access in machine environment.

    Max step rate is uncharacterized but it is faster than a physical stepper motor can go.

  8. #8
    Senior Member
    Join Date
    Mar 2016
    Posts
    167
    Quote Originally Posted by Logs View Post
    Runs over ethernet ?
    It will. That's the next step. I've tested the hardware and it runs T4.1 Ethernet apps, both Native and lwip. grblHAL works with lwip on other processors. we are porting it to the T4.1 right now though my time is in short supply these days.

    This is important because Ethernet is more reliable for feeding G-Code than USB. USB is more susceptible to EMI than Ethernet.

  9. #9
    Senior Member
    Join Date
    Mar 2016
    Posts
    167
    Quote Originally Posted by KrisKasprzak View Post
    wow, that is a piece of art.
    Thanks. Kind of you to say. I take some pride in making my PCBs look good - clean layout, 45 degree bends, clear and helpful silk screen legends. That's make them work any better, though...

  10. #10
    Senior Member
    Join Date
    Mar 2016
    Posts
    167
    The User Guide is now available here

  11. #11
    Senior Member
    Join Date
    Mar 2016
    Posts
    167
    There was a question about max step rate supported. After some testing, I have been able to produce a 180kHz step pulse stream. Minimum pulse width is 3 uS. You can get to 300 kHz but that probably violates min pulse separation for your stepper drivers - it looks like a spec of 2.5 uS is fairly common, even on higher end drivers. So, 2.5 uS separation and 3 uS pulse width gets you 181.818 kHz. Note that acceleration/deceleration will make that step rate relatively infrequent when running a job. Here's a screen shot of a 148.8 kHz stream.
    Click image for larger version. 

Name:	86495805-b40bb480-bd2f-11ea-8c8f-c6f4f6308d50.png 
Views:	9 
Size:	23.0 KB 
ID:	20850

  12. #12
    Junior Member
    Join Date
    Sep 2014
    Posts
    16
    Awesome. Just ordered one. Thanks

  13. #13
    Junior Member
    Join Date
    Apr 2020
    Location
    Brazil
    Posts
    8
    Quote Originally Posted by PhilB View Post
    There was a question about max step rate supported. After some testing, I have been able to produce a 180kHz step pulse stream. Minimum pulse width is 3 uS. You can get to 300 kHz but that probably violates min pulse separation for your stepper drivers - it looks like a spec of 2.5 uS is fairly common, even on higher end drivers. So, 2.5 uS separation and 3 uS pulse width gets you 181.818 kHz. Note that acceleration/deceleration will make that step rate relatively infrequent when running a job. Here's a screen shot of a 148.8 kHz stream.
    Click image for larger version. 

Name:	86495805-b40bb480-bd2f-11ea-8c8f-c6f4f6308d50.png 
Views:	9 
Size:	23.0 KB 
ID:	20850
    That's good, thank you

  14. #14
    Junior Member
    Join Date
    Apr 2020
    Location
    Brazil
    Posts
    8
    Quote Originally Posted by PhilB View Post
    It will. That's the next step. I've tested the hardware and it runs T4.1 Ethernet apps, both Native and lwip. grblHAL works with lwip on other processors. we are porting it to the T4.1 right now though my time is in short supply these days.

    This is important because Ethernet is more reliable for feeding G-Code than USB. USB is more susceptible to EMI than Ethernet.

    When the ethernet support be available, the actual board version is ready to be populated with the ethernet components (MagJack, etc..) ?

  15. #15
    Senior Member
    Join Date
    Mar 2016
    Posts
    167
    Quote Originally Posted by Logs View Post
    That's good, thank you
    After looking at this a lot more, I've decided to put the max step rate specification at 160 kHz. Quite a bit better than the old 8 bit GRBL of 30 kHz. It can go higher but I don't feel confident of 100% repeatability above 160K. That will support 5000mm/min movement and higher. Of course that depends on stepper drivers, motors, gearing and microstepping being set correctly.

  16. #16
    Senior Member
    Join Date
    Mar 2016
    Posts
    167
    Quote Originally Posted by Alex Stahl View Post
    Awesome. Just ordered one. Thanks
    Thank you - email sent.

    There is just one left but I ordered another batch which should be here next week.

  17. #17
    Senior Member
    Join Date
    Mar 2016
    Posts
    167
    Quote Originally Posted by Logs View Post
    When the ethernet support be available, the actual board version is ready to be populated with the ethernet components (MagJack, etc..) ?
    Yes, that is the plan. Of course it needs testing and characterization. I will post back when we have some results. And the unkit just needs the magjack and the header connection for the Teensy 4.1, all the other components are already on it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •