Gcode On the Duet3 Behaving Unpredictably
-
I'm working on a DIY embroidery machine and I'm using a Duet3 6HC as a controller for the machine.
I've setup inkstitch to use the following stitch command:
G1 X%X Y%Y
M98 P"trigger3.g"Where M98 P"trigger3.g" is:
G1 U5 F1500
G1 H1 U500 F1500
G92 U0What I'm experiencing is very odd. I generate one file, and the machine moves normally. I generate another file, the gcode looks very similar, but the machine only moves in the Y axis. I've attached two of the gcode files in question.
V13 works as expected, V26 does not
TextTestV13.gcode TextTest26.gcodeI'm not really sure if this is a problem on the Duet side or the Inkstitch side.
-
Extracts from the two posted gcode files for easier reference
TextTestV13.gcode:
(STITCH_COUNT:2176) (EXTENTS_LEFT:-21.842) (EXTENTS_TOP:-14.049) (EXTENTS_RIGHT:21.842) (EXTENTS_BOTTOM:14.049) (EXTENTS_WIDTH:43.684) (EXTENTS_HEIGHT:28.099) G90 (use absolute coordinates) G21 (coordinates will be specified in millimeters) G0 X0.0 Y0.0 G1 X12.879 Y-0.621 M98 P"trigger3.g" G1 X12.879 Y0.522 M98 P"trigger3.g" G1 X12.879 Y1.664 M98 P"trigger3.g" G1 X12.879 Y2.806 M98 P"trigger3.g" G1 X12.879 Y3.948 M98 P"trigger3.g" G1 X12.879 Y5.090 M98 P"trigger3.g" ;...... ; gcode continues
TextTest26.gcode
(STITCH_COUNT:981) (EXTENTS_LEFT:-16.469) (EXTENTS_TOP:-8.476) (EXTENTS_RIGHT:16.469) (EXTENTS_BOTTOM:8.476) (EXTENTS_WIDTH:32.938) (EXTENTS_HEIGHT:16.951) G90 (use absolute coordinates) G21 (coordinates will be specified in millimeters) G0 X0.0 Y0.0 G1 X-16.245 Y3.161 M98 P"trigger3.g" G1 X-14.244 Y2.294 M98 P"trigger3.g" G1 X-13.140 Y3.293 M98 P"trigger3.g" G1 X-12.787 Y2.294 M98 P"trigger3.g" G1 X-14.480 Y3.293 M98 P"trigger3.g" G1 X-16.201 Y3.110 M98 P"trigger3.g" G1 X-16.190 Y3.618 M98 P"trigger3.g" G1 X-15.691 Y2.725
I note that the V26 files starts with negative X axis moves ( although they both contain negative X axis moves at some points.
By the look of this Inkstitch expects the machine 0,0 position to be in the center of the work area. Is that how you have the machine setup?
Also as an aside inkstich is inserting an M30 at the end of the file which is often program end in CNC gcode, but in 3d printing gcode its a file delete command (for historical reasons). Please try
please post your config.g
-
@T3P3Tony Thats an interesting note about the M30, I'll try removing it (though I kinda doubt its doing much)
I run G92 X0 Y0 Z0 U0 prior to every run, so yeah at the start it should think its at 0,0.
I've attached my config.g
; Configuration file for RepRapFirmware on Duet 3 Main Board 6HC ; executed by the firmware on start-up ; ; generated by RepRapFirmware Configuration Tool v3.5.8 on Tue Dec 31 2024 16:03:33 GMT-0600 (Central Standard Time) ; General G90 ; absolute coordinates M83 ; relative extruder moves M550 P"DuetPi" ; set hostname ; Smart Drivers M569 P0.0 S0 D2 ; driver 0.0 goes forwards (X axis) M569 P0.1 S1 D2 ; driver 0.1 goes forwards (Y axis) M569 P0.2 S0 D2 ; driver 0.2 goes forwards (Y axis) M569 P0.3 S1 D2 ; driver 0.3 goes forwards (extruder 0) M569 P0.4 S1 D2 ; driver 0.4 goes forwards (Z axis) M569 P0.5 S1 D2 ; driver 0.4 goes forwards (Z axis) ; Motor Idle Current Reduction M906 I30 ; set motor current idle factor M84 S30 ; set motor current idle timeout ; Axes ; Axes M584 X0.1 Y0.0:0.2 Z0.5 U0.3 ; set axis mapping M350 X16 Y16 Z16 U16 I1 ; configure microstepping with interpolation M906 X1200 Y1200 Z800 U2500 ; set axis driver currents M92 X80 Y80 Z400 U409 ; configure steps per mm M208 X0:300 Y0:200 Z0:200 U0:10000000 ; set minimum and maximum axis limits M566 X2000 Y2000 Z12 U400 ; set maximum instantaneous speed changes (mm/min) M203 X10000 Y10000 Z180 U8000 ; set maximum speeds (mm/min) M201 X500 Y500 Z20 U250 ; set accelerations (mm/s^2) ; Kinematics M669 K0 ; configure Cartesian kinematics ; Endstops ;M574 X1 S3 ; configure X axis endstop ;M574 Y1 S3 ; configure Y axis endstop M574 U1 P"!io3.in" S1 ; configure U axis endstop M950 J2 C"!io3.out" ; Input 2 uses io3.out pin, inverted M581 T2 U S1 ; Fans M950 F0 C"out3" ; create fan #0 M106 P0 S0 L0 X1 B0.1 ; configure fan #0 ; Tools M563 P0 D0 ; create tool #0 ; Miscellaneous M501 ; load saved parameters from non-volatile memory T0 ; select first tool
-
Your machine is setup to have 0 in a corner not in the middle:
M208 X0:300 Y0:200 Z0:200 U0:10000000
Try changing that to
M208 X-150:150 Y-100:100 Z0:200 U0:10000000
-
@T3P3Tony That did it. Dumb mistake on my part . Thanks for the assist.