a lot of unneeded lines gcode if using array

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!
Post Reply
herbk
Veteran
Posts: 2660
Joined: Mon Nov 03, 2014 3:45 pm
Location: Windsbach, Bavarya (Germany)

a lot of unneeded lines gcode if using array

Post by herbk »

Hi,
i try to make a new vakuum desk for my router, and need to drill about 2000 holes for that.
Because FC needs a very long time to create a array for 2000 holes, i made only one hole, create a drilling path from it and made a Array with path.

The resulting gcode works (tested on LinuCNC) but the whole code contends much unnedet lines.

FC shows this output for the array:
drilltest.jpeg
drilltest.jpeg (85.86 KiB) Viewed 1304 times
The big amount of rapid movements are only a display problem. If i import the FC gcode at the machine, the done path will be shouwn correct, from one hole to the next.

The gcode Path WB creates looks like that:
drilltest_2.jpeg
drilltest_2.jpeg (85.16 KiB) Viewed 1304 times

The code don't need the lines between the the different drilling lokations. If i reduce it to:
drilltest_3.jpeg
drilltest_3.jpeg (117.91 KiB) Viewed 1304 times
both codes are working, the machine makes the same operation.

It works on that way to, and if it's more easy to programm... why not.... But repeading only the operation, without the only one time needed commands and comments, minors the code very much... in this example from about 16000 to 2000 lines. ;)
Last edited by herbk on Thu Oct 05, 2017 5:39 pm, edited 1 time in total.
Gruß Herbert
roivai
Posts: 117
Joined: Thu Feb 02, 2017 5:29 pm
Location: Oulu, Finland

Re: a lot of unneeded lines gcode if using array

Post by roivai »

Hi herbk,

I kind of agree - array generates a lot of redundancy. But getting rid of that will probably be difficult. Right now, the Array command simply creates a copy of the G-Code. Getting rid of comments would be easy of course, but at least I don't want that every time, so that should be enabled by some checkbox in the Array command. To make it more intelligent, the system would need to know about modality of G-Code, so if we already are in G90 mode, it would be removed from the copies. Or if Z is already 16, the rapid G0 Z16 would be removed and so on.. Those could probably be done, but it might be risky business, I don't know if all CNC controllers handle modality the same way. I might even consider making that logic into post processor instead of all the PathOps..
mlampert
Veteran
Posts: 1772
Joined: Fri Sep 16, 2016 9:28 pm

Re: a lot of unneeded lines gcode if using array

Post by mlampert »

Doesn't solve the array problem, and it might not work at all - I was wondering if you would be better off creating those 2000 holes in the model (which also has an array feature so it should be about the same amount of work) and use the "Reset" feature of the Drilling operation - it should find all of them and generate more efficient g-code.
herbk
Veteran
Posts: 2660
Joined: Mon Nov 03, 2014 3:45 pm
Location: Windsbach, Bavarya (Germany)

Re: a lot of unneeded lines gcode if using array

Post by herbk »

Hi Markus,
to buid the array of 2000 "drills" is not the (time) problem, that needs nearly the same time as the Path array. What needs time is the boolean cut for the holes, about 2,5 Minutes (i'v had longer in mind...)
Also, if i select the cut for the job, it needs about 30 secounds till the job is createt and if it is FC slows down.

And last: in this moment i don't know how to select all 2000 holes at once....

Edit Figured out: just select the base object (the cut) and click "drilling"...? FC works 10 minutes now... and still works... ;)

So "make only one hole per boolean and the others per Path array" is much faster.
The order of the holes createt from path array isn't so bad as the picture suggests, the machine shows line after line
Gruß Herbert
chrisb
Veteran
Posts: 54207
Joined: Tue Mar 17, 2015 9:14 am

Re: a lot of unneeded lines gcode if using array

Post by chrisb »

We had a similar discussion before and IIRC it should be in the post processor. I have it in my philips postprocessor configurable. I did not adapt it for quite a while so I guess it is currently not working, but you may still have a look if you are interested.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
herbk
Veteran
Posts: 2660
Joined: Mon Nov 03, 2014 3:45 pm
Location: Windsbach, Bavarya (Germany)

Re: a lot of unneeded lines gcode if using array

Post by herbk »

Hi Markus,
i was patient and rund a the drilling operation for the 2000 holes till the end. After 1h 10 min it finishd and i got a perfect result, - gcode and screenview. :D
drilltest_4.jpg
drilltest_4.jpg (188.66 KiB) Viewed 1180 times
.

Im sure that a drilling operation with such a lot of holes is not needet very often and so it's not a real problem if the produced code contends a few unneedet lines. The code based on Path array results not in an error on the machine and so that's nothing important.
Only thing is: In my mind the code is confusing if there are redundant commands and comments, - but thats i'm in mind... now i know and as long as the code works i can life with it. ;) ;)
Gruß Herbert
mlampert
Veteran
Posts: 1772
Joined: Fri Sep 16, 2016 9:28 pm

Re: a lot of unneeded lines gcode if using array

Post by mlampert »

herbk wrote: Fri Oct 06, 2017 2:11 pm i was patient and rund a the drilling operation for the 2000 holes till the end. After 1h 10 min it finishd ....
Wow - I think you earned a trophy for most complex path operation every successfully processed with Path! That is pretty impressive 8-)
herbk
Veteran
Posts: 2660
Joined: Mon Nov 03, 2014 3:45 pm
Location: Windsbach, Bavarya (Germany)

Re: a lot of unneeded lines gcode if using array

Post by herbk »

Hi Markus,
the trophy have to go to the people which make that possible...

For me it was easy, only difficulty i'f had: keeping patient... ;) ;)
Gruß Herbert
Post Reply