M92 parameter to indicate microstepping



  • Background

    In my head I usually always calculate steps/mm @x16 microstepping. And usually that is also what I have set for all axes as the effective microstepping factor.

    Now I ran into an issue that took me a while to figure out. Only in recent 2.02RC6 a bug was fixed that would cause a loss of E-steps < 1 microstep instead of accumulating them. The recommended workaround was to set microstepping to a factor so that E-steps/mm would be in the 400-800 range. I added an appropriate command to switch to x128 in my filament's config.g (I am using only one filament at the moment anyway) after I set the steps/mm for this specific filament. I also have a M703 in my start codes.

    When I did the next print it still was at x128 (because I did not add a reset to x16+I in the end code) and then setting the steps/mm again to something around 100 led to the extruder virtually not extruding anything anymore.

    Request

    Add a parameter to M92 that overrides the microstepping-factor the given values apply to, e.g.

    M92 E102.432 U16
    

    This would mean the 102.432 steps/mm are based on x16 microstepping. Or

    M92 Z100 U1
    

    means 100 steps/mm in full steps, etc.
    If the parameter is omitted it will take whatever microstepping-factor is currently set.


  • administrators

    When you send M350, it adjusts the M92 steps/mm automatically to account for the change in microstepping. So we recommend that in config.g any M350 commands come after the M92 commands. That way you can always use the step/mm at x16 microstepping in the M92 commands in config.g.



  • @dc42 Yes, in /sys/config.g my M92 comes first, then M350. For the extruder I set M92 [...] E100 in config.g because this is what the steps/mm @x16 are supposed to be for this (ungeared) model.

    Now I have checked my steps/mm also for some of my filaments and override the steps/mm in the filament's config.g. Yes, this has some issues for filaments that I have not yet checked in case I change filament without a power-cycle (but I virtually never do that so far).

    As part of the recommendation to change steps/mm for the extruder to be somewhere around 400-800 prior to 2.02RC6 I added M350 E128 to my filament's config.g right after the M92 command that sets the steps/mm for this filament. The first time everything is OK but the second print this will fail.

    Of course I have upgraded to 2.02RC6 and removed the M350 from filament's config.g but still the idea to give M92 a parameter to indicate at which microstepping-factor these values were calculated sparked.


  • administrators

    I'll add this to the firmware wishlist.



  • @dc42 Thanks. 🙂



  • @dc42 I just created https://github.com/dc42/RepRapFirmware/pull/247 that implements this.


  • administrators

    Thanks, I'll review it before next release.


 

Looks like your connection to Duet3D was lost, please wait while we try to reconnect.