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

Pololu Forum

Disconnect Command in Script


Presently we are using a 1350 Maestro 6 Channel Controller that runs a script. We run our script one time at startup, then stop. We then momentarily interrupt power by pressing a switch, then reapply power when the switch is released to fire the script one time for each button press.

It’s working very well, but we often experience servo “chatter” in certain positions. We know that the power supply is sized properly and is very clean. We are using HS-785HB Servos.

We would like to disconnect the servo after each movement by a command in the script, so that the servo does not try to maintain position, until the next frame is called.

Is this possible ?




It is possible to stop sending signals to a servo by setting its target to position to zero. This typically will have the effect of disconnecting the servo. However, there are some digital servos that will hold the last position they were directed to when the signal is disconnected, so these would not be disabled. I do not know if your servos work that way.

You should also note that if you direct a servo to a new position after it has been disabled, its acceleration and velocity settings will be lost. You can avoid this by directing the servo to its previous position, then to the new desired position.



The HS-785HB Servo is an analog servo.

This is our script; can you provide an example of setting a target position to 0 in the script ?

  8000 8660 5340 0 0 0 0 frame_0..5 # Frame0 Starting Position Y+
  11500 7076 frame_0 # Frame1 X-
  11500 5560 frame_0 # Frame2 Y-
  11500 3964 frame_0 # Frame3 X+
  11500 3700 frame_1 # Frame4 Z-
  20000 6960 frame_1 # Frame5 Z+
  3000 8660 5340 frame_0_1 # Return to Start
sub frame_0..5
  5 servo
  4 servo
  3 servo
  2 servo
  1 servo
  0 servo
sub frame_0
  0 servo
sub frame_1
  1 servo
sub frame_0_1
  1 servo
  0 servo

It looks like you are using the sequencer to generate your Maestro script. In this case you could simply add frames where the servo motors are disabled by unchecking their enabled boxes in the status tab.

Alternatively, using the Maestro scripting commands, if you wanted to set a servo 1 to a target position of zero to disable the motor, you would write 0 1 servo.



In the instance of Maestro Scripting, How is the duration specified; say 3s ?

3000 0 1 servo ?


No, you cannot specify a duration in the same command as setting the servo target, but you can add a delay command after you set the target position, such as 3000 delay. There is more information and examples for the Maestro scripting language in the user’s guide.



I modified the script to set the target to zero, in order disable the servos when at each of the six positions. That eliminated the chatter at all positions.

Eliminating the chatter by ‘disabling the servos’ has now introduced a new problem, where the servos no longer hold position.

It looks like I cannot disconnect the servos, else the only thing holding the servo in posititon is the internal friction of the servo.

Is there something further that I can check to eliminate chatter, such as the pulse control period ? Presently it’s set to 20ms.


You can try reducing the servo chatter by decreasing the pulse period. You can set it under the channel settings tab and do not need to set that in your script. Adjusting the pulse period is an advanced option that will change the units of speed and acceleration, so you should carefully read the related user’s guide section.

Keep in mind that your servo chatter is a function of the strength of your servos and the magnitude of the loads you are applying on them, so you may reach some limitation where you cannot further reduce chatter without changing your servos or loading conditions.