I've always been wondering of upgrading my old engraver. Something which makes set-up a lot easier and something g-code independent so we can go away with using CAD and CAM software thereby reducing the deployment time. Below is a view of a g-code tool environment.
EveryBeginner's Problem
One of my biggest problem with the CNC machines is that it is always reliant to the CAD and CAM software which generated the g-code. This reliance has no link between actual CNC machine capability and g-code tool path generated. This means a lot of set-up and tuning has to be done to ensure the axes, origins and output are according to requirement and repeatable. This can become frustrating to every beginner in this field.
TheGoal
The main objective is to provide a proof of concept that it is possible to use another method of cnc routing in lieu of the existing g-code based system.
DesignConcept
Deploying image processing into this application could greatly enhance set-up, inspection and control flexibility. For demonstration purposes, I am using Arduino as the intermediate translator to reduce complexity of the hardware connections as it comes with a readily available CNC shield. These two piece of hardware is able to duplicate the existing motor control function of the CNC 3018 Pro. Kria KV260 is then used to send and inspect carve toolpath. The Arduino is loaded with LabVIEW via LINX and uses 3 queues, one for each axis. Each axis location can then be represented in 8-bit precision floating point.
More info about LINX is here on this repo:
https://github.com/labviewhacker/lifa/
For the interface, I am using UART with flow control to handshake buffer queue. This connection can easily be achieved on the Kria's pmod connector which is directly connected to PL and using 4 pins. It is to be noted that Arduino uses 5V UART while KRIA uses 3.3V. A voltage divider must be implemented for every outgoing port on the Arduino to match logic level with KRIA.
PreparingKria CNCApplication
There are a lot of available documentations and tutorials to follow when creating the custom application. For my case, I followed this step-by-step guide from Xilinx which runs me from platform creation up to the deployment and re-use of AI application. This is the main advantage of using edge computing. Aside from flexibility in configuring hardware, there is also a solid and rich ecosystem of tools to use which does not require an expert HDL or SOC developer.
1. Generate Hardware Platform in Vivado
2. Configure software boot files with Petalinux
3. Create Vitis Platform & Enable UART stepper axes sender
EnableRTSPon Rasp Pi
Image from Raspberry Pi camera is streamed to Kria as input video over ethernet.
ApplicationDemo
The completed system I have runs the coordinates extracted from g-code since I haven't finished yet the edge-detection algorithm using sobel and canny as applications in the Vitis AI model zoo does not yet cover this type of algorithm and I am still working on it figuring out the integration. So I just test it here to verify the motor control and the UART communication. Right now, it can only carve straight lines and arcs with radius of 0.5in. Below are the coordinates extracted from g-code generator and was sent over UART.
In this project, I was able to improve the method for cnc without using GRBL though I haven't completed the edge filtering and detection which will be used to define the coordinates automatically. And on the software side, there are a lot of example tutorials and reference documents that is available to easily step up your knowledge and deployment. The important lesson I want to share is regarding the use and encounter of Linux command line environment familiarity where the user should at least have some experience with this programming environment. This project still need a lot of further improvements though I think it proved the concept and could be a starting point for those interested in going cnc machining further.



_ztBMuBhMHo.jpg?auto=compress%2Cformat&w=48&h=48&fit=fill&bg=ffffff)



Comments