Pallet Stacking With a PhantomX Pincher

Introduction: Pallet Stacking With a PhantomX Pincher

In order to obtain a better understanding of the concepts of robotic platforms and what is required when making any robotic solution, this group has elected to create a small pallet stacking solution, which is exemplary of a basic, yet important industrial task that requires understanding of robot movement and interaction with physical objects. Despite being a small-scale setup, it serves as a simulation of the functionality and implementation of an industrial robotic application.

The pallet stacking task will be performed by a TrossenRobotics PhantomX Pincher 4-degrees-of-freedom 4R robotic arm with a P gripper end-effector, controlled via an ArbotiX-M board. The project includes programming of the robotic arm. All materials produced in this project will be published online on

This Instructable will show how to create a pallet stacking system with the PhantomX Pincher. The pincher will retrive a object from a given position, grab it, move it onto a pallet. Four objects will by placed onto a pallet, and a second pallet is placed onto the first one where four other objects will be placed. However the pallets will be manually placed to its desired position.


Thomas J. Thomsen

Nicolaj A. Olsen

Ragnar Jacobsen

Step 1: Equipment and Software

The necessary eqipment and software need for this setup:


    • PhantomX Pincher

    Assembly guide for the PhantomX Pincher:

    • Arduino ArbotiX-M
    • 2 x RobotGeek Push Buttons
    • 2 x RobotGeek Led Drivers
    • 2 x Diodes


    • Arduino IDE

    Arduino getting started guide:

    • DynaManager


    Make sure to read all relevant material above and install all software linked in this section before proceeding. Note that if you have a Pincher robot already assembled, you dont need to go through Assembly guide for the PhantomX Pincher.

    Step 2: Preparing the Setup

    Attach the base of the robot to the platform. Then attach the platform on a surface where it can be clamped down to ensure that the robot wont move during actions.

    Next attach the two RobotGeek Push buttons and the two LED Drivers to the digital I/O pins, as such:

    • D0: Start Button
    • D1: Reset Button
    • D2: LED Driver with Blue LED
    • D3: LED Driver with Green LED

    Tuck the wires under the base of the robot.

    Next attach the robot onto the base, making sure to connect the cable from the base motor to the arbotix board.

    Mark a area for picking up items and a section where the pallets will be placed.

    Step 3: Programming

    Programming of the Arbotix-M board was done in the Arduino IDE version 1.0.6.

    The beginning of the program contains:

    • Including the library header, allowing us to use commands specific to the AX-12A servo motors, such as SetPosition(id, pos) to set servo positions and ax12SetRegister2(id, address, value) to modify things like servo speed.
    • Definition of poses. These are defined as arrays with 4 indexes, containing positions for the base, shoulder, elbow and wrist servos.

    The program then enters the setup function. Here, pins are set to input or output as needed, servo speeds are set, motors are centered, and LEDs indicate that the arm is ready.

    When this is done, the program enters the loop function. If the Start button is pressed, it will start the following sequence:

    • Set the LEDs to indicate that the system is busy.
    • Flag that the arm is busy.
    • Pick up object and move it over the pallet using function pickupSequence().
    • Place object on the next available space on the pallet using placeObjectOnPallet(numberOfObjects).
    • Increment number of objects on pallet.
    • Open gripper.
    • Return arm to ready position using returnSequence().
    • Flag that the arm is ready.
    • Set the LEDs to indicate that the system is ready.

    If the Reset count button is pressed, the number of objects on pallet is reset to 0.

    The pickupSequence, placeObjectOnPallet and returnSequence functions all use the positions defined in the beginning of the program. When placing an object on the pallets, the desired position is found by evaluating the number of objects already on the pallet. If there are less than 4 objects there, the next object must be placed on the lower pallet. Otherwise the object must go on the upper pallet. On each of these, depending on how many objects are on that pallet, the next position is found in the array and the object is put there.

    The positions can be fine-tuned by changing the servo angle values in the predefined positions. If you need to completely change the positions, the Arduino program DynaPose by TrossenRobotics can be used to "learn" new positions including angles of all servos.

    Step 4: Test It !

    When testing for the first time, note that it might not place all objects correctly. This could be due to, diffirences of worksurfaces and the fact that the this specific robot arm isint always stable and therefor be inaccurat.

    If the objects arent placed correctly, corrections have to be made in the program above in the arreys.

    Sometimes the robot can forget the speed values in the program, another problem experienced is that the robotic arm "ignores" some commands while running. The cause of these problems, are currently unknown since the bugs cant be replicated in a consistent manner. These problems can sometimes be fixed by reuploading the program, disconnecting all servo connections and reconnecting them, uploading the pincher test program from TrossenRobotics or restarting the robot by disconnecting the power supply and reconnect it again. Due note when reconnecting the power supply the robot will reboot and continue the program where it left off.

    Step 5: Conclusion

    Following each step in this Instructable, gathering all the equipment needed and downloading the correct software to program the equipment, it will be possible to construct the process above, however, the process is prone to failure.

    This process is still under construction, it would seem that problems arise in the communication between the arduino board and the Pincher robot, these problems result in the process running inaccurate or complete failure process. From this groups perspective, the easiest solution would be to use a different robotic arm with better motor control and improved encoders.

    Despite this, it was possible to achieve the goal: to simulate stacking of objects on multiple levels of pallets using a Pincher robot with ArbotiX-M controller.

    A PowerPoint presentation about the content of this Instructable can be found below. We hope you enjoyed this little project! Share any comments, ideas and improvements in the comment field :)

    Be the First to Share


      • Back to School: Student Design Challenge

        Back to School: Student Design Challenge
      • Plywood Contest

        Plywood Contest
      • Metal Contest

        Metal Contest



      5 years ago

      Adding the programming by photo is not very smart . For someone to use the code they have to retype it or recover it from pictures somehow. Just reading those is difficult

      Why not just add the ".ino" files as attachments ?

      3 4 Pit
      3 4 Pit

      Reply 5 years ago

      Thanks for the comment, tytower. We'll do that right away! :)


      Reply 5 years ago

      That's much better thanks . Are there any other special libraries needed to make this run?

      I see

      #include <ax12.h>

      If the program does not always do what it is told then there is something wrong in the code or something slips on the device maybe? Put breakpoints in the code to locate the problem areas like Serial.print("Past point 1"); etc


      Reply 5 years ago

      Thank you for the reply!

      The only libraries needed is the ax12.h .

      Regarding the program not always doing what its suppose to, we have tested a lot of different ideas, and the problems seems to be random, even when running the exact same version of the program multiple times the mistakes the robot makes are not necessarily the same every time, so at this point or main theory is that there's some kinda of fault or communication problem, maybe between the robot and the arbotix possibly signal noise due to unshielded comm wires.
      We use print functions to follow the program along, to try to see if we can find the points or were the error happens, however since the errors can not be replicated in a consistent manner, its hasn't proved helpful until now.


      Reply 5 years ago

      Interesting . Try wrapping the TX and RX wires in alfoil and see what difference that might make, short and not short the two lots of alfoil and also try grounding it. Serial communications often interfere with the running of programs on an arduino . You could try to learn about interrupts and rearrange your program to move on interupts only . Interesting


      Reply 5 years ago

      It could be worthwhile changing the processor if that is permissible ,to a faster chip or perhaps using an esp8266 for instance which has more memory anyway and is faster but which will also give you the possibility of connecting via wifi rather than xbee.Seems choosing the arbotix limits you somewhat.


      5 years ago

      That's a neat build, thanks for sharing :)

      3 4 Pit
      3 4 Pit

      Reply 5 years ago

      Glad you like it Swansong! :)