Manually Set the Number of 'Smart' Drivers



  • Hi,

    Atm, it looks like the number of 'smart' drivers (i.e. TMC2660 - but perhaps other variants too?), which are connected to the Duet at any given time is hard-coded into the firmware.

    More specifically, you can only have 5 (Duet) / 7 (Duet + DueX2) / 10 (Duet + DueX5) drivers recognized and operated by the firmware.

    Given that the core functionality is already in place to support any number of drivers (up to 12 max, I think?), it would be awesome if that number could be set manually by the user (say, in the config.g file via a specific g-code command).

    Unless I'm missing something, creating this option would require a very minor tweak in the existing firmware, while opening up endless possibilities for using external 'smart' drivers and/or developing new expansion boards based users' particular needs.

    I can think of many usage examples, but to give just one: say you accidentally fried one of your onboard drivers on an out-of-warranty Duet and (like most) you don't have the tools/time/expertise to replace it by your self. Instead of having to fork out for a brand new Duet, you could simply get a single TMC2660 expansion board, hook it up and define an additional driver in the firmware. Simple.

    All the best,
    SnowCrash



  • I think you all ready can. There's something in the wiki about using external drivers. I was looking into it cause I want to run nema 32s for a cnc mill



  • @bendiesel said in Manually Set the Number of 'Smart' Drivers:

    I think you all ready can. There's something in the wiki about using external drivers. I was looking into it cause I want to run nema 32s for a cnc mill

    I looked at the duet wiki about external drivers but saw nothing there about the possibility of defining those external drivers as 'smart' ones (did I miss it somehow?)

    Btw, this was also the impression I got from comments by @dc42 in other threads, i.e. that it would require changes in the firmware.

    Could you please point me to where you saw this option exactly, @BenDiesel?



  • This post is deleted!


  • Oh don't realise you were wanting the smart feature.

    So I set up a ramps 1.4 with tmc2130. There were 3 spi wires along with a chip slect wire and a skip detect wire. So you would have to figure out how to wire it up aswell as update firmware



  • @bendiesel said in Manually Set the Number of 'Smart' Drivers:

    Oh don't realise you were wanting the smart feature.

    So I set up a ramps 1.4 with tmc2130. There were 3 spi wires along with a chip slect wire and a skip detect wire. So you would have to figure out how to wire it up aswell as update firmware

    Yep, I think the Duet's ability to set the stepper's current & configure all the other features of these advanced drivers via software is brilliant and I definitely want to take advantage of that.

    I already have the wiring aspect figured out (I think 🙂 Now the only missing element is the ability to set the number of 'smart' drivers and it's good to go!


  • administrators

    Currently the number of smart drivers is set automatically based in whether a DueX2, DueX5 or neither is detected. There is no facility to set additional drivers connected to CONN_LCD to be Smart. If users need this feature then I could add it to the M569 command.



  • @dc42 said in Manually Set the Number of 'Smart' Drivers:

    Currently the number of smart drivers is set automatically based in whether a DueX2, DueX5 or neither is detected. There is no facility to set additional drivers connected to CONN_LCD to be Smart. If users need this feature then I could add it to the M569 command.

    That would be awesome! It would certainly make this user very happy 🙂 (and hopefully others too)

    But I wouldn't restrict this feature just to those connected to CONN_LED as this would only give 2 more additional 'smart' drivers.

    As far as I can tell, all the hardware and most of the software are already in place to enable this feature for all external drivers connected to the Duet.

    From the hardware side, the expansion board simply needs to connect to the relevant SPI interface via pin 45 (TWD0) and 46 (TWCK0) on the expansion connector, as well as the relevant STEP, DIR, and ENABLE pins of the given driver/s (say, E2_STEP, E2_DIR, and E2_EN). That's very simple to do.

    From the software side, here's my take on how this could be seamlessly and effectively implemented while taking into account the currently available options.

    I'm aware that in the actual code this is implemented slightly differently than below, but for convenience and clarity here's an Arduino-style switch() function in pseudo-code:

    switch (expansion_board_type) {
    
    	case (Duex2): set 2 x 'smart' driver; break;
    
    	case (DueX5): set 5 x 'smart' driver; break;
    
    	case (other_board): set 1 x 'smart' driver by default on E2 
    			    (but allow specifying up to 7 x 'smart' drivers in total with the M569 command later on); 
    		             break;
    
    	default (no expansion board): set no 'smart' drivers;
    }
    

    And then the user can either add nothing to the Config.g file (thus working with just 1 additional 'smart' driver on E2), or add the said M569 command to specify how many 'smart' drivers are connected in total with the expansion board (up to 7) and where (e.g. E2, E4 and E6).

    Would this work?


  • administrators

    The code already implements something similar except that the "other board" code is not present.

    I'll add this to the work list for firmware 2.01.



  • @dc42 said in Manually Set the Number of 'Smart' Drivers:

    The code already implements something similar except that the "other board" code is not present.

    I'll add this to the work list for firmware 2.01.

    Very cool! Thank you very much, @dc42


Locked
 

Looks like your connection to Duet3D was lost, please wait while we try to reconnect.