Control Micro Maestro 6 Servo Controller using MATLAB

Hi,
I would like to know whether i can control my Micro Maestro 6-Channel USB Servo Controller using MATLAB software. Please let me know the start up codes to do that in MATLAB.

advance thanks

sreekanth

Hello, sreekanth.

The Maestro has virtual COM ports that can be used just like any other serial port, so if you figure out how to send bytes to a serial port in Matlab you can use the Maestro.

The first step is to set the Maestro’s serial mode to USB Dual Port and determine the COM port number of the Maestro’s Command Port by looking in the Device Manager (assuming you are using Windows).

I have never used Matlab, but this code will probably work for you. It was adapted from a post by sc920505. It sets the target of channel 0 to 6000 (1500 microseconds). It uses the Set Target serial command which is documented in the “Serial Servo Commands” section of the Maestro User’s Guide. You’ll probably want to improve it by making a function that takes a channel number and a target and calculates the serial bytes for you.

s2 = serial('COM9',...
'Baudrate',9600, ...
'DataBits',8, ...
'Parity','none', ...
'InputBufferSize',16384)

fopen(s2)
fwrite(s2,[132,0,112,46],'uint8')
fclose(s2)

–David

I’m trying, but does not work
I’m not a good matlab user
can not send data
I’m doing wrong or Another need the extra code

Hello, faitharc.

Please see my response in your thread:

–David

A post was split to a new topic: Reading analog input from Maestro channel to MATLAB