• Tags
  • Documentation
  • Order
  • Register
  • Login
Duet3D Logo Duet3D
  • Tags
  • Documentation
  • Order
  • Register
  • Login

Formulas behind the emf-calculator

Scheduled Pinned Locked Moved
General Discussion
7
9
1.1k
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • undefined
    ZipZap
    last edited by 27 Jan 2021, 15:36

    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

    Most important guide -> Triffid Hunter's Calibration Guide
    HyperCube EVO (derivate) in 250x250x300 - enclosed for ABS - Duet2WiFi - custom watercooling

    ? undefined 2 Replies Last reply 27 Jan 2021, 15:45 Reply Quote 0
    • ?
      A Former User @ZipZap
      last edited by A Former User 27 Jan 2021, 15:45

      @ZipZap

      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

      1 Reply Last reply Reply Quote 0
      • undefined
        droftarts administrators @ZipZap
        last edited by 27 Jan 2021, 16:17

        @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

        Bed-slinger - Mini5+ WiFi/1LC | RRP Fisher v1 - D2 WiFi | Polargraph - D2 WiFi | TronXY X5S - 6HC/Roto | CNC router - 6HC | Tractus3D T1250 - D2 Eth

        1 Reply Last reply Reply Quote 0
        • undefined
          chrishamm administrators
          last edited by 27 Jan 2021, 19:28

          @ZipZap @droftarts The EMF tool on reprapfirmware.org uses the calculations from this StepperMotor spreadsheet by @dc42. You may find that helpful too.

          Duet software engineer

          1 Reply Last reply Reply Quote 0
          • undefined
            ZipZap
            last edited by 1 Feb 2021, 11:38

            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

            Most important guide -> Triffid Hunter's Calibration Guide
            HyperCube EVO (derivate) in 250x250x300 - enclosed for ABS - Duet2WiFi - custom watercooling

            1 Reply Last reply Reply Quote 0
            • undefined
              dc42 administrators
              last edited by 2 Feb 2021, 07:10

              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.

              Duet WiFi hardware designer and firmware engineer
              Please do not ask me for Duet support via PM or email, use the forum
              http://www.escher3d.com, https://miscsolutions.wordpress.com

              1 Reply Last reply Reply Quote 0
              • undefined
                tombrazier
                last edited by tombrazier 24 Mar 2023, 22:52

                @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 and revsTorqueDropHighSlip I think just dividing speed by the number of motors is incorrect. Instead, the value of supplyVoltage 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 when resistance * 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 when voltageDrop is calculated and then, later, when revsTorqueDropLowSlip and revsTorqueDropHighSlip are calculated, it is added on to voltageDrop again.
                • revsTorqueDropHighSlip is missing voltageDrop in two places. This formula is the result of applying the quadratic formula to solve for revs in the equation supplyVoltage = 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. The b coefficient in this equation is 2 * motionBackEmfPerRevSec * voltageDrop and it is this voltageDrop which is lost when the quadratic formula is applied to calculate revsTorqueDropHighSlip.
                undefined 1 Reply Last reply 25 Mar 2023, 09:38 Reply Quote 4
                • undefined
                  o_lampe @tombrazier
                  last edited by 25 Mar 2023, 09:38

                  @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

                  1 Reply Last reply Reply Quote 0
                  • undefined
                    tombrazier
                    last edited by 25 Mar 2023, 13:15

                    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 (where revs is not squared).

                    1 Reply Last reply Reply Quote 2
                    • undefined tombrazier referenced this topic 9 Apr 2023, 18:41
                    • First post
                      Last post
                    Unless otherwise noted, all forum content is licensed under CC-BY-SA