Formulas behind the emf-calculator
-
Dear co-printers,
for an internal research paper i would like to better understand the calculations behind the emf-calculator on reprapfirmware.org.
Does anybody know (or can give me a hint/link) the formulas behind this calculator?
I am a hardcore mechanic - though basic electronics is present, such calculations exceed my knowledge.
Is there an easier way than to look through the site-code?Many thanks in advance and greetings from germany,
Julien -
I dunno bout what they use in the RRF-calculator, but maybe these websites could be of help for ya:
https://www.linearmotiontips.com/electromagnetism-basics-for-mechanical-engineers/
https://www.motioncontroltips.com/lenzs-law/
https://www.motioncontroltips.com/tag/back-emf/
Use dict.leo.org or translate.google.com if you are not so fluent
Or get an "old fashion" book e.g. here: https://www.lehmanns.de/search/quick?PHPSESSID=dk0t4m42jq6cdevmk0h553q9a4&mediatype_id=&q=antriebsauslegung
-
@ZipZap Thanks to @chrishamm, who wrote it, it's plain JavaScript, so you can open the EMF calculator and see what it's doing: https://www.reprapfirmware.org/js/main.js
I'm sure Chris will welcome any suggestions for improvement!
Ian
-
@ZipZap @droftarts The EMF tool on reprapfirmware.org uses the calculations from this StepperMotor spreadsheet by @dc42. You may find that helpful too.
-
Thanks to everyone, great answers.
I will work my way through the spreadsheet whilst trying to undertand the theory from @LB 's links.I have to say, this is one of the few "BS-free" forums i've met. Lots of competent answers and less guesswork .
/Julien
-
The formula for back emf due to rotation comes from matching the input and output energy. Basically, torque x angular_velocity = back_emf_due_to_rotation x current but you need to allow for the phase angle between the back emf and the current.
-
@dc42 and @chrishamm thank you for the EMF calculator. I was busy replicating this work when I found it.
I think I have found several errors in the calculations of the "Speed at which torque starts to drop" values. (Just to give some credence to what I suggest below it might be helpful to know I am a Marlin dev.)
- When calculating
revsTorqueDropLowSlip
andrevsTorqueDropHighSlip
I think just dividing speed by the number of motors is incorrect. Instead, the value ofsupplyVoltage
should be divided by the number of motors. i.e. motors in series form a potential divider for the supply voltage. An easy way to test my assertion is to consider what happens with two motors in series whenresistance * motorCurrent > supplyVoltage / 2
. That should result in "n/a" because the voltage cannot even drive the requested current through the two winding resistances. But, instead, the web page just halves the speeds. driverVoltageDrop
is double counted. It is incorporated whenvoltageDrop
is calculated and then, later, whenrevsTorqueDropLowSlip
andrevsTorqueDropHighSlip
are calculated, it is added on tovoltageDrop
again.revsTorqueDropHighSlip
is missingvoltageDrop
in two places. This formula is the result of applying the quadratic formula to solve forrevs
in the equationsupplyVoltage = sqrt( (revs * inductiveBackEmfPerRevSec)^2 + (revs * motionBackEmfPerRevSec + voltageDrop)^2 )
. This expands to0 = revs^2 * inductiveBackEmfPerRevSec^2 + revs^2 * motionBackEmfPerRevSec^2 + 2 * revs^2 * motionBackEmfPerRevSec * voltageDrop + voltageDrop^2 - supplyVoltage^2
. Theb
coefficient in this equation is2 * motionBackEmfPerRevSec * voltageDrop
and it is thisvoltageDrop
which is lost when the quadratic formula is applied to calculaterevsTorqueDropHighSlip
.
- When calculating
-
@chrishamm
Not sure if there is something wrong with the formulas, but bringing up the subject reminded my of my request to integrate the EMF calculator in DWC as plugin.
So, if it would need rewriting, please consider this option too -
Ah, bother, there is an error in one of my formulae and akismet won't let me correct it. The third bullet point should have "This expands to..." with
2 * revs * motionBackEmfPerRevSec * voltageDrop
in the middle of the equation (whererevs
is not squared). -