Generating Gcode and Optimizing Sovol SO-1 Plotter Printer Settings for Higher Print Quality

 


The first hurdle to overcome with the Sovol SO-1 Plotter Printer is just generating gcode to run on it.  Once you get a gcode generator working, then the next step will be tuning in the settings.  If you have a 3D printer, you are probably familiar with trying to dial in the optimal settings to get the best prints.  This blog post is about the tools I am using to make gcode and how I tested my Sovol SO-1 plotter printer to optimize the print settings.  First I tried to use Inkscape with the Sovol plug in.  This is a screenshot of what I see using the Inkscape Sovol plug in:


To use the Sovol Inkscape plug in, you  have your SVG drawing in Inkscape open, select all and then go Path-> Object to Path.  However, I would get an error as follows and couldn't generate gcode:



Doing some web searches, I found a company called J Tech Photonics that sells diode lasers for DIY laser enthusiasts.  At J Tech Photonics, they have a similar but slightly different Inkscape plug intended for creating gcode for the lasers they sell, which is described and available for download at the following pages:

https://jtechphotonics.com/?page_id=2012

and at:

https://jtechphotonics.com/?page_id=1980

From J Tech Photonics  I was able to reinstall a different version of Inkscape and their plug in and get it work, here is a screenshot of the appearance of their plug in interface:


After it runs, you see paths drawn on a simple image:


The beginning Gcode of the output file:

M05 S0

G90

G21

G1 F3000

G1  X72.5734 Y173.3098

G4 P0 

M03 S255

G4 P0

G1 F750.000000

G2 X75.5632 Y183.2004 I18.7052 J-0.2571

etc.

It makes the paths correctly, but it has code to turn the laser on and off.  This could work except that the SO-1 Plotter Printer needs M280 commands to move the pen such as M280P0S30 to lift and M280P0S0 to go down.

Substituting M280 commands into J Tech Inkscape plug in and setting laser power to 0 looks like:


This works but it generates the following gcode at the beginning of the output file:

M280P0S30 S0


G90

G21

G1 F3000

G1  X72.5734 Y173.3098

G4 P0 

M280P0S0 S0

G4 P0

G1 F750.000000

G2 X75.5632 Y183.2004 I18.7052 J-0.2571

etc.

We have gcode that could work except it has S0 appended to the pen movement commands.

You can use a unix tool like sed to remove all the S0's from the file and then output to a new file.

sed 's/\(M280P0S[0-9]*\) S0/\1/' originalfile.gcode > fixedfile.gcode


Now I have gcode that can work in the Sovol SO-1 Pen Plotter:

M280P0S30


G90

G21

G1 F3000

G1  X72.5734 Y173.3098

G4 P0 

M280P0S0

G4 P0

G1 F750.000000

G2 X75.5632 Y183.2004 I18.7052 J-0.2571

etc.


As I mentioned in my previous post, I messaged a user on the Sovol Plotter Facebook page named Paul Alvarez and he shared his toolchain with me; he uses juicy-gcode as his gcode generator.

I downloaded juicy-gcode, created by Laszlo Domoszlai from https://github.com/domoszlai/juicy-gcode and tried it out and found it was easier for me to work with than Inkscape with the plug-in.

With juicy gcode, you create a simple text file the author calls the gcode flavor file that has the gcode you desire at the beginning and end of the file and what you want to use to lift and lower the pen.

In my case, I use the following as my gcode flavor file which is named gcode_parameters.txt


gcode

{

   begin = "M280P0S30;G90;G21;G28 X Y;G1 F1000;M201 X1000 Y1000 Z1000 E1000;M204 P1000.00 R1000.00 T1000.00;M205 S0.00 T0.00 B20000 X5.00 Y5.00 Z0.40 E.500"

   end = "G4 P50; M280P0S30;G1 X0 Y0"

   toolon =  "M280P0S29;G4 P25;M280P0S28;G4 P25;M280P0S27;G4 P25;M280P0S26;G4 P25;M280P0S25;G4 P25;M280P0S24;G4 P25;M280P0S23;G4 P25;M280P0S22;G4 P25;M280P0S21;G4 P25;M280P0S20;G4 P50"

   tooloff = "G4 P100;M280P0S30;G4 P100"

}


Then running juicy-gcode would look like:

./juicy-gcode test1.svg -o test1.gcode -f gcode_parameters.txt


I described in my previous post that I use a series of small steps in the toolon to slow the descent of the pen and decrease the artifact created from the pen dropping rapidly and striking the paper. 

The first thing I tested was what is the optimal feedrate for drawing quality, which is set with the G1 command.  Feed rate has the units mm/minute.  The marlin firmware installed has a maximum speed in X and Y of 300mm/sec, which could be adjusted with gcode in the file but I just decided to use 300mm/sec as the upper limit of my testing, this would correspond to a feedrate of 18000.

I found from test drawings that a feed rate of about 1000mm/min or F1000 was optimal under my test circumstances.

I created a set of 12 test images of rows of small squares, with each row as a different svg.  I created a python file that would make it easier to create different gcode flavor files to vary parameters I desired to test and then concatenate the resulting gcode into one file with 12 tests in the file.  I first ran the plotter at feedrates of 18000mm/minute to 600mm/minute (with max accel 1000, jerk 10):



I looked at the sharpness of the corners of the squares and found that decreasing the feed rate down to the 1200 mm/minute or 600 mm/minute gave the best squares. The other thing that was apparent besides the accuracy of drawing the squares was the "heaviness" of the lines drawn improved with the slower speeds.  By analogy to 3d printing, you might be able to run a 3d printer with accurate geometrical positioning but you have to have a hot end that can melt the plastic fast enough to not under extrude at that rate.  The pen lines looked deeper/less wispy to my eye at the lower feed rates.  Interestingly, the quality of drawing squares has a kind of U shaped curve, i.e. the worst squares were not at the highest feed rates but at some intermediate speed.

I repeated the test with a gradient at lower feed rates varying from 1200mm/min and dropping by 100mm/min:




I found that a feed rate of 1000mm/minute was the fastest feed rate that gave the quality I desired.
Having established a feedrate of 1000mm/minute, I next tried adjusting the maximum acceleration from 1000 to various lower settings and found no difference with this test (not shown).
I then experimented with the jerk and created a gradient of 20, 18, 16, 14, 12, 10, 9, 8, 7, 6, 5, 4:







The default jerk with the firmware installed is 10.  I found that a jerk of 4 or 5 was optimal with the square test to my eyes with a feed rate of 1000mm/minute.

I created some tests with other geometries including rows of circles (below is varying jerk from 9 down to 3)


Here is a test of jerk with 12 concentric dodecagons from outside to inside 20, 18, 16, 14, 12, 10, 9, 8, 7, 6, 5, 4:



To summarize, first I found that with my Sovol SO-1 Pen Plotter, there are at least two different tools at my disposal to generate gcode, J Tech Photonics Inkscape plug in with a clean up step, or juicy gcode.

Second, I found that a feedrate of 1000mm/minute and a jerk of about 5 was best in my tests.

I will include the test files I used on my google drive at the following link:

Sovol_SO1_testfiles

Disclaimer

The author does not make any warranties about the completeness, reliability and accuracy of this information. Any action you take upon the information on this site is strictly at your own risk, and the author will not be held liable for any losses and damages in connection with the use of this information.


Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

Comments