Introduction: Low Cost Hobby Servo XY Table
(Note, we have a newer version of this project at this Instructable)
You can try this project out live at the site
The Challenge
So, the challenge is taking a hobby servo and getting 2-3 feet of linear motion out of it. ServoCity is working on servo linear actuators, but we'd prefer lower power, lower cost, and longer reach that they currently offer (though new ones may be pending). We also built a basic SCARA type arrangement with 3" lazy susans, servos, and counter weights. This works OK, but the workspace was limited, and due to the polar approach with hobby servos, the resolution is uneven - higher nearer the servos. This may not be a huge problem, but the approach shown here yields the same precision over the entire workspace. We could also consider a hybrid - using one rotational arm with a liner slider on it - the math would be easy in that it would use polar coordinates directly. We could also reverse the two - use on linear slider and add a rotating arm to it. A project for another day!
Using Hobby Servos
With a Hobby Servo, you typically get just 90 or 180 degrees of rotation, so the trick is getting that to work over a longer span - 2-3 feet. We could modify a servo for continuous rotation, but then you lose the positioning capability and we'd like to keep the internal PID circuitry and potentiometer approach. If you use the internal potentiometer and add a big servo horn, you could get a wider range of travel. With a circular horn, the distance traveled is Pi * Diameter of the horn / 2 - that last divide by two is to account for the max 180 degree of travel (we'll get into that later). So, for a 2' travel, you'd need a servo horn with a diameter of over 15"! We could use that approach with a lazy susan type of setup, but the momentum in moving that much material puts a huge mechanical strain on the servos (the same issue we had with the SCARA prototype). Another approach is to gear up the output, so you get more motion on the output. We didn't dig into this, and there may be issues with the power required to move those gears, and in addition, using gears is a bit ticker mechanically - we came up with a much simpler approach.
So, for our system, we pulled the potentiometer out of the servo case, and replaced it with a 10-turn potentiometer. So, right away, you can multiply the distance traveled by 10, so for the above case, it takes the horn diameter for a 2' travel from 15" to 1.5" - much more reasonable!
In terms of coupling the output we could drive a threaded shaft with a follower nut (ACME threading seems to be preferred). This appears to be the most common drive mechanism for homebrew XY Tables - due to it's power and precision. It does result in slower travel, though, and again, a lot of gearing to get the potentiometer to move at the right speed to cover the span of travel.
What we opted for was a very simple timing belt approach where the servo drives a timing belt pulley, and the 10-turn potentiometer is connected directly to the shaft. With this very simple arrangement, then, we get 2-3' of travel in a few seconds with no complex mechanics. You could scale this approach up by gearing down the drive or potentiometer to the limits of the mechanics of a hobby servo.
Step 1: Materials
Timing Belt Pulleys and Belts
Timing belts are strong, flexible, and lose almost no movement to slippage. We used XL timing belts with 0.2" pitch - 77" long (and 3/8" wide to match the pulleys). This seems to work fine - we thought about testing the MXL belts with a 0.08" pitch, but didn't see the need since there was no noticeable play in the system for our purposes, and there was a wider belt selection. We used a fairly large timing belt pulley since that has a big impact on the final distance (the circumference) - it's about 1.5" in diameter - the largest we easily found with the 1/4" shaft size we were using. With a bigger pulley, the range would increase, but the system is ultimately limited by the precision of the potentiometer, so a much bigger belt may not work as well - certainly less positioning precision. We used 1/4" shafts throughout for simplicity - the same as the ten-turn potentiometer shaft.
We got our timing belts and pulleys from McMaster-Carr (but they are available elsewhere):
part # 6484K454 Trapezoidal Tooth Neoprene Timing Belt .200" Pitch, Trade Sz 770XL, 77" Outer Circle, 3/8" Wide
part # 57105K21 Acetal Pulley for XL-Series Timing-Belt for 1/4" & 3/8" Belt Width, 1.63" OD, 22 Teeth
Bearings and Collars
For the timing belt pulley bearings, make sure to get the extended inner ring ones so they don't rub against the shaft collars. You could also use regular ones with small washers on the inner ring. We used flanged ones to make mounting easier.
We got our timing belts and pulleys from McMaster-Carr (but they are available elsewhere):
part # 6462K12 Type 303 SS Set Screw Shaft Collar 1/4" Bore, 1/2" Outside Diameter, 9/32" Width
part # 57155K337 Miniature Precision SS Ball Bearing - ABEC-5 Flanged Shield, Extended Inner Ring, .25" ID, .5" OD
After building these, we noticed that Home Depot has ball bearings for patio doors, and these may work almost as well at a much lower price. Rather than mounting the bearing in a hole, you could put a couple bolts right through the outer plastic ring and bolt it right to an L bracket.
Potentiometer
Most servos use a 5K potentiometer, so we got one of those. Note that these are 10 turn potentiometers per the intro. The 1/4" shaft couplers for the potentiometer to the drive shaft connection are available at many places (McMaster-Carr, ServoCity, and Jameco all have them). The potentiometer could be connected to the shaft on the other side of the timing belt pulley from the servo, but in our case we extended it to the same side of the other pulley just as a simple means to keep the mechanics on one side of the device.
We got our potentiometers at Jameco: part # 183548 - they have a tolerance of +/- 5%. Amazon has them too.
We also saw some at Digi-Key with +/- 0.2% - part # M-22E10-0502K-ND - we may try these at some point to see if they have any finer resolution.
Note: with heavy use on the site, the potentiometers started wearing and freezing up, so we have ordered ETI Systems MH22B series hybrid potentiometers (Mouser #882-MH22B-10-5K). Hybrid potentiometers use a layer of conductive plastic over the wire windings, so they are potentially more accurate and they last a lot longer - 10 million turns vs. 1 million turns for the wirewound ones. It's almost definite that the issue is in the slight wobble of the shafts, so we used a piece of plastic tubing to connect them rather than the rigid shaft couplers - that has worked for years now.
Servos and Servo Hubs
We started with fairly standard servos - Hitec HS-425BBs (57 oz. in. and 0.16 sec to 60 degrees @6v). In testing, we had a standard servo driving a shorter timing belt, and got about 1.5' of movement in about 4 seconds. Not bad, and the servo was powerful enough to move it. But we opted for more speed, and upgraded to higher speed servos - Hitec HS-6965HBs (111 oz. in, and 0.08 sec to 60 degrees @6v). The newer ones were twice as fast, and much more powerful as a bonus, though that wasn't required. They are also digital, so they are programmable and all, but they do whine a lot more due to the higher frequency motor control.
(June 2009) See notes on the servo and last page, but for the X axis, we are currently using a
Pololu 3A Motor Controller with Feedback and a 12VDC 250RPM DC Gearhead Motor. The board from Pololu works just like a servo control board, and we already have the external potentiometer.
To connect the servos to the shafts, we used Servo to Shaft Couplers from ServoCity (http://www.servocity.com/html/servo_to_shaft_couplers.html) - part # HSA250. As far as we know, those couplers are fairly unique to Servo City.
Drawer Glides and Misc Hardware
Mechanically, this is a simple system - we used wood and various metals in the prototypes, and they all worked fine.
For the linear motion, we used Accuride full extension drawer glides from Home Depot. We bolted pairs of them (top to bottom) to give a longer travel. You can buy longer drawer glides, but they get expensive fast, so bolting two together works well at a low cost. One disadvantage with drawer glides is that they extend out past the machine when in use. Also, with two shorter glides screwed together, they tend to dip slightly when fully extended. We used 24" ones for the parallel glides and 20" ones for the single track. Both were fine since we had about 38" of travel. We may switch to linear bearings and shafts at some point if we can find lower cost ones.
We got the 1/4" steel shaft (zinc plated), the 1x4 and 1x6 wood and various aluminum and steel angles from Home Depot. All of the small bolts used in the project were #6 size, and the wood was screwed with drywall screws and pan head screws. We also used some electrical conduit boxes for the plastic shape (see below), but this is totally optional.
Step 2: Timing Belt Pulley Assemblies
The first thing we did was build the timing belt pulley assemblies. There are a lot of possible ways to do this, but basically, we used a collar-bearing-bracket-pulley-bracket-bearing-collar setup. We made several metal L brackets - just drilled a 1/2" hole in them for the ball bearings to fit in to. Then we saw some electrical conduit boxes at Home Depot and used them to make U shaped bracket. Both approaches are fine. It helps to have some shorter 1/4 rods to test these out - we used 2.5" pieces for ours. The final assembly has one 3', 1/4" rod connecting the two sides to prevent racking.
Step 3: X Stage Frame and Drawer Glides
We built the frame from 1x4 and 1x6 pine - we used the fancy grade to limit the amount of warping etc. The length of the 1x6s was 40" to allow for the length of the belt plus a little extra room. The 1x4s were 38" long, but it looks like they could be 40" too. Maybe someday... Screw the 1x4s on top of the 1x6s with a couple drywall screws in each corner. If the screws get in the way when mounting the pulleys later, you can move them. The 1x6s are on top to allow the most room for the mechanics. Make sure to make the frame nice and square - measuring the diagonals works pretty well. Once the frame was complete, we mounted the timing belt pulleys and timing belts. We used a timing belt on the opposite side to help prevent racking as it moves, and it turned out that we only needed one shaft to go across, though we had originally used a long shaft on both ends.
Once we had that working and tested (OK, we cheated and did step 6 first :-)), we added the two drawer glide combos. As described in Step 1, each one was two drawer glides attached top to bottom to give a longer extension with less expensive glides. The ones we had allowed you to remove the top glide (of three), making mounting much easier. We used 6-32 screws and cut off any excess with a Dremel tool.
Step 4: Y Stage
To the top of the two drawer glides, mount a small filler block (we used some scrap 1" thick wood, which allowed the Y stage to clear the X stage belt), then the Y stage board - we used the 1x4 for that since a thinner board gives you a bit more work space. When mounting the filler blocks, it was handy that the top slide had a plastic release catch so we could pull the glide off, attach the block, then slide ti back in again.
Mount two more timing belt pulleys and a timing belt on this stage, leaving room for the drawer glides on one side.
Step 5: Clamp the Timing Belts to the Stages
To attach the X stage, we used an aluminum plate (about 1"x3") under the Y stage board with two screws on each side of the timing belt. We drilled two holes in the X stage to get our 3" driver bit in there - put in two screws, then slide the assembly up a bit and add two more screws. For the Y stage, we made two aluminum plates (one about 1"x3", and the other about 1"x1") to connect the belt to the stage. In each case, you are just trying to clamp (or pinch) the belt to the mechanism.
Step 6: Modify the Servos for Continuous Rotation and Remove the Potentiometer
We won't go into too much detail on hacking a servo for continuous rotation - there are plenty of sites on the web, and Instructables too. Some servos are easier, and if it looks tricky, ServoCity sells modified servos with the potentiometer outside already. For the HS-6965HBs, we pulled the gears, then popped the motor down by wedging a tiny screwdriver between the motor gear and the housing to force it down. We then removed the pot and pulled the wires out through a small hole we drilled in the case. We have no idea if this is the proper way to do it. The HS-425BBs we originally used were even easier since the circuit board comes right out.
In both cases, we also cut off the limiting tab on the main gear. We used a Dremel tool for this - but we had to clean it well after that.
(June 2009) Note that for the Y axis (the one on top), the servo motor is working fine, but for the X axis, we have had some issues. So the current system is using a
Pololu 3A Motor Controller with Feedback and a 12VDC 250RPM DC Gearhead Motor. The board from Pololu works just like a servo control board, and we already have the external potentiometer. The motor is much more robust, and has been working well. One minor issue is that the PID algorithm sometimes overshoots a bit, but it's not too much, and the board allows you to set the PID constants - just need time for fiddling. :-) You can also use a servo board and adapt it for the same use - we'll look into that sometime too.
Step 7: Mount the Servos and Potentiometers, and Calibrate
We made L brackets from aluminum to hold the 10 turn potentiometers and servos in place. At this point, we were just hacking out brackets that fit each situation. They don't need to be very strong - just want to reduce any movement, and they aren't under a lot of pressure. In all cases, using fewer screws and keeping it loose is better since the shaft will not be perfect, and the servos and potentiometer actually move around a bit. We didn't try it (yet), but on some XY tables, we have seen some plastic or rubber hose used to couple the motors to the shaft to allow for movement.
Note: we did eventually have issues with the potentiometers, and have replaced them with longer-life hybrid ones and also have now used (2-3" pieces of) plastic tubing to mount them to the shaft. In addition, we moved the shaft that connects the two sides to the other side, and now have the X axis potentiometer sharing a short shaft with the X axis servo. (see last picture)
Leave the potentiometer and servo couplers loose, move the stage to approximately the center of travel and drive the servos to the center position (using a servo tester, an R/C transmitter or serial servo control board like the Lynxmotion SSC-32). Then turn the potentiometer until the servo stops, looking for the point where the servo slows down and switches direction. Once you find that point, then lock the set screws down. Note that servo testers and R/C radios may go 90 degrees, while SSCs usually can drive servos to 180 degrees. This is important to get the full range of motion - will use more of the potentiometer range.
We didn't worry too much about having it exactly in the middle since we are driving them by computer and needed to set the servo commands for the min and max position anyway.
Step 8: Conclusions, Notes, Room for Improvement
That's about it. For TeleToyland, we used some PHP scripts to command the servos via an Internet to serial connection to the SSC-32 board, which the servos plugged right in to. If there is enough interest, we may do a separate Instructable on that setup.
Both axes have issues with not quite centering due to the potentiometers - causing the the digital servos to whine a lot at rest. For occasional use, it's probably fine. For TeleToyland, we used a separate servo powered switch to just turn them off when not in use. We may get a digital servo programmer to see if narrowing the dead band will help. Higher quality potentiometers may help, but we may also be reaching a practical resolution limit in this approach.
(June 2009) For the linear slides, we used drawer glides. These are working fine so far, but they do stick out when the XY table is in the home position. So, we are thinking about using 16mm Linear glides from www.vxb.com - that seems like the lowest cost ones around.
(June 2009) Note that for the Y axis (the one on top), the servo motor is working fine, but for the X axis, we have had some issues. So the current system is using a
Pololu 3A Motor Controller with Feedback and a 12VDC 250RPM DC Gearhead Motor. The board from Pololu works just like a servo control board, and we already have the external potentiometer. The motor is much more robust, and has been working well. One minor issue is that the PID algorithm sometimes overshoots a bit, but it's not too much, and the board allows you to set the PID constants - just need time for fiddling. :-) You can also use a servo board and adapt it for the same use - we'll look into that sometime too.
Other Uses
This is an interesting approach, and might make an excellent arm configuration for a mobile robot. The Leaf Project members are interested in arms, and this could be used for part of it. You could even add a counterweight on the belt opposite the end effector so that the arm would balance automatically - as the hand moves out, the counter-weight would move back. Adding a second linear system behind it would allow the weight of the object picked up to be balanced too.
The following sites provided some of the inspiration for this project:
Easy to Build Desk Top 3 Axis CNC Milling Machine Tom McWire
Improving Servo Positioning Accuracy David P. Anderson
ServoCity Servo Power Gearboxes
We didn't use this, but it looks interesting - a timing belt pulley for MXL belts (0.08" pitch) for Hitec servos
We found this after building ours - uses gears in a similar way, and the drawer glides are similar:
Autonomous Foosball Table.
You can drive this project live at TeleToyland
.
81 Comments
6 years ago
Hallo! I'm really interested in you project but the hard part for all of Us I think is how to manage all the software part of the project.
The missing steps are:
1) Ok I can also drive some RC servos with an Arduino also but how to make them to do a cooperative work? How to say: If you hit a rock in the sand while you are moving in pure X direction, the rock will slow you but the servo will keep up and you'll draw a perfect straight line in the end. What if you where going on 45 degrees and you hit against an X direction oriented straight obstacle? The Y run will be strongly slowed down by the forntal impact but the X run will not be slowed down at all !!! In the end will you obtain a perfect 45 degrees line? I think... NOP!
Sooo what do you manage those kind of issues?
2) How to translate a vectorial image (or a stl file) into commands to be sent to my Servos?
In conclusion: This project is to be developed a lot! Will you share your work? Thank you for the inspiration bro! :-)
Reply 6 years ago
I think most CNC type applications assume there are no obstacles in the workspace - avoiding those would clearly change the drawing. There are numerous vector conversion programs - maybe you can go from an intermediate format like gcode?
6 years ago
This is a Great Instructable Sir! Your detailed explanation and the use of Drawer glides is a nice alternative to using expensive LM bearings. Truly a nice idea!
I too have made a small CNC machine and have used LM bearings, mounted with simple pipe clamps(2 hole clamps) to keep the cost down. Do check it out.
Here is the link :
https://www.instructables.com/id/CNC-Arduino-GRBL-...
Thanks a lot for giving your time.
Reply 6 years ago
Nice project. Yes, those linear bearings can be expensive, so a lot of projects use v-groove rollers now. The T-Slot version I also published is another approach, albeit more expensive. It is a lot more relaible, though.
7 years ago
Take a look at my build.. Z-axis not yet complete..https://youtu.be/YEhp0V-Ah9A
Reply 7 years ago
Nice!
Reply 7 years ago
Thank you
8 years ago on Introduction
How do you coordinate the movements of the the two motors so one of them doesn't arrive at the destination earlier or later than the other..?
Reply 8 years ago on Introduction
You divide up the full move into move increments or time increments like 100 steps or 2 seconds etc. - those can be any number based on how fast the motors can move and how far you need to go.
Then you step through those and calculate the X & Y position for the current step in the full path.
The sample code in this Indestructible has a simple version, based on time increments: https://www.instructables.com/id/Internet-Arduino-Controlled-T-Slot-XY-Table/
This one has similar code: https://www.instructables.com/id/Table-Sized-Arduino-Joystick-Controlled-T-Slot-XY-/
For stepper motors, you often use the longest dimension in steps.
Reply 8 years ago on Introduction
Looks a little complicated, but thanks!
8 years ago on Introduction
I saw this jig for routers, https://m.youtube.com/watch?v=ulblySFElo4 then i realized it could be controllable by servos,
Reply 8 years ago on Introduction
Could be - not sure how much torque is required for that setup. DC motors would work. It's a cool design, and relatively low cost, though! Lot's of fabricating special parts, though. Check out the T-Slot version of this project - very easy to make.
9 years ago on Introduction
Thank
you for this great tutorial! Thought I might share this website I came
accross which I found very useful:http://www.directindustry.com/industrial-manufacturer/xy-stage-76555.html
10 years ago on Introduction
This is an awesome project, thanks for sharing.
10 years ago on Introduction
Hey Carl amazing, i have an idea, and this will be very useful,
is there a way you can attach a powerful led light on the pointer end, and have it fade in and out?
the idea i have is to capture a lens flare.
as in do your camera move (in the computer) do a 2d track on the image of the light source.(track the cgi light source)
export the 2d tack coordinates to the XY table,
Have a camera pointing the other end. once the light is in position take an picture on the camera.
As to simulate depth/ occlusion the light source need to fade in intensity.
Problem i have, i have no idea how to program this for the XY table to read. any ideas?
Reply 10 years ago on Introduction
Cool idea! Take a look at the T-Slot version of this project - there is a link to it in the intro. Since that one uses an Arduino, you can drive an LED with a transistor - just like the side lighting that project uses, but an LED instead of the Z-Axis servo. Maybe try to get an LED working and dimming with an Arduino first to see how it goes since you are learning? I have another instructable for permanent holiday LED lighting that shows how to dim an LED strip - same thing for an individual LED, and maybe even easier. There are a number of examples of a single LED dimming with an Arduino on the web. Good Luck!
10 years ago on Introduction
Thanks - looking forward to seeing how it goes since I am curious about using stepper motors too.
10 years ago on Introduction
I really enjoyed trying your sand CNC app--thanks! I am building my CNC to use drawer slides and NEMA17 steppers.
13 years ago on Step 1
Just had a thought; you could mark lines on the belt and use a light sensor to detect the light reflected. This method gives no wear at all and the parts are cheap. to get the markings accurate im sure you could use a contact transfer to mark the lines on.
Reply 12 years ago on Introduction
could also use a rotary encoder at the shaft, gray code or something, it'd be like, the reverse of a stepper motor, unless the shaft jumped a whole rotation, you'd have an absolute position... same technique, but without worrying the belt will get the ultra tiny dots rubbed off. there's an ible for a jog shuttle made from a vcr head, the same printout dots and encoder would work perfectly.