|
| Home - Art Installation - Workshop - Inspirations - Geeky Tech - Contact |
Complete HTML & Javascript code, CSS, Images & other files
Linksys WRTSL54GS wireless router info

The serial communication daemon program regularly queries all the motor controllers for their disc positions and the sonar sensors, using this protocol on the RS-485 network (text-only protocol spec), . It allows "clients" to request updates via UDP packets (text-only protocol spec), and it sends the updated status about 40 times per second. In theory, many "clients" could connect and each could control one or more discs. However, only the one server program has been written and it seems unlikely any other programs using the UDP protocol will ever be written.
Serial communication daemon source code
The server program implments all the behaviors of the system. It establishes UDP communication with the comm daemon, and listens for web broswers to make HTTP connections on port 80.
Each time the comm daemon provides new status, the server issues any speed changes necessary. HTTP requests that change the configutation are handled, as are request for static data (html, javascript, images, etc).
Server Program source code (named "client" for historical reasons)
The motor controller and sonar interface have code that waits for 2 byte times between the end of a message and when their transmitter is activated, so a bus conflict does not occur. The motor controller and sonar interface disable their transmitter 1/2 way through their stop bits (wouldn't it be nice if the 233 MHz 32-bit MIPS-based linksys router could do real-time tasks as well as a 12 MHz 8-bit 8051 chip!)
RS485 Transmitter Control Source Code

An interrupt routine that runs 2000 times per second makes the decision when each motor should take a half-step, and updates the position based on both sensors. Code running in the background continuously monitors the measured postion against the number of steps taken and automatically disables the motor when they diverge (assumed to be a participant touching the disc). The serial communication daemon is responsible for implementing the no-movement timeout to reactivate the motor.
The motor controller reports absolute position, but accepts only speed commands. The server program is responsible for sending speed settings at the appropriate time (relayed by the comm daemon) to acheive the desired positions.

Schematic for the controller board (green PCB portion)




Coupling the tiny back side shaft from the motor to the
shaft of the rotation sensor turned out to quite difficult.
This heatshrink tube slips. A second ridig coupler was designed
using plastic and set screws. However, the trade off is extra
drag (torque) on the motor if the shafts aren't aligned perfectly.

The TEAC motors have a shaft on both sides.

The motor, as seen in its natural habitat


The discs mount to a raised plastic platform which holds
the disc at the optimum height above the IR sensor.

This black stripe is drawn on the back side of the disc
by the artist, to mark the bottom of the art. When the amplifier
is properly calibrated, the sensor detects the difference between
the brown cardboard and black ink.

A simple pullup resistor turned out to be
inadaquete to reliably detect the stripe on the back
of each disc. Instead, this amplifer with adjustable
light/dark current threshold was necessary.

Schematic for the IR amplifier board. Two of
these are on each board, sharing the power supply and bias resistors

Parallax
PING Ultrasonic Sensor product info
The sonar interface board listens for a command on the RS-485 network to indicate when the ping should be sent. It then gives the pulse to the Parallax sensor (via the PNP transistor connected to P1.7), and then begins listening for the response pulse that indicates the sound was reflected back. When that pulse is received via INT0, the elapsed time is stored and may be queried via the RS-485.
Ultrasonic Motion Sensor Interface Source Code

Pin P1.7 sends the "begin ping" pulse, and INT0 receives the
echo response.

