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

Are your drivers outputting the current expected?

Scheduled Pinned Locked Moved
General Discussion
4
6
948
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
    jay_s_uk
    last edited by 5 Jul 2022, 10:29

    After recently making some changes to one of my printers, I was running into issues with layer shifting etc and I wanted to investigate further. I was lucky enough to be able to purchase one of @zapta fantastic stepper motor analysers and I thought now was the perfect time to put it to good use.

    For reference, the machine in question has a Fly-E3-Pro installed (which has onboard 2209 drivers) utilising the STM32 port of RRF (3.4.1_102) and uses E3D high torque motors (1680 max peak, set to 1344ma in the firmware).

    Here is a photograph of the readings taken using the stepper motor analyser.
    PXL_20220628_080155173.jpg
    As you can see, the readings (which are in peak on the stepper motor analyser), aren't the values that I was expecting.

    I ran a few more tests using the same board, setting different currents and was getting similar readings. I then switched to a Fly-E3 board I had on the bench, along with a Fly-2209 driver and was getting similar results as the Fly-E3-Pro.

    I also tested a TMC5160 and that performed as expected so I have discounted the 5160 drivers from any further testing.

    Discussions were then had with @gloomyandy to ensure that the STM32 port of RRF was calculating the current both as per the trinamic datasheet (pg 53 of https://www.trinamic.com/fileadmin/assets/Products/ICs_Documents/TMC2209_datasheet_rev1.08.pdf) and in the same manner as the Duet version of RRF. It was confirmed it was, which prompted the need for wider testing to be carried out using both a Duet 3 Mini 5+ and an array of different drivers and boards running RRF, Klipper and Marlin.

    It may have been apparent with the previous screenshot of the stepper motor analyser, that unfortunately, the current is output on a histogram rather than some actual values (yes, there are other screens but the none of them actually show the peak value and are merely real-time values). Luckily for me @Sindarius not only was willing to mod the firmware to display a reading on that screen, he also had a stepper motor analyser to hand for testing those changes. Without @Sindarius help, the testing below would not have been possible so a big shout out to him!

    2e62a436-ecbf-48d2-92d1-a3bab40571af-image.png

    I gathered a collection of boards and tested an E3D high torque stepper (under no load conditions) to each of them in turn, adjusting the M906 requested current value. They all used the same config (x16 micro stepping and no interpolation) and the results can be seen below.

    7ec92c57-a994-4c6c-9865-59c59db584eb-image.png

    A can be seen, the Duet 3 mini 5+ performed consistently well up to 1400mA, with a little bit of current drop off above that. The Fly-E3-Pro-V3 also performed consistently well. The EZ 2209 drivers performed worst at 800mA where the output current was 12.2% lower than the requested current. The Fly 2209 ran consistently ~18-22% lower than the current requested and were the worst performing on the chart. Both the Fly-E3-Pro and BTT-RRF-E3 ran around 10-15% lower than requested.

    I then ran the same current tests using an SKR3 EZ board. First running RRF

    5b94491b-47bf-41da-897f-94cec1ec664f-image.png

    and then running Klipper

    a7ea21a5-9f97-439b-abee-12f269daaea6-image.png

    You may notice that the EZ drivers are missing from the Klipper results. This is due to me incorrectly flashing Klipper when I started the testing and it set them at full current and burnt them out. Please also note that the BTT 2226 v1.0 drivers use a different sense resistor (0.150 ohm) than standard 22XX drivers (0.110 ohm) and I adjusted accordingly for that when running the tests.

    The results are pretty consistent between RRF and Klipper, which confirms the testing method and confirms that both firmwares calculate the required current using the sense resistor in a similar fashion.

    So how we overcome this incorrect current setting? The ideal is for the driver manufacturers to produce drivers that perform as expected, but that doesn't really help users who already have poor performing hardware. Fortunately we can counteract this by adjusting the sense resistor value configured in the firmware (this has only just been added to the STM32 port of RRF in 3.4.1). I found that a sense resistor value of 0.125 resulted in the Fly-E3-Pro performing correctly (when testing with RRF) and a sense resistor value of 0.140 resulting in the Fly 2209 drivers performing correctly (when testing with RRF).

    Further work needs to be carried out to validate the sense resistor values that users should be using with each driver to counteract poor driver performance

    Here are my full results driver_readings.xlsx

    Owns various duet boards and is the main wiki maintainer for the Teamgloomy LPC/STM32 port of RRF. Assume I'm running whatever the latest beta/stable build is

    undefined 1 Reply Last reply 7 Jul 2022, 23:28 Reply Quote 8
    • undefined
      oliof
      last edited by 5 Jul 2022, 10:37

      I find it interesting that the MKS drivers are almost on par with the Duet readings, which kind of counters the point that this would be stepstick vs SMD mounted drivers.

      It would be interesting to get some more readings ... easier said than done, but I am hopeful that I'll have a stepper analyzer some time next month. Then I can test, among other things, the Troodon Bigfoot stepper drivers (-:

      <>RatRig V-Minion Fly Super5Pro RRF<> V-Core 3.1 IDEX k*****r <> RatRig V-Minion SKR 2 Marlin<>

      undefined 1 Reply Last reply 5 Jul 2022, 10:56 Reply Quote 0
      • undefined
        jay_s_uk @oliof
        last edited by 5 Jul 2022, 10:56

        @oliof yes, that surprised me as I originally thought it was down to using the stepstick design. The Fly-E3-Pro vs the Fly-E3-Pro-v3 also disproves this.

        Owns various duet boards and is the main wiki maintainer for the Teamgloomy LPC/STM32 port of RRF. Assume I'm running whatever the latest beta/stable build is

        1 Reply Last reply Reply Quote 1
        • undefined
          rexx @jay_s_uk
          last edited by rexx 7 Jul 2022, 23:30 7 Jul 2022, 23:28

          @jay_s_uk would you think the 6HC is similar to the 5+? great work by the way! or do you know the % drop at 1800?

          undefined 1 Reply Last reply 8 Jul 2022, 06:22 Reply Quote 0
          • undefined
            jay_s_uk @rexx
            last edited by 8 Jul 2022, 06:22

            @rexx from the limited testing I've done with 5160 drivers, they're spot on at whatever I set them at so I wouldn't be too concerned about them.
            I currently also don't have a setup to test a 6HC

            Owns various duet boards and is the main wiki maintainer for the Teamgloomy LPC/STM32 port of RRF. Assume I'm running whatever the latest beta/stable build is

            undefined 1 Reply Last reply 8 Jul 2022, 06:37 Reply Quote 1
            • undefined
              dc42 administrators @jay_s_uk
              last edited by 8 Jul 2022, 06:37

              @jay_s_uk thanks for your detailed report.

              TMC5160 drivers have differential current sense inputs, which if they are used properly eliminates the effect of additional resistance in series with the sense resistors. TMC2209 drivers do not, so careful layout is essential to ensure that no significant additional resistance is added between the sense resistor and ground.

              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 4
              3 out of 6
              • First post
                3/6
                Last post
              Unless otherwise noted, all forum content is licensed under CC-BY-SA