5 ms·
It would look like something like this: go_home set_units mm set_movements relative activate_tool 0 move X 10 move Y 10 Instead, each
by marcosdumay 8y ago
It would look like something like this:
go_home
set_units mm
set_movements relative
activate_tool 0
move X 10
move Y 10
Instead, each of those names is replaced by G + a number.
- 51lver 8y agoThat's because the above would be highly wasteful on a slow serial link, like the ones gcode was made on and for. That said, I bet vim syntax highlighting could get you most of what you want. Color code movement, configuration, values, maybe display the toolhead status and position at your current line in the status bar...
- marcosdumay 8y agoWell, a gcode file is usually entirely composed of "move" operations. I'm adding one extra character on a 8 characters (at a minimum) line, for an increase of 12.5% at the worst case. A CNC moves with speeds on the mm/s range. So does a 3D printer (unless you ask for larger movements, but those take less codes/s). They also have a precision on the 100's of µm, but let's push it down to 10's here so we overestimate things by an order of magnitude. That means they'll need around 1000 codes/s, with a minimum of 64kbps on the 8 character case, or 72kbps with my codes. I don't think there is any serial interface chipset on the market that can't do 512kbps even on a 100's of meters long cable. Not to say that everything nowadays runs over USB anyway. The gcodes are a leggacy that isn't needed anymore. And since both sides of the CNC link are composed of overpowered computers doing anything on software, the only reason it didn't change already is because nobody bothered to do something better. I'm not much bothered by them either so, I'm not jumping over it, but it is suboptimal.