Help with Gcode needed
-
Hi all,
I'm slowly getting my head around my CNC, but as yet I've not actually done anything but move the machine around via the dashboard controls
My issue comes with the Gcode I have - my plan is to use the CNC for plotting and cutting only, so nothing that complex
I've generated some code in another app, but the Duet2 card is having none of it, it throws up a load of errors and doesn't get very far. The reason Im using this app is because it can spit out code for a tangenal knife.
any ideas?
ALSO!!! if possible could someone send me some Gcode just to plot a simple 50x50mm square? Hopefully that's simple, but Its just something I can test the machine on really
( Use case: ? )
( SVG import by GRBL-Plotter 1.7.0.1 )
( Source: C:\Users\mushr\Desktop\Export Dump\svg test.svg )
(<Header >)
( G-Code lines: 22 )
( Pen Down/Up : 2 times )
( Duration ca.: 1.1 min. )
( Conv. time : 00:00:00.0325643 )
( SVG dimension : 656.43 928.16 )
( Graphic offset: -116.60 -593.46 new origin: 0.00 0.00)
( Original graphic dimension min:116.599;593.460 max:450.196;775.673)
(</Header >)
G54 (Setup - GCode-Header)
G90
G00 Z2.000
M3 S1000 (job start)
(<Figure Id="1" Geometry="path" PenColor="black" PenWidth="0.265" PathLength="292.6"> )
G00 X202.887 Y136.297
G01 Z-2.000 F1000
G01 X202.887 Y69.688 F2000
G01 X297.571 Y69.688
G01 X297.571 Y99.414
G01 X202.887 Y136.297
G00 Z2.000
(</Figure>)
(<Figure Id="2" Geometry="path" PenColor="black" PenWidth="0.265" PathLength="1027.2"> )
G00 X7.583 Y233.817
G01 Z-2.000 F1000
G01 X7.583 Y56.009 F2000
G01 X141.352 Y56.009
G01 X141.352 Y162.254
G01 X341.180 Y162.254
G01 X341.180 Y238.221
G01 X7.583 Y233.817
G00 Z2.000
(</Figure>)
M05
M30 -
@mattyd I'm not a CNC expert, however the GCode in your post looks OK to me for RRF to execute provided that you have commanded RRF to execute in CNC mode. To do this, send command M453 (see https://docs.duet3d.com/en/User_manual/Reference/Gcodes#m453-select-cnc-device-mode). You can do this in your config.g file.
The GCode you need to plot a 50x50mm square depends on where you set the bed origin. If you set it so that X0 Y0 is at one corner of the bed, and all reachable X and Y coordinates are positive, and the bed size is at least 100x100mm, then the following should work after you have homed the axes.
G0 X25 Y25 ; move to X25 Y25 at maximum speed G1 X75 F3000 ; move to X75 Y25 at 3000mm/min G1 Y75 ; move to X75 Y75 G1 X25 ; move to X25 Y75 G1 Y25 ; move to X25 U25
-
@dc42 said in Help with Gcode needed:
however the GCode in your post looks OK
thank you for your help! I'm going to look at this today
I did try that Gcode for the square and it through up a load of errors again. So I'm hoping the issue is with "RRF/CNC mode"
-
Just found this - Im guessing the "M453" is in the incorrect place and needs to be moved to "configuration files"
-
@mattyd said in Help with Gcode needed:
@dc42 said in Help with Gcode needed:
however the GCode in your post looks OK
thank you for your help! I'm going to look at this today
I did try that Gcode for the square and it through up a load of errors again. So I'm hoping the issue is with "RRF/CNC mode"
That's very odd, it's as if you inserted a newline after each character.
-
@dc42 said in Help with Gcode needed:
That's very odd, it's as if you inserted a newline after each character.
I'm debating resetting and reinstalling the software. is there a process to reset everything and starting a fresh?
-
@mattyd said in Help with Gcode needed:
I'm debating resetting and reinstalling the software. is there a process to reset everything and starting a fresh?
I doubt doing that will help. Please post the gcode file you posted above as a file, not as text. I suspect there are invisible characters between each character in the file.
Also, please post the output from
M115
, so we know what firmware version you are using.Ian
-
@droftarts said in Help with Gcode needed:
M115
FIRMWARE_NAME: RepRapFirmware for Duet 2 WiFi/Ethernet FIRMWARE_VERSION: 3.3 ELECTRONICS: Duet Ethernet 1.02 or later FIRMWARE_DATE: 2021-06-15 21:45:03<LF>ok<LF>
the Qcode is copied directly from @dc42 code above
G0 X25 Y25 ; move to X25 Y25 at maximum speed G1 X75 F3000 ; move to X75 Y25 at 3000mm/min G1 Y75 ; move to X75 Y75 G1 X25 ; move to X25 Y75 G1 Y25 ; move to X25 U25
Im pretty sure it's good because I can load the code into the G-Code Viewer and it shows up just fine (I can't upload the actual file as its an unsported format ".nc" )
Here is the full error, and thank you for your help!
M32 "0:/gcodes/Square from forum.nc" File 0:/gcodes/Square from forum.nc selected for printing Error: Bad command: ��G Error: Bad command: 0 Error: Bad command: X Error: Bad command: 2 Error: Bad command: 5 Error: Bad command: Y Error: Bad command: 2 Error: Bad command: 5 Error: Bad command: m Error: Bad command: o Error: Bad command: v Error: Bad command: e No tool is selected Error: Bad command: o Error: Bad command: X Error: Bad command: 2 Error: Bad command: 5 Error: Bad command: Y Error: Bad command: 2 Error: Bad command: 5 Error: Bad command: a No tool is selected Error: Bad command: m Error: Bad command: a Error: Bad command: x Error: Bad command: i Error: Bad command: m Error: Bad command: u Error: Bad command: m Error: Bad command: s Error: Bad command: p Error: Bad command: e Error: Bad command: e Error: Bad command: d Error: Bad command: G Error: Bad command: 1 Error: Bad command: X Error: Bad command: 7 Error: Bad command: 5 Error: Bad command: F Error: Bad command: 3 Error: Bad command: 0 Error: Bad command: 0 Error: Bad command: 0 Error: Bad command: m Error: Bad command: o Error: Bad command: v Error: Bad command: e No tool is selected Error: Bad command: o Error: Bad command: X Error: Bad command: 7 Error: Bad command: 5 Error: Bad command: Y Error: Bad command: 2 Error: Bad command: 5 Error: Bad command: a No tool is selected Error: Bad command: 3 Error: Bad command: 0 Error: Bad command: 0 Error: Bad command: 0 Error: Bad command: m Error: Bad command: m Error: Bad command: / Error: Bad command: m Error: Bad command: i Error: Bad command: G Error: Bad command: 1 Error: Bad command: Y Error: Bad command: 7 Error: Bad command: 5 Error: Bad command: m Error: Bad command: o Error: Bad command: v Error: Bad command: e No tool is selected Error: Bad command: o Error: Bad command: X Error: Bad command: 7 Error: Bad command: 5 Error: Bad command: Y Error: Bad command: 7 Error: Bad command: 5 Error: Bad command: G Error: Bad command: 1 Error: Bad command: X Error: Bad command: 2 Error: Bad command: 5 Error: Bad command: m Error: Bad command: o Error: Bad command: v Error: Bad command: e No tool is selected Error: Bad command: o Error: Bad command: X Error: Bad command: 2 Error: Bad command: 5 Error: Bad command: Y Error: Bad command: 7 Error: Bad command: 5 Error: Bad command: G Error: Bad command: 1 Error: Bad command: Y Error: Bad command: 2 Error: Bad command: 5 Error: Bad command: m Error: Bad command: o Error: Bad command: v Error: Bad command: e No tool is selected Error: Bad command: o Error: Bad command: X Error: Bad command: 2 Error: Bad command: 5 Error: Bad command: U Error: Bad command: 2 Error: Bad command: 5 Finished printing file 0:/gcodes/Square from forum.nc, print time was 0h 0m
-
@mattyd how did you enter the GCode, and how are you sending it to the Duet or otherwise getting the Duet to execute it?
-
@dc42 said in Help with Gcode needed:
@mattyd how did you enter the GCode, and how are you sending it to the Duet or otherwise getting the Duet to execute it?
Via the dashboard (which is a workbee version/skin) I go to Jobs/Upload G-Code and execute it.
Once I hit "yes" I get this error
Followed by the error I posted that's copied from the Consol.
the actual file that Im uploading and using is this one
-
@dc42 A Little update that I think is encouraging.
I copied your code (the one that you supplied) into the "send" tab at the top, and hit "Send"
the error I got back is written at the bottom - this looks encouraging
-
@mattyd it looks to me that either you have very large tool offsets, or you are running in a workplace coordinate system with a large offset. As your initial tool position is (-50,-50) you could try this:
G1 X-50 Y0 F3000 G1 X0 Y0 G1 X0 Y-50 G1 X-50 Y-50
-
@dc42 said in Help with Gcode needed:
G1 X-50 Y0 F3000
G1 X0 Y0
G1 X0 Y-50
G1 X-50 Y-50That worked! omg!
So with this in mind what was I missing originally, have I missed a step in correctly setting this up?
-
@dc42
Hi again! I was wondering if you could help with something else....In you Gcode you gave me for the simple square to get it to work you had to change everything to negative/minus figures.whats the best way to flip my Cnc work area to work with positive numbers? Logically this makes more sense I think, esp when dealing with other peoples files
-
@mattyd it sounds to me that you might have the wrong movement directions or the wrong endstop configuration. I suggest you do the following:
- Decide where you want X0 Y0 to be. Popular choices are the front left corner of the bed, or the centre of the bed.
- Decide which direction you want to be positive X and which direction should be positive Y. Usually positive X is to the right and positive Y is away from you. Other directions are possible but be sure to choose a right hand coordinate system.
- Adjust the motor directions in config.g to get positive X and Y movements in the desired direction.
- Establish whether your endstop switches are high end (at axis maximum) or low end (at axis minimum) and configure the endstops accordingly in the M574 commands in config.g.