Introduction

Many of the images and text of this guide comes from the TAMV wiki via the fine folks at Jubilee.

TAMV comes from the late Danal Estes, whom among many other things contributed this tool to the open source community before his passing in early 2020.

A special “Thank You” goes out to “H2B” of the Jubilee discord for his maintenance and support with this system.

In order to achieve the highest possible precision when using multiple tools, Danal Estes graciously created the Tool Alignment with Machine Vision (TAMV) and Z Tool Align with Touch Plate (ZTATP) programs that allow us to correctly determine both XY and Z offsets for multiple independent tools on a toolchanger platform.

  • TAMV = Tool Alignment with Machine Vision

TAMV is a fully automated process that uses a camera to calculate XY tool offsets set with G10 L1 tool offsets that go in config.g to correctly set the XY alignment for correct tool-to-tool behavior when printing.

  • ZTATP = Z Tool Align with Touch Plate

ZTATP is a partially automated process that uses a touch plate to calculate Z tool offsets also set with G10 L1 tool offsets that go in config.g to correctly set the Z alignment for tool-to-tool correct behavior when printing. It also sets the bed-to-tool-zero spacing!

Requirements

  • Raspberry Pi 3B+ or 4B, with USB attached camera (no Picam at this time).
  • Almost any webcam with auto-exposure and the ability to focus within a few centimeters of the lens will work. Logitech C270 is one that is known to have a threaded lens and a case that can be removed and replaced with a printed case.
  • A Duet printer, reachable from the Pi by network, running V2 or V3 firmware
  • May run on Duet3+Pi; does NOT require that configuration, run on any Pi.

What you’ll need before you start:

  1. A Raspberry Pi with a working installation of Raspbian, with an internet connection from the Pi. While a bit more costly, a Pi4 is highly recommended, but not required.
  2. Your SUDO user of choice (default is usually the “pi” user) and SUDO password (default is “raspberry”) with SSH login
  3. An SSH client of your choosing, such as Windows 10 built in ‘winterm’ and ‘ssh’ or install PuTTY (links in guide)
  4. A VNC client of your choosing, such as VNC Viewer (links in guide)

Video Overview

  1. Special notes to AVOID MACHINE DAMAGE!
    • Special notes to AVOID MACHINE DAMAGE!

    • TAMV will move your tools around in ways that may be different than day-to-day printing. In particular, if your camera is anywhere beyond the Y coordinate of the parking stalls for other tools, collisions could occur. To ensure this does not happen, two things must be true:

    • TAMV expects a tool change, as initiated by a T0 or T1 or so forth, will not cause a collision, no matter where the tool is when the tool change initiates.

    • It is entirely possible that your tool change macros do not ensure this today, particularly when a ‘current tool’ is beyond the Y line of the parking stalls at the moment a tool change is initiated.

    • TAMV itself will always “manhattan move”, that is move in square blocks, and will move X (only!) first, they Y (only!) as required to get FROM wherever the tool is after a Tx, TO the camera.

    • If (big IF) your tool change macros end with the tool at a ‘safe Y’, then ‘Manhattan moves’ will always prevent collisions. In fact, this form of move is best practice within your tool change macros.

  2. Click Here for the official how-to guide for installing the current Raspbian version OS on your new Pi.
    • Click Here for the official how-to guide for installing the current Raspbian version OS on your new Pi.

    • Click Here to download the latest Raspberry Pi OS. You'll need the desktop version with or without the "additional recommended software"

    • Once the image is installed on the SD card, you can move onto the next step.

  3. Login via SSH to your Raspberry Pi and and run the Raspberry Pi config tool using the command: Click Here to download PuTTY, a freeware tool. Most Raspbian installs have SSH disabled by default. This means you won't be able to connect via PuTTY straight away. Use this guide if you'd like to get SSH and/or wifi set up "headless" without needing to temporarily connect a monitor/keyboard/mouse: https://www.raspberrypi-spy.co.uk/2017/0...
    • Login via SSH to your Raspberry Pi and and run the Raspberry Pi config tool using the command:

    • Click Here to download PuTTY, a freeware tool.

    • Most Raspbian installs have SSH disabled by default. This means you won't be able to connect via PuTTY straight away. Use this guide if you'd like to get SSH and/or wifi set up "headless" without needing to temporarily connect a monitor/keyboard/mouse: https://www.raspberrypi-spy.co.uk/2017/0...

    • This can also be done by connecting a mouse, keyboard, and monitor to your Pi. Open the command terminal from the home screen. After VNC viewer is installed, the rest can be done remotely.

    • Find the IP address of your connected Pi via your routers client list. Connect to this IP via puTTY. Type the following commands.

    • sudo raspi-config

    • Select “3 Boot Options”

    • Select “Desktop / CLI”

  4. Select “Desktop” Now from the main menu, select “5 Interfacing Options” Select “VNC”
    • Select “Desktop”

    • Now from the main menu, select “5 Interfacing Options”

    • Select “VNC”

  5. Confirm that you would like to enable VNC server by selecting “Yes” You’ll get a confirmation that the VNC server has been enabled
    • Confirm that you would like to enable VNC server by selecting “Yes”

    • You’ll get a confirmation that the VNC server has been enabled

    • Select the “7 Advanced Options” from the main menu

    • Select “Resolution”

    • Select “DMT Mode 16 1024x768” or any other resolution you’d like

    • Once you’re done, reboot the Raspberry Pi! ( Unplug OR command "sudo reboot")

  6. Click Here to Download VNCViewer.
    • Click Here to Download VNCViewer.

    • Install VNCViewer.

  7. Now that your Pi has VNC set up, the remainder of the process can be carried out from any computer on the same network as the printer/Pi. Launch VNC Viewer on your computer, and select “File” -> “New connection…” Enter the IP address or network name of your Raspberry Pi in the “VNC Server” field, and give this connection a name to identify it in the VNC viewer connection list
    • Now that your Pi has VNC set up, the remainder of the process can be carried out from any computer on the same network as the printer/Pi.

    • Launch VNC Viewer on your computer, and select “File” -> “New connection…”

    • Enter the IP address or network name of your Raspberry Pi in the “VNC Server” field, and give this connection a name to identify it in the VNC viewer connection list

    • Note that you may need to check your routers clients to find the IP address of your Pi.

    • Right-click on the new connection you’ve just created and select “Connect”

    • You’ll be connected to your Raspberry Pi and prompted for a username and password. Use your SUDO login credentials (most commonly the Pi user) and click “Log In”

    • (default is usually the “pi” user) and SUDO password (default is “raspberry”)

  8. Launch a new “Terminal” process to access the CLI (Command Line Interface) of your Pi NOTE: The terminal will launch into your “home” directory, which is “/home/username” under Linux. The following screenshots were for a user called “tamv”, but generally you’ll be seeing the “pi” user Run the following command from the prompt, which will clone the GitHub repo to the current folder you’re in: git clone https://github.com/HaythamB/TAMV
    • Launch a new “Terminal” process to access the CLI (Command Line Interface) of your Pi NOTE: The terminal will launch into your “home” directory, which is “/home/username” under Linux. The following screenshots were for a user called “tamv”, but generally you’ll be seeing the “pi” user

    • Run the following command from the prompt, which will clone the GitHub repo to the current folder you’re in:

    • git clone https://github.com/HaythamB/TAMV

    • Once the clone is done, you’ll need to switch to the new folder using:

    • cd TAMV

    • Now run the installation script using:

    • ./install_opencv.sh

    • Sit back and relax. This process should take anywhere from 45 minutes to three hours to complete, and make sure your Pi doesn’t run out of power during this period. Consider cooling the pi during install.

  9. This can easily be the most challenging part of the process. We are installing a native build of OpenCV versus a more typical virtual install.
    • This can easily be the most challenging part of the process. We are installing a native build of OpenCV versus a more typical virtual install.

    • This step is why we recommend the Pi 4 for TAMV. Setup on a Pi 3B+ will likely take 3 hours time. If for any reason you have trouble completing this step, see the next step for tips and tricks to help get it done.

  10. If your install of OpenCV went silky smooth the first time, congrats! Continue on through this guide. Otherwise:
    • If your install of OpenCV went silky smooth the first time, congrats! Continue on through this guide. Otherwise:

    • Click Here for a walk through on increasing the swap file size temporarily to aid install.

    • This install will max the CPU in some areas. Place a cooling fan in front of your Pi during install if you are not using a case with a fan built in!

    • You may need to try this multiple times before success. Don't hesitate to reach out to the community for help!

    • Don't forget to reduce your swap file size after successful install! Not doing so will severely decrease the life of your microSD card.

  11. Mount webcam somewhere fixed on the bed using gluestick/double sided tape OR on the frame in a spot where the nozzle of the tool can be positioned over the lens.
    • Mount webcam somewhere fixed on the bed using gluestick/double sided tape OR on the frame in a spot where the nozzle of the tool can be positioned over the lens.

    • Shorten webcam focal distance to about an inch away from the lens (webcams are generally set up for longer focus distances so this would probably necessitate opening up the camera shell and manually turning a focus ring)

    • Heat nozzles and clean up all nozzles from gunk and filament blobs to enable correct nozzle circle detection in TAMV. This is very important! Debris in and around the nozzle will make calibration more challenging.

    • You may need to cover other "circles" within the camera's range to avoid detecting them as the nozzle. Painters tape works well for this.

    • Make sure they cool. You don’t want to ‘drool’ on the camera!

    • Set tool active and standby temperatures to 0 before running TAMV. Again to avoid drooling.

    • TAMV does not currently support password protected Duet printers. Temporarily remove any passwords in config.g before proceeding.

  12. Run TAMV with with the -vidonly argument. This MUST be on a VNC session, not ssh (because you have to see the graphic image). Use the following commands from a fresh terminal window: Home the Printer now cd TAMV
    • Run TAMV with with the -vidonly argument. This MUST be on a VNC session, not ssh (because you have to see the graphic image). Use the following commands from a fresh terminal window:

    • Home the Printer now

    • cd TAMV

    • ./TAMV.py -vidonly

    • NOTE: If you are greeted with an error "undefined symbol: __atomic_fetch_add_8" Start TAMV.py this way instead. ---------- LD_PRELOAD=/usr/lib/arm-linux-gnueabihf/libatomic.so.1.2.0 python3 TAMV.py -vidonly

    • Starting TAMV in "vidonly" mode will not move your machine automatically. Jog your machine until the Z probe switch is centered in the TAMV window. Adjust the Z axis to achieve a good, detailed focus on the tip of the switch as shown. If you're ready, skip to step 17 to head over to the next guide!

    • First Remove old files via a command line:

    • cd TAMV

    • rm TAMV*

    • rm ZTATP*

    • rm DuetWeb*

    • Continued on next step.

    • Then re-downloaded the updates:

    • wget -N https://raw.githubusercontent.com/HaythamB/TAMV/master/TAMV.py

    • wget -N https://raw.githubusercontent.com/HaythamB/TAMV/master/ZTATP.py

    • wget -N https://raw.githubusercontent.com/HaythamB/TAMV/master/DuetWebAPI.py

    • Build the exe:

    • chmod 744 TAMV.py

    • For features rundown:

    • ./TAMV.py -h

    • In Progress

Finish Line

Kris Brickman

Member since: 06/09/2020

1,573 Reputation

7 Guides authored

0 Comments

Add Comment

View Statistics:

Past 24 Hours: 1

Past 7 Days: 7

Past 30 Days: 30

All Time: 744