Generating efficient tool paths

Here's the place for discussion related to CAM/CNC and the development of the Path module.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
martinvavra
Posts: 3
Joined: Wed Jan 20, 2021 9:05 am

Generating efficient tool paths

Post by martinvavra »

Hi there, I am quite new to CAM/CAD designs, started couple of days ago, so I might have stupid questions, however I did not find a way to get arround that, so I might need a help with that. Thank you in advance!

I had succesfully design this solid with pockets and generated the toolpath. I think it will work just fine, however I am a little bit confused with what is just a simulation and how the tool will move on the cnc in real world. And I have two questions:

1) The thing is that I have pockets with the same depth. Is there a way how to make a operation of two pockets with the same depth in single operation (two on the odge) and then combine them with another two pockets (two smaller next to them) while moving the tool from lower left pocket (1 - 8cm wide), then to move to next (2 - 4 cm wide but with another depth), then trird with another depth etc while not to return the spindle to the starting point 0,0? I found that best strategy is to create an operation of every single pocket separately in order to stay efficient, but I am wondering if there is some quicker solution..

2) If I have created the pockets separately in good order - from lower left to lower right and then upper right to upper left, can I somehow enable the boolean "mintravel" of all operations "in the group", so it will clear one pocket and move to another while not coming back to start point 0,0?

3) On the picture 2 I can see that the step is executed just by moving Z axes by the set distance, is there I way how to set that it will move slowely while cutting the wood? This is happening in every step down in all operations. I think that if the endmill will make a step down on some angle, it will be better for life of that endmill and result in better surface.

and lastly 4) Is there some way to make finish passes of maybe 0,5 mm inside the pockets and outside actual workpiece?

I found a video from creater of CAM module on this forum https://www.youtube.com/watch?time_cont ... =sliptonic, but I think that this is not the solution whoch I want. I think I understand the start point but my starting point of the actual job is right, so I don't need to change that manually.

In the video there is mentioned MinTravel boolean, so I am wondering If I can fuse that somehow.

And there is another topic which I have found: https://forum.freecadweb.org/viewtopic.php?t=29652

Sliptonic is mentioning: "With gcode, a move is always relative to the previous position. Since the first move in a job is relative to wherever the cutter is currently positioned and Path doesn't know that, it uses the part placement in order to render the first red rapids. This does NOT mean the cutter will first go to that position and then go to the actual start point." - That confused me even more. Does it mean that only way how I can check how the actual spindle is moving is from inspecting rendered G-code? :?


Thank you for advice! :)
Attachments
g-code.txt
(27.45 KiB) Downloaded 31 times
2.PNG
2.PNG (64.16 KiB) Viewed 1324 times
1.PNG
1.PNG (26.31 KiB) Viewed 1324 times
jbraun
Posts: 253
Joined: Fri Sep 18, 2020 5:41 pm

Re: Generating efficient tool paths

Post by jbraun »

I wrote a long winded response and the forum ate it :)
Here's a shorter one. Don't get hung up on those phoney red lines, the truth is in the posted code. Learning to read the code is a good thing but until that time maybe an online back plotter ? https://ncviewer.com/

When setting up a job in PATH make Z=0 the top. Making the bottom of the part Z0 is usually a bad plan.
For English help on youtube check out Joko Engineering or Mango Jelly Solutions.
Look for recent videos, this software is updated at a rapid pace.
RatonLaveur
Posts: 991
Joined: Wed Mar 27, 2019 10:45 am

Re: Generating efficient tool paths

Post by RatonLaveur »

martinvavra wrote: Wed Jan 20, 2021 9:45 am Hi there, I am quite new to CAM/CAD designs, started couple of days ago, so I might have stupid questions, however I did not find a way to get arround that, so I might need a help with that. Thank you in advance!
Welcome and thank you for a very well documented post. I will try and help a bit, but cannot answer all your questions as I have not had the leisure to spend too much time on FreeCAD recently.
martinvavra wrote: Wed Jan 20, 2021 9:45 am and lastly 4) Is there some way to make finish passes of maybe 0,5 mm inside the pockets and outside actual workpiece?
Yes, there is. Russ has been working on getting this feature homogeneous in all aspects of the PathWB GUI. But generally you what you need to do is perform a pass extension. The option is either in the Task pannel when creating the OP or once the OP is created, you select it in the model tree to the left, and then in the Data tab, you can find the correct values to play with.
martinvavra wrote: Wed Jan 20, 2021 9:45 am Sliptonic is mentioning: "With gcode, a move is always relative to the previous position. Since the first move in a job is relative to wherever the cutter is currently positioned and Path doesn't know that, it uses the part placement in order to render the first red rapids. This does NOT mean the cutter will first go to that position and then go to the actual start point." - That confused me even more. Does it mean that only way how I can check how the actual spindle is moving is from inspecting rendered G-code? :?
Sliptonic is our PathWB guru, that is true. But his youtube teaching may be sometimes dated because absolutely no-one, not even Sliptonic, can manage to keep all his documentation (he has time to document his work, can you believe it?!) up to date when PathWB is evolving so fast.
So:
the movement is only relative, in G-Code if using the G91 modal, which means incremental machining. if using G90 instead then the machining coordinates are all absolute vs. the origin you selected placed virtually. Usually in the real-world that would be G54 by default. G54 to G59 are called Work Coordinate Systems or Workpiece Coordinate Systems or some variation thereof. There is a plethora of simple GCode explanation of how that works.

I agree with above poster, the best way to check the real instructions your machine will receive before crashing a spindle, is to copy paste your code in NCViewer https://ncviewer.com/. Alternatively, some users use https://camotics.org/

Regarding your other questions, optimizing the workplan is generally best performed by making several OPs. That is much better than trying to achieve everything in one big OP.

Another note:

PathWB, like all CAM software, first output what is known as "Pseudo G-Code". It contains the most basic trajectory information. Usually a small bit of program called a PostProcesser or PostPro or Post will take that Pseudo G-Code and translate into the syntax your machine will understand. (e.g. a Fanuc system will read G1X#nnnY#nnn, while a DeltaTau system will read G1XPnnnYPnnnn...etc). Post will also add the header and footer to your code, which will tell the machine for example: G54 (select the G54 coordinate system) G90 (work in absolute coordinates) ....etc. and the footer will be at the most basic M30 (end of program).

Also it is important to create your tools and tool-controllers (spindle feed, feedrate...etc). Otherwise that information will be absent from your code and your machine will probably use the last default settings. Not good. Toolcontrollers also determine the tool diameter compensation when generating Pseudo-G-Code and using that option.

Personnally, I don't use toolcontrollers because I run a laser system, I set my Feedrates and powers manually.

Hopefully this gives a bit of clarity and opens some doors for further learning.
herbk
Veteran
Posts: 2660
Joined: Mon Nov 03, 2014 3:45 pm
Location: Windsbach, Bavarya (Germany)

Re: Generating efficient tool paths

Post by herbk »

jbraun wrote: Thu Jan 21, 2021 8:12 am When setting up a job in PATH make Z=0 the top. Making the bottom of the part Z0 is usually a bad plan.
Why? Z0 has to be where it is at the machine to, I use it since severat jears ( since FC 0.16) at this way and don't have many probs... ;)
Gruß Herbert
User avatar
sliptonic
Veteran
Posts: 3459
Joined: Tue Oct 25, 2011 10:46 pm
Location: Columbia, Missouri
Contact:

Re: Generating efficient tool paths

Post by sliptonic »

RatonLaveur wrote: Thu Jan 21, 2021 8:58 am
martinvavra wrote: Wed Jan 20, 2021 9:45 am Sliptonic is mentioning: "With gcode, a move is always relative to the previous position. Since the first move in a job is relative to wherever the cutter is currently positioned and Path doesn't know that, it uses the part placement in order to render the first red rapids. This does NOT mean the cutter will first go to that position and then go to the actual start point." - That confused me even more. Does it mean that only way how I can check how the actual spindle is moving is from inspecting rendered G-code? :?
Sliptonic is our PathWB guru, that is true. But his youtube teaching may be sometimes dated because absolutely no-one, not even Sliptonic, can manage to keep all his documentation (he has time to document his work, can you believe it?!) up to date when PathWB is evolving so fast.
So:
the movement is only relative, in G-Code if using the G91 modal, which means incremental machining. if using G90 instead then the machining coordinates are all absolute vs. the origin you selected placed virtually. Usually in the real-world that would be G54 by default. G54 to G59 are called Work Coordinate Systems or Workpiece Coordinate Systems or some variation thereof. There is a plethora of simple GCode explanation of how that works.
People are often confused about Path rendering the backplot twice; once as the operation and again as part of the job. This is why you have to toggle the visibility of both the operations AND the job to hide everything. This is intentional and a feature. When you're setting up an operation, you're concerned with the path accuracy of that alone. But when you're configuring the entire job, you care about the order of things and how it all fits together. Each operation in a Path job is atomic. Each calculates its path commands independently. This means you can hide everything except the one operation or show it all. It also means the entire job doesn't have to be recalculated if something changes in an operation.

If you want to see a more accurate view of the job overview without the redundant red lines, just hide the operations and only show the job.

Even then, despite our best effort, it's impossible to completely render how a job will look an your actual machine. This is because the job might be outputting gcode for multiple coordinate systems and the relative positions of the those WCS are not know to Path. They only exist in the controller.

Running through a simulator, and or 'air-cutting' is the best way to check your gcode.
I agree with above poster, the best way to check the real instructions your machine will receive before crashing a spindle, is to copy paste your code in NCViewer https://ncviewer.com/. Alternatively, some users use https://camotics.org/
Hoping to make this process easier soon. We are collaborating with the CAMotics people on an integration.
jbraun
Posts: 253
Joined: Fri Sep 18, 2020 5:41 pm

Re: Generating efficient tool paths

Post by jbraun »

herbk wrote: Thu Jan 21, 2021 9:05 am
jbraun wrote: Thu Jan 21, 2021 8:12 am When setting up a job in PATH make Z=0 the top. Making the bottom of the part Z0 is usually a bad plan.
Why? Z0 has to be where it is at the machine to, I use it since severat jears ( since FC 0.16) at this way and don't have many probs... ;)
Well sure there are endless possibilities and that's why pro shops have set-up sheets. I was trying to simplify things for OP. Looking at the code posted it's hard to read . His clearance height is 48mm, the safe height is 46mm and a good guess is the top of part is 43mm. I pieced this together from knowing FreeCAD's operations and defaults. No need for guesses if Z=0 is top of part. Z minus will be below the top.

If OP's machine is capable of displaying relative coordinates there will be no need to remember the part is ??mm thick. When the tool is at the top of part the DRO will read Z0.

Take the example of an engraving operation where the code may be reused on different stock. G-code with Z=0 at bottom becomes an inconvenience.
I save programs for reuse and Z=0 at top gives me consistency without having to keep notes or fudge offsets.
That's my take and I'm not saying your way is wrong, I'm aware of reasons for your method. Consistency in using offsets is probably more important than the methods used.
For English help on youtube check out Joko Engineering or Mango Jelly Solutions.
Look for recent videos, this software is updated at a rapid pace.
User avatar
shadowbane1000
Posts: 10
Joined: Wed Jan 20, 2021 10:45 pm

Re: Generating efficient tool paths

Post by shadowbane1000 »

In your first image, I believe the line you circled in highlighter is the move from X0,Y0,Z0 to the first location in the GCode. It's not possible for the drawing code to know where your machine will be when you start the program, so, it just assumes it is at 0,0,0 before you start. The only real alternative would be to not draw anything until all axis have moved to a known value, then start drawing. But it's useful to know what the first couple of moves will be.

This is one reason that setting Z=0 to the top of the part can be useful.

On the other hand, setting Z=0 to the bottom of the part or other locations is useful you have known fixturing locations and known tool lengths as you don't have to do any set up at all, just put the part in and hit go...

I always used to use Z=0 as the top because my first machine didn't know anything about itself or the world it was in, so I had to set each tool height separately and such, which is easier with Z=0 at top. Now I'm learning to use a machine with absolute encoders, a trammed in vise on the table, etc, and so far it is OH SO NICE! But so far, Z=0 at the bottom tends to be easier.
Cincinnati Lamb VCNC 500 3 axis w/Fanuc 21i-MB 11hp
MightyMouse DIY 3 axis w/LinuxCNC 2hp
User avatar
shadowbane1000
Posts: 10
Joined: Wed Jan 20, 2021 10:45 pm

Re: Generating efficient tool paths

Post by shadowbane1000 »

Just realized I hadn't responded to #3 or #4.

#3 - Look in the Path menu at the Dressups. I believe are looking for the RampEntry dressup. That'll ramp the bit into the workpiece.
#4 - Duplicate the path, make the first one leave some amount of stock (Stock To Leave), and the second copy will serve as your finishing pass... Though I think some of the operations have a finishing pass option built in (adaptive seems too... though I haven't yet tried it on a machine)
Cincinnati Lamb VCNC 500 3 axis w/Fanuc 21i-MB 11hp
MightyMouse DIY 3 axis w/LinuxCNC 2hp
jbraun
Posts: 253
Joined: Fri Sep 18, 2020 5:41 pm

Re: Generating efficient tool paths

Post by jbraun »

I always used to use Z=0 as the top because my first machine didn't know anything about itself or the world it was in,
It had no HOME ?
One of my machines is grbl with no switches so I always move it to the same parking spot before shutting down. Brings to mind an old car that I always parked uphill because the starter wasn't reliable.
With a repeatable HOME and repeatable tool lengths, changing Z0 should just be a matter of changing a G5x Z entry with one touch-off. Depends on the method used though. Works without repeatable HOME too but power down will mess things up. Or at least mess things up if a user doesn't have fancy encoders that store their reading.
My opinions on offsets have managed to hijack this thread so I'm outta here,
For English help on youtube check out Joko Engineering or Mango Jelly Solutions.
Look for recent videos, this software is updated at a rapid pace.
GeneFC
Veteran
Posts: 5373
Joined: Sat Mar 19, 2016 3:36 pm
Location: Punta Gorda, FL

Re: Generating efficient tool paths

Post by GeneFC »

jbraun wrote: Sat Jan 23, 2021 9:52 am With a repeatable HOME and repeatable tool lengths
Simple machines may or may not have a Home. They likely do not have repeatable tool lengths.

There is no right or wrong with respect to zero positions.

The bottom line for all of this discussion is that the user must be fully aware of the positioning strategy and must be fully consistent in usage.

Otherwise bad things happen. :o

Gene
Post Reply