Entries Tagged 'Gadgets' ↓

Convert a servo into a high-torque motor

Small robots have been household gadgets for decades, but until recently they’ve been little more than toys. With a limited range of motion and almost no interaction with their environment, a task as simple as moving from one point to another without bumping into something was too advanced for these early bots.

In the last few years, however, these “toys” have become far more sophisticated. Lifelike humanoid bowlers, dinosaurs with personalities, and robotic dogs that recognize spoken commands are now mainstream products. Even the old-fashioned interlocking plastic brick has gone high-tech with motors, sensors, and programmable circuits.

The miniaturization of these circuits and sensors has certainly played the biggest role in making small robots increasingly intelligent and capable, but a lesser-known supporting player is the humble servomechanism. More commonly known as a servo, it’s essentially an electric motor combined with positional feedback. The servo knows how far it has turned and is able to respond to electronic commands such as: “Turn 60° left of center.” This feature makes the servo ideal for arm and leg joints, sensor scanners, and other robotic accouterments.

With the increasing demand for robot kits and toys, the performance and diversity of servos has been growing. There are now jumbo-sized servos (about 7 centimeters long), micro servos (some as small as 3 grams), servos with metal gears (for extra-heavy loads), and all kinds of torques, speeds, and packagings. There’s even a SERVO Magazine that covers the burgeoning community of robot-building, servo-hacking hobbyists.

But like any electronic device, servos have limitations. They can’t drive a robot wheel, for example, because servos don’t rotate continuously like a normal motor. Instead, to keep their design and construction simple, they allow rotation only through 180° or so (although some advanced models can do up to 360°). Providing both the position control of a servo and the speed control of a motor would make the servo’s electronics and signaling too complex. After all, if a robot’s design calls for a wheel or other continuously rotating device, a traditional motor can always do the job.

Ironically, though, thanks to improving technology and falling prices, servos are probably the cheapest type of geared motor on the market, especially after factoring in the speed control circuitry (an H-bridge) that comes built-in with every servo. In fact, servos often provide higher power in a more compact package than comparably priced motors. The only catch is that a servo is still a servo: It can’t spin continuously the way a normal motor can.

Luckily, there’s a relatively easy fix for this problem. Because servos are basically a motor with a feedback loop, simply disconnecting the feedback opens the loop. Without feedback to tell the servo it has reached a desired position, it will just keep on turning. The servo effectively becomes a continuously rotating motor that just happens to have a speed control circuit and gearbox conveniently attached to it.

Although this hack is a great way to save money—just convert old unused servos instead of buying new motors—the full conversion process isn’t quite so simple. There are additional complications to deal with, such as the cylindrical stop on the output gear that prevents full rotation. The feedback circuit that detects the angle of rotation (usually a simple potentiometer) also has to be anchored to a neutral position so that it doesn’t accidentally generate feedback signals, causing the servo to turn spontaneously.

A variety of tutorials explain how to get around these problems (search for “modify servo continuous rotation”), and some manufacturers even sell servos pre-modified for continuous rotation. Unfortunately, after starting a project for a two-wheeled self-balancing robot (like a mini-Segway), I consulted a variety of these tutorials and found them inadequate. None addressed the issues of a metal-geared servo, which I happened to be using, nor did they explain the difference between driving the motor with a traditional H-bridge circuit rather than a servo controller.

After struggling through these obstacles, I was finally able to complete the modifications, but not without some confusion and setbacks. To save others from the same kind of trouble, I’ve written the following tutorial on how to modify a servo for continuous rotation. While similar to existing tutorials of this kind, it goes into a bit more detail than most and, given the wide variety of servos available, having another perspective on the process couldn’t hurt.

This tutorial deals specifically with the standard-sized GWS S03T servo, a rather high-end model with metal gears, dual ball bearings, and an extra-high gear ratio that provides almost double the torque of a typical servo. The metal gears improve strength, while the ball bearings ensure smoother rotation and better centering. Note that the addition of these features does not alter the basic design of the servo, which is remarkably similar across manufacturers and models, so the advice offered in this tutorial should be widely applicable.

The first step is to remove whatever horn or arm happens to be installed on the servo. (The S03T ships from the factory with a standard wheel attached.)

Next, remove the body screws. Be careful not to strip the grooves off the screw heads.

After removing the body screws, pull off the top of the case to expose the gears.

Now remove the output gear and the top center gear, taking care not to lose any of the tiny parts. In this particular servo, removing the output gear should expose one of the two ball bearings. (The other should have come off when removing the top of the case and is most likely still lodged inside of it, underneath the opening.)

Turn the output gear over and you should see a plastic slot. This piece connects the potentiometer to the geartrain so that every turn of the servo also turns the potentiometer, thus providing positional feedback. This is how the servo knows when it has reached the desired angle and should stop turning.

The goal here is to transform the servo into a motor, so the feedback needs to be disabled. To do so, simply remove the plastic slot; it should pop right off.

Now, turn the output gear right-side up and note the small cylindrical stop. It mechanically prevents continuous rotation of servo, so it has to be removed. If this gear were made of plastic, the stop could be removed rather easily using a tiny saw, wire cutters, or perhaps even fine-grained sand paper.

With a metal gear, however, removal is more difficult. After many attempts at yanking the stop out of its socket, I eventually had to grind it clean off using a rotary tool. (Be careful not to grind too far into the gear itself. You can see in the picture that I accidentally shaved off part of the gear shaft’s base.)

Note that other tutorials describe an additional step at this point: Replacing the feedback potentiometer with a voltage divider, composed of two resistors, to fool the servo circuitry into thinking the potentiometer is still connected and fixed at the center position. This feat is rather tricky, though, because the exact values for the resistors must be determined by calibrating the servo at its center position and then measuring the resistance across the old potentiometer. An alternative approach, one that works on this servo and probably many others as well, is to manually rotate the potentiometer shaft to its center position, then simply glue it in place! This will achieve the same effect of convincing the servo that it hasn’t reached the requested angle and will thus continue to rotate.

After removing the gear stop, disconnecting the feedback potentiometer, and fixing it in place (either electrically with a voltage divider or mechanically with glue), the modifications are complete. You can now reassemble the servo and send it the usual PWM signals from a servo controller. These signals formerly told the gears which angle to move to; now they control how fast the gears should rotate and in which direction.

But the story does not end here. The original servo motor driver circuits are still in the loop, and this could cause problems. The electronics in a servo are usually designed for the sporadic, off-and-on operation of normal servo usage, not the continuous spinning of a motor. They might not be able to handle the constant activity and could eventually burn out. Also, the controllers that generate PWM signals for a servo typically have higher latency than a standard DC motor driver, especially if it’s a serial servo controller that has to perform the extra step of translating RS-232 signals.

So what’s the solution? Simply rip out all of the electronics from the servo, thereby converting it to a simple geared motor. You will then have to drive it with a standard H-bridge motor controller rather than a servo controller, but you will likely gain faster response time and minimize the chances of early burn-out.

To begin the lobotomy, pry off the bottom of the servo’s case.

Next, turn the servo upside down and note the location of its circuitry.

Cut away the hard tacky glue that holds the circuitry in place, then carefully pull it out.

Now cut off the electronics to complete the lobotomy. (The black piece shown in the picture connects the potentiometer to the output gear. It fell out when removing the electronics, but since potentiometer feedback isn’t needed after this conversion, it can be discarded.)

At this point, you have a choice to make. You can either splice the wires together, or you can remove the motor’s wires entirely. The first option is simpler but might be unreliable depending on how you splice the wires. The latter option requires more work, but it gives you the option of using your own wires, and you can solder them for a more permanent hold. I chose to remove the motor’s wires and attach the original external servo wires directly to the motor. The first step was to scrape off the hard tacky glue off the terminals, then use a soldering iron to melt the solder and remove the wires.

Now you can solder the external servo wires—or any other wires, depending on your needs—directly to the motor. (My soldering job in this picture was quite messy; don’t think I’m trying to pass this off as a good example of a soldered joint!)

Finally, reassemble the servo case and put the gears back on. (Don’t forget to return the two ball bearings to their original locations.) You now have a servo-sized motor with a high-torque metal geartrain in a nice tidy package!

Here’s a short video of the motor in action.

[flashvideo file=http://vocaro.com/trevor/blog/wp-content/uploads/2009/06/servo.mp4 width=450 height=430 /]

Thanks to Adam Borrell for his helpful advice that made this tutorial possible.

Treo 700p revisited

Back in May, I covered the Treo 700p announcement, declaring it a worthy replacement for my current handheld, the Treo 650. I had always intended to upgrade, but I couldn’t justify the expense until recently: Last month, my service contract with Sprint expired (making me eligible for a discount on the Treo), and my wife’s cheap Nokia 6225 finally bit the dust. Solution? I got a new 700p; my wife got my old 650.

Treo 650 and Treo 700P

The Treo 650 (left) and Treo 700p (right)

Now that I’ve actually had a chance to use the Treo 700p, I can offer a more thorough review. First, the cons:

  • I thought cell phones were getting smaller and sleeker, but the Treo 700p is just as thick and chunky as the model it replaces. After eighteen months, you’d think Palm’s hardware engineers could slim their flagship product just a little bit. Instead, the Treo remains (unofficially) the world’s fattest cell phone.
  • The Menu key, a rather frequently pressed button, has been moved. It’s no longer found on the middle-right, which was a perfectly natural location for thumb usage when holding the phone in your left hand (and still very accessible when holding the phone in your right). Instead, it is now located all the way down on the lower right. Not only does this make the Menu key nearly impossible to push when holding the phone in your right hand, it requires an awkward reach of the thumb when held in the left hand. Why, Palm, why?
  • The 700p has two phone buttons: a green button to answer calls and (just below it) a Phone hard key to switch to the dial pad. There’s no reason for this redundancy: On the 650, a single Phone button worked perfectly fine for both functions. Worse, the extra button takes up space that could otherwise be used for the Menu key (see above).
  • With its faster EV-DO radio, the Treo is now able to play streaming video. It’s a nice idea, but I found the quality to be terrible. Instead of spending $10/month on Sprint TV, I’d rather just use my video iPod.
  • Sprint now requires the purchase of a $40/month “Phone As Modem” plan if you want to use the Treo to give your laptop wireless Internet access. (The 650 only required the Vision plan at $15/month.) Luckily, a hack is available that disables the need for PAM. Full details are in my updated step-by-step guide for Bluetooth dial-up networking.

And now the pros:

  • Speaking of Bluetooth DUN, this feature had to be enabled and disabled manually on the 650. It was a tedious process of switching to the Bluetooth preferences, turning on DUN, then getting a warning message about Bluetooth devices not working when DUN is enabled. On the 700p, this entire process is automatic. DUN enables and disables itself on demand, so there are no warning messages to deal with.
  • The keyboard has a better feel. The keys are slightly bigger and easier to push.
  • Internet access is noticeably faster. Although certainly not “broadband-like” as Sprint claims, the speed is a big improvement over the 650. In terms of raw performance, the 650 is like having a wireless dial-up connection, while the 700p is more like ISDN (somewhere between dial-up and broadband). Raw speed for downloads is about 10 KB/s on the 650 and at least 20 KB/s on the 700p, although there’s still an awful lot of latency when surfing on the 700p. Still, net access on the 650 was sometimes painful, but on the 700p it’s usually acceptable. A case in point: The Internet access at home temporarily went down last week, so I used the 700p’s DUN feature as a backup. After a few minutes, I almost forgot I wasn’t on Wi-Fi anymore!
  • My favorite new feature in the 700p is one that I haven’t seen mentioned anywhere: It now charges directly from a USB port! So, instead of carrying yet another AC adapter with me when I travel, the same USB cable that I use to sync my Treo with my laptop can also be used to charge it.

That’s four pros and five cons. As you can see, I’m not quite as thrilled about the 700p as I was back in May, at least not as an upgrade from the 650. Given that the operating system, processor, and screen haven’t changed at all, and the form factor is almost the same (and worse in some ways), it’s hard to justify the cost. The only substantial improvements are the EV-DO radio and the ability to charge from USB. Keep that in mind if you’re a 650 user looking to upgrade to the Treo 700p.

A bowling robot helps me choose a career

Nate Anderson wrote an excellent article for Ars Technica about the recently released version 2 of the Robosapien. This humanoid robot is just a toy, but it’s supposedly one of the most advanced toys ever. After all, the manufacturer claims that the Robosapien V2 is a “highly evolved robotic fusion of technology and personality, combining fluid biomechanical motion with a multi-sensory, interactive humanoid personality.”

That’s quite a statement! But how does it compare with reality? The answer can be found in one of Nate’s videos. Here, Robosapien demonstrates a new ability: bowling.

ROBOSAPIEN BOWLING
(turn your sound up)
Copyright © Ars Technica

[flashvideo file=http://vocaro.com/trevor/blog/wp-content/uploads/2009/06/robosapien_bowling.mp4 width=450 height=338 /]

Wow-wee! (Sarcasm.)

Yes, I realize Robosapien is just a toy, but I think the video perfectly illustrates the state of robotics today. There’s an enormous disconnect between the kind of robot we want to build:

Data from Star Trek

…and the kind that’s actually available to us:

Robosapien Bowling

In other words, the field of robotics is wide open. There’s so much work to do, so much more we’ve yet to accomplish! In fact, the robotics industry looks so compelling and full of promise that I’m seriously considering making a career of it. I’m convinced this century will come to be known as The Robotics Age, and I want to be ready for it! In fact, I’m already finding myself focusing on robotics as the major “motivating example” for my doctoral thesis.

Who knows? Maybe one day I’ll learn enough to create a robot that can actually bowl…

How to extract GPS coordinates from TomTom Navigator 5

TomTom Navigator 5 is a marvelous piece of software that can turn a PDA into a GPS navigation system. At $180, it’s somewhat expensive, but if you already have a PDA and get a cheap GPS receiver, you can end up saving hundreds of dollars over traditional stand-alone navigators.

For a few months now, I’ve been using it with my Treo 650, which means in addition to making calls, tracking finances, playing games, and surfing the web, my little smartphone keeps me from getting lost, too! I no longer have to ask for directions or look them up on the Internet; I just hop in the car, give Navigator an address, and it tells me exactly where to turn.

One of the more useful features in Navigator is that when you arrive at an interesting location, you can save your current GPS coordinates as a “Favorite.” You can then return to your Favorite at a later date without having to give Navigator an address. This feature is especially useful for remote locations that might not have an actual street address to begin with.

For instance, on a trip to South Dakota last week, my wife and I stayed at my parents’ cabin, which happens to be pretty deep in the woods, so I marked its location in Navigator as a Favorite. It wasn’t that I was worried about finding my way back; instead, I wanted to remember the coordinates of the cabin so that I could easily look them up in Google Earth when I returned home.

When I got back, I discovered that extracting those GPS coordinates was anything but easy. The Navigator 5 software won’t display the coordinates of a Favorite, and it doesn’t offer any documented way of uploading a Favorite to a computer. That meant I had to find an undocumented way.

After scouring numerous discussion boards and various websites, I finally cobbled together enough information on how to extract the GPS coordinates of a Favorite from TomTom Navigator 5. To save others from the trouble I went through, I’m posting a step-by-step guide below.

  1. Convert the Favorite into a Point of Interest (POI).
  1. Go to Change Preferences, then Manage POI, and choose Add POI Category.
  2. Type a name for the new Favorites category. (“Favorites” sounds like a good choice.)
  3. Choose a marker.
  4. Choose Add POI, then select the Favorites category.
  5. Choose Favorite and select the Favorite you want to convert to a POI.

Manage POI

  1. Transfer the POI file to your computer. The easiest way to do this is with the FileZ utility.
  1. Launch FileZ, then view the contents of the external card.
  2. There should be a directory there called region-Map, where region is the map you are currently using (e.g., “Plains”).
  3. Open that directory by tapping on the little triangle.
  4. Look for a file ending with “OV2” and having the same name as the POI category you created in the previous step (e.g., “Favorites.ov2”).
  5. Transfer this file to your computer. The easiest way to do this is to tap the file to select it, then tap the Send button and choose the Bluetooth option. This will shoot the file through the air onto your computer (assuming, of course, that your computer supports Bluetooth, as all good computers do). If not, you can choose the VersaMail option to email yourself the file, or use any other means at your disposal.

FileZ

  1. Extract the contents of the POI file. The next step is to convert the OV2 file from its original binary form into something that mere mortals can read. The easiest way to do this is at the GPS Visualizer website, which provides a convenient front-end for the GPSBabel software.
  1. Go to the GPSBabel section of the GPS Visualizer website.
  2. For the input file format, choose “TomTom POI file”.
  3. For the output file format, choose “Textual Output”.
  4. Select the file (e.g., Favorites.ov2) that you transferred to your computer in the previous step.
  5. Click the “Convert the file” button.

GPS Visualizer

That’s it! You should now see a list of your Favorites. The first column is the name of the Favorite; the second and third columns are its longitude and latitude. (The fourth column in parentheses is the location in UTM coordinates.) For example:

Cabin   N44 58.663   W103 35.017   (12T 617600 4890373)

Now that you know the coordinates of your Favorite, you can use them any way you wish. For instance, you can copy and paste them directly into Google Earth’s search box, and it will immediately fly you there.

Google Earth

Treo 700p Announced

The Treo 650 has been my constant companion for the past year-and-half. (Come to think of it, it’s with me more than my wife is!) It’s my cell phone, my calendar and to-do list manager, it gives me turn-by-turn driving directions and Internet access wherever I go, and it even trounces me at chess. But that doesn’t mean I don’t want something better. The rumor mill has said for many months now that someday Palm would release a new and improved smartphone, the Treo 700p. Well, today is that day.

Treo 700p

Looking at the specs, this new Treo is mostly identical to my old 650:

  • Same screen (320×320 pixels)
  • Same processor (312MHz Intel)
  • Same operating system (Palm OS 5.4)
  • Still no Wi-Fi support (a lot of people complain about this, but I’ve never understood the need for Wi-Fi on the Treo)

But there are some welcome differences:

  • Four times as much memory (128 MB vs. 32 MB), although supposedly only 60 MB are available to the user
  • Slightly better Bluetooth (version 1.2 vs. 1.1), which should mean slightly faster speeds and fewer interference problems. This will be nice to have when syncing and when using the Treo for dial-up networking.
  • And speaking of dial-up networking, the 700p has a 1xEV-DO radio instead of the old 1xRTT, which means Internet access should be a lot faster. (This is probably the single biggest difference between the 700p and the 650.)
  • Higher-resolution camera (1.3 megapixels vs. 0.3 megapixels), although this doesn’t matter to me since I always use a real camera for taking pictures
  • Slightly different form factor (but identical to the previously released 700w). I like the bigger buttons and slightly modified layout, but I’m not sure about the squarish-looking keys.
  • Built-in voice memo application (not sure whether I’ll use this)

All in all, there’s enough here to get me to upgrade, especially considering the improved Internet access speed. (It’s so nice when you’re stuck in a hotel room and you can connect your laptop to the net just by pushing a few keys on your phone.)My wife will now get my Treo 650 as a hand-me-down. Now, don’t complain; her old phone was a low-end Nokia candybar model with no Bluetooth support. With the 650, she’ll finally be able to use our wireless headset and avoid those neck cramps she gets during long calls.