Could serial noise confuse the Maestro like this?

Hi, Folks, I have a (master) Maestro 12-channel connected to my Windows 7 PC by USB Chained and working fine. I have (for now) a single slave Maestro 12-channel connected to the master by TTL and set up for UART auto-detect baud rate. It is powered by your 5VDC 3A wall wart power supply. Eight servos are connected, but only one is actively moved at any one time (with a miniscule load) while the others hold position. The problem is that I have to send the same command multiple times from your serial transmitter (or my code) to move any of those eight servos attached to the slave. The master’s TX pin and GND pin are connected by your ‘Wires with Pre-crimped Terminals 50-Piece Rainbow Assortment F-F 12"’ to header strips divided into little soldered-together islands for distribution to many slaves. From the island connected to the master’s TX, there is one of your 60" wires connecting it to the RX of the slave. Likewise GND of the master goes to an island and on through a 60" wire to GND of the slave. A third 60" wire is connected from TX of the slave directly to RX of the master. The plan is that I can connect many slaves to one master via the distribution board for a total distance of 72" between master TX and any slave. It works, but it isn’t working well, and I’m soliciting your advice. I think it might be serial noise of some sort, but I don’t know what to do about it if it is.

The master is device 0; the slave is device 62 (0x3E). Using your serial transmitter to simplify matters, I’m passing two different commands through the master to the slave. One is 0xAA 0x3E 0x21, where 0x21 is the Get Errors command. The other is 0xAA 0x3E 0x04 0x08 0x40, which is Set Target for channel 8 to some arbitrary position, where the servo has recently responded and moved to target 0x01 0x20, another arbitrary position distant enough so the new move will be visibly obvious. Notice in the snippet below that I got and cleared any errors, but then I had to send the identical same command SEVEN times before the servo jumped to the right position:

04:12:17 PM sent AA 3E 21
04:12:24 PM sent AA 3E 04 07 01 40
04:23:37 PM sent AA 3E 04 07 01 40
04:23:51 PM sent AA 3E 04 07 01 40
04:23:58 PM sent AA 3E 04 07 01 40
04:24:02 PM sent AA 3E 04 07 01 40
04:24:07 PM sent AA 3E 04 07 01 40
04:24:38 PM sent AA 3E 04 07 01 40

It eventually does set to the correct target (or close enough that I can’t perceive otherwise). Sometimes it works in only two tries, and rarely in only one try as it should. There are plenty of errors in most tries. Here are four new lines from the same series of attempts (note the time stams), where I went to 0x01 0x20 again (two tries. no errors), and then attempted and failed to go back to 0x01 0x40, but got an error:

04:23:58 PM sent AA 3E 04 07 01 40
04:24:02 PM sent AA 3E 04 07 01 40
04:24:07 PM sent AA 3E 04 07 01 40
04:24:38 PM sent AA 3E 04 07 01 40
06:52:19 PM sent AA 3E 04 07 01 20
06:52:22 PM sent AA 3E 04 07 01 20
06:53:37 PM sent AA 3E 04 07 01 40
received: DF ‘ß’ F8 ‘ø’

The red LED is now on. Here are two new lines in the same series:

04:24:38 PM sent AA 3E 04 07 01 40
06:52:19 PM sent AA 3E 04 07 01 20
06:52:22 PM sent AA 3E 04 07 01 20
06:53:37 PM sent AA 3E 04 07 01 40
received: DF ‘ß’ F8 'ø’
07:00:48 PM sent AA 3E 21
received: 12 ‘’ 00 '
07:01:14 PM sent AA 3E 04 07 01 40

In this case (assuming the error response is low byte, high byte-- the documentation is unclear) I supposedly got two error flag bits, 0000000000010010. Bit 1 says, “Serial Overrun Error (bit 1).” Bit 4 says, “Serial protocol error (bit 4).” Bit 1 does not make sense to me but bit 4 might if, say, serial noise is causing the received packet to make no sense to the Maestro. The servo did move correctly in the last line above.

Sometimes I cannot clear errors. Here is a short series of commands illustrating that:

07:17:27 PM sent AA 3E 21
received: FF ‘ÿ’ FF 'ÿ’
07:17:39 PM sent AA 3E 21
received: FE 'þ’
07:17:47 PM sent AA 3E 21
received: FF ‘ÿ’ F6 'ö’
07:17:55 PM sent AA 3E 21
07:18:55 PM sent AA 3E 21

The red LED stayed on throughout, is still on even though the last two lines would suggest it should be off, since no errors are reported.

So do you think it is noise? If so, how should I wire up to 127 Maestros connected by TTL to the master? If not, what in the world is happening? Thank you!

Loren

Hello,

I am sorry that you are having trouble with chaining your two Maestros. I do not see anything obviously wrong with what you are doing, but there is a lot going on in your setup. Can you try to simplify it as much as possible to locate the source of the problem? In particular, you could remove all of the servos and the TX line of the slave. Connect both Maestros via independent USB cables to your PC so that you can monitor errors and servo positions without having to send serial commands or watch the actual servos. Consider replacing your multi-wire cabling with just a single short pair of wires for now.

Next, maybe you should start with a single problem - for example, can you send 0xAA and get the baud rate to be detected successfully? (You will see the yellow LED transition from a slow flashing with a 50% duty cycle to a short blink.) If that works, try a simple servo setting command. If not, stop there and try to get it to work!

By the way, what baud rate are you setting the master Maestro to?

-Paul

Hi, Paul, First of all, I want to express my sincere gratitude for your astonishingly quick response. It was waiting for me this morning at 5:30 EST! Wow! More even than that, thank you so much for being RIGHT first try! You usually are, but it is so darn gratifying to get one’s problems fixed by some clear thinking on your part-- namely, in this case, your suggestions as to how I could “divide and conquer” the problem. In the process of simplifying I hooked both Maestros to USB cables, and both worked great. (Some research today tells me that if I had to I could layer USB hubs 5 tiers deep and achieve something approaching 127 USB-connected Maestros! I had no idea! Expensive compared to the TTL route, but a great backup plan!) With the Control Center (a GREAT utility) looking at either the master or the slave Maestro, I discovered that in fact the slave was not in UART Detect Baud Rate, but UART Fixed Baud Rate, which was set to 56000. So had the serial transmitter been set. However, looking at the master Maestro which I had once had in UART Fixed Baud Rate, the entry had self-adjusted to 56075 baud when I’d set it to 56000. That setting still appeared in the box though I’d long since switched over to USB Chained mode. If the slave was making the same small adjustment, unbeknownst to me, that smidgen of difference could explain why communication worked, but unreliably. So I set the slave to UART Detect Baud Rate as it should have been.

I went to shorten the wires from 60" to 12" and move them from the distribution board to direct connect between master and slave. At that point I discovered a suspicious ground connection on GND of the slave I never would have noticed but for your good advice. The wire felt like it might be broken at the crimp plug, inside the insulation, detectable only by handling, not visually. Too much right-angle bending on my part, without a doubt. So I fixed the ground and hooked everything back up, and I have wonderful results from half an hour’s testing. All fixed, working great. Stupendous! Thank you SO much. I’m not 100% sure which was the actual fix, but it don’t make no never-mind now, you got it working! I really appreciate this.

Loren

Hello,

It is great to hear that you got it to work! Yes, I am a big proponent of the “divide and conquer” approach to debugging. I am pretty sure it was your loose ground connection, since that tiny baud rate adjustment sounds like you were just seeing the rounding that needs to be done to store the baud rate on the Maestro, and a tiny difference like that would not have mattered anyway - the UART can handle being off by a few percent.

By the way, I am not at all sure that it will work with 128 Maestros on the same serial line, but I am really excited to hear what you find out. I would start by using up all of my available USB ports with multiple masters - something like 4 chains of 32 might be a lot more manageable than 1 chain of 128.

Good luck,
-Paul

The USB ports on your computer probably share a common ground, so when you plugged both Maestros in to USB their GNDs became connected. That could be why things started working, even though your other GND connection was bad.

–David