Xcarve control

From P2P Food Lab
Jump to: navigation, search
  • A few useful links

[CNC cookbook ]

[Grbl settings]

[Gcode commands]

[Learning G28]


  • A few useful commands

Wait end of command before release serial:

G4 P0.01


Homing of the X-carve

Setting of homing position

$H Homing run

G0 y100 Jog the machine to the work 0 location

G92 X0 Y0 Z0 Reset work zero

G28.1 Save that position

Starting new session

$H Homing run

G28 Jog to work 0

G92 X0 Y0 Z0 Set work zero


Limits

$21=1 set hard limits $20=1 sets soft limits with max travel distance given by ($130,$131,$132)


Sending a command through Python

import serial

port="/dev/ttyACM0"
baudrate=115200
s = serial.Serial(port,baudrate)
s.write("\r\n\r\n")
time.sleep(2)
s.flushInput()
 
cmd="G90 \n"
s.write(cmd)
grbl_out=s.readline()
print ' : ' + grbl_out.strip()