Saturday, April 20, 2013

Turret Gun Robot - iPhone Control

The turret gun robot is up and running in a "teleoperated" mode using an iPhone as the controller.  The built in accelerometer on the iPhone has been mapped to control the drive motor powers.  As noted before, the OSC connection seems to work fine as long as the bug involving the motor power is screened out.  The Processing interface reports the sensor data (two encoders, three IR distance sensors, and a 6DOF gyro/accelerometer), shows the motor powers derived from the tilt of the iPhone, shows the gun status as on/off, and shows the pan/tilt of the turret by both printing the values and mapping them to a target bulls-eye   When Processing is set to 3D mode, the gyro values are mapped to a rotating cube which shows the orientation of the robot.  Since the robot can only rotate around a single axis, the cube rotates around the x-axis.  There are two movies below which show the processing sketch in 2D mode, then in 3D mode.

Processing in 2D Mode.

Processing in 3D mode:  Watch the rotating rectangle.
This project has been a long time in the making so I am very proud to have gotten this far.  The robot is pretty dumb for the amount of sensors it has, so I'll have to work on making it smarter.

Here is the link to the Arduino Code.  Note that I turned off the stall checks as they were giving false positive too often.  I will have to work on figuring out why that is.

Sunday, April 14, 2013

Useless Box with No Button

This is another useless box, but this time I incorporated a "No Button" which my parents had given me for X-mas.  The button just says "No" in one of many different ways when it is pressed.  I figured this would be easy to rig with the existing momentary switch on the inside of the box so that it would say "No" when the box was turned on and as it was turning itself off.

Two battery systems power the motor and the No Button.
The speaker is in the top right corner.
Whenever integrating ideas like this, one has to make sure of compatibility   For instance, the GM3 motor is running off of 6V, but the No Button runs off of 3V.  Should those two be integrated or left separate?  In this case it was much easier to leave them separated.  A voltage divider was something I considered, but the voltage will fluctuate as the GM3 motor turns and also as the No Button circuit draws current.  In addition, the voltage divider would be constantly shunting current from the batteries unless a separate on/off switch was installed, which seemed to defeat the purpose of the useless box.

Here you can see the two momentary switches
which are both tripped by the wooden arm.
Another compatibility question was whether the same momentary switch could be used to drive both the GM3 and the No Button.  This would be very convenient, but it turned out not to work.  Instead when the motor was running, the No Button generated static which persisted even after the momentary switch was opened again.  Perhaps some capacitance and some IC effects on frequency?   Anyhow, after brainstorming, I realized that it would be very easy to add a second momentary switch right next to the first so that the arm would trip both switches at the same time.  In this way, the No Button is completely isolated electrically from the motor circuit, and it works great.

Monday, April 8, 2013

Useless Box

I've been wanting to make a useless box since I saw several postings on Make Magazine's website.  I decided to make two for an auction for a choir that I sing in called the Northwest Chamber Chorus.  I based the design completely off one found on Thingiverse, using the author's .stl files to generate gcode for our Replicator 1.  Thanks so much jamesarm97!!!  The only thing I modified was the arm (dxf file here).  I made one in white and one in black.

Parts List:

This is how to wire the DPDT
switch.  Looking at the bottom.
The wiring that makes this work is fascinating and really clever.  The DPDT reverses the polarity of the battery that the motor sees when the switch is thrown.  In addition, one leg of the circuit has a momentary switch in series with the motor.  The momentary switch is soldered so that it is normally closed, but opens when the switch is pressed.

Picture taken from Pombo on
In the "all off" position shown at right, the momentary switch is pressed so no current flows (top illustration).  When the DPDT switch is thrown, the motor is now in series with the battery and swings the arm counterclockwise (middle illustration).   As soon as the arm begins to move, the momentary switch is now unclicked and so it is shorted.  

When the arm  hits the DPDT switch and pushes it "off", the motor is now in series with the battery but with the opposite polarity, so it begins to rotate in a clockwise direction.  This happens until it contacts the momentary switch, which then opens the circuit.  This loop repeats every time the power button is pressed.

Once all the parts were printed, it was basically just a matter of assembly.  I had to try several designs for the arm until I found one which worked, but it was not very difficult.