Here’s how to modify a servo for continuous rotation. There are many ways to do this, in this brief video I’m explaining how to do it in a way that is:
1) reversible,
2) doable by people who don’t want to mess with a soldering iron.
This is very handy if you live somewhere servos aren’t easy to come by, so you have to make do with a few which means you’ll probably go back and forth; I’m also showing you how to undo the changes and get your servo back.
http://www.youtube.com/watch?v=caKvJL72BTs Part 1 (How to do)
http://www.youtube.com/watch?v=EWs5CB4cLkI Part 2 (How to undo)
After seeing the excellent tutorial on Instructables on how to connect a serial cable to a G1 phone, I decided to do some followup work on that. I will post my own instructable on how to make your own serial port level shfter later — in the meantime, here’s a little treat: a 1.51 (Cupcake) kernel that lets you actually USE the serial port.
After unlocking your phone and downloading the Cupcake firmware or one of its variants (Cyanogen, JesusFreke and so on), you can try this kernel out by using fastboot (if you don’t know what that is, find an unlocking guide — you will after that!), as follows:
fastboot boot serialport_cupcake
This will let you use /dev/ttyMSM2 as a serial port. I’ve already hooked up a picaxe and servo to it, let’s see what you do
given the compass, accelerometer and GPS in the g1 phone the navigational applications are obvious…
If you want the technical discussion, I’ve contributed to a thread here. There’s also a config file if you want to build your own.
UPDATE:
Here’s the boot image you can use to flash your gphone with the serial port enabled: you can use fastboot to load the kernel without having to do so at every boot.
Get your phone into fastboot then use
fastboot flash:raw boot kernel_cupcake_serialport kernel_ramdisk_standard
to restore, use
fastboot flash:raw boot kernel_cupcake_standard kernel_ramdisk_standard
… especially when you have to contend with the limitations of whatever little microcontroller you’re working with; a lot of micros don’t have trig functions or only have sin/cos/tan. Atan2 is a fundamental function in navigation (it lets you turn two pairs of coordinates, for example where you are and where you’re going, into a heading, for example which way to turn how to get there) but if it’s there it tends to be slow as most microcontrollers don’t have lookup tables for it. You can do Taylor expansion, but it’s very slow — and on microcontrollers that can only do integer math precision is lost very quickly.
With this in mind, I had to come up with ways to approximate atan2 quickly and precisely enough to drive or sail by.
http://spirit-plumber.com/portfolio/math/fastatan2.htm
You can use this formula with a microcontroller that can handle 32 bit floating point numbers, such as the Parallax Propeller. If you’re limited to an even smaller system (say, a Basic Stamp or Picaxe or PIC micro) here’s the 16 bit integer version, accurate to 1 degree in most cases.
http://spirit-plumber.com/portfolio/math/fastatan2_integer.htm
Why the emphasis on using as few divisions as possible? Because micros generally have to do “long division in their head” by means of repeated subtraction; division generally takes long compared to other operations.