Need to dwell on plotting.
It was a bit of a mystery why plotting some text looked a bit broken in my last post, with the extra lines at the ends of letters, since in my software simulations it all looked fine.
Incidentally, the software stack for making plots is now a plotting library taking primitives like 'line-to' or 'bezier-to' and converting them to gcode, a gcode to PGM converter which simulates a plot, a web server which just shows all the recent images in a directory and a script to send the gcodes to the plotter. Everything is written in Janet except the script which is in Tcl/Expect.
I do all the coding remotely on a VPS which I can access from whichever computer I happen to be on, be it my office desktop, my work laptop, the Chromebook by the couch, or even my phone. So having the web server is handy for showing the images generated on the remote box.
So I tried another plot while watching it and it became apparent that the problem was the plotter was moving onto the next code immediately after lifting the pen, before the pen was actually off the page. The solution was to pause after lifting the pen, just briefly to be sure it was up.
The G4
code does this. It's called 'dwell', which I kinda like. I've been using the Marlin gcode
documentation since it's pretty thorough. The Marlin firmware is used in tonnes of different 3D
printers, and probably a few CNC machines. It says G4 P<ms>
or G4 S<s>
will work but I found
that Grbl doesn't accept S
as an argument to G4
and instead if you want sub-second dwellings
then you can use a decimal with P
, e.g., G4 P0.25
to pause for 250ms.
Anyway, pausing after a pen up fixed it. Here's a before and after image:
And so I thought I'd try some smaller text. This is rendered with a ballpoint pen at a 12mm height and I'm pretty happy: