tag:blogger.com,1999:blog-345929302024-03-13T08:49:16.652-07:00George FrickSharing My ExperiencesGeorge Frickhttp://www.blogger.com/profile/00820157398592673682noreply@blogger.comBlogger17125tag:blogger.com,1999:blog-34592930.post-5512932358672102442017-04-02T14:23:00.000-07:002017-04-02T14:23:00.166-07:00Create a "GG Button" With an IOT Button on DiscordI was having some fun with my internet button (found here: https://store.particle.io/collections/shields-and-kits), and also working on some bot coding.<br />
<br />
So I decided to bring the two together; with the goal of pressing a button to summon a bot to my channel to play a sound effect(s). This would be similar to the famous https://www.ggbutton.com/ button, but would play a sound to everyone I am in a Discord channel with.<br />
<br />
Since I was already working with Darkside's SoundBoard bot for Discord; I decided to utilize the API. That way I'd be creating a simple web hook that could later be used for other purposes; like having Jenkins run a build/deploy.<br />
<br />
You can see the completed work in action:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen="" class="YOUTUBE-iframe-video" data-thumbnail-src="https://i.ytimg.com/vi/Xh_Vnjorjzk/0.jpg" frameborder="0" height="266" src="https://www.youtube.com/embed/Xh_Vnjorjzk?feature=player_embedded" width="320"></iframe></div>
<br />
This comes from this source code:<br />
<br />
<pre style="background: #f0f0f0; border: 1px dashed #cccccc; color: black; font-family: "arial"; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;">1: // This #include statement was automatically added by the Particle IDE.
2: #include <HttpClient.h>
3:
4: // This #include statement was automatically added by the Particle IDE.
5: #include <InternetButton.h>
6:
7: /**
8: * George Frick
9: *
10: * This application will play a certain sound effect in a voice channel
11: * when the button is pressed.
12: *
13: * A simple http post when a button is pressed.
14: * You don't have to go through the particle API.
15: *
16: * In this example, we post to a Discord sound effect bot.
17: * @see https://github.com/Darkside138/DiscordSoundboard
18: *
19: * You also need the above two libraries, HttpClient and InternetButton
20: * https://github.com/spark/InternetButton
21: * https://github.com/nmattisson/HttpClient
22: *
23: * To use the Serial output, have your internet button connected via usb
24: * and type 'particle serial monitor'
25: */
26:
27: HttpClient http;
28: InternetButton b = InternetButton();
29: bool mashBlocker = false;
30:
31: // Headers currently need to be set at init, useful for API keys etc.
32: http_header_t headers[] = {
33: { "Content-Type", "application/x-www-form-urlencoded" },
34: // { "Accept" , "application/json" },
35: { "Accept" , "*/*"},
36: { NULL, NULL } // NOTE: Always terminate headers will NULL
37: };
38:
39: http_request_t request;
40: http_response_t response;
41:
42: void setup() {
43: b.begin(); // pass 1 for older buttons (no shield)
44: b.setBrightness(50); // limit overall brightness.
45: Serial.begin(9600);
46: }
47:
48: void loop(){
49:
50: if(b.buttonOn(2) && mashBlocker == false) {
51: b.ledOn(3, 255, 255, 255);
52: mashBlocker = true;
53:
54: Serial.println();
55: Serial.println("Making web request...");
56:
57: request.hostname = "192.168.1.193";
58: request.port = 8080;
59: request.path = "/soundsApi/playFile";
60: request.body = "soundFileId=sms1&username=gfrick-test";
61:
62: // Post request, it blocks. (blocking i/o)
63: http.post(request, response, headers);
64:
65: Serial.print("Application>\tResponse status: ");
66: Serial.println(response.status);
67:
68: Serial.print("Application>\tHTTP Response Body: ");
69: Serial.println(response.body);
70:
71: b.ledOff(3);
72: mashBlocker = false;
73: }
74:
75: }
</code></pre>
<br />
This was a quick and fun little project, and it gets me started on doing IOT based dev ops and more!<br />
<br />George Frickhttp://www.blogger.com/profile/00820157398592673682noreply@blogger.com0tag:blogger.com,1999:blog-34592930.post-90531701823475286412012-09-19T21:22:00.002-07:002012-09-19T21:22:29.444-07:00Upgrading The 3D Printer And Hexy Build Notes (Prusa RepRap)What a busy couple of weeks I have had. Many upgrades for the printer have arrived, and work continues on understanding and possibly building <a href="http://www.kickstarter.com/projects/arcbotics/hexy-the-hexapod-low-cost-six-legged-open-robot" target="_blank">Hexy</a> before my Kickstarter version arrives from <a href="http://arcbotics.com/" target="_blank">Arcbotics</a>. In this post I will cover the upgrades I have made to the printer; why I made the upgrades, their cost; and finally show some updated Hexy prints to show off the new accuracy.<br />
<br />
First; I was printing the <a href="http://www.thingiverse.com/thing:24013" target="_blank">Seej Starter Set</a>, in preparation for taking my printer to work on my last day. While doing so, the printer gave up the ghost. Badly. First, the z-axis was homing and went right down through the printer bed. So after a break and calming down, I put the z-axis back together, calibrated; and went to home it again. Same thing, it went right down through the printer bed; which was saved by being spring loaded. This time though; the z-axis couple snapped in half.<br />
<br />
So, because of this complete printer failure and needing to order new parts anyway; I decided to do the upgrades that are suggested to get good accuracy. Mainly, G2 pulleys. So I ordered:<br />
<br />
<ul>
<li>2 x <a href="http://ultimachine.com/content/timing-belt-pulley-gt2-kit" target="_blank">Timing Pulley</a>, GT2, 20 Tooth - $11.00 each</li>
<li>3 x <a href="http://ultimachine.com/content/timing-belt-pulley-gt2-kit" target="_blank">Timing Belt</a>, GT2 - $9.00 each</li>
<li>2 x <a href="http://ultimachine.com/content/motor-shaft-coupling-5mm-8mm" target="_blank">Motor Shaft Coupling</a>, 5x8mm - $7.00 each.</li>
</ul>
So that is $63.00 plus shipping came out to around $75.00 all said. I also ended up buying a new metric hex set for ~$10.00 because I stripped a set working with the Motor Shaft Coupling. I purchased all of this from <a href="http://ultimachine.com/" target="_blank">Ultimachine</a> which is where I get all my parts/PLA.<br />
<br />
Moving along... I rebuilt with my new drive belts. The nice thing about the GT2 is that they are meant for this type of machine instead of the old T5 belts which aren't. It is also nice to go from a printed pulley to an aluminum one. So at the end of the day, the change is getting rid of printed parts (vitamins), lowering how much of the printer can be re-printed. I wouldn't suggest anyone build one of these without this immediate upgrade. In a moment, you'll see the stark contrast in quality.<br />
<br />
So first, the change to the coupler:<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEitubbmQ9zjB1ZonZfxO213izh4aJTy0biAUV9dtoVw0YWSB7W3vADphgNGYjwi5FF4i9gOD_OupS5ms79DqHh_G-AgHCWHoPAugSxHQ4-eaBdRqmCPw7zdm29VgkDQ1D6epPmc/s1600/20120919_194018.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEitubbmQ9zjB1ZonZfxO213izh4aJTy0biAUV9dtoVw0YWSB7W3vADphgNGYjwi5FF4i9gOD_OupS5ms79DqHh_G-AgHCWHoPAugSxHQ4-eaBdRqmCPw7zdm29VgkDQ1D6epPmc/s320/20120919_194018.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">On the left, the printed coupler, on the right, the new aluminum one.</td></tr>
</tbody></table>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEik40CgMXMsYABIGTjy42JPZLNeJHNrtKL-XZ1wacNd-nk4Sr6A_dbdHVY9QQKgg3oeO74nqc8DftEST8dG4t2Rbw5OwjQMr-CwOxNfl8rFe4VrlkctHQqqZVigWQGx6mpVPGxK/s1600/20120919_200723.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEik40CgMXMsYABIGTjy42JPZLNeJHNrtKL-XZ1wacNd-nk4Sr6A_dbdHVY9QQKgg3oeO74nqc8DftEST8dG4t2Rbw5OwjQMr-CwOxNfl8rFe4VrlkctHQqqZVigWQGx6mpVPGxK/s320/20120919_200723.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">On the left, the printed pulley, on the right, the new aluminum one.</td><td class="tr-caption" style="text-align: center;"><br /></td><td class="tr-caption" style="text-align: center;"><br /></td></tr>
</tbody></table>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: left;">
With the upgrades installed, it's like a new printer!</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjwJ1aZ-31c3euZEV7YF-VIm7_XuDwMMC25HqAOe__3TTY6ACpefPbo5VOm_0Xn-J2vYEYS37YwGiWc_q0ou_rmT0MLjdd8i4EljVOJAIvZy13u1l6BkLXGpY4b8hNOo2PMSpsL/s1600/20120919_224840.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjwJ1aZ-31c3euZEV7YF-VIm7_XuDwMMC25HqAOe__3TTY6ACpefPbo5VOm_0Xn-J2vYEYS37YwGiWc_q0ou_rmT0MLjdd8i4EljVOJAIvZy13u1l6BkLXGpY4b8hNOo2PMSpsL/s320/20120919_224840.jpg" width="240" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Printer, with new pulley/belt and new shaft coupling.</td></tr>
</tbody></table>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
So with an upgraded printer, it was timing to do a comparison print and produce a part for Hexy. This part should hold two small servos; which I just happen to have received from Hobby King today. My apologies for the following photo being upside down. What you see if a servo measured with a caliper compared to the Hexy piece it should fit it. The problem being the hole is the exact size of the servo, so it doesn't fit! Either does the screw, as predicted by the guys at Arcbotics.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
One thing we can note in the picture below though; is the Hexy part on the left (right if the picture was flipped). That part was produced under the old belt/pulley/coupling system by the exact same STL file, and as you can see is obviously way too big.</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgaMKzsh8ZYCqwXfyurUNw682Hb_rkRTvRnX1N1RFjS15VQC2QZet6Th3bfBX-pVL6_6POXm0b-ciowiTGh2k1q3aafa3FKH_rAiFLBOtyVCJhdYIQIQToynCAZuCRWIiFcKkvK/s1600/20120919_224453.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgaMKzsh8ZYCqwXfyurUNw682Hb_rkRTvRnX1N1RFjS15VQC2QZet6Th3bfBX-pVL6_6POXm0b-ciowiTGh2k1q3aafa3FKH_rAiFLBOtyVCJhdYIQIQToynCAZuCRWIiFcKkvK/s320/20120919_224453.jpg" width="320" /></a></div>
<br />
So the current plan is to work a bit from on calibrating the printer to see if that resolves the issue of the Hexy piece now being slightly too small; unless the error is in the STL file. Regardless, I am very happy with the prints being produced; especially with so little changes to configuration. I'll be posting in the Arcbotics forum to see if the STL can be resolved further and to provide them more feedback. Next chance I get, I'll be reproducing an entire leg of parts for Hexy, and trying to print the Seej set again.<br />
<br />George Frickhttp://www.blogger.com/profile/00820157398592673682noreply@blogger.com0tag:blogger.com,1999:blog-34592930.post-21612865286014962182012-09-03T14:02:00.001-07:002012-09-03T14:02:33.874-07:00RepRap Rebuilt! A 3D Printer StorySo it has been a long time since I made a real post; but we won't dwell on it. Instead, let us get to the good stuff and share some information!<br />
<br />
This post regards my long term rebuild of my Prusa Mendel Reprap, which I decided to do back in March. If you saw my previous blog posts, you will have seen the state of the printer. It worked, but it didn't print well and there were wires everywhere. I even used some CAT5 as motor wire.<br />
<br />
Because of the setup, the printer experienced many problems:<br />
<ol>
<li>Wires would catch during the printing run.</li>
<li>The printer could not be moved.</li>
<li>The RAMPS (Arduino Mega + Shield) kept getting bumped around, etc.</li>
</ol>
So, I took the entire thing apart and took the following steps:<br />
<ol>
<li>All wires now use connectors (pictured below). These are available at Ultamachine: http://ultimachine.com/content/molex-4-pin-plug-socket-connector-kit</li>
<li>The power supply and RAMPS are mounted on a small piece of wood, which is mounted to the reprap (pictured below)</li>
<li>The thermistor, print head, and extruder motor now share the ribbon cable, instead of 3 wires handing intermingled in the machine.</li>
</ol>
With the changes in place, the printer actually printed really well with no calibration. The controller computer was also updated; (1ghz/512MB -> Core i3 + 2GB). Going forward, I don't recommend hooking a reprap up to an older machine like that unless you are going to "slice" on a different machine. I consider the connectors to be a big upgrade, it should be easy to swap out, adjust and generally maintain all of the connections. <br />
<br />
Here are a couple pictures:<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhkGRhLwJNBBiCN930ENISWlghP9wSEPR1-0ElajVBSc3Dz6jpgb_zF9G_19Ki0uomZ7CFGvQijGgwITbHo0S5z_WcvMwcxECvnViMaZh-1I8BwHADE8CAzTpSGw9-Gyp9GxBDR/s1600/20120903_153945.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhkGRhLwJNBBiCN930ENISWlghP9wSEPR1-0ElajVBSc3Dz6jpgb_zF9G_19Ki0uomZ7CFGvQijGgwITbHo0S5z_WcvMwcxECvnViMaZh-1I8BwHADE8CAzTpSGw9-Gyp9GxBDR/s320/20120903_153945.jpg" width="240" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgqpX1xxOMNbhRP96YAR54cTWjKuSZp3fIL3qPN4cNb4RAUKAD7k7Z_Ppk6rGiji0f_fg_QdvCEOqpSCZ33dl2sidWumtwWO-iIABdNtd5lxx6eJvaSYDyyOq2gJtfoXKLFGjQK/s1600/20120903_154010.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><br /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSxsA_2Yudbg5BJq61dcNrG2KEfM9TdsE_iB5Dn0JKiQ4T_MFEF6dy3X5M2ApxCJQetxg3vxHGBvtnfMw2CFAHxBAYPGBfZrbb29sVZAzWbq-xbb4WowVKx3PyqBX0VZ1sLe3O/s1600/20120903_154038.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSxsA_2Yudbg5BJq61dcNrG2KEfM9TdsE_iB5Dn0JKiQ4T_MFEF6dy3X5M2ApxCJQetxg3vxHGBvtnfMw2CFAHxBAYPGBfZrbb29sVZAzWbq-xbb4WowVKx3PyqBX0VZ1sLe3O/s320/20120903_154038.jpg" width="320" /></a></div>
<br />
Well, that is the 3D printer post. I've been printing some Hexy parts to calibrate it; and I'm very happy. It prints better than it ever did before! <br />
<br />
I have a post coming up with some code in it that is pretty exciting, and I'm continuing to experiment with the printer while waiting for my Hexy. Don't forget about my little tracked bot! A model is needed for the sensor mount to make the line following more smooth!<br />
<br />
That is all for now!<br />
<br />George Frickhttp://www.blogger.com/profile/00820157398592673682noreply@blogger.com1tag:blogger.com,1999:blog-34592930.post-48871005410252011172012-09-02T20:39:00.000-07:002012-09-02T20:39:52.062-07:00Quick Post About HexyHello, just a quick post about <a href="http://www.kickstarter.com/projects/arcbotics/hexy-the-hexapod-low-cost-six-legged-open-robot">Hexy the robot.</a><br />
<br />
I was recalibrating the printer after finishing up the rebuild and wanted to do some printing. Since I was curious about the sizing of Hexy and also my ability to print parts for it; I decided to grab the STL files and get printing.<br />
<br />
There was trouble; not all of the stl files were ready, some of them needed to be run through http://cloud.netfabb.com/ first. It took me a while to figure this out; but once I found it everything went smoothly.<br />
<br />
You may be curious; so here are some leg pieces for Hexy; printed in blue PLA.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjXraD8k4L8feeOMz_xhpM_Y_pxP2ZWxrHU80RUPtws22KC7YjJ0BSY0U9GvPq-399HFK1fCEVtm304R9xlo-O4fF1zIq7SKO-GMC_R-B2dBH_34hFuvigWqETL7rQRZlXi2q-j/s1600/20120902_223050.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjXraD8k4L8feeOMz_xhpM_Y_pxP2ZWxrHU80RUPtws22KC7YjJ0BSY0U9GvPq-399HFK1fCEVtm304R9xlo-O4fF1zIq7SKO-GMC_R-B2dBH_34hFuvigWqETL7rQRZlXi2q-j/s320/20120902_223050.jpg" width="240" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZTZj_FcDEoo2fqkzoWeUeVp_hMUrYcM65sqGMc534cWIfbv-gySra37ugNnqcegAVcfv1oTY_Y195zwmWQ75k44-Ofd_c8pKN1WFVHcPaux2_ks_kSmGbj7kkniLSwCUF3CDn/s1600/20120902_223155.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZTZj_FcDEoo2fqkzoWeUeVp_hMUrYcM65sqGMc534cWIfbv-gySra37ugNnqcegAVcfv1oTY_Y195zwmWQ75k44-Ofd_c8pKN1WFVHcPaux2_ks_kSmGbj7kkniLSwCUF3CDn/s320/20120902_223155.jpg" width="240" /></a></div>
<br />
<br />
<br />
<br />
That's all for now. I'm prepping a full post on the rebuild reprap; my robot progress, and another project that is coming along very nicely.<br />
<br />
George Frickhttp://www.blogger.com/profile/00820157398592673682noreply@blogger.com0tag:blogger.com,1999:blog-34592930.post-3935277990572474082012-01-08T09:53:00.000-08:002012-01-08T09:59:56.699-08:003D Printer Build Post 2 (RepRap Prusa Mendel)My long journey concerning this printer has turned out to be a glorious one. With objects coming off the printer with a pretty high quality; and my ability to design objects starting to form, it became time to share the progress and information. I will answer my own questions from the end of the previous post; outline more of the printer build, and share the general experience. Also, I will address the budget with an update.<br />
<br />
Alright, so let's see it!<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7dxnipCpvzUn3glOLe_ShFbdNYKKFbdBVAM2INSufYdvBpKoZFnCgrWVqyT6rrZ82F01xpt4qZMBMDIeDfDR2dCnB-YOQHdbvy1W-uFiOA2uZY-gsukJPyWm56XvtR4Ik2bKi/s1600/100_0891.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="640" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7dxnipCpvzUn3glOLe_ShFbdNYKKFbdBVAM2INSufYdvBpKoZFnCgrWVqyT6rrZ82F01xpt4qZMBMDIeDfDR2dCnB-YOQHdbvy1W-uFiOA2uZY-gsukJPyWm56XvtR4Ik2bKi/s640/100_0891.JPG" width="480" /></a></div>
<br />
Above is my RepRap (Prusa) as it sits today. It is half converted over to version 2. I chose to do this conversion to understand the printer better, and more importantly to improve the prints. The original build calls for using printed clamps on the axis; and the plastic simply slides. This is fine; but the clamps have to be replaced periodically and you just don't get accurate movement. So I printed a new X-axis, new Z-axis, some stabilizers and purchased a set of <a href="http://www.ebay.com/itm/12pcs-LM8UU-8mm-Linear-Ball-Bearing-Bush-Bushing-/330621488095?pt=LH_DefaultDomain_0&hash=item4cfa938bdf" target="_blank">LM8UU shaft bearings</a> to mount the new parts. Here are closeups of the new X-axis and Z-axis. <br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhP-KtM0XPfpz7cR968NAW4ATh-qETyqEgZrHj4Lt284KwbhVhxK1jYIo_pmEkpoGLcCctZvzP5Y8ECBqMLEvGuy9zsD5ZxDhpE4e_CMy4GZkMKwkhmLT0ERZHiFxD8PyPM7JLJ/s1600/100_0893.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhP-KtM0XPfpz7cR968NAW4ATh-qETyqEgZrHj4Lt284KwbhVhxK1jYIo_pmEkpoGLcCctZvzP5Y8ECBqMLEvGuy9zsD5ZxDhpE4e_CMy4GZkMKwkhmLT0ERZHiFxD8PyPM7JLJ/s320/100_0893.JPG" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9j_ID9tg0aU89ud0ycV46XiOm0J2G9UVfGsxVhp0nEoIUy5W1XwBEnJG9bmYsKO4kQHm9Aia1dvgjakLR_UDBmUeaLfc_gRmyrNAWsnNBl0VEZVrKezw95879I-8yiw3qY47e/s1600/100_0899.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9j_ID9tg0aU89ud0ycV46XiOm0J2G9UVfGsxVhp0nEoIUy5W1XwBEnJG9bmYsKO4kQHm9Aia1dvgjakLR_UDBmUeaLfc_gRmyrNAWsnNBl0VEZVrKezw95879I-8yiw3qY47e/s320/100_0899.JPG" width="240" /></a></div>
<br />
You can see the role of the LM8UU bearing. The Y-axis still uses the old printed clips. You can see them in this picture for comparison.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhv3Y3EU5R1serdKJ6C5VL7ysSytpeNb3_7yzV0wDmwLNKg7ivegG4_UpR6V_UkbIYJ2x0SthVh2O7akRPbPsaoYaHI7m8koty9BcErdh04_3nkLnbpHzkouMFc4bzCZa9Ya9Dy/s1600/100_0898.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhv3Y3EU5R1serdKJ6C5VL7ysSytpeNb3_7yzV0wDmwLNKg7ivegG4_UpR6V_UkbIYJ2x0SthVh2O7akRPbPsaoYaHI7m8koty9BcErdh04_3nkLnbpHzkouMFc4bzCZa9Ya9Dy/s320/100_0898.JPG" width="320" /></a></div>
<br />
Obviously the shaft bearing works way better. although the clip design is really good and it works surprisingly well as a printable solution. To complete this tour of the upgrades, we can compare the old Z-axis to the new one, and show the Dremel work I did on the z-axis coupler at the top. I cut out the center so I could separately tighten the two ends. Here are the pictures.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiq-jqZ4NtSNhbEKIiwGdCj6-T3-IPlApZk3X7B2Nxw0o8ywIxcU2DfjCHbfbaMYapCpQ4Wh0eiMQpPj4fzdmB6KLar8CcUfduZ7LPt9bNPlpKGF3eCwdYo5OIN4wPRXLez1o1G/s1600/100_0897.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiq-jqZ4NtSNhbEKIiwGdCj6-T3-IPlApZk3X7B2Nxw0o8ywIxcU2DfjCHbfbaMYapCpQ4Wh0eiMQpPj4fzdmB6KLar8CcUfduZ7LPt9bNPlpKGF3eCwdYo5OIN4wPRXLez1o1G/s320/100_0897.JPG" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZaPqPAV_BEMmbDcAOvqydm6p2xg2KLU7feWdyBs_kDKJSDMg2jczwcmdokxBxb9SYNwiiH4CoFvX_zRxZQenr8mZIwq_FhhhDRkawPOLrkVx8NRxRdgKwFggcrdNTjmhMoVF6/s1600/100_0900.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZaPqPAV_BEMmbDcAOvqydm6p2xg2KLU7feWdyBs_kDKJSDMg2jczwcmdokxBxb9SYNwiiH4CoFvX_zRxZQenr8mZIwq_FhhhDRkawPOLrkVx8NRxRdgKwFggcrdNTjmhMoVF6/s320/100_0900.JPG" width="320" /></a></div>
<br />
The last upgrade to talk about is visible at the top of the first picture. I printed a mount for a large Ultimachine spool of PLA. I haven't gotten to the spool yet (finishing up the clear PLA), but it's ready to 'spin' now.<br />
<br />
With all of that said, it would be wise to update the budget. The budget previously stood at $782.00, and I did some upgrades and had to purchase the LM8UU bearings.<br />
<ul>
<li>Upgrades - Free. Printed on my printer.</li>
<li>LM8UU bearings - $15.00 w/shipping (<a href="http://www.ebay.com/itm/12pcs-LM8UU-8mm-Linear-Ball-Bearing-Bush-Bushing-/330621488095?pt=LH_DefaultDomain_0&hash=item4cfa938bdf" target="_blank">Ebay</a>)</li>
<li>Additional PLA - $76.95 w/shipping (<a href="http://ultimachine.com/content/pla-3mm-blue-5lb-spool" target="_blank">Ultimachine Blue PLA Spool</a>)</li>
<li>Razor blades and Miscellaneous like zip ties.</li>
</ul>
This brings the total for the current setup to ~$900.00. This is a ready to print state with a full spool of blue PLA.<br />
<br />
The next topic to cover are notes from my build. A LOT of work goes into getting the printer 'correct'; once it is built there are a whole new set of challenges ahead.<br />
<ul>
<li>Do the axis move correctly? Does telling each of them to move 10cm move them exactly 10cm? This will be adjusted in firmware until it is as correct as you have patience for.</li>
<li>Do the axis move smoothly, or do they jerk? You'll end up printing tension mounts for your belts and converting over to LM8UU so that your prints don't start 'shifting' mid print when something skips.</li>
<li>Is the whole thing rigid enough and on a rigid base? Get a good print going and a bad table or weak frame tightening will cause the frame, the table or both to shake.</li>
<li>Is the bed level and is the print head setup to be the correct distance from the print bed when home? Instructions say 1 or 2 sheets of paper; yep. Easy :-(</li>
<li>Does the Z-axis wobble? This is why I did the work on the z-axis couplers and added the stabilizers at the bottom. Without that work the rods wobble and the print wobbles as it goes up.</li>
<li>Does the extruder push through 10cm of plastic when told to? This has to be adjusted physically (is your hobbed bolt working properly?) and in firmware.</li>
<li>Are the motor steppers AC adjusted correctly? Too high; they'll overheat (and burn you!), too low and they'll miss steps. I added heat sinks; but ended up not needing them.</li>
<li>Is your software configured correctly? Correct filament width; correct temperature settings for your filament? Correct fill settings? Correct layer height/width? I spent weeks on this.</li>
</ul>
Finally, we do want to print things. Where do these magical things come from? Well, I'm not going to really cover the printer firmware/software except to provide some links. I use <a href="http://reprap.org/wiki/Sprinter" target="_blank">Sprinter</a> for firmware with <a href="http://reprap.org/wiki/Printrun" target="_blank">Pronterface/Skeinforge</a> for my software; it is running on Windows Tablet Edition (2001). This is because I'm using an ancient computer I had in the basement for printing.<br />
<br />
The best place to find things to print is <a href="http://www.thingiverse.com/" target="_blank">Thingiverse</a>. The software uses STL files that are representations of 3d models. The software then cuts the model into layers and modifies as needed in order to print. Frequently you will have to add supports that you cut away/etc; in order to make a print work. Here are some objects on Thingiverse that I really like:<br />
<ul>
<li>http://www.thingiverse.com/thing:12351</li>
<li>http://www.thingiverse.com/thing:12097</li>
<li>http://www.thingiverse.com/thing:12633</li>
</ul>
You can see my thingiverse profile here: http://www.thingiverse.com/georgefrick<br />
If you follow it; you can see what I've printed (some) and what I like. I haven't uploaded anything(yet).<br />
<br />
To take it further, you will want to design your own objects. I have been using <a href="http://www.openscad.org/" target="_blank">OpenSCAD</a> to design things. Although I use the term 'use' lightly, I'm still learning. OpenSCAD is a programmer's design tool; you write scripts that generate objects. Once done, you can export them to STL, have them sliced and run them off the printer.<br />
<br />
To wrap this up; here is an object I designed in OpenSCAD and printed. Just a small business card holder. I hope to parametrize it and print a larger one as a stand from my Kindle DX.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_B4GpdolDdABrRBiBbMg8ssU3uiL-wfW0lSaTCUvTR3RoZa9n1_mKTXy1BrpRxkvrTBGqbXx0uka8wdLvLqcq3te-CNX0T-t6sf09ZqNdZFj7fLZtCKTlhdyMUZTpand3eZZF/s1600/100_0895.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_B4GpdolDdABrRBiBbMg8ssU3uiL-wfW0lSaTCUvTR3RoZa9n1_mKTXy1BrpRxkvrTBGqbXx0uka8wdLvLqcq3te-CNX0T-t6sf09ZqNdZFj7fLZtCKTlhdyMUZTpand3eZZF/s320/100_0895.JPG" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_wjAH4Y4QhYshR4FYnDzKm2NcItCToiyF7yctIMTM1JFTr1h2jABbmN1twgGzwArCi07t5bFVWM-UfrUYuZmEuYWHgZejAwiGrFmSmykmj5e1RJ0LIjZvzbaZyUROvqRg_Og3/s1600/100_0896.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_wjAH4Y4QhYshR4FYnDzKm2NcItCToiyF7yctIMTM1JFTr1h2jABbmN1twgGzwArCi07t5bFVWM-UfrUYuZmEuYWHgZejAwiGrFmSmykmj5e1RJ0LIjZvzbaZyUROvqRg_Og3/s320/100_0896.JPG" width="320" /></a></div>
<br />
If you are looking for some good videos of the reprap in action, checkout <a href="http://www.youtube.com/user/GeoDroidJohn" target="_blank">this guys channel on Youtube</a>. He has filming setup, where as I don't. <br />
<br />
A great video of his:<br />
<iframe width="560" height="315" src="http://www.youtube.com/embed/uqTOQ8J8XSo" frameborder="0" allowfullscreen></iframe>
<br />
That wraps up this post; and hopefully opens the door for many more. Feel free to send me questions or feedback. I hope everyone had a great holiday and came into the new year with a sense of renewal and determination!<br />
<br />
<br />
<br />
<br />
<br />George Frickhttp://www.blogger.com/profile/00820157398592673682noreply@blogger.com0tag:blogger.com,1999:blog-34592930.post-53321822936485286872011-10-25T12:38:00.000-07:002011-10-27T09:14:47.516-07:003D Printer Build Post 1 (RepRap Prusa Mendel)The long journey to building a 3D printer has been underway for quite a while now. With the complete set of parts ordered and much of the construction finished I decided to share the progress; outline my frustrations, and post about how you can benefit from my mistakes.<br />
<br />
I have been building the printer for over a month; and the last batch of parts arrived early this week. What can clearly be said about this project is that you will underestimate it. The original plan was to get this working in six months. Once construction was underway; it seemed more like a month. It now looks like this could really take up to six months (to produce a quality 3D printed part). In this part of the coverage; I hope to outline the budget and basic build so far; finally going over some problems and warning points.<br />
<br />
The budget for this printer is quite high. It is a mid-range open source 3D printer known as a Prusa Mendel. You can find the wiki for it <a href="http://reprap.org/">here</a>. I chose to start with the basics (more on this later). So here is the budget:<br />
<ul>
<li>The starter kit $195.00 (<a href="http://www.ebay.com/itm/230655908875?ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1497.l2649">from this ebay auction</a>)</li>
<li>Rods - Threaded and Smooth, $68.17 (McMaster.com)</li>
<li>Motors - Pololu Nema 17 x 5 $104.70 (Pololu.com, <a href="http://www.pololu.com/catalog/product/1200">item link</a>)</li>
<li>Hot End and Ramps 1.4 $364.00 (Ultimachine.com)</li>
<li>Wire, digital caliper, etc. ~50.00</li>
</ul>
So the total budget so far for the printer is ~$782.00<br />
<br />
Here are the basic pictures; showing various steps of the frame building process. I cut the rods myself; making a jig according to <a href="http://www.woodworkingtips.com/etips/etip092900sn.html">this</a> page. I then used the electric saw to get through them quickly.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjt9vHr76dfRnW1-f1KGajAaSm4o2gbAj_5jwfDzrTp5JBSYgEKCjZ4jDBh3jDkFwviLyjZxmMQKBhNP8YO8Nr2Ou9pVOgpPbeoGvhp_dS8pHtuDhjthJ_F6U7mvLrdiHY7uCvM/s1600/101_0834.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjt9vHr76dfRnW1-f1KGajAaSm4o2gbAj_5jwfDzrTp5JBSYgEKCjZ4jDBh3jDkFwviLyjZxmMQKBhNP8YO8Nr2Ou9pVOgpPbeoGvhp_dS8pHtuDhjthJ_F6U7mvLrdiHY7uCvM/s320/101_0834.JPG" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Preview...</td></tr>
</tbody></table>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEitGE7nFTAkONF_lgi7HWThVpainyakJdj1nt578CTlKwy6ULTYFT8ZjVShfzTL6WBtFgt50-vpz436Bz-I3kOegya09_oPyYoxpJY79ud-A_wkJzCoM9O4k3oU8VAhKiSAUnXt/s1600/101_0794.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEitGE7nFTAkONF_lgi7HWThVpainyakJdj1nt578CTlKwy6ULTYFT8ZjVShfzTL6WBtFgt50-vpz436Bz-I3kOegya09_oPyYoxpJY79ud-A_wkJzCoM9O4k3oU8VAhKiSAUnXt/s320/101_0794.JPG" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEia-pBLLyL_icuy0Af5VNxmMonUgOMPzYLQUX4VyeCgcdH81CuduIU7UuXRTHOiDQWLiwOmEaK4fp5sBKuQoAqBbFdb_FtlWobxpfic82xf7qzkRyFYoHSzzrsbIL3on8ALVgoQ/s1600/101_0796.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEia-pBLLyL_icuy0Af5VNxmMonUgOMPzYLQUX4VyeCgcdH81CuduIU7UuXRTHOiDQWLiwOmEaK4fp5sBKuQoAqBbFdb_FtlWobxpfic82xf7qzkRyFYoHSzzrsbIL3on8ALVgoQ/s320/101_0796.JPG" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhGr0CQYgjLvQcNOLxWhaZca1YxlFSSdSstF4_neBnWoSZQihPHzNiMHs-Y4yLmEmByg62mutiDqREuqLiUzMreFBJd6MJnUo3w0rznr3GjUmiSzg0nqyc0lbjDzLx-opf0tKxD/s1600/101_0798.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhGr0CQYgjLvQcNOLxWhaZca1YxlFSSdSstF4_neBnWoSZQihPHzNiMHs-Y4yLmEmByg62mutiDqREuqLiUzMreFBJd6MJnUo3w0rznr3GjUmiSzg0nqyc0lbjDzLx-opf0tKxD/s320/101_0798.JPG" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi3i-fNclulQ8AUVjv3Nj2Tgpr-RGaWw4ffuWRcYzdIwWGQ_szS3Pk1UPKMYvzdiz0641lqRZzQsnHguH3h7ZkhshzxxQ04tb9LdmBxYUSnW8IqDRZzYfV4ooOO1RA1cFdb6kj2/s1600/101_0801.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi3i-fNclulQ8AUVjv3Nj2Tgpr-RGaWw4ffuWRcYzdIwWGQ_szS3Pk1UPKMYvzdiz0641lqRZzQsnHguH3h7ZkhshzxxQ04tb9LdmBxYUSnW8IqDRZzYfV4ooOO1RA1cFdb6kj2/s320/101_0801.JPG" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEilMmJZFLfR0HLR2GjVTVgeFM5fRhCPRvE6iPmfjV7HyugUKP8elLwei80Fs0a6Ad_Jet5Cqf7G07-bDOyD1qc1FhFiw3Btl8P7IRc9Y0NX5Mf21yG0pawkr-tNxig7uKFj6stk/s1600/101_0803.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEilMmJZFLfR0HLR2GjVTVgeFM5fRhCPRvE6iPmfjV7HyugUKP8elLwei80Fs0a6Ad_Jet5Cqf7G07-bDOyD1qc1FhFiw3Btl8P7IRc9Y0NX5Mf21yG0pawkr-tNxig7uKFj6stk/s320/101_0803.JPG" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJmG4E_c93T-e7lbpG6PnlOZxi7qq8immZc_zEuayp6YdyeyMgq5B41bdpQoZSPHWiCL5r3F4cFlH8iEnrlFyKWwuPXbgJ2YW0nG3jeZaDtOO4hDl3HATqksK9dLEN-5CbwujW/s1600/101_0806.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJmG4E_c93T-e7lbpG6PnlOZxi7qq8immZc_zEuayp6YdyeyMgq5B41bdpQoZSPHWiCL5r3F4cFlH8iEnrlFyKWwuPXbgJ2YW0nG3jeZaDtOO4hDl3HATqksK9dLEN-5CbwujW/s320/101_0806.JPG" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjs-9H81qwd2qrzsUT21EyAQ2_resdgWhV7R-hpgg-4T-rwBCoLFDjf9j1p7oaXijT9_FQEt2K2Ul5xCdHEg9X-3wxwhYHHf8P7NuFhJlY7HreUSvAld2J0Pm_lAteEdmyPDnC9/s1600/101_0810.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjs-9H81qwd2qrzsUT21EyAQ2_resdgWhV7R-hpgg-4T-rwBCoLFDjf9j1p7oaXijT9_FQEt2K2Ul5xCdHEg9X-3wxwhYHHf8P7NuFhJlY7HreUSvAld2J0Pm_lAteEdmyPDnC9/s320/101_0810.JPG" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgHhktALjYR3HKrQ79ImTa-zzue3uPEq0-gwdM353y1R4EWt6Hv9NXnHuqMuDXm1AGThUJF0xMawswSM2GCRg_2DXmxQv4EO9eSmrOLN4pqcLJMC-o-eHpzSuHNYf7AUYAjlrg6/s1600/101_0811.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgHhktALjYR3HKrQ79ImTa-zzue3uPEq0-gwdM353y1R4EWt6Hv9NXnHuqMuDXm1AGThUJF0xMawswSM2GCRg_2DXmxQv4EO9eSmrOLN4pqcLJMC-o-eHpzSuHNYf7AUYAjlrg6/s320/101_0811.JPG" width="240" /></a></div>
<br />
At this point I lost my memory card; so there is a gap of missing pictures. They weren't very interesting anyways. The pictures resume with motors in place and the y-axis completed.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBUfyVEIHJ2hWEkap1XQTtEnUAp0C14dRwU_g5Vy8veZXpgY5ozsTduNkOWHhyZgEcdSGCaqrv9_qAKuqv3Rdj-Jt9FD8yxzvZn84VRjynkakqEbg4R4UqrZTKi_YDVnTbRgPg/s1600/101_0822.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBUfyVEIHJ2hWEkap1XQTtEnUAp0C14dRwU_g5Vy8veZXpgY5ozsTduNkOWHhyZgEcdSGCaqrv9_qAKuqv3Rdj-Jt9FD8yxzvZn84VRjynkakqEbg4R4UqrZTKi_YDVnTbRgPg/s320/101_0822.JPG" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4eu6fmhs_B4KyVi9T3vig_j-j7StOaV0cD9FCnGDkcFOPP8wz_VVKMWdUdr3S8mo6oCRA9oQ3K0V32X6Gu61x4kh4A8hYP705MjFgzIJIAxToEvy6OnL1R9pyxAvttjRW9D4u/s1600/101_0824.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4eu6fmhs_B4KyVi9T3vig_j-j7StOaV0cD9FCnGDkcFOPP8wz_VVKMWdUdr3S8mo6oCRA9oQ3K0V32X6Gu61x4kh4A8hYP705MjFgzIJIAxToEvy6OnL1R9pyxAvttjRW9D4u/s320/101_0824.JPG" width="320" /></a></div>
<br />
The extruder which feeds plastic into the hot end has to be 'hobbed'; basically you give it teeth so that it grips the plastic. The extruder can then force plastic into the hot end which acts as a glue gun (but for plastic). I hobbed by hand. Following that sparks are some pictures of the extruder; which came together easily.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0rGMb-HYo3StQCcdpiSaSSuP8Ahexi77q-Up4c1FSl5nebPvHV3cuBv2-OKl9onNjfvd3iGP5xT57Gmj4_wh4WrIuzDYTyN1VzRKwwfYMS4NxI4P-OvXmMGitIhaWqrXy5SkW/s1600/101_0825.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0rGMb-HYo3StQCcdpiSaSSuP8Ahexi77q-Up4c1FSl5nebPvHV3cuBv2-OKl9onNjfvd3iGP5xT57Gmj4_wh4WrIuzDYTyN1VzRKwwfYMS4NxI4P-OvXmMGitIhaWqrXy5SkW/s320/101_0825.JPG" width="240" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhs2zaUOT7Cy-7vSxRvWH1cQtLXIUao1ul8dukkiuUCfFPVSPkXb5jef8jsLQNRODzrzqX4hzKLKrRNWP28rWmgLDpI6Ai7PY4aQW2yEJckjCAfdeXQZE5sgm7Yk1j-ZmJyb-C3/s1600/101_0828.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhs2zaUOT7Cy-7vSxRvWH1cQtLXIUao1ul8dukkiuUCfFPVSPkXb5jef8jsLQNRODzrzqX4hzKLKrRNWP28rWmgLDpI6Ai7PY4aQW2yEJckjCAfdeXQZE5sgm7Yk1j-ZmJyb-C3/s320/101_0828.JPG" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiI2-DNctSXfSwbFANIhKTSmZIIdkQmJYTJ1CH-Hl9Sa7mUrrM7T5XFlg5Q_1YyPYIBmeBjz5myIuDhOhiIMGWZM9DqQv0K-5t9yIlbpPlsdo4ZMFHhfCPln6z5v3483wNGyGf2/s1600/101_0829.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiI2-DNctSXfSwbFANIhKTSmZIIdkQmJYTJ1CH-Hl9Sa7mUrrM7T5XFlg5Q_1YyPYIBmeBjz5myIuDhOhiIMGWZM9DqQv0K-5t9yIlbpPlsdo4ZMFHhfCPln6z5v3483wNGyGf2/s320/101_0829.JPG" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhdVNZ6myOPNPY4IKC0WhQvGNjqwHQrMwlszyyHDylc56RHb4Avyp6bb6uzKFSHGT1dxPpZperob6RvdjjiUW_t1XzAziasWhgeEItcD_ktwtxvGiHo1qa59gsDQdVVi132r-z8/s1600/101_0830.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhdVNZ6myOPNPY4IKC0WhQvGNjqwHQrMwlszyyHDylc56RHb4Avyp6bb6uzKFSHGT1dxPpZperob6RvdjjiUW_t1XzAziasWhgeEItcD_ktwtxvGiHo1qa59gsDQdVVi132r-z8/s320/101_0830.JPG" width="320" /></a></div>
<br />
With the extruder completed, tested, and mounted - the basic build was complete. I didn't want to start wiring things up until I got some chores out of the way. So the second picture below is my converted ATX power supply. I may do a complete post on this; as it is very useful for anyone doing robotics/arduino. The short and sweet? Connect the green to ground; then all of the orange (3.3v), red (5v), and yellow (12v) become easy power. The other wires can be removed.<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjt9vHr76dfRnW1-f1KGajAaSm4o2gbAj_5jwfDzrTp5JBSYgEKCjZ4jDBh3jDkFwviLyjZxmMQKBhNP8YO8Nr2Ou9pVOgpPbeoGvhp_dS8pHtuDhjthJ_F6U7mvLrdiHY7uCvM/s1600/101_0834.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjt9vHr76dfRnW1-f1KGajAaSm4o2gbAj_5jwfDzrTp5JBSYgEKCjZ4jDBh3jDkFwviLyjZxmMQKBhNP8YO8Nr2Ou9pVOgpPbeoGvhp_dS8pHtuDhjthJ_F6U7mvLrdiHY7uCvM/s320/101_0834.JPG" width="320" /></a></div>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiQeGm9Whj3Oy2yYEiFFg-mxWNfHOIFCoTL1m7GbAwRBerNKJ37X6SDjMPZF2ahjXpt7BzEhlH8hAtia2vMXq2orsOrmQvFLZk5Q8ejTtIIaSwWN8JbS2MO0vYuY0P6IK3eoskx/s1600/101_0835.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiQeGm9Whj3Oy2yYEiFFg-mxWNfHOIFCoTL1m7GbAwRBerNKJ37X6SDjMPZF2ahjXpt7BzEhlH8hAtia2vMXq2orsOrmQvFLZk5Q8ejTtIIaSwWN8JbS2MO0vYuY0P6IK3eoskx/s320/101_0835.JPG" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Before putting the top back on.</td></tr>
</tbody></table>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
At this point I have begun working on the wiring and getting everything to the final setup. There is still a ton of work to do however and I do not think that my carriages move as freely as they should. That said; I did want to share some of my sticking points in case you are considering this venture for yourself. So; consider these points before you start and you can benefit from my troubles.<br />
<ol>
<li>A dremel is NOT an optional tool. You will need to correct parts, cut parts; etc.</li>
<li>Have a large work area available; I am using both my full desk; a table I purchased and a couple shelves.</li>
<li>Have something to organize parts; similar to component bins. There are a LOT of nuts, bolts and washers.</li>
<li>Have a small enough level; if your level is too big; it doesn't fit against the rods and you will have trouble leveling. You could also have a spacer ready; but remember you need to level various parts.</li>
<li>A digital caliper is highly recommended for accuracy.</li>
<li>Plan for the 'breaks'; you will have two glue steps where you glue and walk away. You will also apply ceramic to the hot-end and it should sit overnight.</li>
<li>Have your PSU ready before you attempt to build your hot-end; you will need the +12v for curing. </li>
</ol>
There are also various problems I'm running into that I can't seem to find resources for. Be wary of these; or if you know the answer - let me know!<br />
<ol>
<li> How does the hot end attach to the extruder? I really cannot find this!</li>
<li>Preparing the default bed; do I just put aluminum foil on it? All documentation seems to simply skip this and references the 'prepared print bed'.</li>
<li>I will know more tonight; but you apparently need a linux box to build
and upgrade the firmware. I will update this entry based on my findings.</li>
<li>How should the Arduino Mega be powered; usb?</li>
</ol>
That wraps up this post. Hopefully my next post about this will include a first print and more information to help you build your printer. <br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<br />
<br />
<br />
<br />
<br />George Frickhttp://www.blogger.com/profile/00820157398592673682noreply@blogger.com0tag:blogger.com,1999:blog-34592930.post-77794209975690097302011-10-15T23:13:00.000-07:002011-10-15T23:14:06.787-07:00Arduino Robot 3 - Part 1 - Reflectance SensorThis is the first part of my post covering my creation of the line following Arduino robot. In this post I will talk about the costs; setup and preparation for creating the robot. I will also discuss a few different approaches to line following that I explored. We will get the sensor attached to the robot and retrieving data. In the next part, we will cover the final approach used; tour the code, and see the full video.<br />
<br />
The budget for this tank is quite low, because we start with Robot 1. I chose to add a single reflectance sensor to the bottom of Wandering Tank; and remove the wall avoidance equipment. So, the budget:<br />
<ul>
<li>Robot 1 ($98.00) [See <a href="http://georgefrick.blogspot.com/2010/01/arduino-robot-1-basic-tank.html">this</a> post for building Robot 1]</li>
<li>Sensor - <a href="http://www.pololu.com/catalog/product/959">Pololu QTR Reflectance Sensor $2.49 + $4.95 S&H</a> (est)</li>
</ul>
So Line Following Tank has an estimated budget of $105.00 to build. <br />
<br />
Since there is no need for the parts from Robot 2, the cost is very low. I would suggest coming up with a few other things to order so that you don't pay more in shipping and handling than for the sensor. I ordered a couple sensors and of course, more of <a href="http://www.pololu.com/catalog/product/86">these</a>. Time to build!<br />
<br />
Building this robot is not as simple as ordering the parts. I could find no reliable way to attach the sensor to the bottom front of the robot. I ended cutting a strip of double sided tape up into squares and stacking them to a desired height. Wiring the robot is simple; I used digital pin 5; which is pin 19 on the Arduino. Here are some pictures as a guide:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgYZdGNECNsAALFB-lRONtmlbVTaqXG6p0DG_kVNMR4RQ3bK4NzWlq5HwAofGSXdqA-2R1ulBrXd6WZO7kmdisHH-Jzy5WYlbhMjB4haQcp7RAgEcvLjgoHEJPSRYZitVdrsn3v/s1600/101_0813.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgYZdGNECNsAALFB-lRONtmlbVTaqXG6p0DG_kVNMR4RQ3bK4NzWlq5HwAofGSXdqA-2R1ulBrXd6WZO7kmdisHH-Jzy5WYlbhMjB4haQcp7RAgEcvLjgoHEJPSRYZitVdrsn3v/s400/101_0813.JPG" width="400" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEheHCXHlL1qwZECz_dnijnKSpZVM88W72Khr8DiJLeErQjImzRDuChFY7JnpLj_WdVOdsBcFiC87TuocS7_5WZwcg3Y9ennW4o-hzgOjjGIORhrfyDTdx8P-B_aIm-UMFV7JcEN/s1600/101_0814.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEheHCXHlL1qwZECz_dnijnKSpZVM88W72Khr8DiJLeErQjImzRDuChFY7JnpLj_WdVOdsBcFiC87TuocS7_5WZwcg3Y9ennW4o-hzgOjjGIORhrfyDTdx8P-B_aIm-UMFV7JcEN/s400/101_0814.JPG" width="400" /></a></div>
<br />
Soldering the wires to the sensor is easy. You are simply giving it 5V to operate with, grounding it, and giving it somewhere to send data. You must add the <a href="http://www.pololu.com/docs/0J19/all">Arduino Library For Pololu QTR Sensors</a> to your Arduino IDE before working with the sensor.<br />
<br />
In preparing to create the line follower; I had to do a lot of research and of course make sure I was ready to use the sensor in code. Using the sensor in code is easy. I will show the code to use the robot as a color detector. The speaker will make noise to reflect (get it?) the color seen by the sensor. As I wave the robot over a dark line; the frequency will change.<br />
<br />
<pre class="Cpp" name="code">/*
* George Frick (george.frick@gmail.com)
* October 2011.
* Arduino Robot 3 - Sensor Wave Test
* This isn't a robot; but uses the build line following robot to test the reflectance
* sensor. The robot starts up and beeps to notify the user to calibrate (wave robot
* back and forth over line), then beeps again before starting. Once started the robot
* calls buzz with the detected color value as the frequency.
* This tests runs continuously. The user may choose to view Serial output.
*/
#include <PololuQTRSensors.h>
const int qtrPin = 19; // pin 5 as digital is pin 19
const int buzzerPin = 14;
// create an object for your type of sensor (RC or Analog)
// in this example there is one sensor on qtrPin
PololuQTRSensorsRC qtr(( unsigned char[]) {qtrPin}, 1);
void setup() {
Serial.begin(9600); // set up Serial library at 9600 bps
pinMode(buzzerPin, OUTPUT);
buzz(buzzerPin, 1000, 100);
calibrateQTR(); // Wave the sensor accross the color specture during this time!!!
buzz(buzzerPin, 2000, 200);
}
void loop() {
delay(250);
unsigned int a[] = { 0 }; // One sensor!
qtr.readCalibrated(a); // It will fill the array from the sensor array.
Serial.println(a[0]); // Use a[0] to get the only entry.
buzz(buzzerPin, a[0] - 50, 100); // the minus 50 is arbitrary.
}
void calibrateQTR() {
// start calibration phase and move the sensors over both
// reflectance extremes they will encounter in your application:
int i;
for (i = 0; i < 250; i++) {
qtr.calibrate();
delay(50);
}
}
void buzz(int targetPin, long frequency, long length) {
long delayValue = 1000000/frequency/2; // calculate the delay value between transitions
// 1 second's worth of microseconds, divided by the frequency, then split in half since
// there are two phases to each cycle
long numCycles = frequency * length/ 1000; // calculate the number of cycles for proper timing
// multiply frequency, which is really cycles per second, by the number of seconds to
// get the total number of cycles to produce
for (long i=0; i < numCycles; i++){ // for the calculated length of time...
digitalWrite(targetPin,HIGH); // write the buzzer pin high to push out the diaphram
delayMicroseconds(delayValue); // wait for the calculated delay value
digitalWrite(targetPin,LOW); // write the buzzer pin low to pull back the diaphram
delayMicroseconds(delayValue); // wait againf or the calculated delay value
}
} </pre>
<pre class="Cpp" name="code">/* EOF */ </pre>
<br />
In the video; you will notice me waving the robot in the beginning with no sound. This is during the calibration phase when you want to show the sensor different colors. Once calibrated another beep announces the 'wand' is ready.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<object class="BLOGGER-youtube-video" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" data-thumbnail-src="http://i.ytimg.com/vi/7_9INdWkUyM/0.jpg" height="266" width="320"><param name="movie" value="http://www.youtube.com/v/7_9INdWkUyM?version=3&f=user_uploads&c=google-webdrive-0&app=youtube_gdata" />
<param name="bgcolor" value="#FFFFFF" />
<embed width="320" height="266" src="http://www.youtube.com/v/7_9INdWkUyM?version=3&f=user_uploads&c=google-webdrive-0&app=youtube_gdata" type="application/x-shockwave-flash"></embed></object></div>
<pre class="Cpp" name="code"></pre>
<br />
The final discussion is the approach to line following. With only one sensor; it gets tricky. If you have more than one sensor; you can find the line and keep it between two sensors; etc. With one; you have to make an effort to say on the line. As of writing this; I am aware of a few approaches:<br />
<ol>
<li>Drive forward if on the line. When the robot leaves the line, sweep left and right until the line is found again; then continue forward. This has several problems; the largest of which is a simple 90 degree turn; in which the robot may end up going back along the line.</li>
<li>Constantly sweep back and forth. I have seen this implemented on Youtube and other places. I don't like it and I don't think the robot should have to 'dance' in this way.</li>
<li>I am working on this :-) Depending on how it turns out; it will be the next post. Otherwise I may settle for one of the other two approaches.</li>
</ol>
So; the robot is built and the code works. It's time to implement approaches to line following and see what kind of results I can get. The follow up post to this will share the finished robot and code!<br />
<br />
<br />
<br />
<br />George Frickhttp://www.blogger.com/profile/00820157398592673682noreply@blogger.com1tag:blogger.com,1999:blog-34592930.post-56667660756965039172011-10-08T17:58:00.000-07:002011-10-09T09:35:34.767-07:00Resuming My Robot Work With Bonus 3D Printer ProjectWell after a long break of working on the house; this blog will be returning to a primarily robot programming focus. My work on the house is shared elsewhere...<br />
<br />
So; I've resumed work on my robot and added a second Arduino to my arsenal; this way I can prototype ideas without disassembling the robot. I have used it to go through the tutorial for the TFT screen:<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg5BVDmiHoYBngrKvjv-_qM1Jb5hxqUibgefrgPoleRPcAyhHtN_AeTTntUukaEowXx1E1fhFFd8hjIglL_pvzvx132X-eX0MsEDfV2akrfIgKKSdupWvVX9_P3Tp5a3aYtzKC8/s1600/101_0787.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg5BVDmiHoYBngrKvjv-_qM1Jb5hxqUibgefrgPoleRPcAyhHtN_AeTTntUukaEowXx1E1fhFFd8hjIglL_pvzvx132X-eX0MsEDfV2akrfIgKKSdupWvVX9_P3Tp5a3aYtzKC8/s320/101_0787.JPG" width="240" /></a></div><br />
<br />
The new Arduino is an UNO; they come in much more sophisticated packaging than their predecessor:<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEinitqselmfGBCvQ1BAZYLAFb16_oQpeTJPVVYcYA_Ipw88k9xeqieWspQSxrpl1UcjaqD_K7aeLLFBVsVBffF8jwSH0KId5dn9R10z3tV3xP8BqrNttjNFQ3iIEL36QcYEr8Ao/s1600/101_0777.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEinitqselmfGBCvQ1BAZYLAFb16_oQpeTJPVVYcYA_Ipw88k9xeqieWspQSxrpl1UcjaqD_K7aeLLFBVsVBffF8jwSH0KId5dn9R10z3tV3xP8BqrNttjNFQ3iIEL36QcYEr8Ao/s320/101_0777.JPG" width="320" /></a></div><br />
<br />
<br />
<br />
<br />
That is a sticker sheet on the right and a EULA in the middle. The first nice thing to notice about the UNO is it auto switches the power source. You can see this difference and other slight changes in the comparison here:<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjReMbczMijb4mRQ5WjGGzMlyzmgYTITSfhCrH-sVKAlz02ZNjFrd6Fqu4SoKU6iK-X4w_mN8ybr77s5YhkR0RKX7_whtwZt2P2reQxzHcGc4OReam5W-HmX8IUSg1KOfs1vEQt/s1600/101_0779.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjReMbczMijb4mRQ5WjGGzMlyzmgYTITSfhCrH-sVKAlz02ZNjFrd6Fqu4SoKU6iK-X4w_mN8ybr77s5YhkR0RKX7_whtwZt2P2reQxzHcGc4OReam5W-HmX8IUSg1KOfs1vEQt/s400/101_0779.JPG" width="400" /></a></div><br />
So; I will post about the robot again when line following can be demonstrated and the code is ready to share. I hope to share two versions (with and without TFT info printing).<br />
<br />
With that; the other exciting news is that I am building a 3D printer; which I will document here and share my problems (and answer any questions the best I can). I hope to be able to print robot parts in the spring; as I have more than once been held back by the ability to mount parts. It has driven me towards switching back to Lego; which I do not want to do. The printer being targeted is the RepRap Prusa Mendel.<br />
<br />
I have made first acquisitions and the plan is to build the printer for around $600.00. The initial set of parts (the printed ones, etc) were purchased on Ebay; <a href="http://www.ebay.com/itm/Reprap-Prusa-Mendel-Kit-Metric-/230655908875?pt=LH_DefaultDomain_0&hash=item35b429dc0b">this guy sells them</a>. I then purchased the rods (uncut) from <a href="http://www.mcmaster.com/#">McMaster</a>; who I had never heard of, but find very awesome! The next purchase was the stepper motors; which I of course got from Pololu.<br />
<br />
The build has not been started yet; the parts need to be confirmed and some need to be cleaned up with the Dremel. There is also the cutting of the rods (ordered in 2 meter lengths). I'll close this post off with some more pics.<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjW92Z6n_s5q_B-hs-XexYpKQDau9DSFupkNvEupBjlU3ZUdN0Y-p5lo21vQxy8SYYY1rfm0eJn6zgQsyUDggc1v555VuFtwB5tva0diqODuSotkObhPoIPk1psi89Mg5zGspiP/s1600/101_0792.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjW92Z6n_s5q_B-hs-XexYpKQDau9DSFupkNvEupBjlU3ZUdN0Y-p5lo21vQxy8SYYY1rfm0eJn6zgQsyUDggc1v555VuFtwB5tva0diqODuSotkObhPoIPk1psi89Mg5zGspiP/s320/101_0792.JPG" width="320" /></a></div><br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjeFK2UAXFdMSvcr6A3H-27XCozeEyZrgSVdFsNw3Bg6Ueu3k2YCKLdrp6AggGNK0xg3QF9pwHME4o-wHOM2mOicXICLi6NX3D77JzpWjPl7Ybu2sxMSRaLc8tsInktA2uKiR3M/s1600/101_0793.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjeFK2UAXFdMSvcr6A3H-27XCozeEyZrgSVdFsNw3Bg6Ueu3k2YCKLdrp6AggGNK0xg3QF9pwHME4o-wHOM2mOicXICLi6NX3D77JzpWjPl7Ybu2sxMSRaLc8tsInktA2uKiR3M/s320/101_0793.JPG" width="320" /></a></div>George Frickhttp://www.blogger.com/profile/00820157398592673682noreply@blogger.com1tag:blogger.com,1999:blog-34592930.post-1082542401772383772011-05-16T19:46:00.000-07:002011-05-16T19:46:42.191-07:00Back To Robotics - A Long Awaited UpdateThere has been next to no progress on my robot; this has been due to buying a house and realizing I would need to do a lot of work on it. That aside; I now have a work bench coming together and the time and money freeing up to get back to it (yay!).<br />
<br />
There is some news; there is now a local <a href="http://milwaukeemakerspace.org/">Maker Space</a> getting started up. This may provide tools, resources and people to work with. I am very excited since I live nearby (about a mile away); though there is no way I could currently afford the membership fee. We will see; as I plan to stop by one of their open houses.<br />
<br />
More exciting; I have purchased a part. I saw the part come up on my reader feed and realized it was cheap and would go quickly. I refer to the 1.8 inch 18 bit color TFT LCD display with microSD card breakout released by adafruit. At only $25.00 I knew they would be gone in an instant so I just went ahead and purchased one! My goal for this is to use it for output from the robot; debugging output in the short term and more interesting output in the long term. I'm not sure what to do with the SD card slot; but it is great to have it.<br />
<br />
So; when I make progress on my robot, including adding the TFT as output in regards to what the robot is doing; then I will post with haste here! I do have a new idea for the line following so that it isn't so jerky, and I'm excited to try and implement it. For now; here are some pics of the screen as it arrived.<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhPz0mB0E-02MmWBM4NMfmY-oTgKXqiUEUN_tevAvu_l7dDaYbNYrV9RqnCx2cO5ArdHoBtokPQDe9Tv4fzfy_7cL-z-z9TjUJOw7OipCk05kJBYiTJUd24L45-wU5MLfDlduVN/s1600/tft_back.JPG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhPz0mB0E-02MmWBM4NMfmY-oTgKXqiUEUN_tevAvu_l7dDaYbNYrV9RqnCx2cO5ArdHoBtokPQDe9Tv4fzfy_7cL-z-z9TjUJOw7OipCk05kJBYiTJUd24L45-wU5MLfDlduVN/s320/tft_back.JPG" width="320" /></a></div> <a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhXAkzOcI6kNp8DuiQnaJYwlN2pz1SYhvBxPlojyEsSU50mFbG0O9nxCGbFoNMDbP74tFta1vYByX7lc-TSfj8HogSDzO0tNiSaV6vULYYi540_lwTaOlNGeGHydSwiWX1oJFmD/s1600/tft_front.JPG" imageanchor="1" style="clear: right; display: inline !important; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhXAkzOcI6kNp8DuiQnaJYwlN2pz1SYhvBxPlojyEsSU50mFbG0O9nxCGbFoNMDbP74tFta1vYByX7lc-TSfj8HogSDzO0tNiSaV6vULYYi540_lwTaOlNGeGHydSwiWX1oJFmD/s320/tft_front.JPG" width="320" /></a>George Frickhttp://www.blogger.com/profile/00820157398592673682noreply@blogger.com0tag:blogger.com,1999:blog-34592930.post-83578151565668692032011-05-12T08:23:00.000-07:002011-05-13T13:28:23.426-07:00Improving your Netbeans Java Class Template And Including A License FileWell, working with Netbeans I have a problem occur over and over. One of those annoying programming tasks where you always make the change but are too lazy to deal with underlying problem. Today I decided to address on of them. Every time I create a class in Netbeans, there is a comment that appears at the top:<br />
<pre class="Cpp" name="code">/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
</pre><br />
My co-workers leave this in place; I am OCD about removing it every time. I don't like four lines of useless code at the top. This morning I decided to change this problem and maybe make my Java class templates a little better. I will walk through improving the class template, and adding the license file for display.<br />
<br />
This is a stub class created before the changes:<br />
<pre class="Cpp" name="code">/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package com.something.somewhere;
/**
*
* @author GFrick
*/
public class MyClass {
// class here.
}
</pre><br />
We will start by creating a license file. You just have to create a file "license-company.txt" anywhere on your file system and fill it with your company license info. This can be any information you want in the header of all of your created Java classes. Netbeans has to be told about this file, so we choose Tools->Templates and then go down to the folder "Licenses"; highlight it and click "Add...". Navigate to the text file, choose it and click "Add". Now for any project to use this; simply open the project.properties file and add a line like this:<br />
<br />
<pre class="Cpp" name="code">project.license=company</pre><br />
With this done, your license file should now appear when you create new files in Netbeans.<br />
<br />
Now, we will improve the Java class template to include a little better javadoc and information at the top. Go to tools->templates again, find the "Java" folder and the "Java Class" item under it. You will want to copy/paste this to make a backup so you have the original. The original looks like this:<br />
<br />
<pre class="Cpp" name="code"><#assign licenseFirst = "/*">
<#assign licensePrefix = " * ">
<#assign licenseLast = " */">
<#include "../Licenses/license-${project.license}.txt">
<#if package?? && package != "">
package ${package};
/**
*
* @author ${user}
*/
public class ${name} {
}
</pre>We will add some additional information, namely date and encoding to convenience; the updated version looks like this:<br />
<br />
<pre class="Cpp" name="code"><#assign licenseFirst = "/*">
<#assign licensePrefix = " * ">
<#assign licenseLast = " */">
<#include "../Licenses/license-${project.license}.txt">
<#if package?? && package != "">
package ${package};
/**
* ${nameAndExt} (${encoding})
*
* ${date}
* @author ${user}
*/
public class ${name} {
}
</pre><br />
Now when you create a new class, a much nicer version of the template appears and there is no need to remove the top comment. Here is an example class created:<br />
<br />
<pre class="Cpp" name="code">/*
* Software property of Something Somewhere Companies. Copyright 2011.
*/
package com.something.somewhere;
/**
* MyClass.java (UTF-8)
*
* May 12, 2011
* @author gfrick
*/
public class MyClass {
}
</pre><br />
There are of course plenty of other things you can add to the template. They are written using FreeMarker; so you can script them up to your desire. There are a list of variables here: <a href="http://wiki.netbeans.org/FaqTemplateVariables">Netbeans Template Variables</a>George Frickhttp://www.blogger.com/profile/00820157398592673682noreply@blogger.com1tag:blogger.com,1999:blog-34592930.post-73778362368421514352011-05-04T06:40:00.000-07:002011-05-04T06:40:00.729-07:00New Site For Robotics And Electronics SuppliesI was browser my Google reader feed and a great site popped up. I've checked it out and once I get my work bench set up and get back to my robot; I'll definitely be ordering some things from here. I wanted to spread the word about the site: http://www.inmojo.com/<br />
<br />
They have lots of RFID, Robotics and just Arduino stuff that I think would be cool to play with.<br />
<br />
I hope to get a full post up soon.George Frickhttp://www.blogger.com/profile/00820157398592673682noreply@blogger.com0tag:blogger.com,1999:blog-34592930.post-88677800745958912302011-04-18T16:46:00.000-07:002011-04-18T16:46:00.327-07:00Installing the Sun (Oracle) JDK on 64 Bit Ubuntu From ShellI had a bit of trouble installing the JDK via the shell; but I eventually figured it out. Seems a large part of the problem was differences in 64 vs 32 bit Ubuntu. I wanted to use the apt-add-repository, but had to figure out that it requires some python libs. Here are the simply steps if you have been looking:<br />
<div><br />
</div><div><br />
<ol><li><span class="Apple-style-span" style="font-family: Verdana, sans-serif; font-size: x-small;">sudo apt-get install <span class="Apple-style-span">python-software-properties</span></span></li>
<li><span class="Apple-style-span" style="font-family: Verdana, sans-serif; font-size: x-small;">sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"</span></li>
<li><span class="Apple-style-span" style="font-family: Verdana, sans-serif; font-size: x-small;">sudo apt-get update</span></li>
<li><span class="Apple-style-span" style="font-family: Verdana, sans-serif; font-size: x-small;">sudo apt-get install sun-java6-jdk</span></li>
</ol></div><div><span class="Apple-style-span" style="font-family: Verdana, Arial, Tahoma;"><span class="Apple-style-span" style="font-size: 12px;">After that, you should have javac/etc. </span></span></div>George Frickhttp://www.blogger.com/profile/00820157398592673682noreply@blogger.com0tag:blogger.com,1999:blog-34592930.post-17216611469497566652010-02-28T11:01:00.000-08:002010-02-28T11:44:04.606-08:00Arduino Robot 3 - Line Follower (Goals & Notes)Work has begun on my third Arduino Robot. I decided that after some comments I read in various forums, that making a line following robot would probably be a proper increase in challenge. With research in hand, I placed my orders for parts and began looking into creating a test track. Here are the goals for Arduino Robot 3 - Line Following Tank:<br />
<ol><li><a href="http://robogames.net/rules/line-following.php">Conform to Robo Games Line Following Rules (2010)</a> </li>
<li>Use only a single sensor.</li>
<li>Robot should move in a smooth motion (no twitching about the line)</li>
</ol>I have begun the physical build, but I'm still looking into a 'practice arena'; I may end up taping together printer paper...<br />
<br />
Full report, code and video upon completion (so check back here).<br />
<br />
Edit: The reason for the single sensor goal is because someone trying to do similar with a Lego robotics set would only have one sensor. I do not want to be putting more money/hardware into any of the robots. They should be a challenge; and with my programming background I think that even two sensors (let alone an array!) would make this too easy. This is because two or more would allow a basic edge following; three or more would allow the robot to distinguish line direction (veering). The robot may be improved to have multiple sensors; but I feel I can defeat the challenge with one.George Frickhttp://www.blogger.com/profile/00820157398592673682noreply@blogger.com1tag:blogger.com,1999:blog-34592930.post-41688299640820041072010-02-09T18:05:00.000-08:002010-02-09T18:09:59.375-08:00Arduino Robot 2 - Wandering TankMy second robot was a bit more complex and ended up taking twice as long to build as originally intended. The budget changed, the designed changed, and my understanding of Robotics in general changed. The second robot is an attempt to make an obstacle avoidance robot that isn't overly simple. I will be outlining the goals, budget, build and code for Wandering Tank.<br />
<br />
The goals for Wandering Tank were simple:<br />
<ul><li>Should be able to scan an area in front of itself.</li>
<li>Should be able to avoid not only walls, but obstacles.</li>
<li>Avoid random decision making; the robot should use information when avoiding.</li>
</ul>Wandering tank meets these goals, and also looks pretty cool doing it. The code for the robot will show how the third goal is met and the other two will be obvious in the video.<br />
<br />
The budget for Wandering Tank was quite cheap. Since I started with Robot 1, the only additional cost for Wandering was the sensor and the servo.<br />
<ul><li>Robot 1 ($98.00)</li>
<li>Sensor - <a href="http://www.pololu.com/catalog/product/1134">Digital Distance Sensor 10cm $6.95 + $2.00 S&H (est) </a> </li>
<li>Servo - HiTec HS-311 Standard Servo (Greenfield News & Hobby) $10.99</li>
</ul> So Wandering Tank has an estimated cost of $120.00 to build.<br />
<br />
Building Wandering Tank was pretty quick. The chassis was modified to hold a servo and the wiring for the motors was improved. Originally the original continuous servo was used, which you will see in the previous post about scanning. Eventually a real servo was purchased and replaced the scanning mechanism. The first thing I did, was improve the motor shield by adding headers for the Arduino ports that it wasn't using. You can see here on the lower right and upper right the additional headers:<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhbqd9Mk87XL-NTc-ofgXa9P_emBfMALBQOoSSrAoEXDri6vx8Z3JPxFHkDPLMWMsA7LSu1gzK_4m_REZ6gu43UTh2sxDCbbAgl-8a0Qacuktl5tKrSDbappQtzpsr3H2JD8uis/s1600-h/MotorShieldHeader.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="195" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhbqd9Mk87XL-NTc-ofgXa9P_emBfMALBQOoSSrAoEXDri6vx8Z3JPxFHkDPLMWMsA7LSu1gzK_4m_REZ6gu43UTh2sxDCbbAgl-8a0Qacuktl5tKrSDbappQtzpsr3H2JD8uis/s400/MotorShieldHeader.png" width="400" /></a></div><br />
The next step was to modify the chassis to hold a standard size servo. The servo was lined up and used as a tracing template, I then cut out the area to make room. You will also notice in the first picture the improved running of the motor wires, and that the gear box is moved out slightly. This made the treads tighter and the robot moved better! Finally, the battery for the Arduino (9V DC) now fit underneath with room for the servo. In the middle on top is the velcro for the motor battery pack.<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgtxlAbF9GdbH_6En8Ack-2gwyaaS9V5CSiNwJj8xklyMTNNXjVK2u9kJ3qHh4sJypHhCu_Dvm-dWcIRHnyyMwD_4VW97Dvo5rfVtc1_3ge_o_Rab2h4d_-6k5cgQGAT0VGs4ld/s1600-h/WanderingTank1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="184" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgtxlAbF9GdbH_6En8Ack-2gwyaaS9V5CSiNwJj8xklyMTNNXjVK2u9kJ3qHh4sJypHhCu_Dvm-dWcIRHnyyMwD_4VW97Dvo5rfVtc1_3ge_o_Rab2h4d_-6k5cgQGAT0VGs4ld/s320/WanderingTank1.png" width="320" /></a></div><br />
Next the servo was mounted with the Velcro piece in place to hold the sensor. In the picture, the motor shield battery is in place as a test fitting.<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgI72vTSSLSnETtPJtT2D2_l-L-YdpZATp8bC-estcZyEvdjzqmwdmA7GG02ZdcNmfgTRZTKSe0_umjYgHXFU-T8Eq-1069PJzHM_E4S4rF3p_UYgh6nxj8yTVdAcPotFY1RzDq/s1600-h/WanderingTank2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgI72vTSSLSnETtPJtT2D2_l-L-YdpZATp8bC-estcZyEvdjzqmwdmA7GG02ZdcNmfgTRZTKSe0_umjYgHXFU-T8Eq-1069PJzHM_E4S4rF3p_UYgh6nxj8yTVdAcPotFY1RzDq/s320/WanderingTank2.png" /></a> </div><br />
Finally, everything is assembled and you have Wandering Tank (that does nothing):<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEisd6TqvcQHLxf7oz772ca60ygfsnHEQmPch-TSZvG8mgbMEkYVUAEfmf8Q5jGFpoLy7PgzOcpO_2J5gYFp8jhAi-NvJF4QRJbtFlXGRjiXBF8OE1aiX66nH-XHyQmHMt_9RcNh/s1600-h/WanderingTankFinal.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEisd6TqvcQHLxf7oz772ca60ygfsnHEQmPch-TSZvG8mgbMEkYVUAEfmf8Q5jGFpoLy7PgzOcpO_2J5gYFp8jhAi-NvJF4QRJbtFlXGRjiXBF8OE1aiX66nH-XHyQmHMt_9RcNh/s400/WanderingTankFinal.png" width="400" /></a></div><br />
With the bot built, it was time to write code to do the actual logic. The code for the scanner from the previous post couldn't be used and I ended up starting over. The code would work life this:<br />
<ol><li>Update Sensor Angle</li>
<li>Scan with Sensor</li>
<li>Move</li>
</ol>Each of these steps is much more complicated than it is described. To update the sensor angle requires checking bounds and reversing the direction as necessary. When the sensor is checked, if there is a collision it records the sensor angle during collision (but lets the sensor angle continue to update!), and then records the collision. Movement works by checking for collision and sensor collision angle. If the robot sees something, it moves backwards until vision is clear; it then turns away from the object based on which side of the robot it saw the object. The robot then continues forward, scanning and avoiding as necessary. Here is the source code with comments:<br />
<br />
<pre name="code" class="Cpp">/*
* George Frick (george.frick@gmail.com)
* Jan/Feb 2010.
* Arduino Robot 2 - Wandering Tank
* This robot will wander around, scanning with a very short range forward IR.
* When an object is detected, the robot will turn based on the position of the IR sensor
* during the detection. The robot will move backwards, then turn away from the detected object
* and continue. The robot runs continuously.
*/
#include <AFMotor.h>
#include <Servo.h>
// Two motors, a servo, and an IR sensor.
AF_DCMotor motor1(1, MOTOR12_64KHZ); // create motor #1, 64KHz pwm
AF_DCMotor motor2(2, MOTOR12_64KHZ); // create motor #2, 64KHz pwm
Servo sensorServo;
const int irPin = 19; // pin 5 as digital is pin 19
// Timing. I don't like using delay.
unsigned long tCnt = 0;
unsigned long tStart = 0;
unsigned long tDelta = 0;
unsigned long tTurn = 0;
int state; // Current Robot State
int lastState; // Previous Robot State
int servoPos; // Position to send servo
int servoDirection; // Direction servo is turning
int lastDetectionAngle; // Position of servo at last IR detect.
// Constants for state of tank tracks.
const int STATE_FORWARD = 1;
const int STATE_TURN_RIGHT = 2;
const int STATE_BACKWARD = 3;
const int STATE_TURN_LEFT = 4;
// Constants for Servo.
const int DIR_LEFT = 0;
const int DIR_RIGHT = 1;
const int MIN_DEGREE = 40;
const int MAX_DEGREE = 140;
/*
* Initializes everything. Is run once.
*/
void setup() {
Serial.begin(9600); // set up Serial library at 9600 bps
sensorServo.attach(10); // attaches the servo on pin 10
pinMode(irPin, INPUT);
motor1.setSpeed(255); // set the speed to 200/255
motor2.setSpeed(255); // set the speed to 200/255
tStart = millis();
lastState = state = STATE_FORWARD;
servoPos = 90;
servoDirection = DIR_RIGHT;
sensorServo.write(servoPos);
//state = 0; // Uncomment to have robot not move tank tracks.
}
/*
* Runs continuously.
* 1. Update Servo.
* 2. Check IR sensor.
* 3. Move Robot
*/
void loop() {
tDelta = millis() - tStart;
tCnt += tDelta;
tStart += tDelta;
// Tell the servo to move 2 degrees every 25 ticks.
if( tCnt > 25 ) {
tCnt = 0;
if( servoDirection == DIR_LEFT ) {
servoPos -= 2;
} else if( servoDirection == DIR_RIGHT) {
servoPos += 2;
}
// Servo position will be beyond desired angles, turn around.
if( servoPos >= MAX_DEGREE ) {
servoDirection = DIR_LEFT;
} else if( servoPos <= MIN_DEGREE ) {
servoDirection = DIR_RIGHT;
}
sensorServo.write(servoPos);
}
// Allows disabling of tracks by setting state to 0.
if(state == 0) {
moveRobot();
return;
}
// Double read the pin, @see forums.adafruit.com
digitalRead(irPin);
delay(5);
if( digitalRead(irPin) == 0 ) {
lastDetectionAngle = servoPos;
state = STATE_BACKWARD;
} else {
if( state == STATE_BACKWARD ) {
if( lastDetectionAngle > 105 ) { // right
state = STATE_TURN_LEFT;
tTurn = 1000; // turn for ~1 seconds
} else if( lastDetectionAngle < 75 ) { // left
state = STATE_TURN_RIGHT;
tTurn = 1000; // turn for ~1 seconds
} else { // center
state = STATE_TURN_RIGHT; // for now, turn right by default.
tTurn = 1500; // turn for ~1 seconds
}
} else if ( state == STATE_TURN_RIGHT || state == STATE_TURN_LEFT ) {
tTurn -= tDelta;
if( tTurn <= 10 ) {
state = STATE_FORWARD;
}
} else {
state = STATE_FORWARD;
}
}
moveRobot();
}
/*
* Uses the state of the robot to move tank treads accordingly
*/
void moveRobot() {
// The motors seemed to respond better if they receive a stop before a switch in direction.
if( state != lastState ) {
motor1.run(RELEASE); // stopped
motor2.run(RELEASE); // stopped
}
switch( state ) {
default:
return; // helps test, state 0 = dont move.
case STATE_FORWARD: {
motor1.run(FORWARD); // turn it on going forward
motor2.run(FORWARD); // turn it on going forward
break;
}
case STATE_BACKWARD: {
motor1.run(BACKWARD); // turn it on going forward
motor2.run(BACKWARD); // turn it on going forward
break;
}
case STATE_TURN_RIGHT: {
motor1.run(FORWARD); // turn it on going forward
motor2.run(BACKWARD); // turn it on going forward
break;
}
case STATE_TURN_LEFT: {
motor1.run(BACKWARD); // turn it on going forward
motor2.run(FORWARD); // turn it on going forward
break;
}
}
lastState = state;
}
/* EOF */
</pre><br />
And finally, here is Wandering Tank in action:<br />
<object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/sNGU9MCZrOE&hl=en_US&fs=1&"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/sNGU9MCZrOE&hl=en_US&fs=1&" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object>George Frickhttp://www.blogger.com/profile/00820157398592673682noreply@blogger.com5tag:blogger.com,1999:blog-34592930.post-15500993746898966462010-02-02T10:32:00.000-08:002010-02-02T10:32:54.835-08:00Arduino Robot 2 - Part 1 - Forward ScannerWork has been coming along well on the development of the second version of Arduino Robot. There have been multiple set backs; the biggest of which is my purchase of a continuous rotation servo instead of a normal one. Otherwise the bot is constructed and mostly works in tests.<br />
<br />
The goals for Robot 2 were a step up from Robot 1:<br />
<ul><li>Ability to continually scan in front of itself.</li>
<li>Ability to back and turn to avoid obstacles.</li>
<li>Smoother movement.</li>
</ul>Basically Robot 2 is a wandering avoidance robot; called Arduino Robot 2 - Wandering Tank. For this to work, I needed some type of affordable sensor to place at the front of the robot; and from there the ability to look around with it. My solution was to mount a sensor on a servo. The servo would be used to sweep across a selected field of vision looking for possible collisions. So Wandering Tank has to do the following:<br />
<ul><li>Move Forward</li>
<li>Scan left to right</li>
<li>Move backwards while object detected</li>
<li>Turn after object no longer detected </li>
<li>Repeat </li>
</ul>Because only a continuous rotation servo was available without spending more money; the design was changed so that instead of targeting a degree; the servo would have some way to trigger moving back and forth. The eventual solution was to mount a light sensor just behind the servo. A disk was then cut with a slot cut out defining the open degrees of movement. The scanner would scan back and forth, reversing direction each time the light sensor met darkness. It didn't work out this simple, and I'm still perfecting the code. It does perfectly scan back and forth in normal light conditions however.<br />
<br />
To fix the problem, a led will be added with the purpose of providing a continually known light source. The problem being that when moved from the work bench to any other area, the relative light/dark changes and the servo starts to just spin and rip wires asunder.<br />
<br />
Until part 2, where the complete Wandering Tank project will be shared, here is the scanning servo. Any ideas on doing this better are welcome!<br />
<br />
<object height="344" width="425"><param name="movie" value="http://www.youtube.com/v/vrxUusKzETc&hl=en_US&fs=1&"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/vrxUusKzETc&hl=en_US&fs=1&" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object>George Frickhttp://www.blogger.com/profile/00820157398592673682noreply@blogger.com0tag:blogger.com,1999:blog-34592930.post-4612281518981032392010-01-20T19:00:00.000-08:002010-02-09T17:42:59.089-08:00Arduino Robot 1 - The Basic TankWhat you see below is the result of my first attempt at building a robot. The goal was to build something Arduino based. It would move forward, turn around, come back; and then turn around again to be in its original position. Finally, I wanted to try multiple part selling web sites, to get experience with who to buy from. Fortunately; they were all better than expected experiences. My Arduino was a Christmas present; but I will be factoring 32.00 into the cost of the project to account for it.<br />
<br />
The first phase was an order from SuperDroidRobots.com. Tank treads, a double motored gear box, and some plastic to build a chassis came in at $40.00. The second order was from Adafruit.com, for a continuous rotation servo and an Arduino Motor Shield. The Adafruit order also came in at $40.00. Subtracting the cost of the unused Servo, this robot is built for just under $100.00. You can see the initial parts order below.<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifkJyx8HOcC77VcoKcbTlXdyp79uTsdqMUUV6xVPYSy-uDIHdewVW1_Aq2sas-FICiNIpTpIqA3UOOSXGMY8Es2ZP_HREKW9q3BUlrtLQB3pS7AjHwVdpqDxPL_dtgCiNVT3vb/s1600-h/RobotOrder1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="232" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifkJyx8HOcC77VcoKcbTlXdyp79uTsdqMUUV6xVPYSy-uDIHdewVW1_Aq2sas-FICiNIpTpIqA3UOOSXGMY8Es2ZP_HREKW9q3BUlrtLQB3pS7AjHwVdpqDxPL_dtgCiNVT3vb/s400/RobotOrder1.png" width="400" /></a><br />
</div><br />
I started by building the motor shield, this is the motor shield kit when taken out of the anti-static bag.<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgR-9Viyvwmv1OLUq1any0nD1HL_8K3h8Wb0BLueiGJnN2Kd0zK66hl3SaP8w54D6AjyecKMt1voYoOLWClWSvgoKv-KkjDoCi1-ZcPN4jU2zTe3lgfFixAUdPlqtUIbuta1oO4/s1600-h/MotorShieldKit.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="264" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgR-9Viyvwmv1OLUq1any0nD1HL_8K3h8Wb0BLueiGJnN2Kd0zK66hl3SaP8w54D6AjyecKMt1voYoOLWClWSvgoKv-KkjDoCi1-ZcPN4jU2zTe3lgfFixAUdPlqtUIbuta1oO4/s320/MotorShieldKit.png" width="320" /></a><br />
</div><br />
This is the completed Arduino Motor Shield after soldering everything into the board. The pins coming out of the bottom are the interface to the Arduino. You will notice two jumpers near the bottom middle of the picture. This is the motor power jumper, and is used in conjunction with the external power supply input; which is the block of two screw terminals just to the left of the jumper. You can see it says "EXT_PWR".<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWqFfdmiY1qkPtTCly_CPzW1FPxEiX0p-E3Ox372__zVQzr4qa86IuozOVxtRb8VZkWvwDufjYoudbz2UdLZttGhIx4bq5d42UpNr0Rq8LwOzrFBkoJ-2Eu1citXLkY5gInZwe/s1600-h/MotorShield.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWqFfdmiY1qkPtTCly_CPzW1FPxEiX0p-E3Ox372__zVQzr4qa86IuozOVxtRb8VZkWvwDufjYoudbz2UdLZttGhIx4bq5d42UpNr0Rq8LwOzrFBkoJ-2Eu1citXLkY5gInZwe/s320/MotorShield.png" /></a><br />
</div><br />
I moved on to building the "tank", this would be the chassis to hold the gearbox and Arduino + Motor Shield. I would later realize it had to hold two battery packs; one for the Arduino and one to power the motors via EXT_PWR. Getting the little plastic treads together wasn't fun, but everything came together.<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjohymnN6w0MKBis70kctlgF6Ixyfn3IdOMtWjLRBGApThmWFcNGduTj3rc9reRye1UUTej7eOQd2FMypMTNguvg3TCCl-sk15wv0xO58UVhBI8j5XXMF1XYsj20h2z5BS48wbc/s1600-h/ArduinoTank1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjohymnN6w0MKBis70kctlgF6Ixyfn3IdOMtWjLRBGApThmWFcNGduTj3rc9reRye1UUTej7eOQd2FMypMTNguvg3TCCl-sk15wv0xO58UVhBI8j5XXMF1XYsj20h2z5BS48wbc/s400/ArduinoTank1.png" width="400" /></a><br />
</div><br />
I had to solder two lines to the motors for them to work, then wire everything up. The wiring is supplying 6V from a battery pack to the motors, and there is the standard Arduino 9V battery pack powering it. Both packs are held to the chassis by velcro. You can see the Motor Shield stacked on the Arduino. Here is the final bot with source.<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh-yciDeohw28X7wRYoI80VUABawYRILmb2Vl-NLZAEN7zgk75SBB4x-DVWtOut3qUM9zZHx04r_bAG9_u7hULRVlWM7nF3HuQ-Z6WvD1zpePETH48-lCL9vPM5kBM5zIaa0Fcq/s1600-h/ArduinoBot1Final.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="160" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh-yciDeohw28X7wRYoI80VUABawYRILmb2Vl-NLZAEN7zgk75SBB4x-DVWtOut3qUM9zZHx04r_bAG9_u7hULRVlWM7nF3HuQ-Z6WvD1zpePETH48-lCL9vPM5kBM5zIaa0Fcq/s640/ArduinoBot1Final.png" width="640" /></a><br />
</div><br />
<pre name="code" class="Cpp">#include <AFMotor.h>
AF_DCMotor motor1(1, MOTOR12_64KHZ); // create motor #2, 64KHz pwm
AF_DCMotor motor2(2, MOTOR12_64KHZ); // create motor #2, 64KHz pwm
unsigned long tCnt = 0;
unsigned long tStart = 0;
unsigned long tDelta = 0;
void setup() {
Serial.begin(9600); // set up Serial library at 9600 bps
motor1.setSpeed(255); // set the speed to 200/255
motor2.setSpeed(255); // set the speed to 200/255
tStart = millis();
}
void loop() {
tDelta = millis() - tStart;
tCnt += tDelta;
tStart += tDelta;
// run motors for 5 seconds.
if( tCnt <= 5000) {
motor1.run(FORWARD); // turn it on going forward
motor2.run(BACKWARD); // turn it on going forward
return;
} else if ( tCnt <= 6300 ) {
motor1.run(BACKWARD); // turn it on going forward
motor2.run(BACKWARD); // turn it on going forward
return;
} else if ( tCnt <= 11300 ) {
motor1.run(FORWARD); // turn it on going forward
motor2.run(BACKWARD); // turn it on going forward
return;
} else if ( tCnt <= 12600 ) {
motor1.run(FORWARD); // turn it on going forward
motor2.run(FORWARD); // turn it on going forward
return;
}
motor1.run(RELEASE); // stopped
motor2.run(RELEASE); // stopped
}
</pre><br />
Finally, it all gets put into motion. I made some mistakes that others should watch out for. The motors that come with the Tamiya gearbox don't work well with the Motor Shield. Their stall rating is too high. If not for this, the code above would simply use a 'delay'; but with the Tamiya motors; the delay keeps the motors from ever getting past stall. Also, the battery pack isn't needed. In this simple case the 9V + setting the jumper would power the two motors just fine. It was fun! I have ordered my first sensor; so I'll be starting Robot 2 - Wandering Tank. Here is Robot 1 in action:<br />
<br />
<object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/pozyxlymQ04&hl=en_US&fs=1&"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/pozyxlymQ04&hl=en_US&fs=1&" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object>George Frickhttp://www.blogger.com/profile/00820157398592673682noreply@blogger.com8tag:blogger.com,1999:blog-34592930.post-91229396630143443662010-01-17T10:39:00.000-08:002010-01-17T11:39:19.374-08:00Fixing a dead Sansa MP3 player (Versions e200 e260 e280)First, here is the player we are discussing, or at least your average version:<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiv3UiLVJ-wuzftn22RZxQprH6mcNqWItoitfFdUVqGxDUig_6kkCGeBjv86Z1Wup4Mhn5Pl4DV2B9UTKZo0er1Bt3btpyjpYvWFIrryhq0DzZj2eayqa4QprZ1buPQ5vvs5dd_/s1600-h/Sansa_e200Series.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiv3UiLVJ-wuzftn22RZxQprH6mcNqWItoitfFdUVqGxDUig_6kkCGeBjv86Z1Wup4Mhn5Pl4DV2B9UTKZo0er1Bt3btpyjpYvWFIrryhq0DzZj2eayqa4QprZ1buPQ5vvs5dd_/s200/Sansa_e200Series.jpg" /></a><br />
</div>Although if you are here, you probably don't see the nice shiny interface above. That's a shame, but we'll try to fix it. This all started for me when a friend got a bag of crap from <a href="http://www.woot.com/">Woot!</a> Among the loot, were quite a few dead Sansa e2XX players. You have to use the e200 tool to reflash them, it works better under Linux, and I run Linux (Ubuntu if you must know). So I ended up in a deal where I would try to fix all three. They were all fixed, and below I share how I eventually got all three working.<br />
<br />
There are many posts on the web about how to fix these. They involve going into factory mode and flashing the firmware. Unfortunately a measurable percentage of people find that to be completely useless because if you can't get the device into factory mode then you can't update the firmware.<br />
<br />
Let's troubleshoot a Sansa MP3 e2XX player. Keep following these steps, if you make it to the end, your player is beyond my help.<br />
<div class="separator" style="clear: both; text-align: center;"><br />
</div><ol><li>Is it simply locked up? Hold the power button 30 seconds. The player should reboot.</li>
<li>That didn't work, your player turns on, but isn't responsive. Remove the cover and take out the battery for 30 minutes.</li>
<li>You removed the battery, and it didn't help. Now we'll try to get into factory/recovery mode. There are a couple ways of doing this depending on your version. They all start by turning the hold button on so you see orange. You then either hold the middle button, or the record button (and keep holding) while turning the player on. If you can get into factory mode, cool; go here: <a href="http://www.anythingbutipod.com/forum/showthread.php?t=11233">Fixing a Sansa in Recovery Mode</a> </li>
<li>You can't get into recovery mode, the player turns on; but all you get is a blue ring. This is the ridiculous problem happening to a lot of people. They end up throwing away the player if it is too late to return it. The short answer is; your memory probably came loose. Here is an illustration of the problem: </li>
</ol><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiuYNBthK781QqCvsQumMEoFFM8bwdQSKsMJJS4ZSc1Vql-bgFoluG2aARga_XA5GUA1WlA0slwx4aXwzMJXONJDtdcz1-w3OOma1-CQjPjirxypxXbQV0GUABA5KyKpxECx-yI/s1600-h/SandiskLooseMem.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiuYNBthK781QqCvsQumMEoFFM8bwdQSKsMJJS4ZSc1Vql-bgFoluG2aARga_XA5GUA1WlA0slwx4aXwzMJXONJDtdcz1-w3OOma1-CQjPjirxypxXbQV0GUABA5KyKpxECx-yI/s320/SandiskLooseMem.png" /></a><br />
</div><br />
It makes me upset with Sansa that the memory for their MP3 players is attached with no locking mechanism at all. Here is what this should look like:<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQBcvEQ861ckpLzHlatXOqLoWCvitmo5HUUIMNpSIcZCHbRmPyK9thPaci4GBpbsLWV97GC2IynOMLoY9Nv705d3Ci5kMzAtEYv1I50E27H87pNHTCAbDO8Ck3bK_3PZj5vfmg/s1600-h/SandiskFirmMemory.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQBcvEQ861ckpLzHlatXOqLoWCvitmo5HUUIMNpSIcZCHbRmPyK9thPaci4GBpbsLWV97GC2IynOMLoY9Nv705d3Ci5kMzAtEYv1I50E27H87pNHTCAbDO8Ck3bK_3PZj5vfmg/s320/SandiskFirmMemory.png" /></a><br />
</div><br />
Fixing this is simple, and NO; you don't have to take the player apart as in the above pictures. I took a player apart, and had the memory fall on the floor; and here we are! Simply remove the battery cover (4 screws), remove the battery; and then find the big black square of plastic:<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgLiw7_9i1q_gfdNTWPxBDgZzUZouz3T3YR7iL8NPDiQJO_4kpvWZ-GDJp7X1m1aBJQD7BkeuP33QHBn9hNJeSb0i7-el4D8ax5TgoLxu34tECg0nVyQ2g_-BWM7EsMIzKgVWll/s1600-h/SandiskWithCover.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgLiw7_9i1q_gfdNTWPxBDgZzUZouz3T3YR7iL8NPDiQJO_4kpvWZ-GDJp7X1m1aBJQD7BkeuP33QHBn9hNJeSb0i7-el4D8ax5TgoLxu34tECg0nVyQ2g_-BWM7EsMIzKgVWll/s320/SandiskWithCover.png" /></a><br />
</div> You are going to need to remove that, it is easiest to push in the middle; forcing an edge to pop up, and then removing it. It's just lightly glued in place. You should then see your memory:<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj8U8O8Bwd9CBypyXpRIIUIMVZQX9ndjzPsGwkG-UiIWEIvN_ov8pG0n866_fhsMAHouKVf3sPhGcPzIbMP-cOxGnJUfu_Kx4v47ZUS06UdzSF2di9PSkRbULmua35sfA5VWRjf/s1600-h/SandiskMemView.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj8U8O8Bwd9CBypyXpRIIUIMVZQX9ndjzPsGwkG-UiIWEIvN_ov8pG0n866_fhsMAHouKVf3sPhGcPzIbMP-cOxGnJUfu_Kx4v47ZUS06UdzSF2di9PSkRbULmua35sfA5VWRjf/s320/SandiskMemView.png" /></a><br />
</div> Give the memory a firm push; if you hear a 'click', you probably just fixed your player. I know, this whole blog for that?!?! I spent hours reading forum after forum telling me to just 'be persistent trying to put it into recovery mode'. No; your memory may have come loose. I fixed two different players this way, and one other by flashing it. If this didn't help; you may be out of luck. Keep googling!George Frickhttp://www.blogger.com/profile/00820157398592673682noreply@blogger.com8