Tutorial to prepare a part to generate gcode

A place to share learning material: written tutorials, videos, etc.
User avatar
roerich_64
Posts: 1256
Joined: Thu May 21, 2015 7:00 pm
Location: Ostfriesland

Tutorial to prepare a part to generate gcode

Postby roerich_64 » Sun May 19, 2019 3:39 pm

Hi to all,

Based on this pictures i will show you the workflow to prepare a part to generate gcode for 2.5D and i think others who reading this helps it:

WCS = Work-Coordinate-System
Prepare_a_I.jpg
Prepare_a_I.jpg (128.07 KiB) Viewed 1995 times
Let us have a look to where we can found these Coordinate-Systems in Freecad:
Prepare_a_II.jpg
Prepare_a_II.jpg (174.26 KiB) Viewed 1995 times
Prepare_a_III.jpg
Prepare_a_III.jpg (146.3 KiB) Viewed 1995 times

When we set the WCS: Z=0 at the top of the part then the post processor generates g Code with -Z values. So the spindle steps down to engrave it.

@Sliptonic gave us a nice tool (Setup) to take the Model-body to the right place:
3D-Surface_VI.jpg
3D-Surface_VI.jpg (194.08 KiB) Viewed 2052 times
1. Click on the top of the body
2. take Z-Axis
3. take Z=0. The Model-Body flips down
4. You have to refresh the stock.

Now let us take a look what we now see:
3D-Surface_VII.jpg
3D-Surface_VII.jpg (197.3 KiB) Viewed 2052 times
This is the startpoint to generate the gcode with 2.5D operations ;)

BR
Walter
Last edited by roerich_64 on Mon May 20, 2019 1:49 pm, edited 2 times in total.
User avatar
roerich_64
Posts: 1256
Joined: Thu May 21, 2015 7:00 pm
Location: Ostfriesland

Re: Tutorial to prepare a part to generate gcode

Postby roerich_64 » Sun May 19, 2019 4:15 pm

Ok.

Let us have a look to a real part, how we can need the above procedure.

It is a rolling container for sorting parts:
P1120995.JPG
P1120995.JPG (978.02 KiB) Viewed 2042 times
In FreeCAD:
Prepare_I.jpg
Prepare_I.jpg (68.19 KiB) Viewed 2042 times
When it is ready prepared, than it looks so:
Prepare_II.jpg
Prepare_II.jpg (124.53 KiB) Viewed 2042 times
I think the best way for now is, i make a video.
But, when it is needed, i can also do a step-by-step turorial here ;-)

BR
Walter
User avatar
sliptonic
Posts: 1902
Joined: Tue Oct 25, 2011 10:46 pm
Contact:

Re: Tutorial to prepare a part to generate gcode

Postby sliptonic » Sun May 19, 2019 6:00 pm

Hi Walter,
Nice pictures and a good tutorial. Keep it up!

One clarification however; FreeCAD has no knowledge of the Machine Coordinate System (MCS) at all. We ONLY work with the WCS. What you show in the second picture of the first post is the default placement of the body. It will be used as the default origin for the WCS when the job is set up. The origin of the job can, as you show, be moved.

Machine controllers like LinuxCNC keep track of both and are able to visualize the WCS within the real work envelope of the machine. But FreeCAD doesn't know anything about the machine's origin or work envelope. Since it doesn't know about those things, it can't know about the relationship between job origin and the machine origin.
User avatar
roerich_64
Posts: 1256
Joined: Thu May 21, 2015 7:00 pm
Location: Ostfriesland

Re: Tutorial to prepare a part to generate gcode

Postby roerich_64 » Sun May 19, 2019 8:23 pm

Hi @Sliptonic,

thank you for the additional explanation :-)
The origin of the job can, as you show, be moved.
Yes i am with you and will correct it ;-)

Edit: and now corrected.

Walter
User avatar
roerich_64
Posts: 1256
Joined: Thu May 21, 2015 7:00 pm
Location: Ostfriesland

Re: Tutorial to prepare a part to generate gcode

Postby roerich_64 » Wed May 22, 2019 11:19 pm

At first i will show you how we can generate the container frame:

To do that we need the boxCreator-Macro. We found them with 'Tools / Addonmanager' then with the TAB 'Macros':
Prepare_III.jpg
Prepare_III.jpg (72.95 KiB) Viewed 1736 times
1. Click the TAB 'Macros' in AddonManager and scroll down to 'BoxCreator'.
2. Select them with a 'click' and take 'Install / update'

Now we have to create a new File.
After them we can start the macro 'BoxCreator' when we take the TAB 'Macro' and then take 'Macros...':
Prepare_IV.jpg
Prepare_IV.jpg (57.4 KiB) Viewed 1736 times
It opens the window 'start Macro':
Prepare_V.jpg
Prepare_V.jpg (80.9 KiB) Viewed 1736 times
1. Select with a click the 'BoxCreator.FCMacro'
2. then take 'Start' (in German: Ausführen -) )
Last edited by roerich_64 on Fri May 31, 2019 11:30 pm, edited 6 times in total.
User avatar
roerich_64
Posts: 1256
Joined: Thu May 21, 2015 7:00 pm
Location: Ostfriesland

Re: Tutorial to prepare a part to generate gcode

Postby roerich_64 » Fri May 31, 2019 10:17 pm

Ok, for now the 'box creator-macro' works with Py2 / Qt4 ;-)
Another thanks to @Christi from here!

The Boxcreator-Forum:
https://forum.freecadweb.org/viewtopic. ... 10#p311162

And here my System with which i do the next steps:

Code: Select all

OS: Windows 7
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.16274 (Git)
Build type: Release
Branch: master
Hash: 7c760259a389b38b76da78e4f6e1f9be66714842
Python version: 2.7.14
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.2.0
Locale: German/Germany (de_DE)
So, we have installed the box creator-macro as above and we will create a container under the desk to sort parts:
Dimensions for my Container: W: 475mm, H: 650mm, L: 600mm.
Thickness of the material: 9mm
P1120998.JPG
P1120998.JPG (1014.56 KiB) Viewed 1742 times
P1130001.JPG
P1130001.JPG (963.7 KiB) Viewed 1742 times

Overhang in the front for the dazzle: 19mm
P1130003.JPG
P1130003.JPG (991.35 KiB) Viewed 1742 times
Bild_IV.jpg
Bild_IV.jpg (184.22 KiB) Viewed 1742 times
User avatar
roerich_64
Posts: 1256
Joined: Thu May 21, 2015 7:00 pm
Location: Ostfriesland

Re: Tutorial to prepare a part to generate gcode

Postby roerich_64 » Mon Jun 03, 2019 9:47 pm

The next step is to delete the 'box':
Prepare_VI.jpg
Prepare_VI.jpg (39.86 KiB) Viewed 1691 times
Select the 'Box' and delete them with 'DEL' on the keyboard.

Now we see this:
Prepare_VII.jpg
Prepare_VII.jpg (124.95 KiB) Viewed 1691 times
To see how i can place the walls of the container on the CNC i have create a sketch with the dimensions of my machine:
Prepare_IX.jpg
Prepare_IX.jpg (190.17 KiB) Viewed 1691 times
Result:
Prepare_X.jpg
Prepare_X.jpg (124.67 KiB) Viewed 1691 times
User avatar
roerich_64
Posts: 1256
Joined: Thu May 21, 2015 7:00 pm
Location: Ostfriesland

Re: Tutorial to prepare a part to generate gcode

Postby roerich_64 » Tue Jun 04, 2019 4:53 pm

Next steps:
Prepare_XI.jpg
Prepare_XI.jpg (101.7 KiB) Viewed 1655 times
1. Select the Path-WB
2. Create the job

We select the parts and click 'OK':
Prepare_XII.jpg
Prepare_XII.jpg (125.46 KiB) Viewed 1655 times
Now we are in the 'Setup' and we can do the positioning of the walls:
Prepare_XIII.jpg
Prepare_XIII.jpg (222.91 KiB) Viewed 1655 times
Click in the canvas on the Top of the first part (bottom)
Click 'Z-Axis'
Click 'Z=0'

The part 'bottom' flips down. We have Z=0 at his top ;-)

Next:
Prepare_XIV.jpg
Prepare_XIV.jpg (239.89 KiB) Viewed 1647 times
- Click the inner side of the left wall to define on which surface should be the Z-vector.
- Click 'Z-Axis'
- Click 'Z=0'

Result:
Prepare_XV.jpg
Prepare_XV.jpg (259.81 KiB) Viewed 1647 times