Raspberry Pi 4 with LinuxCNC
While researching platforms to upgrade my 3 axis machine my attention was drawn to the prior work of Kinsamanka and Wireb on the github platform.
Wireb built off of the prior Kinsamanka work.
Searching for examples of projects using PICnc did not get any results. Is the project dead? It seems to be inactive for 7 years as of this writing.
My investigation into the project convinced me that it was a good starting point. So it was decided to go ahead and use this as the starting point for a Pi – PIC LinuxCNC controller.
The goal of the project was to:
Find reliable, readily available, inexpensive compute hardware.
Reduce the footprint of the controller.
Learn a little.
Have some fun.
Add as much flexibility to the system as possible.
There are two hardware platforms, the Pi and the PIC which necessitates two different software platforms.
The Pi code was built using Geany and compiled with halcompile.
The PIC code was ported to use a PIC32MZ, specifically the PIC32-HMZ144, clocking at 200 mHz, from Olimex. This work was done using Microchip MPLAB X IDE v5.40.
The build has resulted in a system that has:
32 optically isolated I/O pins, individually selectable as input or output.
5 optically isolated step & dir outputs
4 optically isolated pwm outputs
Stepgen 80kHz default
SPI clock 5 mHz default
Purchased Components:
RTELLIGENT R60X3 3 Axis Stepper Driver, powered by external linear supply.
Pi 4, 4gB
Olimex PIC32-HMZ144
12 V Supply, generic
5 V Supply, Mean Well LRS 35-5
My Components: I/O Block – an 8 bit interface, optically isolates the field devices from the logic The block used to interface the stepper driver does not have indicator leds nor their associated resistors installed. This is to reduce potential emi on these high speed lines. The yellow parts are the isolators which are flipped 180 degrees to switch from input to output. This is the electrical function, to change the logic a parameter file is used.
Bridge – This provides 5V to the Pi and it connects the Pi to the PIC with spi and handshake signals.
PIC32-HMZ144 Carrier- This board provides the pic to system connections via IDC connectors and it supplies 5 V to the cpu.
12 V Distribution- a modified I/O Board providing 16 tie points.
Reference:
github.com/kinsamanka/PICnc-V2
github.com/Wireb/PICnc-5axis
github.com/LinuxCNC/linuxcnc/blob/master...hostmot2/hm2_rpspi.c