Support for TMC2208 via uart

Hi
Is anybody looking at implementing support for the TMC2208 drivers like what was done for the TMC2130?
It should be trivial,  in theory, to implement now that the 2130s are supported. I built a companion board (esp8266 with web interface and diagnostics) to handle the work for me but it not as clean as having one printer controller doing everything. 

I am hoping that there is someone that has done this and can save me a lot of time hacking through code.

Comments

  • Maybe when 2130 is working in V2 you can adopt it to 2208:-)
  • I really appreciate this wonderful post that you have provided for us. I assure this would be beneficial for most of the people,

    kissanime

    gogoanime

  • Repetier said:
    Maybe when 2130 is working in V2 you can adopt it to 2208:-)
    I will have a look at it, but I may have underestimated how "trivial" such an mod could be. The TMC2208 uart connection to the MCU must be done to one of the hardware serial ports and this limits your pin selection. (software serial would possibly interfere with interrupts and timers) Also, addressing individual drivers in stead of plain broadcast to all would require an analog switch like the 74HCT4051 and 3 IO pins. 

    Looking at this, I think it would be easier to have a companion controller that gets a signal form the printer controller to push settings to the drivers like what I have currently.

    My setup has diodes attached to the enable pin of all the drivers and my companion board and looks for changes in state to push the settings to the drivers. I would like to change this to 1 digital output from the printer controller.

    Can you please guide me, in your code, where would I need to look for the drivers being enabled and disabled to achieve the above?


  • Drivers get enabled/disabled only with the enable pin of the driver. This is done in Printer.h like this:

        static INLINE void  enableXStepper() {

    #if (X_ENABLE_PIN > -1)

            WRITE(X_ENABLE_PIN, X_ENABLE_ON);

    #endif

    #if (FEATURE_TWO_XSTEPPER || DUAL_X_AXIS) && (X2_ENABLE_PIN > -1)

            WRITE(X2_ENABLE_PIN, X_ENABLE_ON);

    #endif

        }


    So here you could override what needs to be done. But you really should stick to step/dir/enable pattern - everything else will not really work. All you can do with uart is configure microsteps, current etc before using them.

  • Thank you. For now I will use a dirty hack to keep my printer happy.

    The issue is that as soon as the stepper is disabled it loses it's configs. This is not supposed to happen but it does, so I have to push the configs every time. I am not ready to write the OTP memmory of the steppers. I need to connect a scope up to see what is going on but I can hardly find the time to troubleshoot. Writing a few lines of code is much faster for now. 

    I was hoping the tmc2208 drivers would work as they are half the price of the tmc2130 with almost all of the functions except stallguard, but the configs are done via UART and they seem to by iffy.

    I am not sure if I got a bad batch or something is weird with my setup. My machine is corexy, In stealthchop mode the printer will run beautifully and silently for the first print after startup. No missed steps, perfect print. The second or 3rd print would fail as soon as the printer starts homing. It would home x fine and and shut down x and y steppers as soon as the y endstop is hit the first time. Not even bounce back. Heat is not the problem and the steppers does not report any errors. Resetting the printer would fix this and I can print one more time. Oddly, in spreadcycle mode this does not happen. 
  • Each stepper has also a disable function. Maybe remove contents there so steppers never disable if that is the reason.
Sign In or Register to comment.