Install UGS On Pi4

As a pre cursor Install GRBL On Arduino Uno

Windows Host Steps

  1. Pop the SD card into a reader and connect to the PC using USB
  2. Download Raspberry Pi Imager https://www.raspberrypi.com/software/
  3. Open Raspberry Pi Imager and install Raspberry Pi OS 32 on the USB using Raspberry Pi Imager

I customised the installation and ran the install

  • hostname cncpi
  • user gordon
  • configured wireless LAN and set country to NZ

Pi4 Steps

After the install pop the SD card into the Pi, plug the Pi into a screen, keyboard & mouse. Then power it on and login.

  1. Update the Pi with sudo apt-get update and sudo apt-get dist-upgrade
  2. run sudo apt update
  3. run sudo apt install default-jdk
  4. Reboot the Pi

Additionally under config enable SSH, this mean you can then SFTP files to the Pi.

Some forms suggested to run sudo raspi-config and setting Display Options -> GL Driver -> Full KMS (external screen) but mine just worked so I left it.

Install Java and download UGS

  1. Run sudo apt-get install openjdk-8-jdk
  2. Download UGS from https://github.com/winder/Universal-G-Code-Sender?tab=readme-ov-file#downloads selecting Linnux ARM64
  3. Extract the content from the tar.gz, I just put it on the desktop
  4. Navigate to ugsplatform-pi\bin\ and right click on ugsplatform -> open and select Execute in Terminal (it took a while to load)

Configure GRBL

From UGS console I then set the GRBL settings, these save to the Arduino UNO, you can view the current settings with $$, I documented the GRBL Settings For My IndyMill Build here.

Configure UGS Macros

This is under Macros, for me it was the bottom left window (Also See GRBL Settings For My IndyMill Build)

Far Corner

This moves the head up and to the far right corner

1
2
Name      Far Corner
GCode $21=1; $23=0; $H; $23=3; $J=G21G91X-5F700; $J=G21G91Y-5F700; $J=G21G91Z-5F700;

Unpacking to understand the commands:

1
2
3
4
5
6
7
$21=1;             ~ ensure limit switches are enabled, could be overkill, meh
$23=0; ~ set X+, Y+, Z+, its a mask that maps back to a table for the +/- of XYZ
$H; ~ home machine, will debounce off limit switches
$23=3; ~ sets X-, Y-, Z+ which is my machines front left corner, this is my default normally
$J=G21G91X-5F700; ~ moves 5mm off the limit switch on X at 700mms
$J=G21G91Y-5F700; ~ moves 5mm off the limit switch on Y at 700mms
$J=G21G91Z-5F700; ~ moves 5mm off the limit switch on Z at 700mms

I also set my x/y max travel high enough for the head to travel corner to corner, see Rates, Acceleration, Max Travel

Probe zero

I got these from this video https://www.youtube.com/watch?v=rDpxyGtxlA0 and they worked for me

1
2
Name     Probe zero
GCode G21; G91; G38.2 Z-50 F100; G92 Z5; G0 Z5

Unpacking to understand the commands:

The second to last G92 Z5, the 5 is 5mm, thats the thickness of my probe block.

References