Tx line from a Maestro Controller

Hi,

I’m using a USB Micro Maestro to control a serial motor speed controller from the Tx line. I am having problems getting the computer to talk to the motor controller using a c# program. This is probably more down to my coding than a problem with the boards, but I was wondering if you could answer a couple of quick questions:

  1. The Tx line sends TTL non-inverted serial to the motor controller, which is what I want. When I set up a SerialPort object in C# and use this to send serial commands via COM1 (the virtual TTL port), is the output inverted Rs232 serial or non-inverted TTL? And does it matter? (Ie if I send Rs232 inverted serial to the Maestro, will it convert it for me before sending it to the Tx line?

  2. When I connect the maestro and the motor controller up with the maestro connected to the computer via USB, the motors move randomly and sporadically. Does this sound familiar, and if so is it a problem that’s easily solved?

Hopefully after a few goes I’ll get the coding sorted - if not I will post up what I’ve done so you can tell me what I’m doing wrong!

Cheers,

Greg

Just to add a bit more detail, when I try and send a serial command to my motor speed controller through the TTL port, the ports “disappear” (ie the Maestro disconnects from the computer as if you’d just pulled out the USB plug. And nothing goes through to my motor controller so something’s going wrong!

I can control the servos connected to the maestro easily using serial commends on the other COM port - that isn’t a problem; it’s just the TTL port that’s causing problems. I checked with your serial transmission utility and the same problem occurs - so it’s not the code I’m trying to write. Can you think of anything obvious that I should do which I’m not doing?

Thanks in advance for your advice,

Greg

Hi Greg,
A USB protocol is used to send data on the virtual COM port. There is no RS232 going on and no question of whether the signals should be inverted or not. The Maestro takes care of converting from USB into the non-inverted TTL output that you are trying to use, so you have nothing to worry about.

Can you detail your connections, tell us what motor controller you have, which version of Windows you are running, and test whether the reset happens when absolutely everything except USB is disconnected from the Maestro? What you have described sounds somewhat mysterious, but it could be as simple as getting RX and TX lines swapped so that the Maestro shorts out as soon as it tries to send its first byte.

One way to verify the functionality of the TTL UART while the Maestro is disconnected from everything except USB is to send bytes while shorting RX to TX with a piece of wire or a screwdriver tip. The bytes should be echoed back to you as you send them.

-Paul

Paul,

Thanks a lot for your advice - I got it working this morning! I did what you said and connected Rx and Tx with a screwdriver head, and the response was fine. So then I thought it was the speed controller that was at fault (It’s a Sabertooth 2x5A by the way), but I tested it in both analogue mode (using 2 potentiometers to control the motors) and then in R/C mode (using 2 servo outputs from the Maestro to control the motors) and this was fine.

I tried again connecting Tx and Rx together, but this time using the wires that I was connecting to the motor speed controller, rather than directly across the pins as before. And when I sent the serial command, it did what it did before and reset itself, disconnecting the COM ports. The way I had it wired up was using two servo pigtails plugged in across all 5 connectors along the bottom of the Maestro, and then only connecting Tx and GND to the motor speed controller. However, this caused the above problem. When I connected just one connector from each pigtail to the Tx and GND pins, the problem was solved and communication with my motor controller was flawless.

I have no idea why this happened - do you have any ideas? I reckon it must be something to do with the resistance added by attaching a length of wire to the other pins (could I have been triggering the RST pin?)

Cheers,

Greg

Ah, that could be it! The pull-up resistance on the RST line is pretty high, so if you start connecting things to it that might be weakly connected to ground, you can easily reset the board. We should put a note about that somewhere in the documentation. I am glad you were able to figure it out - that could have easily remained a mystery for quite a while!

-Paul