Questions tagged [g-code]

G-code is the common name for the widely-used computer numerical control (CNC) programming language defined in EIA-274.

117 questions
1
vote
1 answer

Is there a human readable machine control file format

I am looking for a generic machine control file format to interface with a device. The device consists of various valves, pump, and heaters, and is running embedded C. I would like to be able to control the sequence these devices activate in a…
HugoDW
  • 13
  • 3
1
vote
1 answer

How to decode .dxf files?

I would like to convert the drawings inside a .dxf file into g-code. There are tools doing that but I would like to code it myself. So, the very first part is to decode the .dxf format. Yet, the contents of the .dxf file does not look easy to…
Xfce4
  • 557
  • 5
  • 28
1
vote
2 answers

javascript regex to parse Gcode values

I've been banging my head against this for 2 days and still can't crack it. I have Gcode files with hundreds of lines of XY position data and I'm trying to work out the regex to extract only the float values following the "X" and "Y"…
23fps
  • 11
  • 2
1
vote
1 answer

G-Code post Processing script using Perl to lessen paste 3D printer ooze

this is my first post so I hope I set this up correctly. Basic situation: I'm trying to use a post processing Perl script to change lines of G-code for my custom paste 3D printer. To prevent the paste from oozing I've had decent success by manually…
m slez
  • 13
  • 2
1
vote
1 answer

How much faster is a low level language than a higher level language?

The main two I am considering for my CNC are sending commands through GCODE or Python as the language communicated. I know higher level languages tend to be slower but was wondering how much.
1
vote
1 answer

Changing a file in Python

Recently, Iv'e started to programm in Python. I'm interested in translating lines of G-code : G1 F1200 X253.644 Y174 Z0.2 E3.05044 G1 X252.388 Y174.497 Z0.2 E3.06822 G1 X251.084 Y174.685 Z0.2 E3.08557 to a txt file of the form : GoTo(X(253.644),…
1
vote
1 answer

is there G-Code syntax for monaco editor?

I'm trying to create a code editor via monaco loader which is going to do all of the appropriate formatting and highlighting for .g-code files. I understand that for this to work I need g-code as the language but g-code isn't on the list of options.…
sjjk001
  • 175
  • 2
  • 12
1
vote
1 answer

How do you send two different g-code instructions simultaneously?

Im trying to send two different g-code instructions to the SKR V1.3 simultaneously using the pi 4B's UART pins to control two wheel stepper motors and one stepper motor for my lidar system: First i send this command in order to allow un-restricted…
1
vote
1 answer

Calculate volume of a gcode file in C#

I'm trying to get or calcualte the volume of a gcode (3D printing) file in my C# project. To read the gcode I'm using this third-party library: https://github.com/gradientspace/gsGCode Sadly the author haven't responded yet. For now, this is how I…
1
vote
0 answers

javascript: distribute points on svg paths in adaptative way

I've been working for years on Processing, and I'm now in the process of "migrating" on js/node. Something I've quite worked on in the past is g-code generation. Now, I'm now a bit familiar with the svg implementation on vanilla js and as well on…
piLeoni
  • 131
  • 13
1
vote
1 answer

Modifying Gcode

I am trying to open a .gcode file, read it, and based on what it reads add a specific number to the number attached to any string that contains 'Z' Below is a sample of gcode: G1 Z0.3 G1 F6000 E0 G1 F900 X-14.561 Y14.562 E2.27024 G1 X-14.561…
Bkal05
  • 109
  • 2
  • 7
1
vote
2 answers

Why NIST RS274NGC G-Code Interpreter uses this code style?

I just compiled NIST RS274NGC G-Code Interpreter and saw unbelievable 890 warnings from gcc. 200 of them were caused by this array: char * _rs274ngc_errors[] = { /* 0 */ "No error", /* 1 */ "No error", /* 2 */ "No error", /* 3 */ "No…
Amomum
  • 6,217
  • 8
  • 34
  • 62
1
vote
1 answer

Is there anyway to auto-run a file in Universal Gcode Sender on the program's startup instead of having to upload a file?

I have a file "myFile.gcode" which contains some G-code commands. As it stands Universal Gcode Sender allows the user to upload a file to be executed. However I would like "myFile.gcode" to be run as soon as the program starts up instead of me…
Giga Chad Coding
  • 178
  • 3
  • 12
1
vote
1 answer

Calculate the X -aixes Limmets of a arch from G-Code

I am trying to determine the limits of an arch for a couple of days now without much successes.I know this is more of a geometry type question than programming but here it goes.Let me first show this image to elaborate on what I am trying to achieve…
DarkPh03n1X
  • 600
  • 1
  • 7
  • 17
1
vote
0 answers

Was SVG(Scalable Vector Graphics) created with G-CODE in mind?

As someone who has studied CNC (Computer Numerical Control), I was taught G-Code. When I opened an SVG file to apply certain compatibility changes to it, its path attribute reminded me of G-Code. Now, I get that both work with vectors and such, but…
Statharas.903
  • 463
  • 1
  • 5
  • 13