In this assignment we had to design a CNC machine including the end effector, with the [modular] Machines that make. First, we had to build the passive parts and operate the machine manually, and then, we had to automate it.
To begin work, first downloaded files to understand. Then, with a brainstorm we decided to make a tube CNC Cutter, as got inspired with the Tube Carver example.
We decided to design the machine in cardboard based on material availability and costs.
During assembly of the modules used for the X axis movement, we realized that we could reduce the size and amount of material used while maintaining the necessary rigidity.
In the download file, the anti backlash was located by one of the surfaces of the module, while the redesign we place the anti backlash in the center of the X-axis module, to reduce its size and get better movement.
To design the Spindle we used the "MTM Spindle" but with the difference that the entire structure is made of cardboard and a 3D printed coupling. The first week we prove the mechanism used for the Z axis movement a rack and pinion acrylic 3mm thickness. But this was too much unstable, for this reason we changed the 3D printed pieces by a machined bronze piece and used the AQS Nema 17 stepper motor with lead screw. Also was necessary to reduce the diameter of the spindle axis, so we used a lathe.
For the rotational movement, we designed a bearings bracket to support and avoid the tube warp when machining. And to hold the pipe at the ends designed a 3D printed support. One is connected directly to the shaft of the stepper and another to a cardboard support with an inlaid bearing, so it can follow the rotation.
Some of the machine parts were modified in order to achieve greater rigidity. Three modules with steppers 2 for X axis and one for rotary, gathered together in a single block. Also, the block along the X-axis and Z-axis module merged into a single workpiece.
This part of the project was quite complicated, because we had no experience with programming cards for the GESTALT control nodes.
We followed very useful tutorials available on the web, Here some links for the most useful tutorials for programming GESTALT nodes:
Getting Started With Gestalt Nodes
Welcome to gestalt’s documentation!
From the beginning we used UBUNTU for programming nodes, so it was not necessary to install drivers of the “USB-RS485” cable and the programmer “AVRISP mkIl”. So when connected to the computer it is automatically recognized.
We milled and assembled the "FABNET" card, necessary for supplying voltage to the cards, allow communication between them and the computer.
In the picture you can see the scheme used for connecting the FABNET, the gestalt cards and steppers.
It’s very important be carefull with the order of the wires to connect the FABNET to the first Gestalt node, it is important because any mistakes could generate a short circuit or wasting your time.
To configure the card we have followed the documentations of Nadya Peek webpage, where explanations are quite clear. To test the operation of the entire connection, we used a examples of Nadya, specifically the "XY_PLOTTER.PY".
For our project, we needed to handle 4 nodes at once, so we proceeded to modify the "xy_plotter.py" to work with 4 nodes, in the end we got the "xyzk_test.py" file. You can download the file to test it with your own machine.
Once controlled the 4 nodes, we focus on synchronizing the movement in the X, Y, Z, K axis, where basically each axis represented the following movements:
- X and Y: these two axes perform one movement as a whole.
- K: in this axis obtained rotational movement clockwise and counterclockwise.
- Z: In this axis, the spindle moves to cut the PVC pipe.
In the "xyzk_plotter.py" file is the line "moves", where we find a line array that gives movement to the axis.You can see the following example:
moves=[[20,-20,40,0],[20,-20,40,7],[20,-20,40,7],[20,-20,-40,7],[20,-20,-40,7],[20,-20,40,7],[20,-20,40,0],[0,0,0,0]]
Using a marker and modifying the line of arrays, we made a first test to check the correct operation of the machine, and make sure it was able to do the job we needed.
When testing with the marker, we realized that speed was very high for what we needed, so we proceeded to lower the speed axis movement. Inside the file "xyzk_plotter.py" you may find the line:
stage.xyzkNode.setVelocityRequest (8)
*8 is the speed that brings the default files.
We needed to reduce velocity scroll as little as possible, so our line was as follows:
stage.xyzkNode.setVelocityRequest (0.16)
Gestalt uses a matrix code reading XYZK movements in axes, but for our project we use RhinoCAM with Rhinoceros to program the machining of parts and generate the G code.
So there we have a problem, since the G code was not compatible with the matrices code of the gestalt. To solve this problem we receive the help of Eduardo Yallico, assistant at the Fab Lab TECSUP, who helped us generate an algorithm that translates RhinoCAM G code, the code matrices for gestalt.
The algorithm to translate the G Code to matrices code was as follows:
tempdatoX=0 tempdatoY=0 tempdatoZ=0 datoX=0 datoY=0 datoZ=0 listaTemp=[] listaG =[] codeG = open("HelloWorld.nc", "r") linesG = codeG.read().splitlines() nroLinesG=len(linesG) for x in xrange(0,nroLinesG): tempdata = linesG[x].split() tempLen = len(tempdata) for y in xrange(0,tempLen): identifier=tempdata[y][0:1] if identifier=="X": tempdatoX = tempdata[y][1:tempdata[y].find(".")+3] if identifier=="Y": tempdatoY = tempdata[y][1:tempdata[y].find(".")+3] if identifier=="Z": tempdatoZ = tempdata[y][1:tempdata[y].find(".")+3] datoX = float(tempdatoX) datoY = float(tempdatoY) datoZ = float(tempdatoZ) listaTemp=[datoX, -datoX, datoY, -datoZ] listaG.append(listaTemp); print listaG #The parent moves list should be replaced by listaG #”HelloWorld.nc” is a sample file, there should be your file generated in RhinoCAM.
In Python and Glade we programed the interface,and also the connection with the G code. We had some problems to run the interface in linux. In the picture you can see how the interface would look.