Programming the Micro Maestro Servo Controller

The Pololu Micro Maestro is a servo controller that works great for automatic kite aerial photography (AutoKAP) rigs. When I got it, I was surprised by how easy it was to program the exact sequence I wanted using the included software. Here is a video demonstration of how to do that.

Here are the settings I settled on for my AutoKAP rig with rotation and shutter control. This file includes the sequence and script that I saved, which can be loaded to the Micro Maestro via the File -> Open settings file option. Feel free to use this as a starting point for your own rig, but note that you will need to adjust the servo targets to get the right range of motion.

<!--Pololu Maestro servo controller settings file, http://www.pololu.com/catalog/product/1350-->
<UscSettings version="1">
  <NeverSuspend>false</NeverSuspend>
  <SerialMode>UART_FIXED_BAUD_RATE</SerialMode>
  <FixedBaudRate>9600</FixedBaudRate>
  <SerialTimeout>0</SerialTimeout>
  <EnableCrc>false</EnableCrc>
  <SerialDeviceNumber>12</SerialDeviceNumber>
  <SerialMiniSscOffset>0</SerialMiniSscOffset>
  <Channels ServosAvailable="6" ServoPeriod="156">
    <!--Period = 19.968 ms-->
    <!--Channel 0-->
    <Channel name="Rotation" mode="Servo" min="3968" max="8000" homemode="Off" home="3968" speed="0" acceleration="0" neutral="6000" range="1905" />
    <!--Channel 1-->
    <Channel name="Shutter" mode="Servo" min="3968" max="8000" homemode="Off" home="3968" speed="0" acceleration="0" neutral="6000" range="1905" />
    <!--Channel 2-->
    <Channel name="" mode="Servo" min="3968" max="8000" homemode="Off" home="3968" speed="0" acceleration="0" neutral="6000" range="1905" />
    <!--Channel 3-->
    <Channel name="" mode="Servo" min="3968" max="8000" homemode="Off" home="3968" speed="0" acceleration="0" neutral="6000" range="1905" />
    <!--Channel 4-->
    <Channel name="" mode="Servo" min="3968" max="8000" homemode="Off" home="3968" speed="0" acceleration="0" neutral="6000" range="1905" />
    <!--Channel 5-->
    <Channel name="" mode="Servo" min="3968" max="8000" homemode="Off" home="3968" speed="0" acceleration="0" neutral="6000" range="1905" />
  </Channels>
  <Sequences>
    <Sequence name="Sequence 0">
      <Frame name="Wait" duration="2875">6000 6000 0 0 0 0</Frame>
      <Frame name="Shutter" duration="1000">6000 4300 0 0 0 0</Frame>
      <Frame name="Neutral" duration="1000">6000 6000 0 0 0 0</Frame>
      <Frame name="Rotate" duration="125">6279 6000 0 0 0 0</Frame>
    </Sequence>
  </Sequences>
  <Script ScriptDone="false">250 6000 6000 0 0 0 0 frame_0..5 # Servos neutral
5 delay_minutes                            # Startup delay
400                                                 # Total number of cycles      

# Sequence 0
begin
  dup
  while
  2875 6000 6000 0 0 0 0 frame_0..5 # Wait
  1000 4300 frame_1                          # Shutter
  1000 6000 frame_1                          # Neutral
  125 6279 frame_0                            # Rotate
  1 minus
repeat

sub frame_0..5
  5 servo
  4 servo
  3 servo
  2 servo
  1 servo
  0 servo
  delay
  return

sub frame_1
  1 servo
  delay
  return

sub frame_0
  0 servo
  delay
  return

# delay by a specified number of seconds, up to 65535 s
sub delay_seconds
  begin dup while                    # check if the count has reached zero
    1 minus 1000 delay            # subtract one and delay 1s
  repeat
  drop return                            # remove the 0 from the stack and return
 
# delay by a specified number of minutes, up to 65535 min
sub delay_minutes
  begin dup while
    1 minus 60 delay_seconds # subtract one and delay 1min
  repeat
  drop return                            # remove the 0 from the stack and return
</Script>
</UscSettings>
%d bloggers like this: