I’ve been doing some experimenting with Linear Advance – specifically with the TAZ Pro and TAZ Workhorse because those are the printers that I have available.
Both the TAZ Pro and Workhorse have the feature enabled in the firmware, but the factor default “K-Factor” is zero (meaning no compensation will be applied.)
The elastic/goo-like nature of melted filament means it has a delayed response to changes in extrusion speed. As the print nozzle moves around the part and changes speeds, it also needs to change the extrusion rates to match. But there’s a lag which causes slight under-extrusion as it speeds up or slight over-extrusion when it slows down. These changes in speed can result in reduced print quality.
Some slicing software has features to attempt to compensate … at least for some of the issues. Linear Advance is implemented in the Marlin firmware. If enabled and if a K-factor is set, the printer firmware will handle the issue for you – and will do better than what could be done with slicer software.
To learn about Linear Advance, see this page at the Marlin Firmware website:
There are a few important things to know for LulzBot printers:
- You’ll need some values to enter into the test-pattern generator (more on that in a moment)
- You’ll also want to use most of the Start G-Code for your printer (I’ll include the code I use)
- There is a tiny bit of modification needed to the test-pattern g-code.
Point #2 is important because the LulzBot printers need to level the bed but to do so requires cleaning the nozzle (nozzle web) prior to the bed-leveling. That also requires retracting a fair-bit of filament and re-priming the nozzle after the cleaning is completed but before the start of the job. On a normal print, the nozzle would naturally get primed while laying down a skirt or brim … but the Linear Advance g-code wont sufficiently prime the printer so we’ll need to take care of that on our own.
Values for the K-Factor Calibration Pattern
Keep in mind that the best K-Factors for Linear Advance are dependent on the specific material, temperature, and speeds that you use. There is no single best K-Factor that works for everything. I did my testing with PolyMaker PolyLite PLA and will use the values that have worked best for me.
The Marlin website also has a test-pattern generator. That page is located here:
The page has several values you will need to set. Often the defaults are good … but not always.
- Printer: this is a comment field and can be any name you like.
- Filament: this is also a comment field – use this to record the name of the filament you are using for this test.
- Filament Diameter: 2.85
- Nozzle Diameter: 0.5 – most LulzBot printers will use a 0.5mm nozzle unless you’ve changed it.
- Nozzle Temperature: 230 – I use this value because after doing temperature towers, I got the cleanest results with PolyLite PLA at this temperature (the default LulzBot profile is a little cooler). This temperature needs to be set to whatever temp YOU actually use when printing with your material.
- Bed Temperature: 55 – I use this bed temp for PLA
- Retraction distance: 1 – I find after doing retraction testing that 1mm is pretty good for this PLA. I think 1.5 was the default but unnecessary to retract that much. In general… a direct drive print head (such as all LulzBot printers) does a much better job controlling feed and retraction vs. Bowden drive printers and this means they don’t require as much retraction as would be used on a Bowden type machine.
- Layer Height: 0.35 – this works well for the Linear Advance test
- Bed Shape: Rectangular
- Bed Size X: 282
- Bed Size Y: 282
Origin Bed Center: un-checked
- Slow Printing Speed: 20 (use whatever speed you might use when printing extra slow)
- Fast Printing Speed: 40 (use whatever you might normally use … while I can print faster, I tend not to for better quality)
- Movement speed: 120 (fast enough for non-printing moves)
- Retract Speed: 20
- Acceleration: 500 (this is the factory default for these printers)
- Jerk X, Y, Z, and E: All set to “-1” which means let the firmware handle this
- Lin Advance Version: 1.5 (IMPORTANT: All versions of Marlin 1.1.9 or 2.0 or later all MUST use 1.5. Lin Advance 1.0 is NOT COMPATIBLE with 1.5 (settings are very different)
- Pattern Type: Standard
- Starting Value for K: 0
- Ending Value for K: 0.2 (In Linear Advance v1.5 the values can range from 0 to 4 … but for a LulzBot direct-drive printer they will probably be somewhere in the range of 0 to 0.2. A Bowden type printer would likely use a higher value. Normally you’d do a test from say… 0 to 2.0 then find the best pair of adjacent lines and re-print a new pattern interpolating between just those two values (to zero-in on an even better value). But I’ve found that my printers want to use values between 0 and 0.2 … so to save time I’ll just use these values and skip the larger range of 0 to 2.0)
- K-factor Stepping: 0.02 – this is the increase to k-factor the each new line printed. E.g. first line will print with K-factor = 0, next line with K-factor = 0.02, then next with 0.04, etc. etc.) and will continue until it reaches the ending K-factor (in my case that is 0.2).
- Slow speed length: 20 - this is the default
- Fast speed length: 40 - this is the default
- Test line spacing: 10
- Print Anchor Frame: un-checked
- Printing Direction: left-to-right 0° – this is the default
- Line Numbering: checked on – this will cause the printer to print the K-values on the print bed
- Nozzle Line Ratio: 1.05 – I dialed this down from the default
- Z-Offset: 0 – this is the default
- Use Bed Leveling: No – while we do want bed leveling, we don’t like the way this test code handles it. The LulzBot printers need to wipe the nozzle before doing a bed-level and that wont happen if we turn this on. Instead, we’ll merge the start g-code to handle this for us.
- Extrusion Multiplier: 1 – this is the default
- Prime Extrusion Multiplier: 1 – this defaulted to 2.5 which is… violent. It tries to force material through the extruder much too fast and results in jams. I set it to 1 because I use start g-code to prime the nozzle.
- Prime Printing Speed: 30 – any reasonable print speed is ok here
- Dwell Time: 2
- Give the file a name
- Click “Generate G-code”
- Click “Save as default” (I think this sets a cookie for the page with the values you used so that the next time you visit your values will be retrained.)
- Click “Download as file”
You’ll need to edit the file. You will comment out one line of the generated g-code and you will also merge in the start g-code for your printer (I modified it slightly)
In the generated G-code, open that file.
Search for the line that says:
G28 ; home all axes with heated bed
Comment out that row by putting a semi-colon in front so that it NOW reads:
; G28 ; home all axes with heated bed
The printers own start G-code handle this.
Here’s the code I use in front of the generated g-code (my start g-code). This is mostly just the regular LulzBot Start G-code for the Workhorse … but I borrowed a few lines from the Pro. The Pro moves to a location IN FRONT of the build-plate (nozzle is hanging over the air) and it fully re-primes the nozzle to get things flowing quite nicely. Then it slides the build-plate just under the nozzle to “shear off” the filament and pauses a few seconds to let it cool so you can pull it away. This means you’ll see a bit of filament pool on your table but I find it means the printer will immediately start laying down good filament as soon as the job starts … it wont need several millimeters of extrusion before things smooth out.
Here’s the code:
; ### LulzBot TAZ Workhorse Start G-Code ; M73 P0 ; clear GLCD progress bar M75 ; start GLCD timer G26 ; clear potential 'probe fail' condition M107 ; disable fans M420 S0 ; disable previous leveling matrix G90 ; absolute positioning M82 ; set extruder to absolute mode G92 E0 ; set extruder position to 0 M140 S55 ; start bed heating up M109 R180 ; soften filament before homing Z G28 ; Home all axis G1 E-30 F100 ; retract filament M109 R170 ; wait for extruder to reach wiping temp G1 X-15 Y100 F3000 ; move above wiper pad G1 Z1 ; push nozzle into wiper G1 X-17 Y95 F1000 ; slow wipe G1 X-17 Y90 F1000 ; slow wipe G1 X-17 Y85 F1000 ; slow wipe G1 X-15 Y90 F1000 ; slow wipe G1 X-17 Y80 F1000 ; slow wipe G1 X-15 Y95 F1000 ; slow wipe G1 X-17 Y75 F2000 ; fast wipe G1 X-15 Y65 F2000 ; fast wipe G1 X-17 Y70 F2000 ; fast wipe G1 X-15 Y60 F2000 ; fast wipe G1 X-17 Y55 F2000 ; fast wipe G1 X-15 Y50 F2000 ; fast wipe G1 X-17 Y40 F2000 ; fast wipe G1 X-15 Y45 F2000 ; fast wipe G1 X-17 Y35 F2000 ; fast wipe G1 X-15 Y40 F2000 ; fast wipe G1 X-17 Y70 F2000 ; fast wipe G1 X-15 Y30 Z2 F2000 ; fast wipe G1 X-17 Y35 F2000 ; fast wipe G1 X-15 Y25 F2000 ; fast wipe G1 X-17 Y30 F2000 ; fast wipe G1 X-15 Y25 Z1.5 F1000 ; slow wipe G1 X-17 Y23 F1000 ; slow wipe G1 Z10 ; raise extruder M109 R160 ; wait for extruder to reach probe temp G1 X-9 Y-9 ; move above first probe point M204 S100 ; set probing acceleration G29 ; start auto-leveling sequence M420 S1 ; activate bed level matrix M425 Z ; use measured Z backlash for compensation M425 Z F0 ; turn off measured Z backlash compensation. (if activated in the quality settings, this command will automatically be ignored) M204 S500 ; restore standard acceleration G1 X0 Y0 Z15 F5000 ; move up off last probe point G4 S1 ; pause M400 ; wait for moves to finish M117 Heating... ; progress indicator message on LCD M109 R230 ; wait for extruder to reach printing temp M190 R55 ; wait for bed to reach printing temp ; ; Re-Prime extruder ; G1 X100 Y-29 Z0.5 F3000 ; move to open space M117 Purging... ; LCD status message G1 E0 F100 ; undo retraction G92 E-30 ; set extruder negative amount to purge G1 E0 F100 ; purge XXmm of filament G1 E-1 F200 ; purge retraction G1 Z0.45 ; clear bed (barely) G1 X100 Y10 F4000 ; move above bed to shear off filament M106 S255 ; turn on fan G4 S7 ; wait 7 seconds M107 ; turn off fan M117 TAZ Workhorse Printing... ; progress indicator message on LCD
Your finished file should have:
- The G-code I used above THEN
- The G-code generated by the Marlin Linear Advance site
- WITH… that “G28” line commented out (in the Marlin section … the start g-code already did the G28)
That’s it… save that file, put it on a memory card and send it to your printer.
Run the print job.
You will get a result that looks like this:
The line at the left is just the priming line (just to get the filament moving)
The job will print several lines … each will be printed at the “slow” speed then jump to the “fast” speed for the middle section and then end by returning to the “slow” speed again.
Along the top there are two horizontal lines … these mark the speed transition points. The left mark indicates where each row switches from slow to fast. The right mark indicates where it drops from fast to slow again.
Inspect each row. For example, the “0” row at the bottom shows a very slight “pinch” in the filament at the left transition and a very slight “bulge” in the filament at the right transition point.
The row at the top (the 0.2 row) is the opposite… it shows the “bulge” on the left and the “pinch” on the right.
We want the row that looks perfect … or as close to perfect as we can get (no pinches or bulges).
To my eye, the 0.12 row (7 rows up from the bottom) is nearly perfect but has a very very slight pinch and bulge. Meanwhile the row above that (the unmarked row between the 0.12 row and the 0.16 row) is the 0.14 row and it’s the opposite. THIS tells me that probably a K-factor of 0.13 would be best for THIS printer when using THIS material.
To set this on the Workhorse, go into Cura LulzBot Edition (or whatever slicer you use). Find your “Start” G-code (in the Machine Settings) and add a row at the end of the Start G-code that reads:
M900 K0.13 ; Set Linear Advance K-Factor for PolyLite PLA
BTW, on the LulzBot TAZ Pro, the printer menu (on the touchscreen) has a setting for K-values and you can set it there … no need to edit the start g-code in Cura.
On my Pro I find the best K-factor for the same PolyLite PLA was 0.11
The Start G-code I used to build my Linear Advance test was taken from the TAZ Pro’s start G-code (since it’s a dual-extruder machine). I only bothered to do my left toolhead (the right toolhead on my printer is used for PVA support material so I really don’t care about the quality … I’m dissolving it and throwing it out). Regardless… the pattern of using your printer’s Start G-code to pre-pend to the Marlin test g-code is the same (and comment out the G28 line in the Marline code).
Hope this helps!!
I don’t have a Mini or any prior TAZ model … so I don’t know that Linear Advance is enabled in those printers’ Marlin firmware.