How to force a stepper driver into full step position?



  • Hi all,

    Running some experiments at the moment to test repeatability of the system. With a grid of 16 identical parts my standard deviation is not massively larger than the step size of the printer. I can force the spacing of parts to be an integer number of full steps apart, but I'm not aware of a way of detecting when the driver is on a full step? Perhaps the only real way is to home the system move it to (0,0,30), power cycle, and set the position to (0,0,30) rather than home?

    Thanks!



  • Perhaps... and just for experiments... make your idle current zero, temporarily. When the motor quits getting current, it will cog to a full step. Then set it back to some reasonable percentage.

    Takes advantage of the fully dynamic nature of Duet config commands.



  • @Danal cheers. I was wondering about if M18 more conviently. I'll have to read up on the stepper docs to see if the counter resets, because I don't think the duet has any clue where in the cycle it is.



  • M18 will mark everything as not homed.



  • Cutting current may not move the motor at all depending on how much friction there is in the system. I think that when the current goes from zero to operating value you will see the motor cogging to a full step position.



  • @Danal said in Any way to tell when motor is on full step?:

    M18 will mark everything as not homed.

    That's not so much and issue. Something like the following should work...

    G1 X0 Y0 Z30
    M18
    [enable drives?]
    G92 X0 Y0 Z30

    ...but I don't know what will enable the drives!

    I'll read the driver docs about what happens when the current drops down then comes back up. I would have expected it to come back to the same point in the cycle, as the chip itself isn't powered down?



  • @DocTrucker said in Any way to tell when motor is on full step?:

    I'll read the driver docs about what happens when the current drops down then comes back up. I would have expected it to come back to the same point in the cycle, as the chip itself isn't powered down?

    That is a good point. The chip is sitting there holding a given microstep, by splitting current between the coils. Ramping down/up, it will still split.

    Harumph.

    Let's keep thinking...


  • Moderator

    Wouldn't you have to stall it to get a full step reliably?



  • AH!! Dynamic configuration. Config for no microstepping. Step one pulse, config for whatever microstepping you want.

    You are now sitting on a step, ready to move in microsteps.

    M350 X1
    Generate some movement.
    M350 X16 (or whatever)



  • Isn't an axis flagged as unhomed when the microstepping is changed?


  • Moderator

    Even if it did flag it as unhomed, if you've already put it in a known position, you could force the position again afterwards with G92



  • @Phaedrux right!



  • @bot said in Any way to tell when motor is on full step?:

    Isn't an axis flagged as unhomed when the microstepping is changed?

    @DocTrucker said in Any way to tell when motor is on full step?:

    That's not so much and issue. Something like the following should work...

    G1 X0 Y0 Z30
    M18
    [enable drives?]
    G92 X0 Y0 Z30

    I find the G92 trick worth remembering for machine commissioning of if you've been daft enough to modify a carriage and not consider if it can still hit the limit switch.

    That has never happened to me... 😉

    @Danal the change microstepping may just do it for the D3 board. I'll have to get that together and running before my little one gets kicked out of nursery on Monday!

    Odd there's no apparent counter to M18 though. I wonder if it is triggered by something else, or if M18 is more like a 'switch state' than an enable.

    Edit: Excuse the subject change! Matches the conversation now.



  • @DocTrucker Can't you just run with no microstepping and maybe alter your test procedure to suit? No sure what exactly your repeatability test is aiming to do but if you have a grid of objects, then each time you print then, they should be the same. Individual objects might be slightly different sizes and the spacings between them might vary but that variation should be the same each time you print.

    Alternatively, assuming you use 80 steps per mm @16x then you'll have 5 full steps per mm or 0.2 mm per full step. If you design your test parts multiples of 0.2 mm in size with spacings between them also multiples of 0.2mm, wouldn't that work?

    Just some random thoughts because I don't know what the goal is.



  • @deckingman Morning Ian! I'm avoiding the tempation to go down discussing experimental plan in too much detail as that's a big can o' worms. Bare with me here as I am writing it up, and will share in due time. If I try and defend/discuss the work off the cuff I won't do myself or the work justice.

    These are preliminary tests that I have started simple and am gradually increasing adapting the test geometry, and procedure in order to reduce measurement errors as far as practical.

    In the first post I mentioned about forcing the positioning if the parts to be integer multiples of the full step size. Hopefully this will reduce the effect of microstep inaccuracies across one build. But unless I queue build after build without resetting the machine I can't escape needing to home which may result in a specific co-ordinate of the bed being in a subtly different absolute angle of the stepper than a subsequent build. One valid response would be to improve the limit sensing if that is the case, and the other is a cheaper route which is forcing a specific co-ordinate to be at a whole step position for the motors.

    That said first test this morning will be testing my limits to determine how repeatable they are!

    Other factors that are on-the-shelf for consideration in this body of work are:

    • Local bed temperature variations caused by heater or the use of glass bed (/ another) surface
    • Differences in x and y axis - ie mass.
    • Belt tensions and inconsistencies between axis.
    • Sticking points on the axis.
    • Variations in filament diameter - ie manufactures specified tollerance.

    That's just the tip of the potential causes. The stepping is the one I'm trying to investigate right now.

    Ultimate aim of work? Develop a simple procedure that can optimise achievable tollerance and accuracy for a machine. Not as trivial as you might expect as part geometry, cooling rate, and even extrusion velocity is likely to have an effect on shrinkage - polymers are weird...



  • ...just a final clarification on the previous post. This work is about identifying and fixing identified problems without doing the throw money at it/developer gold plating approach.

    I've found strong indications that I had positional related effects on the size of parts. I'm now working theough a list of potential causes - one by one - to try and identify the cause, or causes until there is little.indication of positional related effects on accuracy.

    I'm interested to benchmark what this system is capable off then compare it to another format such as core xy or improve it with controller or physical changes.



  • Ok, got the machine powered up and checked.

    M18 is not a switch command it is definitely a disable command. I checked the machine and you could definitely move the steppers easily after issuing M18.

    However, the home all command worked fine after M18 with the steppers moving and the process completing.

    The following process seems to work fine and the machine is flagged as homed after:

    G1 X0 Y0 Z0
    M18
    G92 X0 Y0 Z0
    

    I've moved the machine to touching the nozzle on the bed to increase the resistance against dropping the bed. But that said I'm using 1mm pitch lead screws, so the chance of a major movement is minimal. Yes my first layer may be a little crap but I've designed the test geometry so that the measurement point is well above the section of the part that is likely to suffer the 'elephant foot' and between any significant changes in section such as the upper and lower solid areas or any change in XY section in the Z direction.

    Next challenge is a deep dive into slic3r in order to directly specify the part locations of 16 parts. That's one LONG command line string!


  • administrators

    @DocTrucker said in How to force a stepper driver into full step position?:

    I'll read the driver docs about what happens when the current drops down then comes back up. I would have expected it to come back to the same point in the cycle, as the chip itself isn't powered down?

    That's correct AFAIK. Disabling the the driver only disables the output stage. Whereas removing VIN power and reapplying it will reset the chip.



  • @dc42 Ahh ok, my responce there was my thoughts that dropping current to 0 and increasing may not do it, rather tham M18. Just to be clear you are saying M18 may not reset the chip either?



  • Confirmed for the A4982 drivers of the Duet v0.6 and 0.8.5, a power cycle will be needed. Cycling reset could achieve the 'reset to home position' but that is hard wired on the v0.6 & v0.8.5 to the 3.3V line. I've not looked over the Duet3 or Duet2 drivers spec sheets. I guess there may be an SPI command that could achieve the reset but as the use cases are limited to probably just my test it's not worth a feature request.


Log in to reply