Arithmetic expression is gcode?

Results 1 to 9 of 9

Thread: Arithmetic expression is gcode?

  1. #1
    Activation process mbradford's Avatar
    Join Date
    Aug 2018
    Posts
    12
    Downloads
    0
    Uploads
    0

    Default Arithmetic expression is gcode?

    Can I use arithmetic expressions in gcode for CNCUSB?

    For example: G1 [Z]+0.1

    I am thinking about this as a way to position my laser cutter while still retaining the ability the adjust Z height. This would allow me to engrave along a curved surface while maintaining a consistent depth of cut. Is there a better way to do this?

    Similar Threads:


  2. #2
    Member CitizenOfDreams's Avatar
    Join Date
    Nov 2012
    Location
    USA
    Posts
    1267
    Downloads
    4
    Uploads
    0

    Default Re: Arithmetic expression is gcode?

    One way to engrave a non-flat part is to probe the surface and adjust the G-code for the height variations. A program called AutoLeveller does just that (and does it quite well). Do you have a way to attach a probe to your machine?



  3. #3
    Member PlanetCNC's Avatar
    Join Date
    Mar 2017
    Location
    Slovenia
    Posts
    1311
    Downloads
    0
    Uploads
    0

    Default Re: Arithmetic expression is gcode?

    TNG has very powerful arithmetic that you can use in g-code. However I don't understand how this will help you in your case.
    You can use Warp feature to engrave curved surfaces. You don't need AutoLeveller if you use Warp.



  4. #4
    Activation process mbradford's Avatar
    Join Date
    Aug 2018
    Posts
    12
    Downloads
    0
    Uploads
    0

    Default Re: Arithmetic expression is gcode?

    I apologize for not being clearer. I am thinking specifically about engraving on non-planar surfaces as part of the creation process. Example: I made a loose change dish for my son, and I wanted to engrave scripture in the bottom as just another toolpath within a single project. Since the g-code already contains the contour information, It seems (to my simple mind) like it would be more straightforward to use mathematical expressions to keep the laser head 10 mm above the workpiece surface as the head moves along. But maybe I'm approaching it wrong...



  5. #5
    Member CitizenOfDreams's Avatar
    Join Date
    Nov 2012
    Location
    USA
    Posts
    1267
    Downloads
    4
    Uploads
    0

    Default Re: Arithmetic expression is gcode?

    I'm afraid what are you planning to do is way beyond "arithmetics in G-code". Imagine you are engraving a straight line across your dish - the Z would have to change constantlty as a (non-linear) function of X and Y. This math needs to be done either on the controller level (this is what the Warp feature does, I presume), or in a 3D CAM program, or in a program like Autoleveller.



  6. #6
    Member PlanetCNC's Avatar
    Join Date
    Mar 2017
    Location
    Slovenia
    Posts
    1311
    Downloads
    0
    Uploads
    0

    Default Re: Arithmetic expression is gcode?

    Please send me dish and scripture g-code.
    I'll check if something can be one.



  7. #7
    Activation process mbradford's Avatar
    Join Date
    Aug 2018
    Posts
    12
    Downloads
    0
    Uploads
    0

    Default Re: Arithmetic expression is gcode?

    Here is the file. I completed the initial project before I have a laser, so I used a small-diameter bit to engrave the scripture. Now that I have a laser, I would like to use it for engravings since it has a significantly higher resolution.

    Thank you for you trouble!

    Attached Files Attached Files


  8. #8
    Activation process mbradford's Avatar
    Join Date
    Aug 2018
    Posts
    12
    Downloads
    0
    Uploads
    0

    Default Re: Arithmetic expression is gcode?

    I just realized the first file I uploaded was the dish and engraving as a single file. So here they are as separate files (in a single zip):

    Attached Files Attached Files


  9. #9
    Activation process mbradford's Avatar
    Join Date
    Aug 2018
    Posts
    12
    Downloads
    0
    Uploads
    0

    Default Re: Arithmetic expression is gcode?

    I am embarrassed at how difficult I was making this. After some more digging, I realized I could use a combination of G49 and G42 to accomplish exactly what I wanted to do. Thanks to all who used some of their limited time on my (really simple) problem...



Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


About CNCzone.com

    We are the largest and most active discussion forum for manufacturing industry. The site is 100% free to join and use, so join today!

Follow us on


Our Brands

Arithmetic expression is gcode?

Arithmetic expression is gcode?