Hello Guest it is March 29, 2024, 03:04:55 AM

Author Topic: Modifying code to eliminate the up/downs  (Read 4558 times)

0 Members and 1 Guest are viewing this topic.

Modifying code to eliminate the up/downs
« on: September 07, 2014, 01:57:03 AM »
After each pass, the code LazyCam generates causes the Z axis to lift before plunging.

Some searching indicated that the lines causing the raising the Z axis could be commented-out, causing the bit to only plunge until it is done with all passes.

Here is that thread:
https://www.machsupport.com/forum/index.php?action=printpage;topic=7577.0

So I thought I'd write a tiny command-line application that would modify a .tap file.  I'm a competent programmer of command-line utilities.

It would read each line.  If the line lifts the Z, the next line would be examined and if it plunges, then the line that lifts the Z would be commented-out.

But in that thread I've linked above, the OP indicated his efforts to comment-out lines didn't work.

So my question is, how does one properly comment-out a line of g-code?  I imagine the line #'s have to stay, and the semi-colon is added after the line # and before the commands?

My current project requires drilling a number of holes in four passes, so I think my little command-line utility could save me some machine time and also teach me a little about g-code.

DUMB QUESTION:  Maybe there is another way to prevent the ups/downs, and I don't even need to write a small app?
Re: Modifying code to eliminate the up/downs
« Reply #1 on: September 09, 2014, 09:49:19 AM »
Okay, I've got a working small command-line application I'm calling the "LazyCam Z Optimizer" or "LCZO.EXE" for short.

It works like this:

lczo < input_file.tap > output_file.tap

It scans through your input_file.tap and finds any unnecessary movements of the Z-axis, and comments them out.

This can greatly decrease execution time.

For a second I thought it would be unnecessary because I found the "Plunge Clearance" feature, but it turns out that isn't what I thought it was.

Let me know if you want to try my little application.
« Last Edit: September 09, 2014, 09:57:15 AM by cgallery »

Offline RICH

*
  • *
  •  7,427 7,427
    • View Profile
Re: Modifying code to eliminate the up/downs
« Reply #2 on: September 09, 2014, 07:14:54 PM »
Post the file and when i get a chance i'll have a look.

RICH

Offline rcaffin

*
  •  1,052 1,052
    • View Profile
Re: Modifying code to eliminate the up/downs
« Reply #3 on: November 07, 2014, 04:13:37 AM »
Quote
After each pass, the code LazyCam generates causes the Z axis to lift before plunging.
Odd. It does not do that for me.
I am using LCAM to make PCBs for electronics. It seems rather well suited for that. Quirky, yes, but functional.
The PCBs are to upgrade the controls on my CNC. They work. Most appropriate.

Cheers
Roger