Switched Serial Comms for External G-Code Sender

Répondre
Avatar du membre
Zepp3001
Messages : 8
Enregistré le : 29 nov. 2020 03:06

Switched Serial Comms for External G-Code Sender

Message par Zepp3001 »

Disclosure/Caveats:
This post describes a solution that has been effective for my own RS-CNC32 machine, but may not be necessary for others. A few relevant points:
  • It appears that others may be successfully using USB to control large jobs from an external G-code sender. I have not been, and elected to take an alternative approach after tiring of USB troubleshooting :?.
  • Using the baseline RS-CNC32 design, my serial comms between the TFT v1.5 board and the GRBL board worked reliably. (I did, however, add 1 nF caps on the GRBL board at the Tx and Rx header pins to clean up some noise. This may not have been necessary, but made for a nice looking signal :) )
  • Performing CNC jobs from the SD card on the TFT worked reliably
    Using a G-Code sender over USB comms from a Raspberry Pi (cBNC or UGS) did not work reliably (jobs would hang midstream at somewhat random points)
  • I am using v1.04 of the ESP32 library, as recommended by Romaker (recommended to avoid USB issues)
  • I did investigate the USB signals on my DSO, and did not observe any significant noise on the lines (though I will not claim that this investigation was exhaustive)


Overview and Architecture:
Based on the results of extensive serial comms troubleshooting, I determined that using the native RS-CNC32 TFT V1.5 board as a relay for USB data from an external G-Code sender (in this case a Raspberry Pi 4 using bCNC or UGS) was unreliable, resulting in failed CNC jobs. Instead, I decided to use a modified architecture to permit simple, reliable use of both the onboard TFT board (ESP32) as well as an external G-code sender/front end. The modified architecture doesn't rely on USB, and instead uses UART-based serial comms for all traffic between the TFT board, the GRBL board, and an external Raspberry Pi. This architecture also has the advantage of avoiding the somewhat cumbersome USB handshaking between the RS-CNC32 and the external G-Code sender, replacing it with an instantaneous switchover via a hardware switch.

As shown in the diagram, below, the architecture allows serial data from the GRBL board to be simultaneously transmitted to both the TFT board as well as an external computer / G-code sender. A physical toggle switch selects which G-code sender (TFT board or external computer) is sending data to the GRBL board at any given time. In this way, both the TFT board and the external G-code sender can simultaneously display GRBL state data. Once a connection has been established between an external PC / G-code sender and the GRBL board, the toggle switch can be used to instantaneously switch between the G-code senders without causing problems (continued handshaking is not required).
I modified the front panel to accommodate the DPDT switch and LEDs. (I'll make the panel available on Thingiverse if there's any interest.)

Wiring Diagram:
Serial Comms Wiring Diagram.jpg

Modified Panel Detail:
Panel Detail.jpg

RS-CNC32 Controlled from UGS on RPi4 via Serial UART Comms:
RS-CNC32 with RPi (UGS).jpg
This setup has been working great so far, with no hiccups. I really like the ability to instantly switch between using the TFT board Nunchuck to jog the machine, and UGS control on the RPi.

Thanks for looking!
John

Initial build summary of my RS-CNC32:
viewtopic.php?f=41&t=8109
Vous n’avez pas les permissions nécessaires pour voir les fichiers joints à ce message.
Répondre