Packet Serial Mode: Multiple Motor Controllers

General discussion of using Roboclaw motor controllers
roadnarrows
Posts: 2
Joined: Wed Sep 16, 2015 12:40 pm
Packet Serial Mode: Multiple Motor Controllers

Post by roadnarrows »

Hello, I'm attempting to utilize two RoboClaws in Packet Serial mode at the same time.

-I have one motor controller set to mode 7, option 4 (address 0x80, baud 38400), and the other mode 8, option 4 (address 0x81, baud 38400). I will refer to each controller by their addresses from here on.
-I have a 5V Atmega328 based master. I will refer to it as the master.
-I will refer to the UART's TX and RX lines conceptually from the perspective of the master.

-The set up consists of the master with 0x80 and 0x81 connected to the same UART lines.
-I have a scope probing TX and RX.
-I am attempting to "ping" the 0x80 and 0x81 to test the setup by reading their versions (command 21).

-The problem I'm running into is that I get no response back when both 0x80 and 0x81 are connected.
-I do get a response back when only 0x80 or 0x81 is connected.

-Things I've noticed:
---The message from master looks clean and correct.
---The high voltage of the RX signal coming from 0x80 or 0x81 is only 3.5 volts (I would expect 5.0 volts)
---The low voltage when only either 0x80 or 0x81 is connected is roughly 0.5 volts.
---The low voltage when both 0x80 and 0x81 are connected is roughly 1.7 volts.

-Note:
---Master, 0x80, 0x81 are all powered seperately, and jumpers are set correctly.
---They all share ground.
---The supply voltage of master, 0x80, and 0x81 are all measured to be roughly 5 volts.
---Isolating either 0x80 or 0x81 and measuring the voltage on the isolated RX lines reads roughly 3.5 volts.

-Questions I have:
---Is the 3.5 volts measured from 0x80 and 0x81's RX lines normal?
---Why are the low voltages of RX lines 0.5 volts when 0x80 and 0x81 are separate, but 1.7 volts when connected?
---What possible mistakes have I made?
---What can I do to get master, 0x80, and 0x81 communicating correctly together?

0x80 connected to master
500 uS/div & 2 v/div, yellow TX, blue RX
Waveform 1Image

0x80 and 0x81 connected to master
500 uS/div & 2 v/div, yellow TX, blue RX
Waveform 2Image
roadnarrows
Posts: 2
Joined: Wed Sep 16, 2015 12:40 pm
Re: Packet Serial Mode: Multiple Motor Controllers

Post by roadnarrows »

I'm pretty sure this issue is a fundamental misunderstanding on my part of UART, and an assumption made.

I assumed that if multiple motor controllers were designed to be messaged on the bus by a unique address, that they could send a response on the bus.

UART is push-pull and not designed to support this, so I think the 'high' low voltage signal is the result of one controller holding the line high, and the other pulling it low, and signal voltage settling in the middle.

Can anybody confirm this theory?
User avatar
Basicmicro Support
Posts: 1594
Joined: Thu Feb 26, 2015 9:45 pm
Re: Packet Serial Mode: Multiple Motor Controllers

Post by Basicmicro Support »

To use multiple Roboclaws on the same serial port of a PC/Micro controller etc... you must wire a diode in series with each S2 pin on a roboclaw. This is so you end up with opendrain outputs instead of push pull.
Then connect the other sides of the diodes to a common bus wire with a single pullup at the other end.
skcolb
Posts: 22
Joined: Mon Oct 19, 2015 5:05 pm
Re: Packet Serial Mode: Multiple Motor Controllers

Post by skcolb »

acidtech wrote:To use multiple Roboclaws on the same serial port of a PC/Micro controller etc... you must wire a diode in series with each S2 pin on a roboclaw. This is so you end up with opendrain outputs instead of push pull.
Then connect the other sides of the diodes to a common bus wire with a single pullup at the other end.
Is this info still accurate? I noticed that there is now a "Multi-Unit Mode" option and that the wiring diagram doesn't show diodes. Does the firmware now float the Tx pin when not in use so that the multiple units don't fight?
User avatar
Basicmicro Support
Posts: 1594
Joined: Thu Feb 26, 2015 9:45 pm
Re: Packet Serial Mode: Multiple Motor Controllers

Post by Basicmicro Support »

Correct, if you enable the multi-unit mode you wont need the diodes anymore because the TX pins on the Roboclaws will only drive low or float. You will still need the single pullup on the controlling microprocessors RX pin(eg: the arduino).
skcolb
Posts: 22
Joined: Mon Oct 19, 2015 5:05 pm
Re: Packet Serial Mode: Multiple Motor Controllers

Post by skcolb »

acidtech wrote:Correct, if you enable the multi-unit mode you wont need the diodes anymore because the TX pins on the Roboclaws will only drive low or float. You will still need the single pullup on the controlling microprocessors RX pin(eg: the arduino).
Cool, that's a nice solution. Thanks!
steveski
Posts: 22
Joined: Wed Jan 06, 2016 2:09 pm
Re: Packet Serial Mode: Multiple Motor Controllers

Post by steveski »

I am trying to talk to 2 RoboClaw controllers with one Digi XBee 56B module with a VB program. The RoboClaw addresses are 128 and 129. I can talk to them individually with no issues. The RoboClaws are powered up with 12VDC and the XBee with 3.3VDC. I put the RoboClaws in multi-mode and added a 2.2K Ohm resistor between RX and 3.3VDC on the XBee. This seemed to burn up the RX signal because I can't communicate any more with this XBee. When I put a new XBee chip in everything talks fine again. Do I need a different size resistor? Am I doing something else wrong?
User avatar
Basicmicro Support
Posts: 1594
Joined: Thu Feb 26, 2015 9:45 pm
Re: Packet Serial Mode: Multiple Motor Controllers

Post by Basicmicro Support »

It should not have damaged the XBee pin at all. The Roboclaw in the worst case can only ouptut 3.3v maximum on an I/O and if the pullup was to 3.3v as well then there is no way the pin would have gone higher than 3.3v(the usualy cause of I/O damage is over voltage).

Make sure you have a common ground between the XBee and the Roboclaw.

The only other possibility is you are trying to drive an output from the Robcolaw(eg shorting the signal pin of the XBee).

I would recommend first getting a single Roboclaw working consistently with the XBee(one Roboclaw not set to multi unit mode). S1 goes to the XBee output(TX) and S2 goes to the XBee input(RX) and GND to GND.

How are you powering the XBee module?
steveski
Posts: 22
Joined: Wed Jan 06, 2016 2:09 pm
Re: Packet Serial Mode: Multiple Motor Controllers

Post by steveski »

I am using a Wurth Elektronik 173950378 fixed step down regulator module which gives an output of 3.3VDC. All grounds are common. Everything works fine when I connect one XBee to one RoboClaw. I am not using any other I/O from RoboClaw except for S1 and S2 for the communications.
steveski
Posts: 22
Joined: Wed Jan 06, 2016 2:09 pm
Re: Packet Serial Mode: Multiple Motor Controllers

Post by steveski »

Attached is a drawing of how I am wired to one RoboClaw. When going to the second RoboClaw I enabled Multi-mode for both, wired S1 and S2 in parallel to the second RoboClaw and added the 2.2K ohm resistor between the 3.3VDC supply and RX on the XBee (S2). When we added the resistor and powered up the XBee could not communicate again. Popped in another XBee to a single RoboClaw and it worked fine.
Attachments
RoboClaw_Wiring.jpg
RoboClaw_Wiring.jpg (235.68 KiB) Viewed 11884 times

Post Reply