Step 7: Motors & Potentiometers

There are a lot of options for motors.  In the previous project, we used hacked high power hobby servos.  These work well for the Y axis since there is not that much mass to move.  For the X axis, we switched to a DC Gearhead motor, which has been very reliable.

Stepper Motors

We tried using stepper motors and the ones we used were OK, but slightly under-powered for this application (for the X axis) - they were 1.2 amp ones from Pololu. Pololu also has a low-cost stepper driver carrier board that can work with them. It worked well for the Y axis, but a higher power stepper would be better for the the X axis since that 1x3 t-slot etc. is a lot of mass to move for the size of stepper motor we tried.  It did work, though - just skipped a few steps now and then, until we added some acceleration to the stepper commands.  So, that approach will surely work with the proper tuning of acceleration and size of motor.  You'd need something like an Arduino to drive them, though (that's what we did), to make the steps.  Also, you may need to add some limit switches - a bigger issue for the TeleToyland Sandbox since we would want to automatically home the robot with each sequence since it runs un-attended.  All doable.  Those parts together cost about $100 (steppers are ~$18, drivers are ~$13, and Arduino Uno is ~$30).

Encoders + DC Motors

We also tried using motors with encoders and a RoboClaw driver board.  That also works, but the board provides PID for velocity and not position, so it wasn't as precise for this type of application as we'd hoped.  They have been great for some other robot projects, though.  You can definitely get more precise (expensive) position based drivers.  We won't go into this too much - it's well worn material in CNC forums.  As with the steppers, motors with encoders, would also need some limit switches for our application.

Potentiometers + DC Motors

In the end, we decided to use the Pololu JRK 21v3 motor controllers ($50), with motors from Lynxmotion (GHM-16 -$22) - you can get similar ones elsewhere - they are 12v 200RPM gearhead motors with 6mm shafts (nicely close to the 1/4" shafts we are using).  The nice thing about this design is that you can choose any kind of motors you would like.

Other speeds would work fine too.  At 200RPM (3.33RPS) and 6.66 revolutions covering 29.25" on the X axis with the pulleys we used, that's about 10-15 inches per second travel, depending on the ramp up and down time etc.  The full transit time is 2-3 seconds and is approximately 400 divided by the motor RPM (6.66 rotations / RPM / 60 seconds per minute).

The motors are attached to the 1/4" shaft collars.  Since the motors have a 6mm shaft, it's pretty close.  To keep the motors from spinning, we loosely attached them with some plastic tubing to allow the motors to move around, which they do a lot.  We used 3/6" inside diameter x 5/16" outside diameter tubing.

An alternate mounting approach is to make brackets for the motors from some scrap aluminum (we used 1" wide by 1/6" thick), and used flexible shaft couplings.  See the pictures for both mounting techniques.  These brackets were 4" long and folded to 90 degrees at the 2.5" point along the length.  Both mounting approaches worked fine for our application, though the flexible shaft couplers are a bit tighter for CNC type applications.

As with the previous project, we used 10-turn potentiometers. They are 5K ohms like those used in hobby servos. With the JRK, we were able to try a few brands to see how they did, and the two that we tested seemed pretty similar. The ETI MH22B series ones are almost $100 now (they were less when we got them), and Bourns 3540 series are around $20. We've seen others at around $10, but have not tested them thoroughly. We got the ETI MH22B series ones before when we were concerned about the lifetime - they are rated at 10 million turns, while most of the others are at 1-2 million. We had an issue before with the pot failing, but in retrospect, that was due to the fixed mechanical mounting, and the short piece of plastic tubing connecting the potentiometers to the shafts fixes that issue, so the less expensive potentiometers should be fine.  So, get the less expensive ones and save some money.

For the two we tested, they both showed the full range and detail on the JRK - 0 to 4095 steps, and we could get them to move in one-unit steps, though for many locations, the value would oscillate by one unit. Over the 29.25" travel of the X axis, we got abut 2678 units (pre-calibration) of movement (since it's ~6.66 turns of the timing belt pulley - less than the full 10-turn range), so the precision is theoretically 0.01". If you assume we get half that with the occasional one unit oscillation, it would be around 0.02" (1339 units).  In practice, it's probably not that precise.

An interesting comparison: The stepper motor we tried has 1.8 degree full steps, so at about 6.66 revolutions, that's 1332 steps - about the same as the approach we are using. Microstepping would theoretically get higher precision, but we are not sure what the limits are on the mechanics etc.

For the Potentiometers, we made some brackets from some scrap 1" wide aluminum (1/6" thick). To prevent wear on the potentiometer bearings, we used some 3/16" ID x 5/16 OD plastic tubing to connect them to the shafts.  See the pictures for the bracket spacing.

We eventually added pipe clamps on the potentiometer side of things - one on the potentiometer and one on the shaft.  With the ramping up and down of the speed, we thought they wold not be necessary, but we did notice some slip over time.

Here's a sample video of a stepper motor on the Y Axis.  The X Axis needs more power since it needs to move the whole Y Axis too.

Since a few people have been requesting the stepper code, I have attached what I used in the video to this step - the zip file.  Hopefully it will help, but it is not much, and not well commented or anything.

<p>puedo poner un laser para grabar</p>
<p>Thanks for sharing this information. I want to construct a similar X Y table but I want it to be of more precision (will be used for scanning). So I want the movement to be at a step of 0.1 mm. What do you think I should change/replace in your design to be able to do mine?</p>
Thanks. I do not think this approach would be suitable for very high precision positioning. Using stepper motors would help, as well as making sure everything is well tuned. But, there are many XY table hardware options out there that may be more reliable. I have not used them, so cannot make any recommendations. Good luck!
<p>Hi, can i have the programming for this?</p>
<p>There is a link to the code in Step 9. Also, this project has some related code that might help: http://www.instructables.com/id/Table-Sized-Arduino-Joystick-Controlled-T-Slot-XY-/</p>
<p>CarlS,</p><p>Can this x-y table support 5-10 lbs of loading while moving?</p>
<p>Possibly. There is only one screw holding each roller wheel, so those may be OK, but it might be better with a more rigid structure and multiple screws per roller. Also, with that kind of weight, there would be a lot of inertia in the system, so ramping the motors up and down carefully would be important.</p>
<p>Thanks a lot for the response. So if we ramped the motors up and had a more rigid structure it sounds like we still should be fine. </p>
<p><a href="http://www.instructables.com/member/SachinY/" rel="nofollow"></a> <br></p><p><a href="http://www.instructables.com/member/SachinY/" rel="nofollow">SachinY</a>22 seconds ago<a rel="nofollow">Reply</a></p><p>Hi Carl,</p><p> Thanks much for <br>sharing this - this is great. I have a question, on step 5, picture 3, <br>can you give the details of all the pieces which will help us hold the <br>nylon ball bearing on the aluminum channel. I can see that you have:</p><p>a. Two washers (M 93574A513) and </p><p>b. Two flanged bearings (M 57155K323) </p><p>c. Pulley (M57105K21)</p><p>But <br> then you also have a cylindrical rod along with 2 black round things. <br>I'm <br> assuming it is a shaft with 1/2&quot; diameter along with a shaft collar (M <br>9414T6).Can you please let me know if this is correct. </p><p>Also for shaft, I'm planning to buy the following and then cutting it into 44&quot;, 2.25&quot; (2) and 3.25&quot; (2)</p><p><a href="http://www.mcmaster.com/#precision-shafts/=wesr2v" rel="nofollow">http://www.mcmaster.com/#precision-shafts/=wesr2v</a></p><p>Please let me know if this will work.Thanks a lot- your help is <br>is much appreciated.</p><p>Best,</p><p>Sachin</p>
<p>Yes, that is a short piece of the <strong><em>1/4&quot;</em></strong> shaft (not 1/2&quot;) since it fits on the inside of those 1/4&quot; ID bearings, and the black things are the shaft collars. I just got my shaft material from the local home store.</p>
<p>Thanks Carl for your prompt response. Much appreciated.</p><p>Best,</p><p>Sachin</p>
<p>Hi, Greetings from Colombia, I'm working doing a project for my university that is based on the xy table, you could be so kind as to let me see the code you used in Arduino please.</p><p>Thank You</p>
<p>Step 9 has some code, and also, this similar one that is joystick controlled. Hope that helps! http://www.instructables.com/id/Table-Sized-Arduino-Joystick-Controlled-T-Slot-XY-/</p>
<p>Hey CarlS,</p><p>outstanding Instructable! As a retired Mechanic and Mechanical Engineer your comment about having the &quot;Nice Toys&quot; to improve the fit of the parts I can suggest the following. The photos show the pulleys and shafts skewed to the slots. That is understandable since the slots are meant to easily insert a screw and nut and it's up to you to apply a square and tighten until red in the face to hold the alignment! One suggestion: there are u-tube and Instructables about soldering aluminum with a low temperature torch (propane or butane) that really holds. Cutting pieces of aluminum strap material a little oversize you can file the piece to just slide into the mating slot. Then, squaring the piece of aluminum to the piece you wish to locate, clamp it and solder away. Touch up with a fine tooth file can give you the fit you are looking for. No great expense, practice soldering on aluminum scrap, and when ready, build a machine that looks and is accurate. The aluminum solder holds up against stress and strain far beyond what you will face with your design here. Outstanding! Thank you for the instructable!</p>
<p>Thanks - good ideas!</p>
<p>hi..may someone help me in my project..i want to make project to move <br>object from one place to another base on this project </p><p>can i do it?and how..please help me</p>
<p>Hi, awesome project! I to would appreciate if you do not mind sharing code to control two 4 wire 12v stepper motors with a joystick or something of the sort, if you have know it. Also what the circuit would look like, sorry I'm really novice, but learning as implementing this into a school project.<br><br>thankyou inadvance, any direction will be helpful!<br><br></p>
<p>Hi, I am doing a similar project . I would appreciate if you do not mind to share your arduino code used to control the system especially the internet control.</p><p>Thanks in advance</p>
<p>I think I replied via message, but to get it in the comments... The code should all be in this Instructable, and I am happy to answer any questions.</p>
<p>Carl,</p><p>I would just like to say thank you for all the help. Your documentation was very easily to follow and adapt as needed for our XY stage application. Per my school requirements. Would it be okay if I add you as a reference along with the pdf build procedures in my thesis. An email concurrence is okay. Thanks a bunch once again. </p>
Absolutely. I'd love to see the report or some pictures of what you built. If you have anything online, I can also link from the site if you would like.
Appreciate the detailed instructions. This will be really helpful for my project. Would it be possible to get a copy of your arduino code used to controll your system with the stepper motors. This would really help for my project application. Thanks in advance
Thanks. I will PM you the code since it is not pretty! :-)
would you please send it to me too? thank you
May i have the code too for step motors?please
<p>I went ahead and added it to Step 7 since there have been a few requests.</p>
OK, I sent it
Thank you so much! :)
<p>How is the stepper controlled ? by joystick?</p>
<p>That was just a test, and hard-coded with an Arduino. If the project was switched to stepper motors, it would work as it does now - with commands being sent to the installation from the web site.</p>
<p>Congratulations on your work, your projects are awesome Carls.</p><p>Do you think im able to do the same with an arduino and an adafruit motor shield v2? </p><p>My project is similar to yours but with a positioning table, do you think it's better with step motors or servos ?</p>
<p>Most lower cost precision tables use stepper motors, so that may be worth checking. The Adafruit shield may work. With DC motors and potentiometers, you would need to write code for the motion control - preferably with PID control, which may work. For this project, I used the Pololu motor drivers to off-load that functionality. The other concern with the Adafruit board is if you can have motors with sufficient power to move a project of this size and mass - I am thinking that shield may not be able to supply quite enough power unless you are building a smaller one, but I have not tried it.</p>
Hi Carl <br>You instructions are amazing and I used your idea to base my project that uses the xy table on your design. The issue that I am having is that following the analog calibration the commands don't seem to correspond to a linear mapping i.e commanding the jrk to go to 2045 does not drive the motor to the centre of the range. Rather it behaves somehow logarithmically. I have double checked the specs of my potentiometers and are definitely linear. I was wondering if you experienced a similar issue? <br>Thanks <br>Apollon <br>
Very nice work. <br> <br>I sent you a PM. <br>Bye Mr. Carl.
Beautiful project and a really nice write-up! <br> <br>I'm tempted to try something like this myself, but I find myself balking a little bit at the $50 (each!) motor controllers. Are there any other closed-loop options? Seems like it's just a microcontroller with an A/D input and an H-bridge... shouldn't be more than $10 in parts. But I know the devil is in the details. I know Pololu does great work, but were there any other options you considered?
Thanks! Most of the people who use this design use stepper motors, so that is one way to go. You would either need to manually home the system every once in awhile, or use limit switches and automatically home it...<br><br>For the DC motor approach, you may be able to use H-Bridge chips and an Arduino or something to do the motor control. I just like the JRK controllers since you can calibrate them (PID, max accel, and travel limits) easily with the Windows program.<br><br>For the Y Axis, you could use a hobby servo pulled apart - see the previous design Instructable that is linked in the intro of this one. For the Y axis, a reasonably powerful servo will work. For the X axis, though, there seems to be a bit too much momentum for regular higher power servos to handle. There are some monster servos, but then you are getting back up to the same price point.<br><br>Good luck!
What a great work! Congratulations.
I have a very strong motivation to build my own mill, or cnc machine. I VERY much like your choice of frame materials and overall construction method. But higher resolution will be necessary, as some of the parts will require military spec final dimensions. (Not aerospace specs mind you...) Stepper motors and a control system are obviously indicated. What other factors am I obviously missing? I am an absolute novice yet at this point. But, on a positive note, I'm very quickly assimilating information on processes and materials. My problem with many of the current build I see are materials used in construction, and especially max size of parts. I don't need to machine &quot;large pieces&quot;, but I need something larger than a pencil box.
You should definitely look at other home made CNC projects. This one was designed to be low cost and low precision, so it would not work for your application. Many of the materials (t-slot &amp; timing belts) are used in other CNC machines. Good luck!<br>
This is a great design and write-up, thanks for taking the time to document it so well. <br>I am looking to do something similar but on a rather smaller scale, roughly about 1/4 of what you've made. I want to be able to cut a designs into 3&quot; by 6&quot; sheets of 0.02&quot; vinyl. I will be using MicroRAX instead of T-Slot for the smaller cross-section, but what other changes would you recommend to fulfill those needs?
Another user was building a smaller one too, though I think he is using the same design with a smaller frame. It's important to note that this design is not very accurate since it's just a sand box. You most likely want stepper motors etc., and there are a lot of great CNC designs on the web. I have some MicroRAX, OpenBeam, and MakerBeam extrusions - all about 10mm, and you would definitely want to test it out to see how it flexes, but on a smaller scale, it might be great. Some of the 3D printers, like the BukoBot, also use T-slot, and work in a very similar fashion. Good luck! I am also interested in making a more portable one to show at Maker Faires etc.
Is it possible to purchase this as a kit or at least grab the parts from a single online retailer? :)
Sorry - it was a custom project. The parts and sources should all be listed, though.
@ CarlS, I'm looking to make a larger desing of this XY Linear table, do you know what changes in the potentiometer, motor, and controller will I need. I found longer T-slots, hardware and programing will be the same, but also can' <br>t find a longer timing belt right now. Do you think you could help point me in the right direction?
The motors and controller would be fine. The trick with the potentiometer, though, is that the design in the Instructable uses almost all of the 10 turns that the potentiometer allows. So, using the same setup would require some other approach - maybe gearing the potentiometer down (at a lower resolution), or a different approach like using stepper motors or DC motors + encoders. <br><br>For longer belts, I think they make ones that are adjustable - you make any length you want.<br><br>Good luck!
@ CarlS, <br>Thank you for the helpful hints. Hopefully the 10 turn potentiometer can be geared down enough to cover the length of the linear table. Would you think using one with more turns would also be ok? As far as the adjustable timing belts, I tried looking around for them but can't seem to find, would you happen to know where they sell those? <br>Thank you!
I guess getting one with more turns and gearing a 10-turn one down are about the same - you would be getting the same voltage range across the table. With either approach, you probably want to use as much of the range of the potentiometer as possible so you will get the most precision. If I were making a larger one, I would probably consider using steppers or a dc motor with encoders. <br> <br>For the belts, maybe this page will help. I have not used them myself. <br>http://www.mcmaster.com/#timing-belts/=ign0e1 <br> <br>I am not sure how you join them - the plate may work if it can travel from one pulley to the other, and not go around a pulley.
Thank you for your help, think I might gear down the 10-turn pot or try and find one with more turns, decided to use cable wire and more pulleys instead of trying to find an exact longer belt pitch pattern, we were planning to use 3x3&quot; frame t-slots, but the moving X and Y axis beams would still be 1 x 3&quot;. I couldn't quite tell but did you use the same motor for the X and Y axis? Also we may not need a pot if we use a stepper motor appication, but well see. And also I couldn't quite tell if you had a separate controller for the X and Y axis? BUt thank you for all your help, I love the design of the Arduino stage.
Yes, I used the same motors for each axis, and two JRK controllers - one for each axis. With the larger frame, momentum may be more of an issue, so the motors may or may not be powerful enough. You can set the ramp up/down with the JRK, so that may help.

About This Instructable




Bio: A Maker since childhood with all the classic symptoms, a robot builder, and an Internet software CTO by day.
More by CarlS:LED Holiday Tree with Shared Internet Control LED Bar Light Tardis Door 
Add instructable to: