Welcome! Log In Create A New Profile

Advanced

External stepper drives with Duet?

Posted by pkm 
pkm
External stepper drives with Duet?
August 31, 2015 10:53AM
Hello!
I'm building a large delta using NEMA23 motors. Unfortunately I got a bad resonance on steppers, either with A4988's on RAMPS or with Duet 0.8.5. Nothing helps so far, so I'm going to replace motors and/or drives.
Just wondering if it's possible to connect external drives to Duet (for higher microstepping, decay modes etc.).
Re: External stepper drives with Duet?
August 31, 2015 11:28AM
You can connect 4 external stepper drivers to the Duet expansion connector, the pins that the DuetX4 would use for its motor drivers if you has one. Currently you need a special firmware build if you want to substitute those external drivers for the internal XYZ drivers- and I believe T3P3 has such a build - but I intend to add a motor remapping facility to my fork of RepRapFirmware soon.



Large delta printer [miscsolutions.wordpress.com], E3D tool changer, Robotdigg SCARA printer, Crane Quad and Ormerod

Disclosure: I design Duet electronics and work on RepRapFirmware, [duet3d.com].
pkm
Re: External stepper drives with Duet?
August 31, 2015 12:10PM
Thanks, David!
"Soon" meaning a few days or a few weeks/months?
Meanwhile I'm going to try 24V PSU and different motors. Actually my current delta has NEMA23 motors too (just twice shorter belts) and there's no such resonance... So this is (hopefully) just wrong motors.
I'll try to PM T3P3 if he doesn't appear here.
Re: External stepper drives with Duet?
August 31, 2015 05:02PM
Hi

I have had a few enquires about this:

There are 4 sets of pins on the expansion header that are used to drive the 4 steppers on the Duex4 and could be repurposed to drive external drivers by connecting the step, dir and enable lines to the external drivers. You can change the order of the pins in the firmware for step, Dir and enable so that E2,E3,E4,E5 (on the Duex4) become X,Y,Z, E0 (normally on the Duet).

The firmware to modify is here:
[github.com]

The pin outs on the expansion header are:
Duet header pin number Labeled as function
15 PC9 E1 Step
16 PC3 E1 Dir
17 PC5 E1 En
18 PC6 E1 Heater PWM
19 PC7 E2 Step
20 PB14 E2 Dir
24 PC20 E2 En
21 PC23 E2 Heater PWM
22 PC22 E3 Heater PWM
23 PC21 E4 Heater PWM
42 PC11 E3 Step
43 PC12 E3 Dir
44 PC13 E3 En
45 PC14 E4 Step
46 PC15 E4 Dir
47 PC16 E4 En

The change to the firmware required are all in platform.h, I think all you would need to do are:


// DRIVES
//original ones (commented out)
//#define STEP_PINS {14, 25, 5, X2, 41, 39, X4, 49, X10}
//#define DIRECTION_PINS {15, 26, 4, X3, 35, 53, 51, 48, X11}
//#define ENABLE_PINS {29, 27, X1, X0, 37, X8, 50, 47, X13}

//switched ones to swap E2,E3, E4 and E5 drives with X Y Z E0 respectively
#define STEP_PINS {39, X4, 49, X10, 41, 14, 25, 5, X2,}
#define DIRECTION_PINS {53, 51, 48, X11, 35, 15, 26, 4, X3}
#define ENABLE_PINS {X8, 50, 47, X13, 37, 29, 27, X1, X0}

A compiled version on this is available on my github:
[github.com]

However I do recommend that you setup Eclipse so you can compile it yourself incase there are some other changes you need for your specific implementation.

Cheers

Tony


DuetWifi.: advanced 3d printing electronics
Re: External stepper drives with Duet?
August 31, 2015 05:58PM
Quote
pkm
Thanks, David!
"Soon" meaning a few days or a few weeks/months?

Possibly as soon as tomorrow. It's the next firmware change on my list after I have tested and documented the changes for supporting the Duet 0.8.5.



Large delta printer [miscsolutions.wordpress.com], E3D tool changer, Robotdigg SCARA printer, Crane Quad and Ormerod

Disclosure: I design Duet electronics and work on RepRapFirmware, [duet3d.com].
pkm
Re: External stepper drives with Duet?
September 01, 2015 08:35AM
Thanks Tony!
I'm trying to find the corresponding pins on the header, but pins 15, 16, 17 are labeled PC29, PC4, PC28 instead of PC9, PC3, PC5. Just like here. Does it matter?

David, I'll be waiting unpatiently for you to implement this. Thanks!

Edited 1 time(s). Last edit at 09/01/2015 08:39AM by pkm.
Re: External stepper drives with Duet?
September 01, 2015 08:38AM
Ahh good point, the pin labels above are for the Duet 0.6, the 0.8.5 is as you describe (also that's for E5 not E1 as E1 is not on the main board)

Cheers

Tony
pkm
Re: External stepper drives with Duet?
September 01, 2015 09:39AM
I successfully connected one drive. With 64 or 128 microostepping the motor moves a lot smoother.
What is the maximum step rate for Duet?
Re: External stepper drives with Duet?
September 01, 2015 12:24PM
Quote
pkm
I successfully connected one drive. With 64 or 128 microostepping the motor moves a lot smoother.
What is the maximum step rate for Duet?

Using 1.09h-dc42 firmware on a delta printer, I recommend that you keep the maximum speed in mm/minute times the microsteps/mm below 2 million. This equates to a total step rate for all 3 motors of 100k steps/second (i.e. 33kHz for each of 3 motors). On a Cartesian or CoreXY printer, you might get away with a little more because there are fewer square roots to calculate, and you don't normally move all 3 motors at high speed simultaneously. If you try some high-speed moves and then run M122 and look at the output, you will see a figure for "Max reps" in the Move Diagnostics. If that gets much above 100 then you should probably slow down.

I'll probably do some more firmware optimization to increase the maximum speed at some stage. One of the limiting factors is that the drivers have minimum 1us step pulse high and low times.



Large delta printer [miscsolutions.wordpress.com], E3D tool changer, Robotdigg SCARA printer, Crane Quad and Ormerod

Disclosure: I design Duet electronics and work on RepRapFirmware, [duet3d.com].
Re: External stepper drives with Duet?
September 02, 2015 03:02PM
I've just released new firmware that includes support for drive remapping, full support for the Duet 0.85, and provides a higher maximum step pulse rate to allow higher travel speeds e.g. when using 0.9deg/step motors. For more details, see [forums.reprap.org].



Large delta printer [miscsolutions.wordpress.com], E3D tool changer, Robotdigg SCARA printer, Crane Quad and Ormerod

Disclosure: I design Duet electronics and work on RepRapFirmware, [duet3d.com].
pkm
Re: External stepper drives with Duet?
September 02, 2015 03:35PM
Thank you, David!! I'll try the new firmware tomorrow.
Higher step rate would be very useful, because I can't get anything good even with the external drives... higher microstepping is better, but 256 microstepping would make it too slow, 64 is still not good. Current settings won't improve much either.
So I just ordered 0.9deg 1.7A steppers instead of 1.8deg 3A steppers I have...
Re: External stepper drives with Duet?
September 02, 2015 04:15PM
I'm pretty new to tinkering with electronics, but how much work would it take to modify a RAMPS to be able to run the XYZ axis?

I sort of miss my DRV8825's, the machine was less noisy with them.
pkm
Re: External stepper drives with Duet?
September 02, 2015 04:22PM
Not so much, I guess. Just find the corresponding inputs on ramps and connect them to Duet's outputs. I'd probably use a breadboard instead of ramps.
Re: External stepper drives with Duet?
September 02, 2015 04:38PM
Quote
pkm
Not so much, I guess. Just find the corresponding inputs on ramps and connect them to Duet's outputs. I'd probably use a breadboard instead of ramps.

That I've never heard of a breadboard before now tells you how new to this I am.... spinning smiley sticking its tongue out

But now that I've looked it up I have a really weak remembrance of using one of those in school for about 20 years ago.

Anyway, I just thought that a ramps is already kitted for the purpose with those capacitors for driver protection and external 12-24V power thingy.

Should be OK to use, as long as I don't connect the jumper for the 5V reg right?
pkm
Re: External stepper drives with Duet?
September 03, 2015 06:37AM
Not sure about the jumper, you're going to use RAMPS without Mega... it probably doesn't matter.
As I see from RAMPS schematics, Mega connector has STEP, DIR, EN pins for each driver... So the task is pretty straightforward.

Yesterday I found RAPS128 drives... they might tame most vibrating motors with microstepping and decay adjustments.
pkm
Re: External stepper drives with Duet?
September 04, 2015 06:59AM
David, today I tried your new firmware with the external drives. The remapping works, thanks!

But I noticed a problem... not sure if it's connected to the firmware.
It proved that for any microstepping > 16 the actual moves are always shorter than commanded... 1.5 to 2.5 times or so.
That is, I have 71.1111 steps/mm for MS16. I set 142.222 and MS32, 284.4444 and MS64 and the problem appears.
When I use MS16 everything is OK.

I don't remember this happened with the remapped firmware from T3P3.
I'm just thinking that step times might be reduced in 1.09i, and the drives miss step pulses at higher rates?

Edited 1 time(s). Last edit at 09/04/2015 06:59AM by pkm.
Re: External stepper drives with Duet?
September 04, 2015 07:13AM
Quote
pkm
I'm just thinking that step times might be reduced in 1.09i, and the drives miss step pulses at higher rates?

Both 1.09h and 1.09i switch to double or higher microstepping at high step speeds. The step ISR has been rewritten in 1.09i to make it more efficient, and this will cause the steps to be sent with a shorter interval between them when double or higher microstepping is used. This is probably what's causing the problem. Please provide the specification of the driver modules you are using.



Large delta printer [miscsolutions.wordpress.com], E3D tool changer, Robotdigg SCARA printer, Crane Quad and Ormerod

Disclosure: I design Duet electronics and work on RepRapFirmware, [duet3d.com].
pkm
Re: External stepper drives with Duet?
September 04, 2015 07:35AM
Pretty cheap CW5045 drives, declared pulse time > 10µSec. But who knows which optocouples they soldered...

UPD: Step pulse minimum is 1.5us, max frequency is 100KHz (10us)

Edited 1 time(s). Last edit at 09/04/2015 08:03AM by pkm.
pkm
Re: External stepper drives with Duet?
September 05, 2015 03:55PM
I switched to the internal drives for a while. It seems that with 1.09i the motors work quieter with less vibrations

But there's another problem. I uploaded a vase code (S3D output) and started printing. The movement was very jerky on curves, leaving a lot of blobs, every couple cm... yet have to find out if it's Duet or S3D issue.
Re: External stepper drives with Duet?
September 05, 2015 04:28PM
I was sure I answered your earlier question yesterday, but my post seems to be missing. 100kHz is not fast enough to get reasonable speeds with high microstepping. For example, if you have 1.8deg/step motors and 16 tooth pulleys giving you 400 steps/mm, then to do 200mm/sec travel moves near the edges of the bed, the step rate would reach nearly 220kHz.

Even if you accept a limit of about 90mm/sec when using 64x microstepping, for efficiency the ISR needs to send 2 or 4 steps pulses in quick succession in order to reduce the number of interrupts needed. So there is no way I can reasonably extend the interval between pulses to be always at least 10us.

I don't have S3D and I haven't done any spiral vase prints of models sliced by it. Slic3r and Cura both have bugs with slicing in spiral vase mode. The slic3r bug means you have to use absolute extrusion, even though relative extrusion is preferred by RepRapFirmware to avoid rounding errors. The Cura bug results in seams in some spiral vase prints, due to Cura inserting short non-extruding moves in the gcode.



Large delta printer [miscsolutions.wordpress.com], E3D tool changer, Robotdigg SCARA printer, Crane Quad and Ormerod

Disclosure: I design Duet electronics and work on RepRapFirmware, [duet3d.com].
pkm
Re: External stepper drives with Duet?
September 05, 2015 06:08PM
Thanks for your reply, David.

I don't use Cura since I tried S3D. Though I've been using Slicer for vases, but this time I tried S3D for some reason (I actually know why... it's 10x faster, and I was in a hurry). Sure I will do more tests with Slicer and S3D. S3D supports relative mode, I'll try it too.

BTW here's how it moved [www.dropbox.com] Better heard than seen.
And with 250% speed factor it became a disaster [www.dropbox.com]
I might suspect mechanics, but the motors sound says it's rather controls or Gcode.
Re: External stepper drives with Duet?
September 05, 2015 06:15PM
Can you make the gcode available?

Also, how sharp are those internal corners? At high printing speeds, the firmware will reduce the speed at the corners to avoid exceeding the configured maximum jerk speed.



Large delta printer [miscsolutions.wordpress.com], E3D tool changer, Robotdigg SCARA printer, Crane Quad and Ormerod

Disclosure: I design Duet electronics and work on RepRapFirmware, [duet3d.com].
pkm
Re: External stepper drives with Duet?
September 05, 2015 06:25PM
The code [www.dropbox.com]
The vase [www.thingiverse.com] The corners are rounded at the bottom but at some height they become sharp.
Re: External stepper drives with Duet?
September 06, 2015 03:58AM
I am getting a single seam towards the +Y axis on that print. I found the cause. You are using absolute extruder distances and it occurs when the G92 E0 command is executed. I will fix it in the next release (probably later today as I have another change to release), however you can avoid it by using relative extrusion instead. Relative extrusion is recommended for RepRapFirmware because it avoids rounding errors that occur when absolute extrusion is used.



Large delta printer [miscsolutions.wordpress.com], E3D tool changer, Robotdigg SCARA printer, Crane Quad and Ormerod

Disclosure: I design Duet electronics and work on RepRapFirmware, [duet3d.com].
pkm
Re: External stepper drives with Duet?
September 06, 2015 05:19AM
Thanks for testing. Now I know something's wrong on my side, have to double check everything tomorrow.

Meanwhile I'd like to ask where the probing velocity is defined for G30.

Also, as all my prints go wrong yet, I've extensively used pause button. And the web-interface freeses... like each 2nd time when pausing.

Edited 1 time(s). Last edit at 09/06/2015 05:23AM by pkm.
Re: External stepper drives with Duet?
September 06, 2015 07:26AM
Quote
pkm
Also, as all my prints go wrong yet, I've extensively used pause button. And the web-interface freeses... like each 2nd time when pausing.

That sounds like the issue new to 1.09i that I have just fixed.

The initial probing velocity for G30 and all other bed probing is the M210 Z parameter.



Large delta printer [miscsolutions.wordpress.com], E3D tool changer, Robotdigg SCARA printer, Crane Quad and Ormerod

Disclosure: I design Duet electronics and work on RepRapFirmware, [duet3d.com].
Re: External stepper drives with Duet?
September 06, 2015 09:20AM
Quote
pkm
Also, as all my prints go wrong yet, I've extensively used pause button. And the web-interface freeses... like each 2nd time when pausing.

Fixed in version 1.09j which I have just released, see [forums.reprap.org]. I've also fixed the issue that caused a single seam to appear when I did your spiral vase print.

If you are getting lots of pauses when printing that model, could it be that you are using direct print over USB and you haven't told the host program not to wait for "OK" after each command?

Edited 1 time(s). Last edit at 09/06/2015 09:31AM by dc42.



Large delta printer [miscsolutions.wordpress.com], E3D tool changer, Robotdigg SCARA printer, Crane Quad and Ormerod

Disclosure: I design Duet electronics and work on RepRapFirmware, [duet3d.com].
pkm
Re: External stepper drives with Duet?
September 06, 2015 10:38AM
Quote
dc42
If you are getting lots of pauses when printing that model, could it be that you are using direct print over USB and you haven't told the host program not to wait for "OK" after each command?

Thanks for the fixes!

No, I was printing via web-interface. To tell the truth, I could not get S3D to connect with Duet. Repetier was not willing to connect either, but then I set Reset on connect to "Due native USB port". Sure thing, Pronterface connects out of box.
I find the web-interface pretty convenient, and the micro-USB cable is too short anyways smiling smiley
Re: External stepper drives with Duet?
September 06, 2015 10:59AM
Quote
pkm
Quote
dc42
If you are getting lots of pauses when printing that model, could it be that you are using direct print over USB and you haven't told the host program not to wait for "OK" after each command?

Thanks for the fixes!

No, I was printing via web-interface. To tell the truth, I could not get S3D to connect with Duet. Repetier was not willing to connect either, but then I set Reset on connect to "Due native USB port". Sure thing, Pronterface connects out of box.
I find the web-interface pretty convenient, and the micro-USB cable is too short anyways smiling smiley

I had problems getting S3D to connect as well, fixed it by turning on "hardware flowcontrol" on the "communication" tab in the "firmware configuration"

Edited 1 time(s). Last edit at 09/06/2015 11:20AM by Koenig.
pkm
Re: External stepper drives with Duet?
September 06, 2015 11:16AM
@Koenig Thanks for the tip!
Sorry, only registered users may post in this forum.

Click here to login