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.

  • administrators

    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.

  • administrators

    @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?

  • 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.

  • administrators

    @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.

  • 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.

  • 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.

Log in to reply