post processor resources

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!
Beresford Romeo
Posts: 5
Joined: Mon Sep 21, 2020 3:25 pm

Re: post processor resources

Post by Beresford Romeo »

Hi Paula

Thanks again for your help. I was able to use your post-processor to post out CAM. I had to add a line at line #97 with the value CURRENT_Z =0 because I was getting an error relating to that not being set.

Everything is great but I wondered if you could help me with one more thing.

Below is the g-code for two operations. The first is three holes the second is a profile cut (starts N560).

I think in order to demonstrate the last step that would make this work as a plasma spot drill is to use the code on line N350.

N350 G0 X108.704 Y107.948..... I need to add another line after this that reads N351 G1 X108.704 Y107.948 F20 (any feed rate will do). This is because when the controller sees a G1 the THC (Torch Height Controller) will move the torch down to the piece height, fire the torch wait for a time (ie dwell), in this case the G1 move will be to the same location and when the dwell time is over it will proceed with the next line which is a G0 move to the next drill position.

If there is a way I can get the post-processor to write the line again with the G0 replaced by G1 and a feed rate (any feed rate value) then the whole thing will work without the need for any manual input. This could be a really useful feature because plasma spot drilling is not available in any CAD-CAM package that I am aware of and the workarounds for it are usually inelegant or expensive (plate marker/engraver).

I can't thank you enough for your help. I will test out your post-processor some more and upload the working version for profile cutting at the very least as a Torchamate processor. Hopefully, others can make use of it.



N100 (Exported by FreeCAD)
N110 (Post Processor: torch_post)
N120 (Output Time:2021-04-13 12:30:09.855997)
N130 (begin preamble)
N140 (begin operation: Fixture)
N150 (Path: Fixture)
N160 (G54)
N170 (finish operation: Fixture)
N180 (begin operation: TC: 5mm Drill)
N190 (Path: TC: 5mm Drill)
N200 (TC: 5mm Drill)
N210 (begin toolchange)
N220 (M6 T2.0)
N230 (M3 S0.000)
N240 (finish operation: TC: 5mm Drill)
N250 (begin operation: Drilling)
N260 (Path: Drilling)
N270 (Drilling)
N280 (Begin Drilling)
N290 (G90)
N300 (G99)
N310 ; cmd G81
N320 ; params {'F': 0.0, 'R': 10.0, 'X': 108.704454, 'Y': 107.948294, 'Z': 0.0}
N330 ; DRILL_RETRACT_MODE G98
N340 (G81 X108.704 Y107.948 F0.00 R10.000)
N350 G0 X108.704 Y107.948
N360 (G80)
N370 ; cmd G81
N380 ; params {'F': 0.0, 'R': 10.0, 'X': 143.295546, 'Y': 107.948294, 'Z': 0.0}
N390 ; DRILL_RETRACT_MODE G98
N400 (G81 X143.296 Y107.948 F0.00 R10.000)
N410 G0 X143.296 Y107.948
N420 (G80)
N430 ; cmd G81
N440 ; params {'F': 0.0, 'R': 10.0, 'X': 126.0, 'Y': 151.0, 'Z': 0.0}
N450 ; DRILL_RETRACT_MODE G98
N460 (G81 X126.000 Y151.000 F0.00 R10.000)
N470 G0 X126.000 Y151.000
N480 (G80)
N490 (finish operation: Drilling)
N500 (begin operation: TC: Plasma 85A001)
N510 (Path: TC: Plasma 85A001)
N520 (TC: Plasma 85A001)
N530 (begin toolchange)
N540 (M6 T10.0)
N550 (M3 S0.000)
N560 (finish operation: TC: Plasma 85A001)
N570 (begin operation: LeadInOutDressup001)
N580 (Path: LeadInOutDressup001)
N590 (Profile)
N600 (Compensated Tool Path. Diameter: 1.5)
N610 G0 X3.985 Y1.157
N620 G1 X3.985 Y1.157 F0.00
N630 G3 X3.985 Y3.985 I-1.414 J1.414 F0.00
N640 G1 X3.985 Y3.985
N650 G2 X0.251 Y12.971 I9.016 J9.016 K0.000
N660 G1 X0.250 Y239.000
N670 G2 X12.971 Y251.749 I12.750 J-0.001 K0.000
N680 G1 X239.000 Y251.750
N690 G2 X251.749 Y239.029 I-0.001 J-12.750 K0.000
N700 G1 X251.750 Y13.000
N710 G2 X239.029 Y0.251 I-12.750 J0.001 K0.000
N720 G1 X13.000 Y0.250
N730 G2 X3.985 Y3.985 I0.001 J12.750 K0.000
N740 G3 X1.157 Y3.985 I-1.414 J-1.414 F0.00
N750 (finish operation: LeadInOutDressup001)
N760 (begin postamble)
N770 M2
Beresford Romeo
Posts: 5
Joined: Mon Sep 21, 2020 3:25 pm

Re: post processor resources

Post by Beresford Romeo »

Hi Paula

Apologies I noticed that you have added a section in your post processor regarding the M50 command. I will take a further look at this to see why this did not work on my code export. This M50 stuff is an alternative way of firing the torch (instead of using a feedrate move to the same location as I detailed in my last post).

Sorry for the confusion.
Paula
Posts: 48
Joined: Tue Jan 26, 2021 10:06 pm

Re: post processor resources

Post by Paula »

Beresford Romeo wrote: Tue Apr 13, 2021 1:47 pm Hi Paula

Apologies I noticed that you have added a section in your post processor regarding the M50 command. I will take a further look at this to see why this did not work on my code export. This M50 stuff is an alternative way of firing the torch (instead of using a feedrate move to the same location as I detailed in my last post).

Sorry for the confusion.
Hi,

In case you haven't already figured it out yourself, you need to specify a dwell period in the drill operation otherwise FreeCAD won't generate the G82 command which the post-processor uses.

I've done some more code clean-up to get rid of more redundant code and improve the commentary. I've named this version to reflect that it's intended for use with a a Torchmaster. Hope this is of some use to you.
Attachments
torchmate_post.py
(15.09 KiB) Downloaded 104 times
Beresford Romeo
Posts: 5
Joined: Mon Sep 21, 2020 3:25 pm

Re: post processor resources

Post by Beresford Romeo »

Hi Paula

Apologies I have not replied sooner. I have had so little time to mess around with this and I have been meaning to reply for days.

As far as I can tell your amendments work a treat. I was able to simulate both the profile and drill toolpaths in my controller software and it seems to work. I will try to run an actual test as soon as I can and let you know how it goes.

I can't thank you enough for your help with this. Plasma drilling is a bit of a holy grail and it really changes the game somewhat for accurate hole placements. Is there any way I can donate some money to you by way of thanks. If not I will see if I can donate to Sliptronic or Real Realthunder.

Thanks again.
Paula
Posts: 48
Joined: Tue Jan 26, 2021 10:06 pm

Re: post processor resources

Post by Paula »

Hi Beresford,

I'm glad you found it useful.

I'm not part of the development team and am not looking for any sort of reward but thank you for your kind offer. I started tinkering with the GRBL post-processor a while ago because the peck drilling operation was abysmally slow on my little 3018 CNC so I rewrote that part of the code for my own use and amusement (although now retired I spent over 30 years as a software consultant/developer). In reality my small mods were simply built on the excellent work of the dev team and IMHO they are far more worthy of a donation than me.

ATB

Paula
Post Reply