What is my motor current unders these scenarios?
-
This came up in another post, but rather than continue to hijack that post, I'm starting another.
Background
I have three CoreXY gantries stacked one on top of another. The XY gantries carries the (mixing) hot end. The next one up is the UV gantry which carries the six extruders. The upper most gantry is the AB gantry and carries lumps of lead - the motor directions for this gantry are reversed so it does the opposite of the other two gantries to cancel the forces.
The UV gantry has higher mass than the two gantries, so it has bigger, higher current motors.
For printing, the 3 gantries run in sync with each other but they are homed separately.
Scenario 1. The printer is turned on and the following lines from config.g get executed.
M584 X3.2:0.0:0.2 Y3.1:0.1:0.3 Z3.0 U0.0 V0.1 A0.2 B0.3 E1.0:1.1:1.2:2.0:2.1:2.2 P7; XYZ on ex board 3, UVAB on main board, extruders 0 to 2 to ex board 1, extruders 3 to 5 on exp 2. M669 K8 A0:0:0:0:0:1:1 B0:0:0:0:0:1:-1; CoreXYUV plus AB force cancelling gantry M906 X1800 Y1800 U2300 V2300 A1800 B1800 Z1800 E600:600:600:600:600:600 I20
So driver 0.0 (main board, driver 0) is both one of the three "X" motors and also the "U" axis motor.
Q1. What is the motor current for driver 0.0 at this point? Is it 1800 as defined by it being an "X" axis motor, or is it 2300 as defined by the "U" axis?
Scenario 2. After a period of time, the motor currents drop to the idle hold of 20 percentage.
In the other thread DC42 said "when the motors are switched between idle hold and active mode, or when you use M913, the current will be reset to the configured value for that axis. So it's only useful for making a temporary change prior to doing some specific moves, when you know that idle hold won't kick in."
Q2. What is the motor current at this time for driver 0.0.? Is it 20% of 1800 because it is an X axis motor, or is it 20% of 2300 because it is also the U axis motor?
Scenario 3. Homeall starts to run and the following commands are executed:
M584 P7 ; use P7 to make all visible M584 X3.2 Y3.1; temporarily map X3.2 and Y to 3.1 only
Driver 0.0 is now no longer mapped to the X axis, so ....
Q3 What is the motor current for driver 0.0 now? There is no explicit M584 assignment for the U axis so I assume that the current will be set to (20% of) 2300 from the original M584 but maybe not if it got set to (20% of) 1800 when idle hold kicked in and it got reset to the "X" axis value?
Scenario 4. The following homeall commands now run
; reduce motor currents to 25% for XYUVAB and 50% for Z M400 ; wait for any moves to finish (shouldn't be any) M913 X25 U25 Y25 V25 A25 B25 Z50
Q4. Driver 0.0 is now just the U axis so what is the motor current? 25% of 1800 or 25% of 2300?
Scenario 5. Homing of XYUVA and B is now complete and the following commands get executed.
M913 X100 U100 Y100 V100 A100 B100 ; remap drives to X and Y and hide UVA&B M584 X3.2:0.0:0.2 Y3.1:0.1:0.3 P3
The motor currents for all but the Z axis are restored to 100%.
Driver 0.0 is re-mapped to the X axis (but should retain it's mapping to the U axis from the original M584 in config.g ??).
UVA and B are now hiddenQ5. What is motor current for driver 0.0 now?
TIA
-
I appreciate that, in order to answer the above questions, some detailed knowledge of how the firmware works is required which is probably why there have been no replies.
I could answer the questions myself if I could find a way to get a report of individual motor current. M906 is of no help because it will always report the motor current for all axes and as driver 0.0 is assigned to both X and U, I have no way of knowing which axis takes precedent. Is there any other way of reporting the driver current setting rather than the axis current? Is it in the object model for example?
-
@deckingman I think nobody answered because nobody knows. The easiest way would be to measure it directly with the method of https://forum.duet3d.com/topic/12049/building-a-diy-public-domain-low-cost-stepper-motor-analyzer
I plan to setup a test station to compare different TMC/drivers, but this will take a few months before I have it. -
you don't happen to have a clamp style ammeter to measure the current with?
given the current is "constant" it should be doable to measure with either a DC setting when stationary or AC setting when moving? (not many clamp meters does small-ish DC currents though, so while moving is probably the best bet)
-
No I don't have any means of directly measuring the current. If I had any money to throw at this issue, rather than buy more kit I'd likely just buy four more Nema 23s to replace the Nema 17s, set all the motor currents to 2300mA and be done with it.
Essentially, I just want to use bigger motors and higher current on one gantry which is heavier than the others. I thought I was setting a higher current. But DC's latest comments mean that this is now uncertain.
I can't believe how difficult this is becoming, nor that I am the only person in the world who wants to use different size motors on gantries which have different masses but must move in sync.
-
<snip> nor that I am the only person in the world who wants to use different size motors on gantries which have different masses but must move in sync.
.. I'm sorry, I lost my tea when I read that. Its definitively not a common use case, hats off and all that though..
anyways, a clamp meter is a handy tool and even the cheap ones are quite good for AC and usually doubles as a fully functional wired multimeter. Uni-T 210 E [eevblog] is, afaik, the best value that also does DC currents down to a 2A range afaik. downside is the screen orientation makes for a weird wired multimeter. I've bough a few off AliExpress as they seem to never find their way back to me when borrowed
-
@bearer I appreciate that it's not a common use case but I do know a few other CoreXYUV users and I can't believe their carriage masses are identical. The firmware is ever expanding and recent changes allow for just about any kinematics class using the matrix (M669, not the film) We now also have IDEX machines, tool changers and so forth and who know what other things crazy old farts like me might come up with.
Personally, I don't see why motor current can't be set on a per motor basis the same as motor direction is, rather than on a per axis basis. But I've just been put in my place for suggesting such an outrageous concept.
Pity you are in Norway - otherwise I'd ask to borrow your clamp meter
-
@deckingman said in What is my motor current unders these scenarios?:
But I've just been put in my place for suggesting such an outrageous concept.
that was certainly not my intention, i merely found your wording amusing given the ever so slightly exotic nature of your creation
-
@deckingman said in What is my motor current unders these scenarios?:
how difficult this is becoming, nor that I am the only person
If 99% of the users buy commercial printers and the remaining 1% distribute to RAMPS, exotic printer and different firmware, it is possible that you are the one unicorn out there!
-
@bearer said in What is my motor current unders these scenarios?:
@deckingman said in What is my motor current unders these scenarios?:
But I've just been put in my place for suggesting such an outrageous concept.
that was certainly not my intention, i merely found your wording amusing given the ever so slightly exotic nature of your creation
That wasn't aimed at you so please don't take offence. I didn't make the suggestion about per motor drive currents on this forum but elsewhere.
-
@JoergS5 said in What is my motor current unders these scenarios?:
@deckingman said in What is my motor current unders these scenarios?:
how difficult this is becoming, nor that I am the only person
If 99% of the users buy commercial printers and the remaining 1% distribute to RAMPS, exotic printer and different firmware, it is possible that you are the one unicorn out there!
Great! Now I can add "Unicorn" to my list of accolades which include "old fart".
-
Thought about changing my user name to "AgedFlatulentProneHornedQuadruped" but that's too many letters
-
@JoergS5 said in What is my motor current unders these scenarios?:
@deckingman said in What is my motor current unders these scenarios?:
how difficult this is becoming, nor that I am the only person
If 99% of the users buy commercial printers and the remaining 1% distribute to RAMPS, exotic printer and different firmware, it is possible that you are the one unicorn out there!
That has triggered a train of thought. The implication of what you say is that Duet users buy "standard" commercial printers and the other 1% of "exotic" printer users run Ramps or other hardware variants and different firmware.
Until now, I've only ever used Duet products right from the days of the first 06 board with it's "shield" expansion up to present day gen 3, and I've only ever used RepRap Firmware so I have no knowledge of other hardware/firmware. Do you have any recommendations as to alternative hardware/firmware which might be worthy of consideration?
-
@deckingman Klipper
-
This post is deleted! -
Being an old fart and getting senile, I did a search of previous threads where I had asked about setting motor currents, thinking that my memory must have failed me more than I realised and came across this.
https://forum.duet3d.com/topic/7131/could-there-be-a-possibility-to-set-motor-currents-per-drive
DC42s post of 3rd October 2018 15:32 is interesting. It says this quote .........
"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."....end of quote.
Which is what I thought I was doing and why I thought it was correct. But then in this thread https://forum.duet3d.com/topic/17596/m906-motor-current/8 on 16th July 2020 at 13:37 DC said quote
"Maybe I did say that; however when the motors are switched between idle hold and active mode, or when you use M913, the current will be reset to the configured value for that axis. So it's only useful for making a temporary change prior to doing some specific moves, when you know that idle hold won't kick in."...end of quote.
Which made me a bit miffed and is what lead to me starting this thread because I have no idea what my motor currents are actually set to.
I've just looked at the wiki for M906 which now states quote .....
"RepRapFirmware does not support individual motor settings where an axis has multiple motors connected to different stepper drivers. The first parameter specified will be used for all motors on the axis. You should use identical motors on any axis that has more than one motor to avoid unexpected behaviour". ...end of quote.
So it would seem that the official answer to my question is that I should replace all my lower current Nema17s with identical, higher current Nema 23s, in contradiction to all previous advice.
I guess that's one way of dealing with it, but this is one very long term user and supporter who is now seriously pi**ed off.
-
@deckingman Just in case you are still around, I’ve tried out my idea, and it seems to work! I can only test it in a simplistic way, but I don’t see why it shouldn’t work scaled up. So…
In my config.g I assign a dummy driver number to X and Y. My first (and only) ‘real’ axis is defined as U and V. So driver assignments are:
M584 X5 Y6 Z2 U0 V1 E3
This is just on a Duet 2 WiFi, so drivers 5 and 6 aren’t there, but need to be defined, otherwise it defaults to driver 0 and 1.
For the kinematics, I told it to move U/V to move with X/Y, for the same X and/or Y input move, with:
M669 X1:1:0:1:1 Y1:-1:0:1:-1 Z0:0:1:0:0 U0:0:0:1:1 V0:0:0:1:-1
This shows the matrix as (I've formatted it to show the gcode input axis as rows, and shows how it affects each axis in the columns):M669 Kinematics is modified CoreXY, matrix: Motor driver: 5(X) 6(Y) 2(Z) 0(U) 1(V) (G1 input) (X) 1.00 1.00 0 1.00 1.00 (Y) 1.00 -1.00 0 1.00 -1.00 (Z) 0 0 1.00 0 0 (U) 0 0 0 1.00 1.00 (V) 0 0 0 1.00 -1.00
So a move in X eg G1 X10 causes a move in dummy motors X/Y, and real motors U/V. The X position in DWC changes, but the U position does not. A move in U cause the U/V motors to move and their position is reported in DWC, but not the X or Y position.
I also tested motor current. I set M906 X100, and G1 X10. U and V motors moved correctly, and X10 reported in DWC. I waited for idle hold and did it again, U and V motors moved correctly. I then sent M906 X1000 U100 and tried it again. U motor stalled on moving. So it would seem that the axes keep their individual motor settings this way.
This setup allows for individual ‘Core’ axes homing, with each motor pair being able to have it’s own motor settings. You’d set X/Y as the dummy axis (though there are no motors attached, so you would just set it with G92 X0 Y0), and define the other 3 Core axes pairs as U/V, A/B, C/D, which can be homed individually. From there, normal X and Y movement inputs would cause all three axis pairs to move together. Care would be needed to set accelerations and speeds to settings that all axes are capable of, though.
Ian