Gcode для проги ReplicatorG
G Codes
we will be adding GCode definitions / explanations here. we will also put implementation specific notes here as needed. until then, please see the primer.
Some useful G-Codes are:
•G0 - Rapid Motion
•G1 - Coordinated Motion
•G2 - Arc - Clockwise
•G3 - Arc - Counter Clockwise
•G4 - Dwell
•G10 - Create Coordinate System Offset from the Absolute one
•G17 - Select XY plane (default)
•G18 - Select XZ plane (not implemented)
•G19 - Select YX plane (not implemented)
•G20 - Inches as units
•G21 - Millimeters as units
•G28 - Home given Axes to maximum
•G30 - Go Home via Intermediate Point (not implemented)
•G31 - Single probe (not implemented)
•G32 - Probe area (not implemented)
•G53 - Set absolute coordinate system
•G54-G59 - Use coordinate system from G10 P0-5
•G90 - Absolute Positioning
•G91 - Relative Positioning
•G92 - Define current position on axes
•G94 - Feed rate mode (not implemented)
•G97 - Spindle speed rate
•G161 - Home negative
•G162 - Home positive
G-Codes can have all kinds of arguments. Only a few of those are actually used here:
•X absolute position
•Y absolute position
•Z absolute position
•A position (rotary around X)
•B position (rotary around Y)
•C position (rotary around Z)
•U Relative axis parallel to X
•V Relative axis parallel to Y
•W Relative axis parallel to Z
•M code (another "action" register or Machine code(*)) (otherwise referred to as a "Miscellaneous" function")
•F feed rate
•S spindle speed
•N line number
•R Arc radius or optional word passed to a subprogram/canned cycle
•P Dwell time or optional word passed to a subprogram/canned cycle
•T Tool selection
•I Arc data X axis
•J Arc data Y axis.
•K Arc data Z axis, or optional word passed to a subprogram/canned cycle
•D Cutter diameter/radius offset
•H Tool length offset
M Codes
This page presents a summary of M codes used by ReplicatorG. M codes are very protean and flexible; many are RepRap or MakerBot specific.
The following extra M-Codes were defined for RepRap:
•M101 Extruder on, fwd
•M102 Extruder on, reverse
•M103 Extruder off
•M104 Snn set temperature in degrees Celsius
•M105 get extruder temperature
•M106 turn fan on
•M107 turn fan off
•M108 Set Extruder's Max Speed (Rnnn = RPM, Pnnn = PWM)
•M109 Snnn set build platform temperature in degrees Celsuis
•M110 Snnn set chamber temperature in degrees Celsius
•M120, M121, M122 Snnn set the PID gain for the temperature regulator (not currently supported by ReplicatorG)
•M123, M124 Snnn set iMax and iMin windup guard for the PID controller (not currently supported by ReplicatorG)
•M126 valve open
•M127 valve close
•M128 get position
•M200 reset driver
•M300 Snnn set servo 1 position
•M301 Snnn set servo 2 position
Other M codes understood by ReplicatorG
•M0 Unconditional Halt (not supported on SD)
•M1 Optional Halt (not supported on SD)
•M2 End program
•M3 spindle on, CW
•M4 spindle on, CCW
•M5 spindle off
•M6 Tool change. This code waits until the toolhead is ready before proceeding. This is often used to wait for a toolhead to reach the its set temperature before beginning a print. ReplicatorG also supports giving a timeout with M6 P<secs>.
•M7 coolant A on (flood coolant)
•M8 cooland B on (mist coolant)
•M9 all coolants off
•M10 close clamp
•M11 open clamp
•M13 spindle CW and coolant A on
•M14 spindle CCW and coolant A on
•M17 enable motor(s)
•M18 disable motor(s)
•M21 open collet
•M22 close collet
•M40-M46 change gear ratio
•M50 read spindle speed
•M70 Display message on machine, with optional timeout specified by P-code in seconds
◦Ex.: M70 P10 (Display this text for ten seconds)
•M71 Pause activity and display message, resuming build on button push. Optional timeout specified by P-code in seconds. If timeout is specified and no button is pushed, machine should shut down or reset.
◦Ex.: M71 (Please insert motor into assembly and push a button.)
◦Ex.: M71 P20 (Machine will reset in twenty seconds!)
•M72 Play a song or tone defined by the machine, by a P-code specifying a song type. Default songs are Error Sound (P0), a Ta-da sound (P1), and a warning sound (P2). all other sounds are user or machine specific, with P2 the default for unknown sounds.
◦Ex M72 P1 (Machine will play a 'TaDa' song!)
•M73 Manually set build percentage. Valid P values are 0 to 100, values over 100 are rounded down to 100
◦Ex M73 P10 (Set build percent to 10% )
Logging in ReplicatorG
ReplicatorG 26 and later will feature basic logging functionality through M codes. You can experiment with this feature by checking out the "temperature_log" branch in the git repository.
M310 (FILE_PATH)
Start logging to the file specified by "FILE_PATH". The parenthesis are necessary!
M311
Stop logging
M312 (MESSAGE)
Log the message text to the logging file.
Status messages will be logged to the file once logging is turned on; this means you can log temperature data. NB: you must turn on "monitor temperature" in your preferences to monitor the toolheads! The status of all configured toolheads will be dumped to the log file at one second intervals.
Example:
(This will log 5 seconds of temperature data on all configured tools)
M310 (test.log)
M312 (--Start logging--)
M104 S225 T0 (set extruder temperature)
G04 P5000
M104 S0 T0
M312 (--End logging--)
M311
Other examples
(run toolhead 0 for 5 seconds)
G21 (set units to mm)
G90 (set positioning to absolute)
M108 T0 R1.98 (set extruder speed)
M103 T0 (Make sure extruder is off)
M104 S225 T0 (set extruder temperature)
M6 T0 (wait for toolhead parts, nozzle, HBP, etc., to reach temperature)
M101 T0 (Extruder on, forward)
G04 P5000 (Wait t/1000 seconds)
M103 T0 (Extruder off)
M104 S0 T0 (set extruder temperature)
(run toolhead 1 for 6 seconds)
M108 T1 R1.98 (set extruder speed)
M103 T1 (Make sure extruder is off)
M104 S225 T1 (set extruder temperature)
M6 T1 (wait for toolhead parts, nozzle, HBP, etc., to reach temperature)
M101 T1 (Extruder on, forward)
G04 P6000 (Wait t/1000 seconds)
M103 T1 (Extruder off)
M104 S0 T1 (set extruder temperature)
честно слизал от сюды:
http://replicat.org/mcodes