Physically Position the Servo and Gripper
Prior to doing any programming to open and close the gripper, the servo horn should be centered within the servo’s range of motion - in the middle with 90 degrees of motion on either side - and the Gripper in the closed, lower position as shown below.
- Loosen the screw on the brass connector to allow the brass rod to position itself correctly.
- Move the servo through its range of motion and make sure it is centered when the Gripper is the closed, lowered position.
- If needed, remove the servo screw and rotate the servo horn to an optimal position, then re-attach.
- Tighten the screw on the brass rod connector when you are done.
Coding for the Gripper
Parallax hosts many tutorials for controlling a standard servo. Regardless of the microcontroller you are using, the following is always true for the Parallax Standard Servo which rotates 180°when mounted on the Gripper:
- A positive pulse of 1500 us between a 20-40 ms pause will put the servo in the center position;
- 0° is a 1000 us (1 ms) pulse and 180° is a pulse of 2000 us (2 ms), with the pause mentioned above;
- Program the microcontroller to “step” through the full range of motion and avoid “Gripper slapping” by finding the best increments of pulse stepping to move the Gripper; and
- A range of motion of less than 90 degrees of movement is plenty to control the Gripper.
Refer to the specific tutorials available for our robots for the Shield-Bot with Arduino, the Boe-Bot (BASIC Stamp 2), cyber:bot and ActivityBot 360°.
Below is a sample code in BlocklyProp, our visual programming language for the Propeller Activity Board WX. It can be regarded as pseudo code for other programming languages too.