Pololu Robotics & Electronics
My account Comments or questions? About Pololu Contact Ordering information Distributors

Control Micro Maestro 6 Servo Controller using MATLAB


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



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', ...



Getting started - Maestro Micro 6 Servo Controller in Matlab
Micro Maestro With Matlab
Controlling a Servo via Matlab
Mini Maestro 12-Channel USB Servo Controller use to matlab

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:



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

Reading analog input from Maestro channel to MATLAB