This blog contains the daily technical endeavours of a freelancing software-designer.

2016-12-12

Multi Axis G-Code generation with CNC-Toolkit

Yes, CNC-tookit is ancient. But since Fusion 360 doesn't do the job...so well...
Here are my notes about how to get cnc-tookit running on a modern Windows 10 and create 4 and 5 axis toolpathes with it.

I may add screenshots to illustrate my notes at a later point.

Objective

I'm trying to figure out if and how to generate 4 and 5
axis G-Code in CNC-Toolkit to run on my heavily modified YooCNC 6040 machine.

From STL to G-Code

Convert STL to 3DS

GMax doesn't seem to understand STL or the unual CAD file formats.
So we need a converter.

3D Exploration 1.5 can be found here : cnczone.com/forums/attachment.php?...
(Yes, you need a user account in the CNCZone forum.)
In Windows 10 you need to install this using compatiility settings.
It is discontinued but you should of cause still register it for 40.77 €
+19% sales tax = 48.52 €.

If objects in the original file exceed the 64,000 faces per object limit
for .3DS, it splits info face groups that you need to reunite inside Gmax using
the Editable Mesh 'Attach' or 'Attach List function.

Open "3D Exploration 1.5".

Select your file on the right side.

Select File-Save As... and the 3ds file format.

combine face groups

On the right side you have a number of tabs,

In the first tab, you can assign a name to your objects to identify them.

In the "view" tab with the monitor icon, you can hide objects that clutter your view and render them as solid objects.

In the tools tab, you can "attach" and "attach list" multiple face groups into a single mesh.

Load model

File-Import your convertes mesh.

Make sure it's oriented along the X axis due to limitations of cnc-toolkit.

Note down the size of your stock.

Select your object and in the top right panel, give it a name.

Run cnc-toolkit

Run the "CNC-Toolkit-4.34b.ms" MaxScript file using the menu.

Next select your machine type.

XYZ is a 3 axis mill

XYZA has

a 4th axis mounted on the work-surface that rotates around X

XYZAB has

a 4th axis mounted on the work-surface that rotates around X and

an additional 5th axis "B" mounted on the Y gantry, rotating the spindle around Y

XYZABC has a trunnion arm mounted on the Y gantry

C mounted on the trunnion rotating around the vertical axis

B mounted on the C axis to rotate perpendular to to C

XYZAC has a 4th and 5th axis combination mounted on the work surface.

A rotating the table and

B rotating the part on the table surface

The offsets are the distance from center of rotation to the tip of the tool.
For an axis mounted to the work table, as with XYZA and XYZAC I assume it's the distance from center of rotation to the origin point.

Create a cylinder of splines

In the "parallel splines" section choose "helical" or "cylindrical"

Enter apropriate X, Y and Radio -dimensions for your stock.

Click "Make parallel splines" and wait a second for them to apear.

"Stepover Distance" controls the distance of parallel toolpathes at the
outher diameter.(Oviously the closer they are to the center, the closer
they get. Keep that in mind for stock that can melt or catch fire.)

Despite the name "Stepover" is an absolute distance between tool passes and ignoring the tool diameter.

"Stepover" also ignores any changes in radius during the later projection. As the spline gets near the center of rotation during projection, the resulting toolpathes are much closer then the initial "Stepover" distance.

Project splines onto surface

Delete the unprojected spline using edit-delete (it's no longer needed and can be re-created with just 1 button)

It should now wrap the surface of your object.

Height offset is otherwise known as a skin depth and allows for roughing passes

Create tool vectors along projected spline

Up in the "angle control" section, choose "Use Reference Surface".

Then "Pick Reference Surface".

Select your object and the button should not read "Ref Mesh = ".

Select the projected spline. (Not the original spline. You can delete that one.)

In the "toolpath generator" section, choose "Toolpath from Shape".

You may have to wait for a few seconds.

Generate g-code and show animation

Now you can use the "Tool Control" and "Postprocessor Options" sections to export your g-code to the "Script listener window" to copy and paste it.
(The other options here work in 3D Studio MAX but not in GMAX)

You can find that windows with F11 or in "MaxScript"- "MAXScript Listener..." .

After postprocessing, you can use "/" or the play-button in the lower right to see an animation of the milling process.

TODO

I have not yet fully understood how to compensate for the tool shape.
The tangent mode seems to use the entered tool diameter and offset it along the surface normal.
This simple method would of cause be problematic in pockets narrower then 1.0x the tool diameter that can not be milled with a tool of this size. However an infinitely small tool will try and the applied offset will cut widen the pocket beyond the intended geometry.

As an alternative I should test importing an existing 3 axis toolpath and having cnc-toolkit perform the too-orientation only. Aparently toolpathes from CamBam (trial versions) can be exported as DXF and imported into GMAX. I don't think that works for gcode -toolpathes of my favorite 3 axis CAM software.

I have also not understood yet how to use your own geometry to represent your machine for better visualision and for collision detection. Aparently you can "link" your own geometry to follow the path of the generated stand-ins and then hide the stand-ins.