CAM simulation for the Path Workbench

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!
User avatar
JoshM
Posts: 456
Joined: Thu Oct 05, 2017 5:34 pm
Location: New Hampshire

Re: CAM simulation for the Path Workbench

Post by JoshM »

Hi Shai,
I hadn't thought to try that before, but when I did try it just now, the Pause works fine during the FF/Computation stage. It seems like it's on the playback side of things... It's a minor thing really.

Have you had any thoughts on whether it's feasible to add in the Path-Dressup, and Path-Partial-Commands? Those are the biggest limitation for me at the moment. Really appreciate this feature!

Best Regards,
Josh
User avatar
shaise
Posts: 486
Joined: Thu Jun 11, 2015 8:11 am

Re: CAM simulation for the Path Workbench

Post by shaise »

JoshM wrote: Tue Nov 21, 2017 6:04 pm Path-Dressup, and Path-Partial-Commands
It might seem odd, but I'm not familiar with all the Paths options. Can you explain what are these 2 features?
User avatar
JoshM
Posts: 456
Joined: Thu Oct 05, 2017 5:34 pm
Location: New Hampshire

Re: CAM simulation for the Path Workbench

Post by JoshM »

Hi Shai,
I'm still figuring things out myself, so no problem.

Under the Path-WB, Path-Menu, all the Path Operations are available:

Path-Dressup:
1. DogBone-Dress-up: Modifies Contour Cuts to over-cut the corners.
2. DragKnife-Dress-up: I don't know how this one works, but believe it's used for foam cutters that literally drag a knife blade.
3. Tag-Dress-up: I'm not positive, but believe this places Tabs to be when you do a cutout, similar to what I see when I order Arrays of PCBs.
4. RampEntry-Dress-up: Modifies an operation to ramp into the cut, for example, when entering a Pocket operation, instead of Plunging.

To use these (I've only used Dogbone and RampEntry so far), I select the Operation I want to Dress-Up, then I select the option from the Menu. The Operation is then subsumed under the Dress-up (In same way in greater FreeCad, an underlyng Sketch sits under the Pocket/Pad/Groove/etc...), and is moved to the bottom of the Operation list, from where I move it back to its proper order.

Fundamentally, at least with DogBone and RampEntry, the GCode is just modified, so if your simulator is GCode driven, it should be reasonably easy to add these in. At the moment, if Enabled in your Simulation-List, they stall it.

Similarly, the Partial-Path-Commands (also in the Path-Menu) stall your Simulator if enabled on the list.
Path-Partial-Commands:
1. Selection-Plane: Selects XY, XZ, YZ as the working Plane. I think this will be used for greater than 3-axis work, but am not positive about that. It also may apply to Vertical versus Horizontal CNC. Again, haven't used it myself.
2. Fixture: Selects G53-G59.9. I have used this and it stalls your simulator if selected.
3. Tool-Length-Offset: Appears to provide a mechanism for applying a Z-Offset, but haven't used it yet.
4. Comment: I believe it inserts a comment in the Job, but haven't used it yet.
5. Stop: Inserts a Full-Stop M-Code into the Job.
6. Custom: Allows Custom-GCode to be inserted by hand.
7. From-Shape: Generates GCode Paths from the selected shape and appends it after the Job I believe. The code follows the Shape, with no Offset I believe. This is a bit weird, but this is also available from the main Path menu, which I believe is a redundancy...

Below that, on the Path-Menu, is another sub-menu, Path-Modifications. I don't believe these impact your Simulator.
1. Copy the Operation In The Job: Makes a copy of the currently selected Operation, so since the basic operations don't stall the simulator, copies are fine.
2. Array: I just played with this. It takes an operation, and makes a selectable number of copies at a selectable X,Y, or Z offset (or combination). I'd never used this, but tried it with success on your simulator.
3. Simple-Copy: Copies the Selected Operation, but not sure the distinction between this and a regular copy. I tried it and it doesn't appear to work in your Simulator...

I hope this helps clarify those other items that are not yet supported.

Best Regards,
Josh
mlampert
Veteran
Posts: 1772
Joined: Fri Sep 16, 2016 9:28 pm

Re: CAM simulation for the Path Workbench

Post by mlampert »

JoshM wrote: Tue Nov 21, 2017 6:48 pm Under the Path-WB, Path-Menu, all the Path Operations are available:

Path-Dressup:
1. DogBone-Dress-up: Modifies Contour Cuts to over-cut the corners.
2. DragKnife-Dress-up: I don't know how this one works, but believe it's used for foam cutters that literally drag a knife blade.
3. Tag-Dress-up: I'm not positive, but believe this places Tabs to be when you do a cutout, similar to what I see when I order Arrays of PCBs.
4. RampEntry-Dress-up: Modifies an operation to ramp into the cut, for example, when entering a Pocket operation, instead of Plunging.

To use these (I've only used Dogbone and RampEntry so far), I select the Operation I want to Dress-Up, then I select the option from the Menu. The Operation is then subsumed under the Dress-up (In same way in greater FreeCad, an underlyng Sketch sits under the Pocket/Pad/Groove/etc...), and is moved to the bottom of the Operation list, from where I move it back to its proper order.

Fundamentally, at least with DogBone and RampEntry, the GCode is just modified, so if your simulator is GCode driven, it should be reasonably easy to add these in. At the moment, if Enabled in your Simulation-List, they stall it.
this is a pretty accurate summary and explanation of all dressups. They are also regular Path features the only distinction is that they (should) not reference a ToolController directly - the ToolController is defined by the base operation. Strictly speaking they take plain g-code as input and output g-code
Similarly, the Partial-Path-Commands (also in the Path-Menu) stall your Simulator if enabled on the list.
Path-Partial-Commands:
1. Selection-Plane: Selects XY, XZ, YZ as the working Plane. I think this will be used for greater than 3-axis work, but am not positive about that. It also may apply to Vertical versus Horizontal CNC. Again, haven't used it myself.
2. Fixture: Selects G53-G59.9. I have used this and it stalls your simulator if selected.
3. Tool-Length-Offset: Appears to provide a mechanism for applying a Z-Offset, but haven't used it yet.
4. Comment: I believe it inserts a comment in the Job, but haven't used it yet.
5. Stop: Inserts a Full-Stop M-Code into the Job.
6. Custom: Allows Custom-GCode to be inserted by hand.
7. From-Shape: Generates GCode Paths from the selected shape and appends it after the Job I believe. The code follows the Shape, with no Offset I believe. This is a bit weird, but this is also available from the main Path menu, which I believe is a redundancy...

Below that, on the Path-Menu, is another sub-menu, Path-Modifications. I don't believe these impact your Simulator.
1. Copy the Operation In The Job: Makes a copy of the currently selected Operation, so since the basic operations don't stall the simulator, copies are fine.
2. Array: I just played with this. It takes an operation, and makes a selectable number of copies at a selectable X,Y, or Z offset (or combination). I'd never used this, but tried it with success on your simulator.
3. Simple-Copy: Copies the Selected Operation, but not sure the distinction between this and a regular copy. I tried it and it doesn't appear to work in your Simulator...
Simple-Copy does just that, think of it as a Copy-and-Paste in one command. Once the copy is created it is not connected to the source anymore - each one can/must be modified independently.
User avatar
shaise
Posts: 486
Joined: Thu Jun 11, 2015 8:11 am

Re: CAM simulation for the Path Workbench

Post by shaise »

Josh,

Basically the simulator should handle any generated gcode, so I guess the ones that do not work, are just handled incorrectly by the simulator.
Can you please attach a freecad file with all the path options you stated, and I will try to make it work.

shai
User avatar
JoshM
Posts: 456
Joined: Thu Oct 05, 2017 5:34 pm
Location: New Hampshire

Re: CAM simulation for the Path Workbench

Post by JoshM »

Hi Shai,
Attached is a simple Example file with most if not all of those options exercised.
Best,
Josh
Attachments
FreeCad_Simulation_Example_File.FCStd
(47.39 KiB) Downloaded 41 times
User avatar
shaise
Posts: 486
Joined: Thu Jun 11, 2015 8:11 am

Re: CAM simulation for the Path Workbench

Post by shaise »

Josh,

The first reason some operations do not work is a bug... will be fixed.
The second reason some operations do not work is that these operations lack a tool. Though the simulator is based on GCodes for movement, It takes the tool type from the operation itself, and operations like "custom" do not have a tool associated. What I can do for these operations is continue with the last tool used in previous operations. But if this is the only operation, this can not be done.


BTW I was not aware of all these extra features, since I always used the tool bar - not the menu... :oops:

shai
User avatar
JoshM
Posts: 456
Joined: Thu Oct 05, 2017 5:34 pm
Location: New Hampshire

Re: CAM simulation for the Path Workbench

Post by JoshM »

Yes, on Custom, there is no Tool per se. I generally--though I didn't in that example--insert the Tool code by hand to ensure that my Post-Processor handles it appropriately.

For example, in a recent Job, I had a Custom-GCode that began with:

(machine: iWorx Taig CNC mm/min)
(T21: 1/8 Tapered 2-Degree-400mm/minute)
M6 T21
M3 S10600.0000

Would this suffice to provide the Tool-Diameter for your Simulation, assuming T21 references a properly defined Tool-Controller?

I was also surprised when generating the Example file for you because RampEntry prompted me for a Tool-Controller, though one is defined for the under-lying Operation. I assume the Tool-Controller would have to match the underlying Tool, though not necessarily the Tool-Controller--that is, if it's a 3/8" Endmill during RampEntry, then that is what is used during the Operation. In testing this out now, it seems that if you select a different Tool-Controller in the RampEntry, it then changes the underlying operation to match. That is different from Dogbone....

In any case, if you were able to make it so things didn't "hang" on non-Tool-Controller operations such as Fixture, that would be fine as there is noting to be done there anyway... I think Dogbone and Ramp will take care of themselves as they have GCode, and an underlying Tool-Controller.

Glad I was able to help show you something in return for ALL that you have done Shai!

Best,
Josh
mlampert
Veteran
Posts: 1772
Joined: Fri Sep 16, 2016 9:28 pm

Re: CAM simulation for the Path Workbench

Post by mlampert »

shaise wrote: Tue Nov 21, 2017 8:41 pm ... What I can do for these operations is continue with the last tool used in previous operations. But if this is the only operation, this can not be done.
You might also consider checking if the OP has a "Base" property, and if so check if that Base has a "ToolController". You need to check recursively because a dressup can get applied on top of another dressup. If you do a simple cutout, a Contour with a Tags dressup on top of it might be the only OP in your job.
User avatar
shaise
Posts: 486
Joined: Thu Jun 11, 2015 8:11 am

Re: CAM simulation for the Path Workbench

Post by shaise »

mlampert wrote: Tue Nov 21, 2017 8:58 pm You might also consider checking if the OP has a "Base" property, and if so check if that Base has a "ToolController".
On further investigation, all operations with 'Base' have also a tool, so they are ok.
The only 2 problematic operations are "Custom" and "Simple Copy" both have no Base, nor a tool

shai
Post Reply