Gcode - not in order line execution
Hi
i am using repetier firmware 1.0 , Ramps1.4 , Arduino Mega to control a prototype robotic arm i build
i am using repetier firmware 1.0 , Ramps1.4 , Arduino Mega to control a prototype robotic arm i build
i have setup the firmware in order to have a servo enable and one stepper motor extra
the problem that i am having is that in a small Gcode command line i wrote to test the arm some of the commands are executing before the order i have placed them
the code is this one :
the problem that i am having is that in a small Gcode command line i wrote to test the arm some of the commands are executing before the order i have placed them
the code is this one :
------------------------------------------------------------------------------
G28
G205 E0 P1
G201 X30 P1
G90
M340 P0 S500
M340 R1000 P0 S1500
G204 P1 S0
G1 X400 Y400 Z400 F2400
G1 Y600 Z600
G1 X10 Z740
M340 P0 S2500
G1 X10 Y500
G1 X400 Y100 f1500
G201 X5 P1
M340 R1000 P0 S500
G201 X30 P1
G90
M84
M104 T0 S0
M140 S0
M84
M104 T0 S0
M140 S0
M84
G205 E0 P1
G201 X30 P1
G90
M340 P0 S500
M340 R1000 P0 S1500
G204 P1 S0
G1 X400 Y400 Z400 F2400
G1 Y600 Z600
G1 X10 Z740
M340 P0 S2500
G1 X10 Y500
G1 X400 Y100 f1500
G201 X5 P1
M340 R1000 P0 S500
G201 X30 P1
G90
M84
M104 T0 S0
M140 S0
M84
M104 T0 S0
M140 S0
M84
------------------------------------------------------------------------
the problem is that the commands :
the problem is that the commands :
M340 P0 S2500 (line 11)
M340 P0 S2500 (line 12)
M340 R1000 P0 S500 (line 15)
G201 X5 P1 (line 14)G201 X30 P1
(line 16)
became active at the same time as the :
G1 X400 Y400 Z400 F2400 (line 8 )
What i am doing wrong ?
how should i write these commands in order to be executed in the line order i choose?
Thanks in advance
how should i write these commands in order to be executed in the line order i choose?
Thanks in advance
Comments
G28
G205 E0 P1
G201 X30 P1
G90
M340 P0 S500
M340 R1000 P0 S1500
G204 P1 S0
G1 X400 Y400 Z400 F2400
G1 Y600 Z600
G1 X10 Z740
M400
M340 P0 S2100
G1 X10 Y500
G1 X400 Y100
M400
G201 X5 P1
M400
M340 R1000 P0 S500
G201 X30 P1
G90
M84
M104 T0 S0
M140 S0
M84
M104 T0 S0
M140 S0
M84
M104 T0 S0
M140 S0
M84
M104 T0 S0
M140 S0
M84
if there is any other solution i would be glad learn it
Also be awayre about G340 being similar. They only set position and timeout but do NOT wait for the servo to reach it. In fact there is no feedback to measure this anyway. So add a G4 afterwards if you want to start moving only after servo is positioned.