1. Got a question or need help troubleshooting? Post to the troubleshooting forum or Search the forums!

linear advance

Discussion in 'General Questions' started by DavidR, Mar 14, 2018.

  1. DavidR

    DavidR Member

    Joined:
    Jan 3, 2018
    Messages:
    78
    Likes Received:
    13
    I was recently reading about Marlin's linear advance feature, which allegedly makes calculations that take nozzle pressure into account to help reduce oozing. Is this option supported on Robo's version of Marlin. If so is it worth setting up?
     
  2. WheresWaldo

    WheresWaldo Volunteer ( ͠° ͟ʖ ͡°)
    Staff Member

    Joined:
    Feb 18, 2015
    Messages:
    5,905
    Likes Received:
    3,593
    No it isn't.* Most slicers now have coasting and retraction restart settings which do the same thing. You can get it to work if you are willing to recompile, flash, test, adjust linear advance setting, recompile, flash, etc. And you need to not use the settings in your slicer.

    * The code is there but it is not enabled.
     
  3. DavidR

    DavidR Member

    Joined:
    Jan 3, 2018
    Messages:
    78
    Likes Received:
    13
    Great Thanks. I will mention the Marlin website mentions that after its enabled you can actually modify the K value via the start gcode scripts. So I feel like you wouldn't need to reflash each time. The site mentions this was done since the value can vary for different materials.
     
  4. DavidR

    DavidR Member

    Joined:
    Jan 3, 2018
    Messages:
    78
    Likes Received:
    13
    @WheresWaldo Is #if(ENABLED) the same as #ifdef? That is, does #define NAME enable NAME? I just downloaded the source code for Robo Marlin off GitHub and #define LINEAR_ADVANCE is NOT commented out. Perhaps I downloaded the wrong one? I downloaded the RC branch.
     
  5. WheresWaldo

    WheresWaldo Volunteer ( ͠° ͟ʖ ͡°)
    Staff Member

    Joined:
    Feb 18, 2015
    Messages:
    5,905
    Likes Received:
    3,593
    Except if K = 0 it is disabled, that is how the Robo code is currently configured. Here is the exact code in Configuration_adv.h
    Code:
    /**
    * Implementation of linear pressure control
    *
    * Assumption: advance = k * (delta velocity)
    * K=0 means advance disabled.
    * See Marlin documentation for calibration instructions.
    */
    #define LIN_ADVANCE
    
    #if ENABLED(LIN_ADVANCE)
      #define LIN_ADVANCE_K 0
    
      /**
      * Some Slicers produce Gcode with randomly jumping extrusion widths occasionally.
      * For example within a 0.4mm perimeter it may produce a single segment of 0.05mm width.
      * While this is harmless for normal printing (the fluid nature of the filament will
      * close this very, very tiny gap), it throws off the LIN_ADVANCE pressure adaption.
      *
      * For this case LIN_ADVANCE_E_D_RATIO can be used to set the extrusion:distance ratio
      * to a fixed value. Note that using a fixed ratio will lead to wrong nozzle pressures
      * if the slicer is using variable widths or layer heights within one print!
      *
      * This option sets the default E:D ratio at startup. Use `M900` to override this value.
      *
      * Example: `M900 W0.4 H0.2 D1.75`, where:
      *  - W is the extrusion width in mm
      *  - H is the layer height in mm
      *  - D is the filament diameter in mm
      *
      * Example: `M900 R0.0458` to set the ratio directly.
      *
      * Set to 0 to auto-detect the ratio based on given Gcode G1 print moves.
      *
      * Slic3r (including Průša Control) produces Gcode compatible with the automatic mode.
      * Cura (as of this writing) may produce Gcode incompatible with the automatic mode.
      */
      #define LIN_ADVANCE_E_D_RATIO 0 // The calculated ratio (or 0) according to the formula W * H / ((D / 2) ^ 2 * PI)
      // Example: 0.4 * 0.2 / ((1.75 / 2) ^ 2 * PI) = 0.033260135
    #endif
    I do not believe that S3D can handle an Auto ratio, but since it isn't free the Marlin devs did not test this themselves, that is likely why only Slic3r and Cura are mentioned specifically.

    One other note, disabling it the way Robo did does, allow you to experiment with LIN_ADVANCE but Marlin devs do not disable it in the same manner. They comment out the #define so that the code is not compiled into the binary .hex file.

    Don't forget if you set a K factor you will need to disable all ooze control (coasting, extra startup, wiping) in your slicer or your values will be incorrect. You will also find that different types of filaments may require different K factors, it is not really a universal one and done setting.

    I played with it for quite a few prints and then decided for myself, this was better left to the slicer.
     
    #5 WheresWaldo, Mar 14, 2018
    Last edited: Mar 14, 2018
  6. tiagomaricate

    tiagomaricate Member

    Joined:
    Jul 5, 2020
    Messages:
    102
    Likes Received:
    19
    I was looking for more info and found this thread.

    If disabled, what are those settings in Linear Advance option on the LCD menu?

    By default the K value is 0 and the R value is also 0.

    I was imaging the K was for enabling/disable the linear advance and R was for ratio.
     
  7. mark tomlinson

    mark tomlinson ༼ つ ◕_ ◕ ༽つ
    Staff Member

    Joined:
    Feb 21, 2013
    Messages:
    23,912
    Likes Received:
    7,338
  8. tiagomaricate

    tiagomaricate Member

    Joined:
    Jul 5, 2020
    Messages:
    102
    Likes Received:
    19
    I did the test (without great results) and started to change directly via Cura.
    Also tried some changes via EPRON (Robo R2).
    When I change the values via EPRON, Octoprint shows me whats is happening.
    Last time I get these outputs

    [​IMG]


    So basically K is the Linear Advanced itself and R is like "ratio"?
    You can see R is indicated by E/D (extruder/delta?)... so its like, acceleration? Like (or exactly) the extruder jerk?
     
  9. mark tomlinson

    mark tomlinson ༼ つ ◕_ ◕ ༽つ
    Staff Member

    Joined:
    Feb 21, 2013
    Messages:
    23,912
    Likes Received:
    7,338
    tiagomaricate likes this.
  10. tiagomaricate

    tiagomaricate Member

    Joined:
    Jul 5, 2020
    Messages:
    102
    Likes Received:
    19
    I just did about 30 print tests changing the K... and the result was always the same on all tests.
    Just jerk changed a bit.
    My main problem is the calibration cube letter (X, Y, Z) are not defined on the edges.
    The walls are perfect, but the letters... :p
    Any tip?
     
  11. mark tomlinson

    mark tomlinson ༼ つ ◕_ ◕ ༽つ
    Staff Member

    Joined:
    Feb 21, 2013
    Messages:
    23,912
    Likes Received:
    7,338
  12. tiagomaricate

    tiagomaricate Member

    Joined:
    Jul 5, 2020
    Messages:
    102
    Likes Received:
    19
  13. tkoco

    tkoco - -.- --- -.-. ---
    Staff Member

    Joined:
    May 7, 2018
    Messages:
    721
    Likes Received:
    273
    #if (ENABLED) is part of a macro, not a definition, used by Marlin. You can find it in the Marlin/macros.h file,
     
  14. mark tomlinson

    mark tomlinson ༼ つ ◕_ ◕ ༽つ
    Staff Member

    Joined:
    Feb 21, 2013
    Messages:
    23,912
    Likes Received:
    7,338

    That looks like insufficient cooling -- particularly on the "V" (top) of the Y and X -- Slow down the print speed and make sure the parts cooling fan is going full speed. With some slicers you can set a minimum layer print time so that for smaller/less toolpath layers it will drop the speed to allow more cooling.
     
    tiagomaricate likes this.

Share This Page