Entries in Interactive (10)

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/

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/

Stereoscopic Processing

Posted on March 7, 2007 by Registered CommenterAOP in , , | Comments2 Comments

Processing_007.jpg

Processing_008.jpg

According to Josh Nimoy, The Processing environment is the easiest Java compiler / interactive graphics and multimedia programming environment known to man. The system can be used to produce locally run pieces, as well as web-embeddable Java applets.  After doing a little more research on the latest version of Processing, I came across one of the source codes for a drawing applet created by Theo Calvin, who based his code on an example put forth by Jeffery Tarbell.   Where I played a part in this research was taking taking the script and adding a few lines of code in order to create a Stereoscopic Image that would give an illusion of surface "depth" when looking at these drawings through 3D glasses.  Each drawing can be generated in a matter of seconds.

Adaptive Tensegrity

Posted on February 21, 2007 by Registered CommenterAOP in , | Comments3 Comments


Tesegrity_004diagram.jpg

This is a digital model that I created after reading Tristan d'Estree Sterk's essay on actuated tensegrity systems.  I've rigged the system to work just like his actuated tensegrity system, so that as the actuator in the middle contracts, the tension members become more rigid, thus making the entire system stronger.  The actuated system is one way to create a responsive tensegrity system that can adapt to changing environmental conditions to make a "learning" structure... however you could eliminate the actuator by making the tension members able to expand and contract, much like a muscle.  I plan on persuing this line of thought for a future skyscraper, but as yet, is still in a hypothetical stage. 

Download Tensegrity Module.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/

the[n]projects

thenprojects_001.jpg

This is my entry for the 2005 Miami Biennial Future Possibilies architecture competition where I placed as a semi-finalist.  The premise behind the entry is that it was a series of explorations on the idea of the network... So for that I had to define exactly what a network is, which to me has three intrinsic properties: 1) Scale 2) Protocols (the way the network behaves) and 3) Time.  So, I created a matrix that would isolate each of these three properties and allow me to combine them in different ways to generate new projects... Since the matrix had 10 slots for each category, you could invariably have up to 3,628,800 different combinations, thus a lot of different network explorations.  Becuase the focus of the project was based on the idea of the network, I wanted to create a flash interface that would complement the concept, and have a non-linear "network" navigation system.  I'll let you check it out, and play around with the interface and also check out the work, but notice that the different nodes have set attractions, so that as you drag certain rings around the page, the other "like" nodes begin to pull nearer to it, so that they begin over time to collapse into one complete project.  Enjoy!  Click here for the link: http://www.thenprojects.com

Tensegrity Tower v1.0

Posted on February 15, 2007 by Registered CommenterAOP in , | Comments1 Comment

Tensegrity_003.jpg

Who knew you could have so much fun with a few wood dowels and a little elastic cord.  I created this as a first attempt to figure out how exactly tensegrity structures get assembled and "tuned" via adjusting the elastic cords so that each tension member has the same amount of tension as the others, thus keeping the structure at equilibrium.  My next response will hopefully incorporate a responsive system by making the elastic cords out of electropieziolastic materials so that each member can contract or expand via electrical current, thus having a tensegrity system that could adapt to different situations. 

Kinematic Pavilion for Transient Passengers

Bus Stop_002.jpg


This was a exploration in embedded Inverse Kinematic systems.  Each plywood panel has a IK system with 3 nodes embedded into it's surface, so that as each node of the bone structure moves, the panels begin to change into various facetted forms.  I then rigged each node's X, Y, and Z values up to sliders in 3D Max so that I could specifically calibrate each node's movement and be able to track that through time.  The animation frames on the right show a few still images of the process of erecting this small pavilion that would be utilized by transient passengers.