• Tags
  • Documentation
  • Order
  • Register
  • Login
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.
  • undefined
    keyz182
    last edited by 2 Jun 2018, 10:23

    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
    • undefined
      whosrdaddy
      last edited by whosrdaddy 6 Feb 2018, 11:04 2 Jun 2018, 11:03

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

      undefined 1 Reply Last reply 2 Jun 2018, 11:22 Reply Quote 0
      • undefined
        keyz182 @whosrdaddy
        last edited by 2 Jun 2018, 11:22

        @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
        • undefined
          dc42 administrators
          last edited by dc42 6 Feb 2018, 16:08 2 Jun 2018, 16:08

          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

          undefined 1 Reply Last reply 2 Jun 2018, 16:13 Reply Quote 1
          • undefined
            keyz182 @dc42
            last edited by 2 Jun 2018, 16:13

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

            undefined 1 Reply Last reply 3 Jun 2018, 12:48 Reply Quote 0
            • undefined
              T3P3Tony administrators @keyz182
              last edited by 3 Jun 2018, 12:48

              @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

              undefined 1 Reply Last reply 4 Jun 2018, 08:40 Reply Quote 0
              • undefined
                keyz182 @T3P3Tony
                last edited by 4 Jun 2018, 08:40

                @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
                • undefined
                  Mabover
                  last edited by Mabover 6 May 2018, 00:19 4 Jun 2018, 15:31

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

                  undefined 1 Reply Last reply 6 Jun 2018, 10:09 Reply Quote 0
                  • undefined
                    dc42 administrators @Mabover
                    last edited by 6 Jun 2018, 10:09

                    @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
                    • undefined
                      Mabover
                      last edited by 12 Jun 2018, 20:12

                      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
                      • undefined the.hungarian referenced this topic 3 Mar 2024, 12:15
                      5 out of 10
                      • First post
                        5/10
                        Last post
                      Unless otherwise noted, all forum content is licensed under CC-BY-SA