My CNC machine is controlled via TinyG. I'm looking for an example of Python PySerial code that loads (or sends) gcode programmatically, and writes into the COM serial port where TinyG is connected.
My simple below Command line options of PySerial, ends up in infinite X movement, not sure if this needs any additional serial port configurations. Whereas gcode from chilipeppr works fine.
I assume you mean X heads into the Xmax rail?
Is $ex=2 (tinyG flow control = rtscts)?
But even if it isn't, not obvious why G00 X1 would over run anything.
How about G00 X1.0 , perhaps tinyG does not like whatever end of line terminator that gets sent.
User Dave Hylands has developed a bunch of Python scripts, perhaps he will stop by and offer some suggestions
OK, my TinyG is not configured yet to my CNCs max xyz movements. so the $pos shows as below
tinyg [inch] ok>
X position: 6.831 in
Y position: 12.629 in
Z position: 20.251 in
A position: 0.000 deg
B position: -270.000 deg
C position: 0.000 deg
tinyg [inch] ok>
I reset the positions using G28.3 X0 Y0 Z0 -- now the "G00 X1" works as in chillipeppr. Thanks.
My CNC max physical movement is 2 in, but $X shows as below.
$X
[xam] x axis mode 1 [standard]
[xvm] x velocity maximum 31 in/min
[xfr] x feedrate maximum 31 in/min
[xtn] x travel minimum 0.000 in
[xtm] x travel maximum 5.906 in
[xjm] x jerk maximum 1 in/min^3 * 1 million
[xjh] x jerk homing 2 in/min^3 * 1 million
[xjd] x junction deviation 0.0020 in (larger is faster)
[xsn] x switch min 1 [0=off,1=homing,2=limit,3=limit+homing]
[xsx] x switch max 0 [0=off,1=homing,2=limit,3=limit+homing]
[xsv] x search velocity 20 in/min
[xlv] x latch velocity 4 in/min
[xlb] x latch backoff 0.197 in
[xzb] x zero backoff 0.039 in
How do I configure TinyG so that the max movement is not more than 2 in for X?