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

    Creating a CANBUS adapter for Duet 2

    Scheduled Pinned Locked Moved
    Duet Hardware and wiring
    5
    10
    3.0k
    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.
    • keyz182undefined
      keyz182
      last edited by

      I've been looking at ways to minimise the wiring to a hotend to make swapping them out easier. One of my ideas was to use CAN, so the only cabling required is CAN+Power. A small board then on the hotend with a micro (with CAN support), an appropriate power regulator, and components needed to drive/read heater, thermistor, Z limits, fans.

      Maybe I2C or SPI could work too? How well do they do over distance?

      Advantages of this approach:

      • allow potential for autodetection of the attached hotend, so possibly reading in a different config.g (or macro) depending on what's connected
      • compact wiring
      • shorter paths for e.g. temp sensing means (if done correctly) less interference
      • more that I can't think of at the moment

      Disadvantages:

      • increase in complexity
      • extra hardware to mount on the hotend
      • more that I can't think of at the moment

      Looking at the Duet 2 schematic, and comparing to the SAM4E docs + eval board details, it looks like the necessary lines are taken by THERMISTOR1, THERMISTOR2, E2_STOP, and E3_STOP.

      According to page 14 of this it looks like only a handful of components are needed.

      I'm not sure how to handle the pullups on T0/1. Would it be easiest to just desolder the resistors, or is there a way to handle that without modifying the board?

      Then there's the question of software. I'm a software dev by trade, so that's where I'm most comfortable, but I've little experience in the world of microcontrollers, so I'd need advice on where to start (if the circuit based part is even feasable).

      Do people think this is a good/useful idea? I've seen mention of a new CAN Duet potentially coming in the future, should I just wait? Have I missed a better idea/better protocol to use?

      1 Reply Last reply Reply Quote 0
      • whosrdaddyundefined
        whosrdaddy
        last edited by whosrdaddy

        Dc42 has already done some work in this direction for nextgen Duet.
        See this thread...
        I believe patience is in order 😉

        keyz182undefined 1 Reply Last reply Reply Quote 0
        • keyz182undefined
          keyz182 @whosrdaddy
          last edited by

          @whosrdaddy said in Creating a CANBUS adapter for Duet 2:

          I believe patience is in order 😉

          But I want it now! 😛

          Yeah, maybe you're right. I should probably focus on getting my printer in optimal shape before going crazy! But still, if it possible/reasonable, I might go ahead anyway as a learning process for myself.

          1 Reply Last reply Reply Quote 0
          • dc42undefined
            dc42 administrators
            last edited by dc42

            I did some calculations, and I found that for the ways we want to use CAN in the Duet 3, basic CAN is too slow and we need CAN-FD. The SAM4E microcontroller in the Duet 2 boards only supports basic CAN, and even then only one of the CAN pins is available so a small modification to the Duet would be needed to access the other one. The next gen Duets will have CAN-FD.

            For low-bandwidth applications, LIN bus may be an attractive option.

            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

            keyz182undefined 1 Reply Last reply Reply Quote 1
            • keyz182undefined
              keyz182 @dc42
              last edited by

              @dc42 said in Creating a CANBUS adapter for Duet 2:

              I did some calculations, and I found that for the ways we want to use CAN in the Duet 3, basic CAN is too slow and we need CAN-FD. The SAM4E microcontroller in the Duet 2 boards only supports basic CAN, and even then only one of the CAN pins is available so a small modification to the Duet would be needed to access the other one. The next gen Duets will have CAN-FD.

              For low-bandwidth applications, LIN bus may be an attractive option.

              That's useful info, thanks! I'll wait for the Duet3 in that case 🙂

              Is the Duet 3 something we might see this year, or is it currently far off?

              T3P3Tonyundefined 1 Reply Last reply Reply Quote 0
              • T3P3Tonyundefined
                T3P3Tony administrators @keyz182
                last edited by

                @keyz182 we might have prototypes later this year but I doubt we will have production boards on general release this year. (on current plans any way)

                www.duet3d.com

                keyz182undefined 1 Reply Last reply Reply Quote 0
                • keyz182undefined
                  keyz182 @T3P3Tony
                  last edited by

                  @t3p3tony That's fair enough. I'll go back to the non-smart bulky connectors for now in eager anticipation of the next release 🙂

                  1 Reply Last reply Reply Quote 0
                  • Maboverundefined
                    Mabover
                    last edited by Mabover

                    @dc42 said in Creating a CANBUS adapter for Duet 2:

                    I did some calculations, and I found that for the ways we want to use CAN in the Duet 3, basic CAN is too slow and we need CAN-FD. The SAM4E microcontroller in the Duet 2 boards only supports basic CAN, and even then only one of the CAN pins is available so a small modification to the Duet would be needed to access the other one. The next gen Duets will have CAN-FD.

                    For low-bandwidth applications, LIN bus may be an attractive option.

                    @dc42 Does this mean that canopen is the "canbus" protocol being used?
                    If support for canopen ds402, to allow external canopen stepper/servor drivers, added it would be an awesome addition to reprapfirmware.
                    Although i am not sure if the majority of exisiting canopen ds402 stepper/servo drives will work with CAN-FD.

                    dc42undefined 1 Reply Last reply Reply Quote 0
                    • dc42undefined
                      dc42 administrators @Mabover
                      last edited by

                      @mabover said in Creating a CANBUS adapter for Duet 2:

                      @dc42 said in Creating a CANBUS adapter for Duet 2:

                      I did some calculations, and I found that for the ways we want to use CAN in the Duet 3, basic CAN is too slow and we need CAN-FD. The SAM4E microcontroller in the Duet 2 boards only supports basic CAN, and even then only one of the CAN pins is available so a small modification to the Duet would be needed to access the other one. The next gen Duets will have CAN-FD.

                      For low-bandwidth applications, LIN bus may be an attractive option.

                      @dc42 Does this mean that canopen is the "canbus" protocol being used?
                      If support for canopen ds402, to allow external canopen stepper/servor drivers, added it would be an awesome addition to reprapfirmware.
                      Although i am not sure if the majority of exisiting canopen ds402 stepper/servo drives will work with CAN-FD.

                      Unfortunately canopen doesn't really support CAN-FD yet, also the protocol overhead would be too great for sending motion commands. UAVCAN is closer to what we need, but still not quite right.

                      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
                      • Maboverundefined
                        Mabover
                        last edited by

                        I am guessing the overhead is to much for the processor used in both the duet gen 2s and the next gen duets along with all the other operations they are performing.
                        Obviously the servo drives I have and the plc systems have more processor resources avilable to them and possibly extra hardware offload processing.

                        Still if there is a chance that in duet gen 3 hardware or future versions could have support for canopen ds402 motion control that would be increadbly usefull.

                        Thanks

                        1 Reply Last reply Reply Quote 0
                        • the.hungarianundefined the.hungarian referenced this topic
                        • First post
                          Last post
                        Unless otherwise noted, all forum content is licensed under CC-BY-SA