Question about microstepping and mixing ratios



  • I'm doing some work and calculations regarding mixing ratios and just need a reality check.

    So a typical "E" move from a gcode file for a short arc segment on my machine could be say 0.04 mm. Keeping the maths simple and say that steps per mm for the extruder are 400 (using 16* micro stepping), that gives me 16 micro steps to complete that move using a single extruder. Now supposing I'm using a 3 colour mixing hot end and have a mixing ratio of 94%, 3% and 3%. For each extruder that is set to 3% (of 16 micro steps) that would mean 0.48 micro steps to complete the move and I'm assuming that rounding would be applied meaning that there would in fact be no movement on that extruder. Is that a fair assumption? Or, because I use interpolation does 0.48 of a step get sent to the stepper drivers and the driver chips interpolate that correctly into smaller micro steps?

    If the micro steps get rounded down, then I'm assuming that overall there would be about 6% under extrusion? i.e 2 extruders set to 3% not moving at all and the other extruder set to 94% doing (16*0.94) 15.04 (rounded down to 15) steps. Alternatively, does the mixing ratio algorithm do something clever to maintain (in this case) 16 micro-steps by rounding up one extruder to compensate for the rounding down of others?

    If my assumptions about rounding down are correct, then it looks like there is a strong case for me to consider 0.9 degree motors or use (say) 64,128 or even 256 x micro stepping on the extruders, (and/or use large segment sizes on arcs).

    If I went for the high micro stepping option, would the Duet keep pace given that I might be using 5 extruders and tend to print at highish speeds?

    Sorry for all the questions.


  • administrators

    Yes, the step count will get rounded up or down. Normally this isn't be an issue, but when using a mixing extruder with just a few % of one filament, I can see that it would be.

    You could try increasing microstepping for the extruder drives, and 0.9deg motors would definitely be a good idea.

    Some time ago I tried adding code to accumulate the lost fractions of microsteps so that eventually a microstep would be taken. Unfortunately this led to a reduction in print quality, which I didn't have time to investigate.



  • @dc42

    Thanks David, it is as I suspected.

    Can you remind me what the maximum step frequency is? Or to be more precise, how can I calculate what the maximum print (or extruder) speed would be for 5 extruders running at nnn micro steps (plus the 4 XYUV motors running at 16x).

    Cheers


  • administrators

    Your microstepping limit for the extruder will be determined by the retraction/reprime and filament loading speeds you want to achieve, not by print speeds. For these extruder-only moves you should be able to get at least 200kHz step rate.



  • @dc42

    Thanks. Yes of course, I've just done a quick check and it looks like the extruder runs at about 5% of the speed of the axes (typically a 300mm long axis move use about 16mm of filament) so even at silly print speeds of 300mm/sec, the extruder would only be running at around 15mm/sec.

    Ref retraction speed, can you just check my maths please? Assuming a desired retraction speed of 60mm/sec. Current steps per mm at 16x micro stepping is 415. Therefore steps per mm at 128x micro stepping would be (415/16128) = 3,320. So for 60mm/sec the step rate would be 332060 = 199,200 or just a tad under 200khz. Would that be a safe value or would I be safer limiting the micro-stepping to 64x ?

    Given that 200kHz limit, I don't really see the benefit of changing to 0.9 degree motors, or is there some other benefit that I've missed?

    Thanks


  • administrators

    How much retraction do you use, and what extruder acceleration? You may not even be reaching 60mm/sec.

    0.9deg motors provide almost double the incremental torque per microstep, so more precise positioning. But that may not be relevant to this situation.



  • @dc42 said in Question about microstepping and mixing ratios:

    How much retraction do you use, and what extruder acceleration? You may not even be reaching 60mm/sec.

    0.9deg motors provide almost double the incremental torque per microstep, so more precise positioning. But that may not be relevant to this situation.

    5mm @ 1,000 mm/sec^2 which, if my maths is correct, would give me a maximum speed of 70 mm/sec. So 128x micro stepping or 64x to be safe?

    Ref 0.9 degree motors, I'd need short ones to fit my mount (cramming 5 extruders onto a carriage is a bit of challenge). Currently the motors I use are 25mm long and that's about the maximum length that I can realistically use. The nearest 0.9 degree motors I can find are 21mm long but have 30% less torque to start with. They are also about £12.25 each so 5 would cost £60+ which is a lot of dosh to find for what might be very little gain.



  • Can I test this? I'm thinking that if I set a mixing ratio of 20% for all 5 extruders then with no filament loaded, command extrude and/or retractions of a reasonably long amount at say 60 mm /sec. Then run diagnostics. Then increases the micro-stepping and repeat until I reach the pulse frequency limit. What would I look for in the diagnostic report that would tell me? As I'll have to do it with no filament loaded, I may not be able to tell from physical observation. Thanks.


  • administrators

    @deckingman said in Question about microstepping and mixing ratios:

    Can I test this? I'm thinking that if I set a mixing ratio of 20% for all 5 extruders then with no filament loaded, command extrude and/or retractions of a reasonably long amount at say 60 mm /sec. Then run diagnostics. Then increases the micro-stepping and repeat until I reach the pulse frequency limit. What would I look for in the diagnostic report that would tell me? As I'll have to do it with no filament loaded, I may not be able to tell from physical observation. Thanks.

    If you are running version 2.0 firmware then look at the Hiccup count in the M122 report. It should normally be very low, but it will rise dramatically when you hit the step pulse rate limit.



  • @dc42

    Thanks. That may have to wait a while as I'm on 1.20.1 RC2. I'm reluctant to update just at the moment as I'm in the process of printing a whole batch of parts that need to be identical and after that, I'm planning to change all my extruders so don't want to introduce too many variables at once.


  • administrators

    With older firmware versions, look at MaxReps in the M122 report.



  • @dc42 said in Question about microstepping and mixing ratios:

    With older firmware versions, look at MaxReps in the M122 report.

    Thank you.



  • Just run some test as follows:

    Tool 5 used throughout and defined with mixing ratio of 20:20:20:20:20.
    Default firmware retraction of 5mm at 60mm/sec (M207 S5.0 R0 F3600 T3600)

    Start with default extruder micro stepping of 16x with interpolation, do G10, then G11, then M122. Change micro-stepping and repeat.

    Micro-stepping and Max reps as follows;

    16x = 5
    32x = 5
    64x = 10
    128 x = 40
    256x = 744.

    In all cases, step errors were zero.

    Commanding 100mm of extrusion using 256x micro-stepping at 60mm/sec (G1 E100 F3600) gave 20mm of measured filament on one extruder so x 5, this would equate to a total of 100mm which is correct (despite 744 Max Reps).

    Reducing extruder speed to 1800 (30mm/sec) and repeating G10 and G11 at 256x micro-stepping brings the Max Reps down from 744 to 40.

    Questions:

    1. I'm assuming that Max Reps of 744 is too high (despite the fact that 100mm of commanded filament move does in fact result in 100mm measured). Is that a safe assumption (that 744 Max Reps is too high)?

    2. If (1) is correct then is Max Reps of 40 safe\OK?

    3. I also noticed in the M122 report something called "SG min/max" for each drive. Typical values for drive 5 (extruder 0) are around 0/155. Typical values for drive 9 (extruder 4) are 0/175. But drives 6 to 8 all show values of 0/1023. Is this normal? Is it significant? Why are drives 5 and 9 so different to drives 6 to 8?

    Thanks.



  • @deckingman said in Question about microstepping and mixing ratios:

    1. I also noticed in the M122 report something called "SG min/max" for each drive. Typical values for drive 5 (extruder 0) are around 0/155. Typical values for drive 9 (extruder 4) are 0/175. But drives 6 to 8 all show values of 0/1023. Is this normal? Is it significant? Why are drives 5 and 9 so different to drives 6 to 8?

    Short: if you do not use stallGuard you do not have to worry about these numbers.

    Long: SG stands for stallGuard. This is a value in the range of 0 to 1023 that is reported back from the TMC2660 to the Duet. The range is reverse to (at least my) intuitive understanding. 0 means a stall has been detected. The upper limit is always motor specific (though never above 1023). Also these values are dependent on the sensitivity of stallGuard as defined by M915 Sxxx parameter. Motors or rather drivers that are not used will always show a 0/1023 pair.
    A value of 0 will only report a real stall if you have tuned stallGuard sensitivity before because otherwise you might have false positives, e.g. my X and Y motors need a value of S10 or higher to not report false positives where my Z axis basically never reports any stalls even at the default S1.

    What I forgot: the numbers listed in M122 output are the minimum and maximum values of SG seen since the last time M122 was called (or the Duet was reset).


  • administrators

    Yes, MaxReps 40 is OK but 744 is much too high.

    If a motor has not been moved then there will be no Stallguard data for it, so it will show 0/1023.



  • @dc42 said in Question about microstepping and mixing ratios:

    Yes, MaxReps 40 is OK but 744 is much too high.

    If a motor has not been moved then there will be no Stallguard data for it, so it will show 0/1023.

    Thanks.

    Ref the stall guard report - I'm not concerned personally but it seems to do random things. I'm using all 5 extruders and can confirm that all five motors (5 to 9) definitely move when I do G1 E100 F3600 (tool 5 with mixing ratio of 20:20:20:20:20) but the SG report shows only one or two with values of around 0/150-170. It's not the same motors every time though - hence the "randomness" comment. The other 3 or 4 motors show 0/1023.

    All the axis motors which haven't moved (0 to 4) report "SG min/max not available".

    I'll check it again when I get around to updating to the latest firmware - it could be something that has already been fixed.


Locked
 

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