• Generating Tool Paths with Houdini

    Sally Kong05/07/2022 at 20:14 1 comment

    Data Through Design 2022

    Data Through Design (DxD) is a collective in New York City that organizes an annual data art exhibition of projects that make use of data about the city made available via the NYC OpenData project. This project was included in the 2022 Ground Truth IRL exhibit.


    One of the datasets available on OpenData is NYC Parks Forever Wild. It maps wildlife zones and ecologically important areas across 138 parks in NYC. The boundaries for each park’s wildlife zones were graphical abstract shapes. These seemed like a natural fit for a robotic tufting system which can fill areas with yarn.

    Data Processing

    The data came in the form of GeoJSON files. GeoJSON is a standard format for using JSON to encode geographic features. To process the data, I first broke down the dataset to have a single GeoJSON file per park.

    This allowed me to use it with vvzen’s Houdini-Geospatial-Tools which created a Houdini polygon primitive given a single GeoJSON file.

    Houdini is a software application for doing work that is common in computer generated visual effects, like procedural modeling and simulation. It provides a node-based programming environment for manipulating geometry. Off-the-shelf nodes are provided for common operations like moving geometry around, simulating particles, adding noise, etc. But there are also nodes that allow arbitrary programs to be written to create any kind of operation that you might want. By combining nodes in networks very complex procedural workflows can be developed.

    When working in Houdini I wanted to have a network per park so that I could tweak them individually.

    For each park I created a canvas polygon scaled appropriately to reflect the 16’x20’ monk cloth I was planning to use for my output. The canvas polygon was formed out of horizontal rows. Later on the map of the yarn to be tufted would be formed by removing sections of these rows.

    I moved the park polygon loaded from the GeoJSON data to the origin and scaled it to fit in the canvas. Then the shape was extruded to increase the threshold for intersecting with canvas polygon.

    Using these intersections, I created a group called “Inside” for the points in the canvas polygon that were bound by the wildlife shape.

    With this group set, I could now assign a new attribute for each point that described the direction of the tooltip. I wanted the robot to move row by row from left to right, so I assigned the direction values while moving along the rows in the canvas polygon. The values that I assigned were: 

    • 0 if it’s in the same state as the previous point
    • 1 if it’s entering the wildlife shape
    • -1 if it’s exiting a wildlife shape

    Based on this attribute, I could now create edge primitives based on when the attribute value changes. These edges now correspond to the lines that will be tufted by the robot. 

    Since the robot motion planner takes in a series of points and does the inverse kinematics for us, it didn’t need all the points as an input. It just needed a command for the endpoints where it needed to go down to tuft and come up to stop. So all the points inside were deleted, except for the ends.

    Then finally, these endpoints were exported out as a CSV file which contained the point ID, position, and command. 

    The next step would be to write a program to read in the data from this CSV file and pass it along to the motion planner and from there out to the actual robot to tuft the map!

  • Hacking the Tufting Gun

    Owen Trueblood02/17/2022 at 19:02 0 comments

    How Tufting Guns Work

    Tufting guns are fairly simple machines. There are usually two modes that they operate in: loop pile or cut pile. In loop pile the yarn is never broken - it's one long strand. Each time the needle pokes the fabric backing it creates a loop of yarn on the other side. The backing holds the loop in place but if you were to pull the loose end of the yarn the entire pattern would come out. Once the pattern is finished a type of glue is added to fix everything in place and prevent the pattern from being pulled out. Cut pile tufting just involves cutting the yarn on the front side after every needle plunge. As a result you end up with a small segment of yarn shoved through the backing after each needle plunge.

    The mechanism is simple and almost the same for loop pile and cut pile. One needle is used to carry the yarn. It has a hole in it which the yarn is threaded through. On the gun we are using it is connected by a crank mechanism to a large gear. On every revolution of the gear the needle plunges once. Another "needle" is used for the loop or cut pile action. It is attached to the same large gear but about 90 degrees out of phase. If doing loop pile a special "pusher" needle is inserted which just helps hold the yarn down while the main needle is retracted from the backing, leaving the loop in place on the other side. If doing cut pile the pusher is removed and a small scissor mechanism is installed instead. The scissors have one fixed "handle" and one free handle that is actuated by pressing against a piece of metal that is fixed up in the linear part of the mechanism. This causes the scissors to close and cut the yarn just when the main needle is being retracted from the backing.

    For control there is just a power switch, a trigger button, and a knob on the bottom to set the speed.

    The motor driver just uses a 555 timer to PWM a half-H bridge based on the potentiometer that the speed control knob is affixed to. There is an additional pot on the PCB that sets the minimum speed.

    Hacking the Tufting Gun

    For our CNC system we don't want to trigger the tufting gun by hand but we still want to be able to turn it on and off, so we can't just leave it running continuously. We need a way to control it from the robot controller, or the computer sending instructions to the robot controller. Ideally we also want to have control over the speed of the gun, because that needs to be synchronized with the speed of the robot arm for a constant tuft density.

    To accomplish these goals I replaced the motor controller, added an Arduino, exposed the Arduino's USB connection, and added an IO port.

    For the IO port I just added a standard stereo 3.5mm audio jack which is wired to ground and two of the analog inputs on the Arduino. With the IO and USB we can update the firmware to either control the tufting gun over USB serial or directly via digital/analog IO. The latter is convenient for the robot because it has digital and analog IO that can be controlled from the program it is running. The easy route will be to use one IO as a digital input to turn the tufting gun on or off and the other IO as an analog input that controls the speed based on the voltage.

    The trigger and pot are wired through the Arduino now. So with a few lines of code we can restore the original functionality and still use the tufting gun manually:

    const int PIN_ENABLE = 2;
    const int PIN_OUT1 = 5;
    const int PIN_OUT2 = 6;
    const int PIN_BUTTON = 3;
    void setup() {
      pinMode(PIN_ENABLE, OUTPUT);
      pinMode(PIN_OUT1, OUTPUT);
      pinMode(PIN_OUT2, OUTPUT);
      digitalWrite(PIN_ENABLE, HIGH);
      digitalWrite(PIN_OUT1, LOW);
      digitalWrite(PIN_OUT2, LOW);
    void loop() {
      if (!digitalRead(PIN_BUTTON)) {
        analogWrite(PIN_OUT1, analogRead(A0) >> 2);
      } else {
        digitalWrite(PIN_OUT1, LOW);

     Next up is mounting the gun to the robot and doing our first CNC tufting.