Basic Gripper Usage

Introduction

Sparki has a gripper. It will be useful to learn how to use it before we move to more complex tasks. And of course, we will use the gripper in future lessons.

Front - Gripper

The gripper is a simple mechanism driven by a stepper motor, the same kind of motor used to move Sparki’s wheels. The stepper motor’s shaft has a pinion attached, which drives a rack:

Rack Pinion

Thus, moving the motor in one direction opens the gripper, while moving the motor in the other direction closes it.

Programming the Gripper

Having learned this, we are now going to program the gripper’s movements. Warning_Triangle Please remember to check that the batteries are properly connected (and charged!). And as we are going to use the motors here, please check that the On/Off Switch is on. Another important thing to take care of when playing with the robot’s motors is to be careful not to be working over a table. A fall from that table could permanently damage your Sparki. The basic commands that Sparki’s software provides to control the gripper are: As there is no sensor to detect if the gripper is fully closed or fully opened, we will control it moving its motor during small time intervals. And to determine the intervals that we should use to open and close it, we will need to experiment a bit before going further. So, before we start, make sure that the gripper is not fully opened nor fully closed: Warning_Triangle Be careful if you find that the gripper is in one of the positions shown in the previous image, since trying to move it during long intervals of time when it’s blocked may damage the motor. For example, if the gripper is closed (as shown in the left photo), you should try first to open it a bit with a simple program like this:

On the other hand, if you see that the gripper is fully opened (like the right photo in the previous image), please run a program like the following: Now, try making small modifications to the time interval. For example, you can open (or close) it for 2 seconds. Please don’t try big numbers here, since you will reach the gripper’s mechanical limit fast. By making a few little experiments with the intervals of time, you will soon be familiarized with the gripper’s limits. Finally,  you can try the example program included with the SparkiDuino software. Please go to the menu File->Examples->Gripper and download the code to your Sparki: This small program will open and close your Sparki’s gripper in a never-ending loop, opening it for 1 second (1000 milliseconds), closing it for 1 second, then pausing for 1 second:  

Extra Activities

If you want to improve the control of the gripper, you can always use the stepper motor instructions that we have learned before: Although these two instructions (motorRotate and motorStop) will allow you to control the gripper’s speed, they aren’t as handy as the standard gripper functions learned in this lesson. But why not to experiment with them too? As a tip, the motor parameter that should be used in order to work with the gripper is MOTOR_GRIPPER.  

Lesson available for the miniBloq Programming Environment

miniBloq.v0.82.ArcBotics.png This lesson is also available for the miniBloq Programming Environment. miniBloq is a graphical programming environment that you can use to easily program your Sparki.