fbpx

YouTube: Machine Tending With Tormach ZA6 & Versabuilt MultiGrip Ep3

Our latest instalment in the Machine Tending With Tormach ZA6 & Versabuilt is out! This episode features all of the intricate details involved in getting the system trained to the vise origin and executing a sample pick and place sequence that can grab and replace the MultiGrip jaws from the Versabuilt vise.

As noted in the video, all of the sample code and latest information are provided below. We will endeavour to keep this as up to date as possible with any new learnings and innovation that arises as we continue our machine tending journey.

Instructions

The example consists of two source files – versabuilt_grip.py, and robot_speech.py. You can download a zip file of our latest version of the files here.

Setting up to run the demo requires you to establish two waypoints:

vise_zero (Program Waypoint) – This is set to be the trained origin/pick up point for your vise jaws. See the YouTube video for a very, very detailed explanation of how to establish this waypoint.

clear_position (Global Waypoint) – This is set up in PathPilot to be the position that the code clears the vise jaws to in between pick and place operations. Again, see the video for how we use it, but it’s fairly straight forward.

Code Sample

The code we run in the demo is provided below. Credit goes to the folks at Tormach for providing the original version of this sample. We’ve added a few tweaks which we discuss below.

enable_speech – This flag can be used to enable or disable the debug speech that goes with the code. Enabling it is good for understanding what is going on, but obviously slower.

optional pauses – There are optional pause commands inserted after each major operation in the code. If you turn on the Optional Pause button in PathPilot, then the program will pause after each step in the process so that you can debug problems or get a better understanding of how things are going.

# versabuilt_grip.py
#
#   VersaBuilt Machine Tending Sample Code
#
#   Credits:                 Tormach Inc.
#   Modified/Presented By:   Trent Shumay, Big T's Chop Shop (https://bigtchopshop.com)

from robot_command.rpl import *
set_units("mm", "deg")

# Vise origin
vise_zero = p[771.61705493927, 494.54623460769653, 249.47866797447205, 0.008317352570451853, -0.1097974506351306, 0.5333155287053432]

# Use this flag to enable or disable debugging speech
enable_speech = True

if enable_speech:
    from robot_speech import speak
else:
    def speak(s):
        pass

def open_multigrip():
    set_digital_out("multi_close", False)
    set_digital_out("multi_open", True)
    sleep(1)

def close_multigrip():
    set_digital_out("multi_close", True)
    set_digital_out("multi_open", False)
    sleep(1)

def float_multigrip():
    set_digital_out("multi_close", False)
    set_digital_out("multi_open", False)
    sleep(1)

def close_vise():
    set_digital_out("vise", True)
    sleep(1)

def open_vise():
    set_digital_out("vise", False)
    sleep(1)

def pick_od_jaws(origin):
    speak("picking jaws from vise")
    with work_offset(origin):
        
        speak("start with the vise jaws closed and the gripper closed")
        close_multigrip()
        close_vise()
        pause(optional=True)


        speak("step 1: move to 50mm away in y direction")
        movej(Pose(x=0.0, y=-50.0, z=0.0))
        pause(optional=True)

        speak("step 2: engage - move in Y until pins engage but dovetails don’t")
        movej(Pose(x=0, y=-3.5, z=0))
        pause(optional=True)

        speak("step 3: side shift to engage dowel pin in fixed side window")
        movej(Pose(x=5.1, y=-3.5))
        pause(optional=True)

        speak("step 4: open gripper to engage window on moving side")
        open_multigrip()
        pause(optional=True)

        speak("step 5: float gripper")
        float_multigrip()
        pause(optional=True)

        speak("step 6: engage face to face ")
        movej(Pose(x=5.1, y=0.0))
        pause(optional=True)

        speak("step 7: side shift to engage dowel pins")
        movej(Pose(x=0, y=0))
        pause(optional=True)

        speak("step 8: close gripper to engage on jaws")
        close_multigrip()
        pause(optional=True)

        speak("step 9: open vise");
        open_vise()
        pause(optional=True)

        speak("step 10: side shift to clear fixed side dovetail on vise")
        movej(Pose(x=-3.9))
        pause(optional=True)

        speak("step 11: up and away")
        movej(Pose(x=-3.9, z=50))
        pause(optional=True)

    


def place_od_jaws(origin):
    speak("placing jaws on vise")
    with work_offset(origin):
        
        speak("step 1: open vise")
        open_vise()
        pause(optional=True)
        
        speak("step 2: approach above vise")
        movej(Pose(x=-3.9, y=0, z=50))
        pause(optional=True)
        
        speak("step 3:engage with vise surface")
        movej(Pose(x=-3.9, y=0, z=0))
        pause(optional=True)

        speak("step 4: shift to engage fixed side of vise")
        movej(Pose(x=0, y=0, z=0))
        pause(optional=True)

        speak("step 5: close vise to clamp on jaws")
        close_vise()
        pause(optional=True)

        speak("step 6: float gripper")
        float_multigrip()
        pause(optional=True)

        speak("step 7: shift to release gripper dovetails")
        movej(Pose(x=5.1, y=0, z=0))
        pause(optional=True)

        speak("step 8: open and float gripper")
        open_multigrip()
        float_multigrip()
        pause(optional=True)

        speak("step 9: pull away")
        movej(Pose(x=5.1, y=-50., z=0))
        pause(optional=True)


def main():
    speak("Prepare to be amazed!")
    pick_od_jaws(vise_zero)
    movej("clear_position")
    place_od_jaws(vise_zero)
    movej("clear_position")

About the author