Tuesday, 25 November 2008

User Auto Fan Prototype

After some work on creating the structure, the UAF has reached a usable prototype stage. In this stage, the fan rotates and moves a substantial amount of air and for demonstration purposes the servo motors can be controlled by the use of a potentiometer.




There are still obviously more development stages that UAF will have to go through before it becomes like the proposed design (not requiring direct user interaction, being a self-contained unit, etc.), however this prototype shows the potential for the project.

Thursday, 20 November 2008

Servo Motors with Arduino

Servo Motors are a kind of motor that can read its position, and turn to a position, rather than just 'run' until stopped. These are a good choice to include in my UAF project as the tools to move the fan.

The Arduino code that will control the motors is freely available on the internet...
/*
Two-servo control from an analog input

Moves two servos based on the value of one analog sensor,
in opposite directions.

The minimum (minPulse) and maxiumum (maxPuluse) values
will be different depending on your specific servo motor.
Ideally, it should be between 1 and 2 milliseconds, but in practice,
0.5 - 2.5 milliseconds works well for me.
Try different values to see what numbers are best for you.

by Tom Igoe
Created 28 Jan. 2006
Repurposed for Dual Servos by Carlyn Maw
24 Mar. 2006
*/

int servoPinL = 2; // Control pin for servo motor - L
int servoPinR = 3; // Control pin for servo motor - R
int minPulse = 500; // Minimum servo position
int maxPulse = 2000; // Maximum servo position
long adjustedAV = 0; // Analog value adjusted for determining pulse values
int pulseL = 0; // Amount to pulse the servoL
int pulseR = 0; // Amount to pulse the servoR
int delayValueMax = 200; // the 20 microsecond maxiumum pulse range for the servo
int delayValue = 200; // the actual value the code should wait, determined later

int analogValue = 0; // the value returned from the analog sensor
int analogPin = 0; // the analog pin that the sensor's on

void setup() {
pinMode(servoPinL, OUTPUT); // Set servo pins as an output pins
pinMode(servoPinR, OUTPUT);
pulseL = minPulse; // Set the motor position values to the minimum
pulseR = maxPulse;
}

void loop() {
analogValue = analogRead(analogPin); // read the analog input (0-1024)
adjustedAV = (analogValue / 10) * 19; // convert the analog value to a number
// between 0-2000 (difference between min and max)

pulseL = adjustedAV + minPulse; // set value for left motor
pulseR = maxPulse - adjustedAV; // and the inverse for the right

digitalWrite(servoPinL, HIGH); // Turn the L motor on
delayMicroseconds(pulseL); // Length of the pulse sets the motor position
digitalWrite(servoPinL, LOW); // Turn the L motor off

digitalWrite(servoPinR, HIGH); // Turn the R motor on
delayMicroseconds(pulseR); // Length of the pulse sets the motor position
digitalWrite(servoPinR, LOW); // Turn the R motor off

delayValue = (delayValueMax - pulseL) - pulseR; // determine how much time you have before the 20 ms is over...
delayMicroseconds(delayValue); // 20 millisecond delay is needed between pulses
// to keep the servos in sync
}


Code from: www.tigoe.net
I edited the code to represent the timing for my specific motors, so the electrical pulse that the servo motors use to move and read position never goes too high or too fast. Here is the result using a potentiometer as the user input (as a method for easy testing)...

Thursday, 13 November 2008

Fritzing and "Virtual Prototyping"


Image of Fritzing from: www.pixelsumo.com
"Fritzing is an open-source initiative to support designers and artists to take the step from physical prototyping to actual product." - www.fritzing.org
Specifically, Fritzing is being designed (is still in alpha stages) to prototype for Arduino-based PCBs (Printed Circuit Boards), and they compare it as a software metaphor to the electronic breadboard, which is designed to be a speedy prototyping base to 'mess' about with.

This kind of Electronic Design Automation software is designed for the Arduino, and is also Open Source much like Processing or the Arduino software. However, this kind of prototyping software is not a new thing...


Image of Eagle from: cadsoft.de

The immediate picture above shows screen-shots of Cadsoft's PCB prototyping software: "Eagle". This software is not primarily targeted at artists in the same way Fritzing is, and is also not focused on the Arduino (but any custom PCB), but still has a freeware version available.

Hidden Systems


Image and information from: www.pixelsumo.com

Above is a picture of the Tuttuki Bako, a Japanese toy that is a handheld system that involves a rather unusual method of interaction...



... as is obvious from the video and picture above, the user has to interact with just one finger placed inside the "virtual world", and interacts by the output on the screen.

In the context of how the system is just one part to the user, and the user only has one way to interact with the toy, it is a great example of how the reduction of parts to one whole object can 'make' the experience to a user or player.

Tuesday, 4 November 2008

Languages

I thought it would be a good idea to look at languages that have been noted as a good choice to work with the Arduino on computers.

Max/MSP

A Max/MSP "Patch"
dhardy.co.uk

Max/MSP is a visial object orientated programming interface that is highly extensible and well documented. Max/MSP uses pre-programmed patches and parameters to form "patches". These patches can scale to any size and can include other patches.

"Max/MSP/Jitter is three things:
  • Max, a graphical programming environment that provides user interface, timing, communications, and MIDI support
  • MSP, for real-time audio synthesis and DSP
  • Jitter, for video and matrix data processing"
I have had some experience with using the Arduino technology with Max/MSP coding and serial input, and the impression I got was that the possibilities are vast and the time-span of achieving ideas can be quite short given the extensive documentation on the function of Max/MSP.

Processing

Cover of a book on Processing
soup-du-jour.net


Processing is an open source programming language that is built on the successful language of Java. It is a language designed by visual artists to encourage visuals in computer programming.

"It is used by students, artists, designers, researchers, and hobbyists for learning, prototyping, and production. It is created to teach fundamentals of computer programming within a visual context and to serve as a software sketchbook and professional production tool. Processing is an alternative to proprietary software tools in the same domain.

Processing is free to download and available for GNU/Linux, Mac OS X, and Windows."

The website describes Processing as a language that is meant to be available to everyone, on any platform, for free, which are hard aspects to find among expensive licensed software usually associated with artists.