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

    support for simpleFOC library (brushless motors)

    Scheduled Pinned Locked Moved
    Firmware wishlist
    simplefoc magnetic encoder
    5
    17
    1.0k
    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.
    • o_lampeundefined
      o_lampe @CNCModeller
      last edited by o_lampe

      @CNCModeller I'm no software expert. From afar everything looks easy.
      Question is: does it all fit together?
      PID control loops for the encoder are probably differerent or some registers for PWM are occupied by RRF stuff.
      Merging two big chunks of software is difficult.

      They say it works best on STM32 boards (*). They produce the fastest control loop, but SAMD21 is another good candidate.

      Time to figure out what's different between the SAM-C21 and the D21...

      *) maybe we can interest @gloomyandy and his team to make a Mellow-version?

      1 Reply Last reply Reply Quote 1
      • o_lampeundefined
        o_lampe
        last edited by

        FYI
        I just searched for klipper simpleFOC and there seems to be a lot of people interested in klipper supporting BLDC motors.
        There is one klipper fork for open loop BLDC support, but it uses a different driver than simpleFOC.
        But no official FW so far.

        1 Reply Last reply Reply Quote 0
        • samlogan87undefined
          samlogan87
          last edited by

          What does Odrive use for their brushless motor control? I believe looking at the docs for them and Duet, they are going to be supporting Odrive

          Custom Core-XY

          1 Reply Last reply Reply Quote 0
          • o_lampeundefined
            o_lampe
            last edited by

            I guess, we will not see simpleFOC integrated in Duet3d, but I want to mention that we can also drive stepper motors with these drivers.
            In open loop it can run with velocity control. A feature frequently asked on this board is infinite rotation which would be possible with sFOC.
            It's also possible to communicate via serial interface to set the target velocity on the fly.
            It would require post-processed gcode, though.

            dc42undefined 1 Reply Last reply Reply Quote 0
            • dc42undefined
              dc42 administrators @o_lampe
              last edited by

              @o_lampe we're doing something similar to FOC in RRF 3.5 on the Expansion 1HCL board. This type of motor control is computation-intensive unless the speeds are low, so it's best done using a dedicated or semi-dedicated processor, such as we have on the 1HCL board.

              In the future we may make a board similar to the 1HCL but with bridge outputs and sensor inputs for 3-phase BLDC motors. It wouldn't be difficult to run SimpleFOC or something similar on a 1HCL board modified to provide the required hardware.

              Using a BLDC motor to control an axis of a 3D printer or CNC machine requires a reduction gearbox, and to counteract backlash in the gearbox you need a second encoder. All of this usually makes it less attractive than using a stepper motor, unless the machine is very large; in which case an integrated AC servo such as Clearpath is probably more appropriate.

              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

              o_lampeundefined 1 Reply Last reply Reply Quote 2
              • o_lampeundefined
                o_lampe @dc42
                last edited by o_lampe

                @dc42 I would also add current sensing, since that is the only way to have low power consumption, but still good starting torque.

                I've played around with simpleFOC and small BLDC motors. Their torque can't compare to same size stepper motors, but the FOC algorhythm makes them run really smooth.
                I will still build a screw-extruder with both motor types (hollow shaft is mandatory) and report in the appropriate thread.

                1 Reply Last reply Reply Quote 0
                • o_lampeundefined
                  o_lampe
                  last edited by

                  New proposal
                  Over at the simpleFOC forum, I started a discussion about using dual-core features of the Cortex M0 MCU ( and other dual core MCUs)
                  Since they don't use it yet, it is obvious, why they disencouraged me to implement their sFOC algorithm in a toolboard. There is just too much else going on to keep the FOC-loop running smooth.

                  But if we could keep the FOC-stuff on the second core, there is plenty of headroom for CAN and temp-control a.s.o.

                  Does RRF use both cores on their M0-toolboards?

                  gloomyandyundefined 1 Reply Last reply Reply Quote 0
                  • gloomyandyundefined
                    gloomyandy @o_lampe
                    last edited by

                    @o_lampe said in support for simpleFOC library (brushless motors):

                    I don't think any of the current Duet3D toolboards use a multi core mpu. Some of the 3rd party boards (like the ones from Mellow/Fly) use the rp2040 mcu (which is dual core), but on those boards the 2nd mcu is already used to handle the CAN-FD interface.

                    o_lampeundefined 1 Reply Last reply Reply Quote 0
                    • o_lampeundefined
                      o_lampe @gloomyandy
                      last edited by

                      @gloomyandy The CAN-FD traffic is so high-demanding? What a pity...

                      The SAMMY-C21 MCU is dual core. Maybe they're using the second core for CAN-FD too, but IIRC it is HW-implemented...

                      gloomyandyundefined 1 Reply Last reply Reply Quote 0
                      • gloomyandyundefined
                        gloomyandy @o_lampe
                        last edited by

                        @o_lampe said in support for simpleFOC library (brushless motors):

                        The SAMMY-C21 MCU is dual core.

                        Are you sure? I don't see anything that says it is dual core?

                        o_lampeundefined 1 Reply Last reply Reply Quote 0
                        • o_lampeundefined
                          o_lampe @gloomyandy
                          last edited by

                          @gloomyandy Maybe I'm wrong? I was under the impression, all Cortex M0+ MCUs are dual core...

                          1 Reply Last reply Reply Quote 0
                          • First post
                            Last post
                          Unless otherwise noted, all forum content is licensed under CC-BY-SA