Monday, April 25, 2011

Controlling a Picoswitch with Arduino

I had a viewer of my Youtube channel request the code accompanying this video. I made this video a long time back because I wanted to trigger a battery-powered airsoft gun from my robot. The Picoswitch is a solid state relay that works with pulse width modulation, same as a standard hobby servo. What this means is, you can supply power to the switch, and a load, such as an electric motor and you can toggle off and on any device up to 1 Amp from a standard R/C radio or microcontroller. If you need more current flow, try Dimension Engineering's Battleswitch. I know, the code says servo, but treat it exactly the same and it works.
Here ya go!

// Controlling a servo position using a potentiometer (variable resistor)
// by Michal Rinott <http://people.interaction-ivrea.it/m.rinott>
#include <Servo.h>
Servo myservo; // create servo object to control a servo
int potpin = 0; // analog pin used to connect the potentiometer
int val; // variable to read the value from the analog pin
int pulse; // variable to show pulse width
void setup()
{
Serial.begin(9600); // begins serial communication with the computer
myservo.attach(12); // attaches the servo on pin 12 to the servo object
}
void loop()
{
val = analogRead(potpin); // reads the value of the potentiometer (value between 0 and 1023)
val = map(val, 0, 1023, 0, 179); // scale it to use it with the servo (value between 0 and 180)
pulse = map(val, 0, 179, 750, 2250); // get a pulse width for current pot position
myservo.write(val); // sets the servo position according to the scaled value
Serial.print("degrees ");
Serial.print(val);
Serial.print(" pulse" );
Serial.println(pulse);
delay(15); // waits for the servo to get there
}

Friday, April 22, 2011

New Humanoid

I have 16 servos, 4 x HSR-5990TG, 6 HS-7954SH, and 6 HS-645MG. Brains will be provided by a SolarBotics Freeduino and Rennbotics servo shield supporting 16 servos. Both will be stuffed into a Freeduino project box with 9V cell providing juice for the Freeduino and a Tenergy 6V 2000 mAh pack for the servos. Control will be via Arbotix commander gamepad over Xbee to the Freeduino.

Hardware will be lasercut, .063" 5052 aluminum and possibly nylon block for servo mounts. The leg design will be a 4 DOF PLM layout, with a servo in each of the hip and ankle tilt locations and one more servo in each of the hip and ankle lift positions. None in the knee area, this is where the parallel links will attach. I will reserve one more servo for the hip rotate if needed. The torso will be solidly mounted to the lower body, meaning no waist rotate. The head will have no pan or tilt either.
For the feet, I have these beautifully machined delrin feet from "Quantum" over on the Trossen Robotics forum.



They are perfectly smooth and rigid, and should provide the perfect balance between traction and glide I'm looking for.  :-)

Here is the head I plan on using. Its a gear shift knob found in the automotive aisle of my local bigbox store.



For this build, I plan to add some sensory for autonomous events. I will mount a Maxbotics EZ1 sonar, Sharp GP2D12 IR, and tilt sensors to automatically trigger getup sequences.

As for project name, I am still undecided. I was leaning toward something military sounding like Corporal Punishment or Major Malfunction, just not Sgt Slaughter (been done already). Any ideas?

Monday, April 18, 2011

Lightweight Kung Fu bouts

I had a bye in my first round. Second round I was up against Rob Farrell's Zot. Whew! I just didn't have the speed or mass to move that guy! So, that was it for Saturday. It was double elimination, so I was hoping to get some payback on maybe a more equally built bot. Turns out Sunday I was up against Boomer, an almost stock Bioloid Premium. That's more like it! Anyways, I think I was leading in points, and felt like the judges maybe were counting my reverse attacks as slips instead. Could be I just didn't understand the rules either, oh well.. But ultimately, what did me in was my own battery pack. I insured it was fully charged before proceeding to the ring, but it kept going into protect mode, probably from pulling too many amps. Never happened before. But not to take anything away from Mike. A fair win to a better opponent! Congrats!



365 days till RoboGames 2012!

Just came back from an amazing weekend at RoboGames in San Mateo, California. What a good time I had! Meeting interesting people and their projects, catching up with old friends and making some new ones I've only chatted with online before. I showed up with two robots hoping to compete in Mech Warfare and Lightweight Kung-Fu. Due to my own lack of preparation, Warchild was not able to be ready in time to qualify for M-W, but I was fully confident in Musa's ability to crack some metallic skulls in the kung-fu octagon! Rather than frantically scurrying to qualify, as in previous years, I decided to let it go, take a chill pill and just enjoy the weekend. Highlights of the weekend included meeting the RobotJapan team and their amazing humanoids, especially Shiba, Mike, from the I-Bioloid blog I check in on regularly, and Tony from Hitech RCD. I just love the camaraderie and cooperative spirit present at this event! So here's some random pics and video I took. LOOK OVER TO THE RIGHT-SIDE NAVIGATION BAR FOR THE LINK. ----------------->

Sunday, April 10, 2011

Less than a week to go!!!

OMG! I am up against the wall on Warchild's rebuild. The lower torso will be retained from last year with some lightening slots for weight savings. A total refab of the turret is necessary, due to the selection of dual tank guns over the single Defender used last year. The extra half panels required by this year's rule change won't make things easier. On top of that, I have to scrap last year's feet because they caught too much traction on the textured floor surface. My Visual C# control software doesn't work anymore for some reason and has to be totally rewritten. Four days to go and I am in full on panic mode now!
On the bright side, Musa is ready as can be for Kung Fu. I hope I fare well against some of the more experienced competitors in this division and more torque-ier robots being fielded.