CamBam
News:
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
January 25, 2020, 12:31:30 pm


Login with username, password and session length


Pages: [1]
  Print  
Author Topic: Need help with quickly editing Gcode  (Read 886 times)
Bubba
CNC Jedi
*****
Offline Offline

Posts: 2779



View Profile
« on: December 28, 2019, 17:59:56 pm »

Not sure where to place this topic so I posted it here, I'm sure David will move it if is out of place. Grin

So,need to edit gcode Z values quickly, I know I can do that manually but there must be a better way to do this without
spending hours doing so. Tried the notepad find/replace option, but it only works the replacing known value with a value.. I have notepad++, and I'm pretty sure it can do this what i.m after if you know what you doing and understand macros, I certainly don't. So I'm asking for help here, either please give me suggestions or write macro for notepad++. I'm pretty sure many of you can do this. To explain why I need this. As some of you know, I'm fiddling with laser and successfully been able to cut with it, now I'm trying to engrave picture on plywood. After creating toolpath using  highmap plugin I need to use the engrave MOP and it follows the toolpath. All I need for the laser to work correctly the Z values must be changed to Z-0.001.

Attached is snipped of the gcode for those of you who wan't to give me an idea how to edit it in Notepad++.

Thanks.

* Z values.txt (0.92 KB - downloaded 9 times.)
Logged

My 2¢
dh42
Administrator
CNC Jedi
*****
Offline Offline

Posts: 5728



View Profile WWW
« Reply #1 on: December 28, 2019, 18:53:17 pm »

Hello

Not sure to understand why you're using a heighmap for engraving with a laser  Huh

I did not use heightmap plugin for a long time, but if I well remember, it generate polylines ?

Maybe you can flatten the polylines before to use them with an engrave mop

http://www.atelier-des-fougeres.fr/Cambam/Aide/Plugins/flatten.html

++
David
Logged
Bubba
CNC Jedi
*****
Offline Offline

Posts: 2779



View Profile
« Reply #2 on: December 28, 2019, 20:32:34 pm »

Thanks David, even thou your suggestion (flatten .*) would not work I don't think Wink You give me an idea to limit the max/min settings to 0.001" in heightmap plugin when generating polyline.

As I mentioned in previous post " I'm trying to engrave picture on plywood" and that's why I'm using heightmap plugin.

Not sure there is any other option in CB.
Logged

My 2¢
dh42
Administrator
CNC Jedi
*****
Offline Offline

Posts: 5728



View Profile WWW
« Reply #3 on: December 28, 2019, 21:34:28 pm »

Not sure it is usable with a laser, but you can find a plugin to engrave picture here

http://www.atelier-des-fougeres.fr/Cambam/Aide/Plugins/Semiton.html

Maybe you can also use the BitMap object ?

http://www.cambam.info/doc/dw/1.0.0/cad/bitmap.html

++
David
Logged
Bubba
CNC Jedi
*****
Offline Offline

Posts: 2779



View Profile
« Reply #4 on: December 29, 2019, 01:27:41 am »

Funny, I just look at the semitone plugin about week a go and give up because is written for V tool. I need to investigate further maybe I find work around this.

Thanks.
Logged

My 2¢
Dragonfly
CNC Jedi
*****
Offline Offline

Posts: 2247



View Profile
« Reply #5 on: December 29, 2019, 09:11:30 am »

In principle a laser can do very good semitone images. Especially if you can control the power according to raster dot (or line) size.
Logged
dave benson
CNC Jedi
*****
Offline Offline

Posts: 1239


View Profile
« Reply #6 on: December 29, 2019, 12:25:59 pm »

Hi Bubba

That plugin was the first to come to mind too, as it is, the output is not laser friendly.
As I have a few lasers, none of them 10 Watt though, and some interest in the subject
I'll write a Post treatment to convert the code into something your laser can use.

There are two options, The first which I will do as it is the easiest and that is to convert the G81's to laser friendly code.
This is where you convert the Z depths to PWM output, this gives you a point that is lighter or darker according to it's depth.
But I'm thinking that this doe's not mimic the same functionality as Drilling a hole, as the depth of the hole gives you
a circle of diameter proportional to the hole depth.

The second way might be to output the point cloud as a series of polylines after first converting them to circles who’s diameter is equal
to the Z depth.
This may give a better result, and if you really wanted to you could get  fancy and hatch the circles according to size.
For example you could use a spiral hatch with widely separated lines at the outer circumference of the circle and progressively
closer together at the centre of the circle, then this would give the illusion of depth to the flat 2d hole.

In pics you can see the Semitone output and the Laser output.
I've made the Spindle speed vary between 0 and 255  for zero and max output
but you'll need to change this for you machine.

How it works is the hole depth governs the laser power and the dwell time at the hole.
I've posted a .nc file for you to try Bubba, just to see if it runs, if it does then I need to know what speed corresponds to
100% PWM. Try to get the most accurate figure  you can as this will make a big difference to the quality of the output.

 

Dave


* SemiTone Output.PNG (58.38 KB, 678x641 - viewed 17 times.)

* SemiTone to Laser.PNG (40.53 KB, 710x629 - viewed 15 times.)
* G81 to laser tests G81ToLaser.nc (248.68 KB - downloaded 7 times.)
Logged
EddyCurrent
CNC Jedi
*****
Offline Offline

Posts: 4119



View Profile
« Reply #7 on: December 29, 2019, 12:36:30 pm »

Dave,

Would it not be better to use the 'line' option in the plugin rather than 'circle' ?
Logged

Made in England
Bubba
CNC Jedi
*****
Offline Offline

Posts: 2779



View Profile
« Reply #8 on: December 29, 2019, 13:38:30 pm »

Hi Bubba

That plugin was the first to come to mind too, as it is, the output is not laser friendly.
As I have a few lasers, none of them 10 Watt though, and some interest in the subject
I'll write a Post treatment to convert the code into something your laser can use.

There are two options, The first which I will do as it is the easiest and that is to convert the G81's to laser friendly code.
This is where you convert the Z depths to PWM output, this gives you a point that is lighter or darker according to it's depth.

That would be awesome, I'm more than happy to test it.

I like the idea of converting Z moves in to PWM output..
Here is short description of my laser setup. Mach3, ESS, G540.

Spindle speed controls the laser power thru PWM

100 rpm-100% power
 50 rpm-50% power
 10 rpm-10% and so on..

I will try it today and post results. Thanks.
Logged

My 2¢
Bubba
CNC Jedi
*****
Offline Offline

Posts: 2779



View Profile
« Reply #9 on: December 29, 2019, 13:50:47 pm »

David, not sure what this gcode supposed to test besides power settings but my 100% power is at 100 rpm. Is it possible to recreate the gcode in inch as well?

Thanks.
Logged

My 2¢
Bubba
CNC Jedi
*****
Offline Offline

Posts: 2779



View Profile
« Reply #10 on: December 29, 2019, 15:13:53 pm »

I would suggest new topic to cover this laser project so in the future it will be easier to find it searching.
Logged

My 2¢
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines

Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM
Page created in 0.139 seconds with 18 queries.

Copyright © 2018 HexRay Ltd. | Sitemap