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

Constant speed of extra stepper motor. How to?

Scheduled Pinned Locked Moved
Duet Hardware and wiring
6
11
1.5k
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
    jml
    last edited by 5 Oct 2018, 00:54

    I want to connect a stepper motor to the Duex5 and be able to send g-code through DWC to set the stepper motor's speed. This will be totally unsynchronized with whatever else the 3D printer is doing. Is this possible?

    Ideally it would be stationary until I click a Macro which causes the stepper to rotate at a set RPM. And I could have different macros for different speeds. And these macros could be launched in the middle of a print without interrupting the print at all.

    If its not possible currently, then I can attempt to modify the firmware to make it possible. I can make a custom g-code to take the direction and speed as an input, but I don't know what to do in the firmware to translate that to moving the stepper motor at a constant speed while allowing the firmware to just continue doing its thing.

    undefined 1 Reply Last reply 6 Oct 2018, 12:30 Reply Quote 0
    • undefined
      dc42 administrators
      last edited by dc42 10 May 2018, 06:42 5 Oct 2018, 06:42

      That would require substantial changes to the firmware, because the firmware isn't set up to do movements that are not synchronised between motors. You might find it easier to use an Arduino and a Pololu or similar stepper motor driver to control that motor.

      If you do decide to change the firmware, you may wish to make use of the SoftTimer facility to generate the step pulses for your motor, so that you don't have to modify the main step generation code.

      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
        T3P3Tony administrators @jml
        last edited by 6 Oct 2018, 12:30

        @jml I am curious about the application? (I guess mixing hotend or similar?)

        As it is a constant speed requirement does it have to be a stepper? How about a servo or DC motor?

        www.duet3d.com

        1 Reply Last reply Reply Quote 0
        • undefined
          deckingman
          last edited by 6 Oct 2018, 14:27

          This thread that I started comes to mind https://forum.duet3d.com/topic/6616/best-type-of-ancilliary-motor

          Ian
          https://somei3deas.wordpress.com/
          https://www.youtube.com/@deckingman

          1 Reply Last reply Reply Quote 0
          • undefined
            jml
            last edited by 7 Oct 2018, 05:09

            I guess it could be a servo or DC motor ... would it be straightforward to control their speeds, or would those need an encoder? I may just use a arduino+pololu as dc42 suggests and communicate through I2C or something.

            The purpose is to experiment with a lathe type setup but where an extruder is extruding filament onto the spinning object. So fast constant speeds would be good in some applications, slow constant speeds too but I would also like to be able to control it precisely in terms of position (where it may move back and forth instead of spinning at a constant speed) - so perhaps I should find a way to use a stepper motor.

            undefined 1 Reply Last reply 7 Oct 2018, 08:08 Reply Quote 0
            • undefined
              T3P3Tony administrators @jml
              last edited by 7 Oct 2018, 08:08

              @jml ah yes if you need that sort of control then a DC motor is not really suitable.

              Just a thought though, if you are extruding onto a rotating surface, is that not actually an axis that you do want to synchronise with all the other gcode (albeit a very "long" axis) conceptually this is no different to extruding onto a flat surface, in that you want to precisely control the amount of extrusion in two dimensions and the distance from the surface to the nozzle in another dimension.

              www.duet3d.com

              1 Reply Last reply Reply Quote 0
              • undefined
                RCarlyle
                last edited by 7 Oct 2018, 13:55

                If you’re extruding onto the rotating surface, I would think you’ll want it to be synchronized with the other motors, so you don’t get inconsistent extrusion as the extruder and Y axis / cross-slide starts and stops.

                1 Reply Last reply Reply Quote 1
                • undefined
                  jml
                  last edited by 8 Oct 2018, 21:51

                  Yeah you're all right, I would want it synchronized. I guess though that the solution might be more related to the slicing rather than the firmware.

                  1 Reply Last reply Reply Quote 1
                  • undefined
                    jml
                    last edited by 18 Jan 2020, 01:10

                    @dc42 Any advice on how to use the SoftTimer for this?

                    1 Reply Last reply Reply Quote 0
                    • undefined
                      Danal
                      last edited by Danal 18 Jan 2020, 03:06

                      @jml said in Constant speed of extra stepper motor. How to?:

                      I want to connect a stepper motor to the Duex5 and be able to send g-code through DWC to set the stepper motor's speed. This will be totally unsynchronized with whatever else the 3D printer is doing. Is this possible?
                      Ideally it would be stationary until I click a Macro which causes the stepper to rotate at a set RPM. And I could have different macros for different speeds. And these macros could be launched in the middle of a print without interrupting the print at all.
                      If its not possible currently, then I can attempt to modify the firmware to make it possible. I can make a custom g-code to take the direction and speed as an input, but I don't know what to do in the firmware to translate that to moving the stepper motor at a constant speed while allowing the firmware to just continue doing its thing.

                      @dc42 said in Constant speed of extra stepper motor. How to?:

                      That would require substantial changes to the firmware, because the firmware isn't set up to do movements that are not synchronised between motors. You might find it easier to use an Arduino and a Pololu or similar stepper motor driver to control that motor.

                      I can't stress DC42 statements enough. The firmware is entirely oriented around the concept of coordinated motion. Using a general IO pin to start/stop something that runs at constant speed is a much better approach, if you really want non-coordinated motion.

                      And...

                      As stated, are you sure about constant speed? Coordinated motion seems to be required from your "where an extruder is extruding filament onto the spinning object" description. If for no other reason, accel/deccel during start stop of the spin.

                      And, coordinated motion will be incredibly easy to test. Define an extra axis, plug in a stepper, specify that axis on your moves. Getting "steps/mm" to be where you want them may take a bit of tweaking.

                      Delta / Kossel printer fanatic

                      1 Reply Last reply Reply Quote 0
                      • undefined
                        jml
                        last edited by 18 Jan 2020, 04:34

                        He also said I may wish to use SoftTimer if I decide to change the firmware. SoftTimer stuff will be asynchronous to the regular synchronized motion. So I decided to change the firmware. If I do it right, I'll be able to have coordinated motion in one mode, and then in another mode, have it accelerate and decelerate to desired speeds asynchronous to what the other axes are doing. I want both modes and am trying to implement it using SoftTimer, but I'm not exactly sure how to use it. I assume its similar to arduino's softtimer but it seems to have more input arguments.

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