Could there be a possibility to set motor currents per drive?
-
As title really. The current method is to set motor currents per axis which makes perfect sense. However, there is at least one instance where it might be desirable to be able to set currents on a per drive basis, but this also leads me to a question.
The usage case I have in mind is a CoreXYUV where U and V axes are only used when homing but otherwise, the motors are mapped to X and Y. The question is, if motors were mapped to X,Y, U and V , then the motor currents set differently for U and V compared to X and Y, would those settings be preserved if those UV motors were then re-mapped to X and Y? Or would the XY motor current be applied to all 4 motors (assuming that X and Y were set to the same value which they should be on a CoreXY).
Expanding on that usage case, I now have an additional gantry which mimics XY but the motors are reversed so movement is in the opposite direction. As it happens, I chose to use the exact same motors for this gantry as for the other two gantries but I could have used less powerful motors of say 1 amp. Had I done so, then setting the motor current to 1.8 Amps for the XY axis would clearly be too high for these motors and setting it to say 900 mA would too low for the other motors/gantry.
In summary, the usage case is for multiple gantries which may use different motors but all gantries would be mapped to the same axes.
-
@deckingman An idea for you specific case: some people couple steppers parallel. You could do the same with steppers with different resistance (ohm) properties, so current to the steppers is different. From those coupled steppers you can use the one for your main movement, the other for the counterweight (with other direction set by the wires). You must be aware that the stepper which receives more current is inside the maximum current specifications of stepper and total current inside Duet stepper driver specification.
-
@joergs5 Thanks but that won't work for me as I need to home each gantry individually. So I have to map individual drivers to individual motors, carry out the homing, then combine the motors to a single gantry. To elaborate - during printing the X axis uses drives 0, 3 and 6 and the Y axis uses drives 1, 4 and 9. But each pair of motors drives a separate CoreXY gantry. Then for homing, the X axis is drive 0, the U axis is drive 3 and the A (or whatever one chooses to call it) axis is drive 6, and the Y is drive 1, U is drive 4 and B is drive 9.
-
@deckingman Your question was whether your configuration will be configured correctly after homing and reassigning.
Would it be possible to send a reset command after you homed everything to be sure your settings will have the intended settings? Then telling the printer that he is already homed. I am sure very people use your configuration, so instead of hoping that everything works as intended, you can reset to a defined state to proceed.
-
This post is deleted! -
@joergs5 said in Could there be a possibility to set motor currents per drive?:
@deckingman Your question was whether your configuration will be configured correctly after homing and reassigning.
Would it be possible to send a reset command after you homed everything to be sure your settings will have the intended settings? Then telling the printer that he is already homed. I am sure very people use your configuration, so instead of hoping that everything works as intended, you can reset to a defined state to proceed.
No not really. I know that everything works as intended. The question I asked was if the motor current was set for a particular driver when it was mapped to a different axis, would that motor current setting be preserved if that driver is then assigned to a new axis, or would that driver inherit the motor current setting for the new axis to which it has been assigned. I suspect it would be the latter case.
-
@deckingman If you tell me your gcode, I can check the source code. Otherwise maybe someone knows or you want to measure it.
-
@deckingman said in Could there be a possibility to set motor currents per drive?:
The question is, if motors were mapped to X,Y, U and V , then the motor currents set differently for U and V compared to X and Y, would those settings be preserved if those UV motors were then re-mapped to X and Y?
Yes, the settings will be preserved until you send M906 again. You could also do something like this:
M584 X1:2:3
M906 X1500
M584 X1
M906 X800
M584 X1:2:3which will leave drive 1 at 800mA and drives 2 and 3 at 1500mA.
-
@dc42 Oh that's excellent! Thank you.