Notifications
Clear all

M900 Vs M572  

  RSS
Cian W
(@cian-w)
Member
M900 Vs M572

Hi,

Im looking for some info surround the use of M900 Vs M572.

I am a bit confused about the both of these since my assumption was linear advance was more or less the same as klippers pressure advance feature. I am no expert in understanding the code so I have hit a wall with trying to find out why there is now 2 implementations of this.

In prusa slicer generic PLA filament settings along with many others for PrusaXLIS it appears that M900 is being called to set linear advance then below is an if statement for input shaper FW M572 setting what prusa are now calling pressure advance.

M900 K{if nozzle_diameter[0]==0.4}0.05{elsif nozzle_diameter[0]==0.25}0.14{elsif nozzle_diameter[0]==0.3}0.07{elsif nozzle_diameter[0]==0.35}0.06{elsif nozzle_diameter[0]==0.6}0.03{elsif nozzle_diameter[0]==0.5}0.035{elsif nozzle_diameter[0]==0.8}0.015{else}0{endif} ; Filament gcode

{if printer_notes=~/.*(MK4IS|XLIS).*/}
M572 S{if nozzle_diameter[0]==0.4}0.036{elsif nozzle_diameter[0]==0.5}0.025{elsif nozzle_diameter[0]==0.6}0.02{elsif nozzle_diameter[0]==0.8}0.014{elsif nozzle_diameter[0]==0.25}0.12{elsif nozzle_diameter[0]==0.3}0.08{else}0{endif} ; Filament gcode
{endif}

I suppose i have x questions to try and gain some insight into whats actually happening here

1. is M572's "S" value the same thing as M900's "K" value? if not then what is M572 doing differently to M900? (I understand that M572 will eventually support setting PA values specific to each tool but that is labeled as TODO in the FW)

2. my assumption is M900 is there to support people running older FW and going forward we should be using M572? is this correct? if so and if the values are different then how are we to tune for this change

3. in the firmware there is a toggle EXTRA_LIN_ADVANCE_K M900.cpp What exactly is this doing? it seems there is a relationship between M900 and M572 but i cant find anything on what that relationship is. A change of this calibre seems like it should come with some sort of explanation.

I greatly appreciate any help on this.

 

Opublikowany : 27/03/2024 6:07 pm
FoxRun3D
(@foxrun3d)
Illustrious Member
RE: M900 Vs M572

They're not the same. See https://3dprinting.stackexchange.com/questions/18681/what-is-the-difference-between-linear-advance-and-pressure-advance for an explanation. How the XL or Mk4 handles it, I don't know, had neither time nor desire to go through the source code.

Formerly known on this forum as @fuchsr -- https://foxrun3d.com/

Opublikowany : 27/03/2024 8:38 pm
Cian W
(@cian-w)
Member
Topic starter answered:
RE: M900 Vs M572

Thanks for the reply,

I did come across this and it would explain the differences but thats from the point of view that marlin uses LA and klipper uses PA but it seems odd that buddy firmware has an implementation of both now. if you tune for example LA then any PA value is redundant and if you tune PA any LA is redundant. my guess is that the intention is to use PA going forward but theres nothing to say this is the case and it still doesnt answer how they are implementing both together.

I guess what im trying to get to the bottom of is; Do I set M900 K0 and then work from there on a PA value or will a change in LA be ignored since a PA value has been defined. does the PA value overwrite the LA value.

 

Opublikowany : 27/03/2024 8:56 pm
Antimix
(@antimix)
Honorable Member
RE: M900 Vs M572

Hello @Cian-w,

I was looking at the same topic. I realized that now on MK4S, PRUSA uses only M572 and any M900 reference has been removed. M900 was used on the old MK3S Fw but not any more on the Buddy.

The source code on the M900 command on the buddy board, does just few diagnostic value check, sends commands to the diagnostic serial, but at the end, it just calls directly the M572  (internal entry) command parsing the received parameters. So, on Buddy M900 = M572

  • If M900 was LINEAR Advance, and M572 is PRESSURE advance, it seems a nonsense that M900 call internally M572 with the same numbers. 🤔 
  • Linear Advance and Pressure advance  are different techniques (the first play around with the acceleration and speed, the second plays around only changing the pressure of the filament in the nozzle through the E motor, not altering speed or acceleration), so are the parameters really interchangeable ?
  • Is the PRUSA Pressure advance a real pressure advance as in Klipper ?

 

The Klipper manual advices the following:

Once pressure advance is tuned in Klipper, it may still be useful to configure a small retract value in the slicer (e.g., 0.75mm) and to utilize the slicer's "wipe on retract option" if available. These slicer settings may help counteract ooze caused by filament cohesion (filament pulled out of the nozzle due to the stickiness of the plastic). It is recommended to disable the slicer's "z-lift on retract" option.

but in PrusaSlicer,  on the MK4S profile, you can see that "z-lift" is enabled (it raises Z of 1.5mm), and the "wipe on retract" is disabled.
This is against the Klipper logic, so I would be not surprised if M572 is another PRUSA way to do things to compensate artifacts that has nothing to do with Klipper.

May be they are now just in a compatibility transition phase where they are just changing the M900 gcode to the new M572 gcode, and it has nothing to do with Klipper Pressure Advance, but it is just like a PRUSA Linear Advance 2.0. 😉 

So, I am currently trying to find the correct values for M572, since the quality of the MK4S is not satisfying me 😑 especially on the corners.

Regards

 

 

Opublikowany : 11/10/2024 7:29 pm
schloo
(@schloo)
Member
RE: M900 Vs M572

I'm guessing by now you may have already come to the same conclusion, but for anyone else looking for an answer:

I just had a bit of a play around with the two values on an MK4S. I generated a Tower and Pattern Pressure Advance test in Orca Slicer which uses the M900 command to set 'Pressure Advance' (i.e. Linear Advance K-factor), I then replaced all 'M900 K' (Linear Advance) commands with 'M572 S' (Pressure Advance) commands using the same values and reprinted. The results were exactly the same.

The official Prusa docs say that it does a 1:1 conversion of M900 commands to M572 (which has been confirmed by my test), I believe it's probably at least partially to reduce erroneous results for people tinkering with the PA value using the tests that exist out there, but probably more to reduce complexity when keeping both command codes active in the FW. I'd say that M900 continues to exist for Prusa printers that aren't pressure advance capable (MK3.5 and below), they may be left out due to lower max speeds? Not sure. But the existence of both 'PA capable' and 'PA incapable' printers would be why both commands still exist in Filament Start G-Code - legacy reasons. 

The docs also note that the PA value will always be set based on the latest M900 or M572 command (again, if M900 K0.036 command is given, this is changed to M572 S0.036). So, working procedurally through the Filament Start G-code (assuming a printer profile of MK4S with 0.4 nozzle, and Prusament PETG filament as at config bundle 2.2.4):

  1. M900 command is given, setting K = 0.07 > This is converted to M572 S0.07
  2. Current printer profile (MK4S) resolves the 'if printer_notes' statement to true > M572 S0.053 command is given (and supersedes the previous)
  3. Then, any M900 or M572 command given after that will supersede the last (converted to M572 with the same value if M900 was given)

So, the TL;DR of this all is that both commands are accepted but, for anything that meets the criteria of the 'printer_notes' statement, it will be converted to M572. If you're playing around with your Pressure Advance values, you can use M900 or M572 and get the same result but be sure to update the M572 value in Filament > Custom G-code > Start G-code. If you only update the M900 K value, it will be superseded by the default M572 S value in the next code block.

Hopefully that helps anyone else who comes across this post wondering the same thing! 🙂

Opublikowany : 17/03/2025 9:00 am
2 ludzie polubili
Green Joe
(@green-joe)
Eminent Member
RE: M900 Vs M572

Thanks so much for taking the time to explain all this. I am trying to pin down the reason for "tearing" at the edge of perimeters and it was incredibly useful to know I didn't need to run all my tests twice. 

Posted by: @schloo

I'm guessing by now you may have already come to the same conclusion, but for anyone else looking for an answer:

Opublikowany : 14/09/2025 5:58 pm
Share: