Entries in Research (18)

Using Grasshopper to Control a Pan/Tilt Servo

Posted on September 12, 2009 by Registered CommenterAOP in , | Comments4 Comments

The above is a follow up video to the posting I made last week showing how we can use a Wii nunchuck to control parametric data in Grasshopper.  However, in this video, we are looking at reversing the flow of information and using parametric data (numeric sliders in Grasshopper) to control two different servos.  In this case, one slider controls the panning servo, while the other controls the tilting servo.

In this demo, we need to set up two different files.  The first is the Grasshopper definition (written for ver. 0.6.0019) which sends the numeric slider information over the serial port via a custom VB.NET component.  This component formats the two variables (the pan slider and the tilt slider) into a string that is separated by a comma.  This comma will serve as our delimeter when we read the data over the serial port on the Arduino side.  You can download the Grasshopper source file below.

On the Arduino side, we first have to understand that serial communication receives individual bytes of information as a stream.  This can become complicated because most data types are more than 1 byte... so you have to understand the data type and then convert it on the Arduino side to the format you are looking for.  In this example, we are reading a string into the buffer and then working through each individual byte until we reach our delimeter (don't forget about the comma).  Once we reach the comma, we pass the data that has been read into the buffer into a variable that ultimately controls one of the servos.  We do a similar process for the second set of bytes after the comma.  The Arduino source code can also be downloaded below.

Again, I'd like to thank Robert Lee for his explanations and insights on how to set up this demo.

Source Files:
Grasshopper_controlling_PanTilt_Servo.pde (Right-click to 'Save Link As') This is the Arduino source code needed to program the micro-controller.  This file was written for Arduino IDE ver. 0017.

Grasshopper controlling PanTilt Servo.ghx (Right-click to 'Save Link As') This is the Grasshopper definition needed for the demo above.  This definition was created for Grasshopper ver. 0.6.0019

Grasshopper to PanTilt Servo.3dm (Right-click to 'Save Link As') This is the Rhino file that accompanies the Grasshopper definition.

Note: These documents are in the public domain and are furnished "as is". The author, Andrew Payne, makes no warranty, expressed or implied, as to the usefulness of the software and documentation for any purpose. This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License. http://creativecommons.org/licenses/by-sa/3.0/us/

Using a Wii Nunchuck to Control Grasshopper

Posted on September 8, 2009 by Registered CommenterAOP in , | Comments1 Comment



The video above demonstrates how we can feed a stream of live sensor data (in this case, I chose to use the accelerometer data from a Wii nunchuck) into Grasshopper to control a parametric model.  I'll be the first to admit that this is not a 'new' demo... In fact, this demo was heavily inspired (in concept) by this video that was created in 2008 that shows how a Wii nunchuck can control a mechanical arm in 3D Studio Max . 

However, my own research was primarily concerned with understanding how to get the sensor data into Grasshopper (and how we can also reverse this flow of information to get Grasshopper to control servos, motors, LED's, etc...) in order to create more complex and sophisticated digitial and physical environments.

Before we get too far, I'd like to say thank you to Robert Lee for his insights on how to setup the VB.NET listener.

Now onto the more technical aspects.  Let's start with the hardware setup.  I am sending the accelerometer data from the Wii nunchuck to an Arduino Diecimila micro-controller which allows me to format the data into a block of code that the Grasshopper VB.NET listener will be able to understand.  I could have spliced up my Wii controller to connect the various parts of the circuit to the appropriate pins on the Arduino board, but I decided to buy a wonderful and cheap little adapter that simplifies the entire process.  You can buy your own from these online stores:

- FunGizmos.com. International shipping for $1 more.
- Tinker.it (UK)
- Little Bird Electronics (Australia)
- Sparkfun. Ships domestic & internationally. Be sure to order header pins too!
- Freduino.eu (EU)

Now, that we've properly connected the Wii nunchuck to our micro-controller, we'll need to program our Arduino board so that it can read the incoming sensor data and send it over the serial port.  For this, I have used a custom built library written by Tod E. Kurt that was designed to help the communication process between a Wii controller and the Arduino.  You can download the "nunchuck_funcs.h" library from his website at: http://todbot.com/blog/.  You can also get the source file needed to program your own board by clicking on the links below.

On the Grasshopper side of things, we need to create a custom VB.NET listener component that can read a string of data coming in over the serial port.  The nice thing about this listener is that it will display any string that is being sent from the Arduino... What you do with that string is another matter... but in this example, we are feeding a string of information that is separated by a comma ",".  The comma will be our delimeter which essentially tells us where to split the string so we can extract the integer value on the left side of the comma (which cooresponds to the X-value of the accelerometer) and the integer value on the right side of the comma (which will cooresponds to the Y-value of the accelerometer). 

Once we have successfully read the data from Grasshopper, we can connect a Timer Component to automatically refresh the solution at a given time interval.  In the video above, I was able to refresh the sensor data at 50 millisecond (the smallest time interval that is currently available in Grasshopper) without any lag or delay.  You can download both the Rhino file and the Grasshopper definition needed for this demo by clicking on the links below.

Source Files:
Wii Nunchuck to Grasshopper.pde (Right-click to 'Save Link As') This is the Arduino source file.  This file was written for Arduino IDE ver. 0017.
Wii Nunchuck to Grasshopper.ghx (Right click to 'Save Link As') This is the Grasshopper definition.  This file was created for Grasshopper ver 0.6.0019.
Wii Nunchuck to Grasshopper.3dm (Right-click to 'Save Link As') This is the Rhino file that accompanies the Grasshopper definition.

Note: These documents are in the public domain and are furnished "as is". The author, Andrew Payne, makes no warranty, expressed or implied, as to the usefulness of the software and documentation for any purpose. This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License. http://creativecommons.org/licenses/by-sa/3.0/us/

Testing the Grasshopper G-code Writer for 2D Shape Milling

Posted on August 30, 2009 by Registered CommenterAOP in | Comments2 Comments

This video shows some on going research on how the Grasshopper plugin for Rhino can streamline the CNC milling fabrication process; specifically for 2D shape milling on a PADE spin-W 5 axis continuous CNC Work Center.  Special thanks to Matthew Spremulli (former University of Toronto Grashopper workshop attendee) and Greg Everett of the Airport Railings & Stairs Co. Ltd. located in Mississauga Ontario Canada for running the code on their 5-axis CNC mill. 

The original Grasshopper definition has been updated to write both the G-codes (which are the individual groups of numerically controlled functions called packets which tell the mill how and where to move) and the P-codes (which are the instructions that are read by the PADEeasy software to call up the packets in a specific order).  Both sets of codes are streamed automatically to .txt files and are automatically updated upon any changes in the definition or Rhino geometery.

More videos to come on surface milling and 5-axis milling techniques.

Team:
Parametric Modeling - Andrew Payne & Matthew Spremulli
CNC Milling - Greg Everett

Fabrication Tools:

Parametric Modeling Software - Grasshopper plugin for Rhino
CAM Manager - PADEeasy
CAM Controller - OSAI Controller
CNC Milling Machine - PADE spin-W 5 axis continuous CNC Work Center

Fabrication Shop:
Airport Railings & Stairs Co. Ltd. located in Mississauga Ontario Canada

Grasshopper G-Code Writer for Surface Milling

Posted on July 28, 2009 by Registered CommenterAOP in , | Comments3 Comments



In this video, we will walk through how to setup a Grasshopper definition that will write the G-code for surface milling on a 3-axis CNC milling machine.  When surface milling - the contouring engine is crucial.  For speed reasons, I found the C# contouring definition written by Giulio Piacentino works extremely well because it allows the user to specify a step distance (tool path offset).  After we have generated the contours (or tool paths) we can subdivide each curve, using the evaluate length component, to create a series of points which will guide the CNC mill head in order.   Because we now have data structures, we can weave formatted text strings that have been derived from the point data into a G-code that will work with the ShopBot CAM software.

As in the previous example, we have formatted our text strings to work with the opensource CAM software, Shopbot.  You can download a free version of the software here: http://www.shopbottools.com/controlsoftware.htm.

 You can also check out this video in HD after the jump.

Note: This video is for demonstration purposes only. Andrew Payne and LIFT architects will not be held responsible for any damages that might arise from using this method. Please consult your machine's operating manual before implementing this fabrication method.

Grasshopper G-Code Writer for 2D Shape Milling

Posted on July 28, 2009 by Registered CommenterAOP in , | Comments1 Comment

In this video, I will explain how to setup a Grasshopper definition that will write the G-code for 2D shape milling on a 3-axis milling machine.  G-codes are the codes that position the tool and do the actual work, as opposed to M-codes which manages the machine.  Actually, there are a whole host of different codes that can be written to control a CNC mill, however G-codes are what we are most interested in for this definition as it will allow us to streamline our fabrication process by sending the parametric data from Grasshopper directly to a CNC mill.

In this example I will be writing the tool path information for a 2D Vornoi Pattern generator, originally written by Sang Hoon Yoon.  You can find his vornoi diagram definition on his site www.sac3.blogspot.com.  This video explains how to use your data-structure (trees) to help weave together various text strings which control how the CNC mill head will operate.

I have formated the text strings to work with the open source ShopBot CAM software.  This software is excellent for many reason, not least of which is the fact that it's free and has a large online help community... much like Grasshopper.  It also allows the user to preview the cut even if their computer isn't connected to an actual CNC mill which can come in handy while testing out your cuts.  Syntactically, ShopBot part files are setup slightly differently from traditional G-code which harkens back to the days when cutting files were stored on punched tape and it's format was optimized for brevity.  You can find a lot of helpful resources on how to setup ShopBot part files in their Programming Handbook

You can check out this video in HD after the jump.

Note: This video is for demonstration purposes only.  Andrew Payne and LIFT architects will not be held responsible for any damages that might arise from using this method.  Please consult your machine's operating manual before implementing this fabrication method.

Waffle Structural System: Using Grasshopper to Output Structural Ribs to a Laser Cutter or CNC Mill

Posted on October 26, 2008 by Registered CommenterAOP in , | Comments25 Comments

Click to see larger imageI have been working on a definition for Rhino's Grasshopper plugin that would create a notched "waffle" structural system for any given surface.  With this definition, you can specify the number of struts in the X & Y axis as well as the strut depth and the notch thickness (or the strut material thickness).  The waffle system has a few components that define the strut labels and has a slider to control the label size to keep the model organized.  Finally, the definition orients the strut curves to the X-Y axis so that the curves can be easily output directly to a CNC mill or laser cutter. 

Also, if you are able to use this definition to create a waffle structure of your own (either laser cut or CNC milled), please email me some images and I will post the work on this website.  Good luck.

Source File:
Waffle Structural System.ghx (size: 789k - file updated on 08.11.10 to work with Grasshopper v0.5.0093 or higher)

Note: This software and its documents are in the public domain and are furnished "as is". The author, Andrew Payne, makes no warranty, expressed or implied, as to the usefulness of the software and documentation for any purpose. This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License. http://creativecommons.org/licenses/by-sa/3.0/us/

Lid of Lids Mockup

Posted on June 24, 2008 by Registered CommenterAOP in , , | Comments1 Comment

Our team finally decided to go forth with our second full scale mockup of the suspended mason jar ceiling and here are a few shots from this weekend's test.  I was pretty satisfied with our connection detail between the mason jar lid and the fishing line that we are using to suspended the lid from the peg board ceiling.  We were able to come up with a system that eliminates all knot tying by threading the fishing line through the back of an ear ring and sandwiching it between the ear ring back and the back side of one piece of a circular velcro strip.  It did take a little practice, but overall the system seems to work pretty efficiently.  The velcro also allows for some adjustability which will hopefully work in our favor once we begin final assembly. 

Lid_mockup_04.jpg

Lid_detail_03.jpg

Animaris Rhinoceros Mechanism

Posted on April 15, 2008 by Registered CommenterAOP in , , | Comments4 Comments


With a background in science from the University of Delft in Holland, Theo Jansen's kinetic sculptures inspire a sense of wonder at the complexity of nature.  For the past 10 years, he has explored the idea of making mechanisms that walk in the wind, ultimately generating a series of "beasts" that rome the beaches living out their own lives.  While there are a full series of sculptures, I found the Animaris Rhinoceros sculpture particularly interesting.  I decided that I would need to create an interactive digital model of the system to understand the mechanics behind the design.  The digital model uses Inverse Kinematics and Bones in 3D Studio Max to create the connections needed for the machine.  Essentially, each side of the model is rigged with Inverse Kinematic solvers and then parented to an invisible "Crank" in the middle.  By rotating the center crank (named Crank1) around the Y-axis, the system begins to "walk" forwards or backwards depending on the rotation of the crank.  Once the initial rig is created, it can be instanced to create the full system as shown in Mr. Jansens actual sculpture. 

Download Animaris Rhinoceros.zip (3D Studio Max 9 size: 39k)

Note: This software and its documents are in the public domain and are furnished "as is". The author, Andrew Payne, makes no warranty, expressed or implied, as to the usefulness of the software and documentation for any purpose. This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License. http://creativecommons.org/licenses/by-sa/3.0/us/

Johnny Chung Lee - Head Tracking and Interactive Displays

Posted on January 7, 2008 by Registered CommenterAOP in , , | Comments1 Comment
 

It's been a while since I have seen something that has truly changed the way I look at technology... But a few of the projects designed by Johnny Chung Lee, a Ph.D. graduate student at Carnegie Mellon's Human-Computer Interaction Institute, are quite remarkable in their ingenuity.  While many of his projects are applicable becuase of their use of products that are readily available, two projects of his stand above the rest.  If you haven't seen these yet, make sure to check out his demonstrations of "Head Tracking for Desktop VR Displays using the Wii Remote" and "Foldable Interactive Displays". 

Head Tracking for Desktop VR Displays and other Wii Projects
Projector-Based Location Discovery and Tracking with Foldable Displays
About Johnny Chung Lee

Tensegrity Wall

Posted on October 5, 2007 by Registered CommenterAOP in , , | Comments4 Comments

After a long time coming, I finally decided to continue my research on actuated tensegrity systems.  I had already created a fully rigged tensegrity module whose compression member's rotation was driven by the distance from the apex of the system to the midpoint.  This distance was wired to a slider in the 3D Max file, so the user can easily drive the system by the use of one simple device.  However, to complicate matters a little bit, I decided it would be more interesting to rig these modules up into a system, or a wall type structure where all the modules were connected and thus getting more displacement out of the design.  Through a little more math and a lot more time, I was able to create a 4x4 wall system that is fully controlled by the same slider that controls the vertical movement of an actuator inserted in the middle of each module (which would ultimately control the distance from the apex to the midpoint).  This system could be configured to work with a sensor so that the structure could change shape according to various environmental stimuli. 

Download Tensegrity Wall.zip

Note: This software and its documents are in the public domain and are furnished "as is". The author, Andrew Payne, makes no warranty, expressed or implied, as to the usefulness of the software and documentation for any purpose. This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License. http://creativecommons.org/licenses/by-sa/3.0/us/

Responsive Material / Responsive Structure

Posted on September 18, 2007 by Registered CommenterAOP in | CommentsPost a Comment

Responsive%20Material2.jpg

Make sure you take a look at the lecture given by Sean Hanna at the Subtle Technologies event held at Toronto University.  While he readily admits that the manipulation of individual molecules for the production of nano-scale materials is still out of the realm of reality, his focus has been to study micro-structures (at the scale of the millimeter instead of the nanometer) and genetic algorithms in order to create learning materials.  His research is readily applicable at other scales as well.   Click here to go to the lecture.  

Wine Bottle Wall

Posted on June 9, 2007 by Registered CommenterAOP in , , | Comments3 Comments

 Wine_module_01.jpg

Here is a model I've been working on to develop a wall system that could be digitally fabricated and used to store wine bottles in a unique way.  The module, seen on the right, was develped using the Sculpture Generator 1 by Carlos H. Sequin, at UC Berkeley.  The modules could be stacked and repeated to form a series of wine rack columns, or duplicated to form a unique wall system.

Page | 1 | 2 | Next 12 Entries