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

Support for RS485 on Duet 6XD and 6HC

Scheduled Pinned Locked Moved
General Discussion
3
36
1.3k
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
    developeralgo222
    last edited by developeralgo222 24 Jun 2024, 19:36

    Re: Does Duet 6XD support RS485 communication

    Currently RRF version 3.5.2 does not directly support RS485 Serial Data communications ( or RS485 MODBUS RTU ) . It supports UART type serial communications

    @dc42 , did mention that support was coming soon in RRF 3.6.0 but that seems to have been revised to "After 3.6.0 ".

    Since Duet dev is not delivering on this RS485 support , i am currently looking for alternatives on how to accomplish the bidirectional communications between Duet 6XD and a Mitsubishi PLC with RS485 Adapter(FX3u-485ADP-MB) which has 60+ SMT PnP Electric Feeders connected to it

    Duet 6XD ( Port IO0 -- UART ) <===> RS485 Adapter on PLC ( FX3u-485-MB) <===> Controlling SMT PnP Electric Feeders

    Do i need a UART TTL to RS485 Two-Way Converter to accomplish this Since there is no direct support for RS485 in RRF ?

    undefined 1 Reply Last reply 24 Jun 2024, 19:51 Reply Quote 0
    • undefined
      dc42 administrators @developeralgo222
      last edited by 24 Jun 2024, 19:51

      @developeralgo222 Modbus RTU support will require both hardware and software support. Future revisions of some Duet 3 boards will include RS485 interfaces. Other Duet 3 boards will need an external 3.3V to RS485 converter and probably a spare IO_OUT pin to control the transmission direction. Software support for Duet 3 boards will be added to RRF either in version 3.6 or shortly afterwards.

      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 2 Replies Last reply 24 Jun 2024, 20:16 Reply Quote 0
      • undefined
        developeralgo222 @dc42
        last edited by developeralgo222 24 Jun 2024, 20:16

        @dc42 is there any Alternative while i wait for a stable solution. I have 60+ Electric feeders that i need working in 4 days for a client production job ? Any suggestions on a RS485 converter to get if required and the wiring connections that for the time being can accomplish this

        My Older discussion is here : https://forum.duet3d.com/topic/35524/does-duet-6xd-support-rs485-communication/5?_=1719243430041

        Since there is no specific timeline for RS485 Support in RRF at the moment

        1 Reply Last reply Reply Quote 0
        • undefined
          developeralgo222 @dc42
          last edited by developeralgo222 8 Dec 2024, 10:38 25 Jun 2024, 16:24

          @dc42 Slide1.PNG Slide3.PNG
          Currently with existing boards Would such a TTL (UART) to RS485 Converter Compatible with 3.3V and 5.0V signals work plus Spare IO (IO0 or IO1 ) port on Duet 6XD ?

          Below is Option 2: Using already existing RRF 3.5.2 CAN support by utilizing CAN0 AUX Port i.e Duet 6XD CAN0 AUX Port <==> CAN-RS485 MODBUS Converter <==> FX3U-485ADP-MB

          Slide3.PNG

          Below are the links to the adapters or converters for the 2 options:

          CAN-to-RS485 Converter:
          https://www.amazon.ca/dp/B0CSFH8QTN/?coliid=I35EGBMWD8HST8&colid=2QAEOOXW12HBB&psc=1&ref_=list_c_wl_lv_ov_lig_dp_it

          UART(TTL) To RS485 (B) Converter
          https://www.amazon.ca/gp/product/B0BQFB7JCK/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1

          undefined 1 Reply Last reply 25 Jun 2024, 18:57 Reply Quote 0
          • undefined
            dc42 administrators @developeralgo222
            last edited by 25 Jun 2024, 18:57

            @developeralgo222 yes that board looks good, although it's more complicated than RS485 boards that I have used before.

            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 27 Jun 2024, 13:42 Reply Quote 0
            • undefined
              developeralgo222 @dc42
              last edited by developeralgo222 27 Jun 2024, 13:42

              @dc42 As for communications commands from Duet 6XD to the electric feeder using the above setup ( RS485 Converter + IO0 Port ) . Can you please elaborate using RRF 3.5.2 commands with an example of a simple communication ?

              undefined 1 Reply Last reply 28 Jun 2024, 15:36 Reply Quote 0
              • undefined
                developeralgo222 @developeralgo222
                last edited by 28 Jun 2024, 15:36

                @dc42, @T3P3Tony ,@droftarts Also what is the Maximum UART Port Speed that IO0 or IO1 can handle on Duet 6XD since i think default UART clock is 3MHz but Apparently UART CLOCK can go as high as 100MHZ. The maximum baud rate is clock/16.

                So what is the Maximum Speed of UART Port on Duet 6XD without corruption of data ? 115200 bps ?

                undefined 1 Reply Last reply 30 Jun 2024, 09:17 Reply Quote 0
                • undefined
                  dc42 administrators @developeralgo222
                  last edited by 30 Jun 2024, 09:17

                  @developeralgo222 maximum transmission speed is much higher than that. However, it you try to receive data above about 57600 baud then you may suffer character loss because of interrupt latency.

                  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 30 Jun 2024, 21:40 Reply Quote 0
                  • undefined
                    developeralgo222 @dc42
                    last edited by 30 Jun 2024, 21:40

                    @dc42 so what would be the recommended fastest baud rate to use with Duet 6XD?

                    undefined 1 Reply Last reply 30 Jun 2024, 21:53 Reply Quote 0
                    • undefined
                      developeralgo222 @developeralgo222
                      last edited by 30 Jun 2024, 21:53

                      @developeralgo222 also is it possible for one of your devs to add the support for RS485 MODBUS RTU to the unofficial dev version of RRF 3.5.2+ or 3.6 dev and I will act as tester for it because I really have an urgent huge need for RS485 MODBUS RTU for Duet 6XD or if one of your devs can provide the code , I can try and compile a dev version to use while waiting for the support to be included in official “After” RRF 3.6 version. I am really desperate to get this done , I need to control and communicate to over 60+ Electric SMT feeders using RS485 MODBUS RTU. This is really , really urgent , time is not on my side

                      undefined 1 Reply Last reply 1 Jul 2024, 08:07 Reply Quote 0
                      • undefined
                        dc42 administrators @developeralgo222
                        last edited by dc42 7 Jan 2024, 08:08 1 Jul 2024, 08:07

                        @developeralgo222 I have just returned from holiday. My immediate priority this week is to fix bugs in 3.6 that our alpha testers have reported. When that's done I may get time to implement Modbus support in 3.6.

                        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 3 Jul 2024, 00:16 Reply Quote 0
                        • undefined
                          developeralgo222 @dc42
                          last edited by developeralgo222 7 Mar 2024, 00:53 3 Jul 2024, 00:16

                          @dc42 , Thanks , i hope you got well needed rest on your vacation and you can get time to work on this. I understand the priority but our very Large project is now at a standstill, We are a large project completely based on Duet 6XD & 3HC products with our Total cost into Tens of thousands of $$$$$. we can't get it working without RS485 MODBUS RTU communications from Duet 6XD being supported. I am willing at moment to be one of the Alpha testers for 3.6.x with this RS485 MODBUS RU enabled.

                          undefined 1 Reply Last reply 24 Jul 2024, 19:31 Reply Quote 0
                          • undefined
                            dc42 administrators @developeralgo222
                            last edited by dc42 24 Jul 2024, 19:31

                            @developeralgo222 I've put a preliminary build of RRF 3.6.0 for the 6XD with experimental Modbus RTU support at https://www.dropbox.com/scl/fo/868isq8kjcmgy1k7z7b3g/ADwxJUoidmE1XRYFZWMdCWk?rlkey=w8imtto9wirwitm5ac2xamxap&dl=0. I've only tested reading input registers, and only from one Modbus device. However as I won't be able to work on this again until next week, I'm making it available in case it is of any use to you.

                            To use Modbus:

                            • Connect a UART to RS485 converter to IO0 or IO1 of the 6XD
                            • Use the new S7 parameter and optionally the new C parameter of the M575 command to set the chosen port to Modbus mode, set the baud rate, and set the port to drive the Tx/!Rx input of the RS485 transceiver if required (that can be any other io#.out port)
                            • Use the new M260.1 command to write Modbus registers and/or the new M261.1 command to read Modbus input registers. Note, the M261.1 command V parameter is not implemented yet.

                            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

                            gloomyandyundefined undefined 2 Replies Last reply 25 Jul 2024, 10:26 Reply Quote 1
                            • gloomyandyundefined
                              gloomyandy @dc42
                              last edited by 25 Jul 2024, 10:26

                              @dc42 Do you have a recommendation for a suitable converter? Most of the ones on Amazon seem to use automatic switching. This one seems to have enable pins: https://www.amazon.co.uk/WINGONEER-MAX485-Module-RS-485-Development/dp/B06XHHWLMW

                              1 Reply Last reply Reply Quote 0
                              • undefined
                                developeralgo222 @dc42
                                last edited by developeralgo222 8 Dec 2024, 10:44 12 Aug 2024, 10:44

                                @dc42 i will continue testing

                                undefined 1 Reply Last reply 12 Aug 2024, 14:53 Reply Quote 0
                                • undefined
                                  dc42 administrators @developeralgo222
                                  last edited by 12 Aug 2024, 14:53

                                  @developeralgo222 latest binaries are at https://www.dropbox.com/scl/fo/yc7mnauicu5vqw6yegeq7/AKnV4j8k1MCADG4VE4EIG6Y?rlkey=skjxh23i9c953yvxm2tb8qr36&dl=0.

                                  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 12 Aug 2024, 15:20 Reply Quote 0
                                  • undefined
                                    developeralgo222 @dc42
                                    last edited by developeralgo222 8 Dec 2024, 16:08 12 Aug 2024, 15:20

                                    @dc42

                                    i am testing with the following GCODE. Can you review to see if i am doing it correctly

                                    M575 P1 B115200 S7  ; Set Serial comms parameters TX & RX
                                    M260.1 P1 A1 R42 B1 ; Modbus Write to registers / Coils 
                                    M261.1 P1 A1 R42 B2 ; Modbus Read from Holding or Input registers / Coils 
                                    

                                    Below is:

                                    RS485 Serial Connections Configurations on the PLC MODBUS RTU Side:

                                    Modbus Slave Address (PLC):  1 
                                    
                                    Comm Mode :   RS485  Modbus RTU 
                                    
                                    Parameters:   115200, 8Bit, None, 1Bit
                                    
                                    i.e 
                                    
                                    Baudrate : 115200
                                    Length: 8 
                                    Parity : None
                                    Stop Bits: 1
                                    
                                    Hardware Control:
                                    Flow Control Mode: No 
                                    DTR: Enable
                                    RTS: Enable
                                    
                                    undefined 1 Reply Last reply 12 Aug 2024, 15:42 Reply Quote 0
                                    • undefined
                                      dc42 administrators @developeralgo222
                                      last edited by dc42 8 Dec 2024, 15:42 12 Aug 2024, 15:42

                                      @developeralgo222 you only need one M575 P1 command, and the C parameter should only be used if your RS485 adapter has a Tx/Rx control input.

                                      The V parameter of M261.1 is not yet implemented.

                                      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 12 Aug 2024, 16:09 Reply Quote 0
                                      • undefined
                                        developeralgo222 @dc42
                                        last edited by 12 Aug 2024, 16:09

                                        @dc42 as edited above ?

                                        undefined 1 Reply Last reply 12 Aug 2024, 16:45 Reply Quote 0
                                        • undefined
                                          dc42 administrators @developeralgo222
                                          last edited by dc42 8 Dec 2024, 16:45 12 Aug 2024, 16:45

                                          @developeralgo222 yes, if your RS485 adapter does automatic Tx/Rx switching, and you want to write 1 word with value 1 to register 42 and then read registers 42 and 43.

                                          It might be a good idea to try with a lower baud fate initially e.g. 19200. The automatic Tx/Rx switching will probably only work over a range of baud rates. 9600 and 19200 are commonly used for Modbus RTU.

                                          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 12 Aug 2024, 22:44 Reply Quote 0
                                          • First post
                                            Last post
                                          Unless otherwise noted, all forum content is licensed under CC-BY-SA