G Code import, Any additional header and footer info required?

Hi

I’ve been experimenting with importing G-Code into Easel. I have managed to create the following basic program:

G90
G21
G54
G0 Z20
G0 X20 Y20
M3 S12000
G0 X150.000 Y110.000
G1 Z-2.000 F228.6
G1 X150.000 Y110.000 F762.0
G1 X50.000 Y110.000 F762.0
G1 X50.000 Y50.000 F762.0
G1 X150.000 Y50.000 F762.0
G1 X150.000 Y110.000 F762.0
G90
G21
G1 Z3.810 F228.6
M5
G4 P0.1

and imported the program successfully into Easil. Easil previews the program like this:

I’ve then run the program (in fresh air) on Carvey and it would appear that the program runs OK

What i’d like to know is:

  1. If there’s any standard header and footer information required on the G Code program above that’s missing?
  2. Is the G-Code in the correct layout
  3. Are there any errors within this program (which ran OK this time but could cause issues with other programs)?

Thanks in advance,

Ben

You can’t imagine how I have been looking for a simple example of g-code to import successfully to Easel. I can now go from here to expand on this.

How I can use this template: to calibrate the machine
How I plan to use g-code: I want to import my previous paths into Easel with simple g-code and had to start somewhere.

Thanks.

I too have just started this leaning curve and at:

they said always include:
G17 G20 G90 G94 G54

note that the example they had did not import to Easel and
that is why I liked that yours did.

Hey Theodore,

Pleased that the info was helpful to you. It was quite a simple process to create tbh where i opened easil, created a rectangle and then under machine tab > advanced > export G code.

I then created a new project, then imported rectangular program G code. The G code fails to import initially so i deleted a line at a time, then import G code, delete failed line etc etc. There is a batch of code at the beginning which i beleive is related to the tool length measuring. This needs to be deleted as this is added/runs whenever Carvey starts by default. I beleive that there are also a number of other commands at the program start/finish that are redundant. Anyway eventually you get some Carvey friendly G Code…but remember also this is an unapproved way of creating code so be careful you dont damage your machine

I would like to of seen a complete G Code guide produced by Inventibles. In addition to acceptable G and M codes, it would of been good to of had some info on preferred format, headers/footers, layout, number of decimal places for G0,G1 commands, tolerances of point, etc etc. I hope this will be published soon

Ben

Please forgive my ignorance, and I don’t mean to think you are wasting your time. But why do you want to write gcode when you can use graphical programs to create it for you?

I understand curiosity to learn what the code means so you can troubleshoot a gcode program line by line. But beyond that I don’t understand the appeal.

@GlennCoates good question

I’m in the process of creating a post processor for my CAM software that will drive Carvey. A PP translates CAM code into G code. If I use Easily as the machine controller,it requires the G code in a specific format. By experimenting with simple raw G code I can quickly determine which commands work or not and therefore create rules/determine spec for PP

Hey @BenSmithson,

Easel does send a header and a footer on the ends of the gcode you import. These are (mostly) statically generated. Your program will run just fine so long as it conforms to Easel’s gcode spec: https://inventables.desk.com/customer/en/portal/articles/2258567-easel-g-code-spec

Hey @EricDobroveanu

Thanks for your reply - but i’m still confused. I completely understand what the Header and Footer moves do that you list above. However if i include this code in my posted file/import file for import into Easil - it fails to import.

For example, I copy and paste your Header code to a txt file

I open Easil and File > Import G-Code. I select the file above. I then get the following error on the 2nd line of code:

If i delete this line of code and import again, i get the following error:

etc. etc.

On my initial forum post above, i went through the program and deleted all the code that failed to import. The majority of this code seems to be related to the Header and Footer info that you mention needs to be included. Once errors deleted, i then ran the program on Carvey. Carvey started, did a tool measure and went off cutting.

I’d be really grateful if you could confirm what info is needed (or not!) to run Carvey via Easil and File > Import G-Code

Many thanks

Ben

The header/footer are injected above/below whatever gcode you import on Carvey, so you don’t need to add any of it manually. All you need in the gcode file, is the code to make the cuts, and it must conform to the spec I linked above

Only the following commands can be in your gcode file:

G0, G1, G4, G17, G20, G21, G40, G54, G61, G90, G94
M0, M1, M2, M3, M4, M5, M6, M7, M8, M9, M30

If your file has anything other than the above, it will get rejected.

OK thanks @EricDobroveanu

This now makes sense

Hey @EricDobroveanu

Is the header and footer info injected automatically by Carvey? or is it done by Easil?

I ask because if i import the code to Carvey by UGS for example, will i need to add the header and footer info you mention above? or is it done automatically by Carvey?

Thanks again!

Ben

Easel will inject the header and footer, not Carvey.

Also I can’t recommend using UGS for Carvey, its very easy to crash into the smart clamp and break it.

Also, please keep in mind that using UGS with Carvey will void your warranty.

For me I use

To turn on: S12500 M3

The S12500 is spindle speed…it doesn’t actually adjust speed, but is required to turn on the relay

To turn off: M5

1 Like

This is the complete header from a file I just cut

G17
G20
G0 Z0.5000
G0 X0.0000 Y0.0000 S12500 M3

Silly question…Are you using the regular g-shield and arduino? Is the switch on logic? Is the power switch on the router on?

shouldn’t matter…swap and see

None that I am aware of…

Has it ever worked? Is it wired correctly?