Need help with running a sequence in preloaded script with Micro Maestro 6-Channel USB Servo Controller using external serial device

Hi,

I’m working with a Micro Maestro 6-Channel USB Servo Controller successfully able to run a sequence in a loaded script using Dual port serial mode under Serial Settings in Controller software with the following python code.

import serial

ser = serial.Serial(‘COM15’, 9600)
command=b’\xa7’
subroute=b’\x05’
ser.write(command)
ser.write(subroute)

ser.close()

Now I need to send these commands using RX, TX lines of the Controller using a separate serial device( Let’s consider USB to TTL converter). I changed the serial mode to UART, fixed baud rate 9600 then connected the RX,TX,VIN, GND pins of the Controller to TX, RX, VIN, GND pins of the USB to TTL converter respectively and set the serial port of the script and run . But no movement from the controller.

Also I noticed that servos didn’t even go to their home positions when I powered up from VIN and GND. Does it mean I can’t run a preloaded sequence using an external serial interface or am I missing some important step or configuration. Do I need to do some additional thing to activate servos in this mode.

Thank you

I don’t see any obvious issues with your code or the way you described your settings.

Are you getting any signs of life from your Maestro when you run your code (i.e. what are the LEDs doing)? I’m not entirely sure I understand why you are connecting VIN on the Maestro to VIN on the USB adapter; are you trying to power the Maestro from the USB adapter with this connection? I suspect a pin labeled “VIN” to be an input, so you might want to double check that the USB adapter is outputting a voltage on that pin and that it is within the Maestro’s operating voltage (5-16V).

If you continue having problems getting it to work, could you post some pictures of your setup that show all of your connections as well as a copy of your Maestro settings file? You can save a copy of your Maestro settings file from the File drop-down menu of the Maestro Control Center while the controller is connected.

Brandon

Thank you very much for replying.

I have done a mistake while typing my connection. I had connected 5V of TTL to VIN of the controller. Extremely sorry about that typing mistake. This is the pin connections I had connected.
TTL | Controller
RX ------> TX
TX ------> RX
5V ------> VIN
GND----> GND

YELLO LED is the only LED I saw while these testing. No RED or GREEN led lighting. Currently I’m out of my workspace so cant get some pictures. But as soon as I reach there I will post some pictures. But I have saved my settings files. I have attached here.
maestro_settings.txt (6.0 KB)

Also to verify there is no any loose connection I did following procedure.

  1. Disconnect 5V line
  2. Connected the controller USB
  3. Configure as Dual port serial mode
  4. Send some data between Controller’s virtual com port and the TTL converter com port.
    This was successful. I was abled to send data between the ports.

After doing these things even connect from the USB of the controller, servos don’t powers up and go to their home positions. I had to unplug and plug to work it as usual way( actually I had to unplug and plug from both endings of the USB cable of the controller ) usual way means to control from the controller software.

I have a question. If I powered the controller from VIN and GND without any external communication connection ( I mean without any USB or TX RX line connection, but powered the servo supply and VIN) shouldn’t the servos power up and go to there home location. Also I have doubt why the GREEN led is not light up when I power it from VIN. It only lights up when USB connected.

Thank you

The way you have your settings configured the Maestro should immediately drive the servos to their home positions when the Maestro is powered (whether through USB or VIN). If that’s not happening, I suspect something is wrong with the way you are powering the Maestro or the servos.

The green LED indicates the USB status of the device, so it is normal for it to be off when you’re only powering it through VIN. You can find more information about that in the “Indicator LEDs” section of the Maestro user’s guide. Just to confirm, do you see activity on the yellow LED when it is powered through VIN? Could you measure the voltage between the VIN and GND pins on the Maestro? Also, could you post more details about how you’re powering the servos? When you have access to your system again, pictures of the setup and connections would still be helpful.

By the way, the command bytes you mentioned in your first post would restart the Maestro script at subroutine 5, which is FRAME_0_4_5 in your Maestro code, so unless something has changed since then, I suspect that isn’t what you’re actually wanting to do. Additionally, all of your main sequence subroutines (i.e. Ayubowan, Handshake, ShowUserLeft, and ShowUserRight) end in a RETURN command which will cause an error if you try to call them with the Restart Script at Subroutine command. If you only want those sequences to run through once when they’re called, you should add a QUIT command before the RETURN.

Brandon

Thank you very much for replying. I re connect all connection then the not going to home position when powering up issue is resolved. But still I was unable to send serial command. I found the issue is with the script. Seems like it close the port before it sends the commands completely. So I modified the script like bellow, I added a delay before closing now everything are working as expected.

import serial
from time import sleep

ser = serial.Serial('COM15', 9600)
command=b'\xa7'
subroute=b'\x01'
ser.write(command)
ser.write(subroute)

sleep(1) # newly added this

ser.close()

Thank you again for your time.

1 Like