Come meet the LA Biohackers and find out more about some of the biotech projects going on in their lab!
Speakers to include...
Keoni Gandall Keoni will be talking about how he is bootstrapping a synthetic bacteria using the common laboratory bacteria Bacillus subtilus. Currently there is no easy method for creating a new organism even if you have the ability to synthesize a new genome from scratch. A method Keoni is working on allows for a new genome to first be integrated into a host genome, then split off during cell division to create two daughter cells - 1 with the host genome and 1 with the new genome. This method will have great use in synthetic biology.
Sophia Hewitt
Sophia will be talking about her research on using epigallocatechin-3-gallate (EGCG), a compound found in green tea as an anti-tumor treatment. In some types of cancer the cancer cells repair their telomeres so the cells effectively don't age, allowing the tumor to grow perpetually. Sophia is testing whether EGCG can inhibit this telomere repair mechanism and allow for treated cells to age. She is usingthe model organism called Tetrahymena thermophila which is an excellent test bed for studies on telomere length.
Cory Tobin
Cory will be talking about his work on creating plants that make their own fertilizer. He is studying an extremophile bacteria that makes it's own ammonia (fertilizer) using water and nitrogen gas from the atmosphere. By understanding the mechanism this bacteria uses, he hopes to create plants and algae capable of synthesizing their own ammonia, negating the need to apply fertilizer to the soil.
The best theoretical analysis of inverse kinetics for the Lynxmotion AL5D robotic arm can be found here.
Furthermore, someone has already coded up the AL5D arm inverse kinetics code for Arduino. I've ported this to Python and a quick test shows it appears to be sane (with some hack tweaks to make up for different initial angles of my servos), but I need to do more extensive testing. I suspect the initial angles of my servos are different than most typical AL5D applications as I've set everything up to maximize reach for moving chess pieces, so I'll have to calibrate those angles into the code.
I extended my Arm controller Python program to be able to map and save the locations of chess board positions.
So here is a video of the "Mechanical Turk" arm moving a chess piece across the board using forward kinetics:
And here is the result of trying to move to another square:
Oops, I crashed into the board! So I think I may have a go at calculating the inverse kinetics to avoid the arm from crashing into the board or (more likely) neighboring chess pieces. The arm has to move the end effectors pretty much straight up a few inches to clear all the pieces, then it needs to move above all the pieces until it is directly above the destination square, then it needs to move directly vertically down.
I could probably heuristically do this with forward kinematics (for example, move up and down first by just using the elbow or such), but if I can get the inverse kinematics working OK it would give me a lot more control over the system.
***** Sunday, June 9, 2013 ***** 1:00pm to 3:00pm ***** Crash Space ***** 10526 Venice Blvd. ***** Culver City, CA 90232 ***** (Directions) ***** No cover charge / donations to venue welcome
Come to Crash Space and learn about the hackersapce and some of their exciting projects:
I added a new end effector to "The Turk" arm. The Lynxmotion Little Grip has screw holes for 4-40 bolts, so I added two pieces of copper pipe hanger that just happened to be the right thickness.
The same Tkinter/Python manual robotic arm control program I used on my Mac also worked fine on my Raspberry Pi with the AL5D robotic arm controlled by the Pololu Maestro Micro servo controller. I just had to change the device filename to "/dev/ttyACM0".
On the Mac side, I logged in with "ssh -X ..." and now any X Windows you open up on the Pi will come through to your Mac. I should note that to open up a general X session on the Pi, I use "lxsession", which seems to work better for me than "startx". Of course I have XQuartz installed on my Mac already.
I chose the Lynxmotion AL5D robotic arm to provide a reasonable reach at an affordable price. Moving plastic chess pieces does not require much torque, so I was able to avoid using the very capable but very expensive Dynamixel servos and instead used standard cheap RC servos. Like many folks, I purchased only the AL5D hardware kit from Lynxmotion, and purchased the RC servos from the cheapest price on Amazon.
Building the AL5D took about four hours altogether. My only serous complaint is that while the hardware is segregated to some extent in heat-sealed plastic bags, it still is often difficult for a novice to figure out which pieces of hardware is which (for example, 2-56 x .250" steel machine screw vs. #2 x .250" steel tapping screw vs. 3mm x 8mm steel screw). It would be useful if every heat-sealed bag section had a piece of paper identifying the hardware in that section and perhaps which part of the instructions the hardware is associated with.
Also my HS-805BB servo (that I purchased from somewhere else besides Lynxmotion) came with a horn that was not quite compatible with the servo bracket. It turns out that Lynxmotion does appear to pack a compatible horn in the kit, but somehow I missed that, so I drilled new holes in the existing horn. Everything worked out anyway.
All of the controllers from Lynxmotion were overpriced or difficult to interface with a Raspberry Pi, so I chose the Pololu Micro Maestro 6-channel RC controller. I have had great experiences with Pololu servo controllers in the past. The Micro Maestro connects to a host via USB, and costs ~$20. It also can provide some analog or digital input as well as serial output, so it is very function-packed for the price.
Two issues with the Pololu Micro Maestro - first, to use it with a Mac or Linux, you need to run the Maestro Control Center on a PC, and under the "Serial Settings" tab you should set the Serial mode to "USB Dual Port". Then under "Channel Settings" you should open up the "Min" and "Max" settings for the arm servos to 500µs and 2500µs to assure you can move the Hitec servos a full 180 degrees.
If you are looking for info regarding inverse kinematics of the AL5D, see this blog entry. Also great source code for full control of the Pololu Micro Maestro can be found here.
Finally, I wrote my first Tkinter program in Python to provide a manual GUI for the arm servo controls on a Mac:
Source code below:
# for more Pololu Micro Maestro interface code
# see http://afflator.ontopoeticmachines.org/post/9def setpos(cha,uS):
"""maestro uses is 0.25us increments
"""
pos=int(uS)
pos=pos*4
low=pos&0x7f
high=pos>>7#print low,high# cmd, chan, low, high s.write(chr(0x84)+chr(cha)+chr(low)+chr(high))
def setpos0(uS):
setpos(0,uS)
def setpos1(uS):
setpos(1,uS)
def setpos2(uS):
setpos(2,uS)
def setpos3(uS):
setpos(3,uS)
def setpos4(uS):
setpos(4,uS)
from Tkinter import*import serial
s=serial.Serial()
# this /dev/tty.usbmodem device is for my particular system
# do ls /dev/tty.usbmodem* to figure out yours
# in Dual USB mode, lower number is the command port
s.port="/dev/tty.usbmodem00049671"
s.baudrate=115200
s.timeout=1
s.open()
master = Tk()
w0 = Scale(master,command=setpos0,from_=500,to=2500,length=500)
w0.grid(row=0,column=0)
w0.set(1500)
w1 = Scale(master,command=setpos1,from_=500,to=2500,length=500)
w1.grid(row=0,column=1)
w1.set(1500)
w2 = Scale(master,command=setpos2,from_=500,to=2500,length=500)
w2.grid(row=0,column=2)
w2.set(1500)
w3 = Scale(master,command=setpos3,from_=500,to=2500,length=500)
w3.grid(row=0,column=3)
w3.set(2000)
w4 = Scale(master,command=setpos4,from_=500,to=2500,length=500)
w4.grid(row=0,column=4)
w4.set(1500)
#note that the initial servo values may differ slightly between arms
setpos(0,1500)
setpos(1,1500)
setpos(2,1500)
setpos(3,2000)
setpos(4,1500)
master.mainloop()
I was able to directly track where the players of my first AWS Mechanical Turk chess game were from since I was using an external web site to serve up the HITs. I used FreeGeoIP to convert the IP addresses to Lat/Long pairs, and then used BatchGeo to map them.
After some problems with my Raspberry Pi SD card blowing up, I was able to rebuild (and back up) the system, and had the first full AWS Mechanical Turk mediated chess game played out. As you can see, it was a pretty long game, complete with pawn promotion. The actual game time was about three days.
I paid $0.05 per move. I suspect that in the future I should 1) pay a bonus for checkmate to get the game moving a bit quicker and 2) see if I can block workers who play for one color to also play for the other. But glad to see that everything worked, and there was actually checkmate!
Here are the results:
+-----------------+ 8 | Q . . Q . . . . | 7 | . . . . . . . P | 6 | K . . . . . . . | 5 | P . . . . . . . | 4 | P . . . . . . P | 3 | . . . . . K . . | 2 | . . . . . . . . | 1 | . . . . . . . . | +-----------------+ A B C D E F G H
I started my first "real" game of chess on AWS Mechanical Turk last night, using a Raspberry Pi as a server, and here is the progress after 10 moves:
I'm paying $0.15 per move, and getting just below 1 move per hour. At some point I will have to investigate the relationship between payout and move speed. Two workers have submitted two moves each, the other moves have been from different workers.
Also the robot arm to move the chess pieces is coming along as well:
My one problem is that I purchased a Hitec HS-805BB from someone else than Lynxmotion, and it appears to come with a different servo horn than the AL5D arm was expecting, so I have to figure out how to obtain the arm-compatible servo horn.
I am in Hong Kong on business, and got a chance to visit Dim Sum Labs near Sheung Wan.
The key to enter the space is an Octopus Card. Pretty much everyone in Hong Kong has one because it is the stored value card for the mass transit system, but has expanded to be used in point-of-sale at convenience stores, fast food restaurants, and parking meters. Some can be linked to a person and used for taking school attendance or library loans. An Octopus Card reader can be purchased for about $20 USD.
The space is mainly one large room. Greeting you is the "Spy Cat" which meows at you when you are detected with the PIR sensor. It also shows on the D.S.L. web site whether someone is in the space or not:
One of the neat projects there is the online Arduino. This is an effort to make Arduino hacking easy for beginners. Members can access a Raspberry Pi over the Internet, and then go into the Arduino IDE running on it, and can program the Arduino to do things with a dot matrix LED display:
Results of the remote hacking can be seen using a webcam on the Pi:
Of course they also have a 3D printer, CNC project, drill press, lathe, etc:
D.S.L. is on the top floor (14th floor!) of a building, so they have access to a roof-top deck space. While not very large, it gives you a neat view of the neighborhood. Here is the look down from the D.S.L. deck:
I got to meet several nice folks at D.S.L. including Alexander List who is working on open spectrum issues, and Katia Vega, the programmer behind a project called "Blinkifier" she did with Tricia Flanagan. This combined skin conductive ink and conductive eyeliner to allow blinks to be translated into LED displays on the headpiece using an Arduino:
I had to listen to the pronunciation of an ancient Greek word recently, and came upon CWSpeak an online text-to-speech portal that does a whole bunch of languages (even ancient Greek and Lojban).
It took a while for me to sift through all the examples to simplify the concept down to what I needed. I need to validate chess moves based on the current chess board before the submission of the move (or else people on AWS Turk will submit lots of badly formed moves). "validate_move.py" is a Python CGI program that reads the QUERY_STRING to get the move and then sends back a "t" if the move is good or "f" if it is false.
<html><head><script>var OK2Submit =false;
function validateMove()
{
OK2Submit =false;
document.getElementById("moveDiv").innerHTML="<i>Validating move...</i>";
var xmlhttp;
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4&& xmlhttp.status==200)
{
var moveGood=xmlhttp.responseText;
if(moveGood.charAt(0)=="t"){
OK2Submit=true;
document.getElementById("moveDiv").innerHTML='<i>That is a valid move, you may submit it</i><br><input type="submit" value="Submit">';
}
else {
document.getElementById("moveDiv").innerHTML="<i>Not a valid move!</i>";
}
}
}
xmlhttp.open("GET","validate_move.py?"+document.forms["myForm"]["move"].value,true);
xmlhttp.send();
returnfalse;
}
</script></head><body><form name="myForm" action="action.py" onsubmit="return OK2Submit" method="post">
Enter Move: <input type="text" name="move" onchange="validateMove();"><br><div id="moveDiv"></div><br></form></body></html>
1) I had a hard time getting people to respond to Mechanical Turk HITs with proper FIDE chess algebra notation. So I am considering using a Javascript chess board as a front end - perhaps this one, together with an ExternalQuestion, with an example external HTML here.
Some of these could be altered to provide longer reach. A typical chessboard is 12-18 inches (30cm to 46cm), although I did find this 10.5-inch (26.7cm)board as well as this 11-inch (28cm) set. There is a 5-inch (12.7cm) set but I am concerned that positioning to a 0.5-inch square might be tough, plus I may have to remove the magnets from the pieces in this magnetic set. This affordable 7.5-inch (19cm) set may be a good compromise between being small and not being insanely small.
Update: Here is a Lynxmotion AL5C playing chess...OK, I bet an AL5D could do it as well!