Saturday, 22 February 2014

Calibrating 3D Printed Sizes in X / Y axes

Early days, calibrating my RepRapPro Mendel was a never-ending task. Little did I realize it was NOT calibrated and I was using software to fix errors that I should have actually calibrated to be correct.

One big issue I've been fighting and overcome is what a lot of people call the 'perimeter width' test. Although the perimeter width has very little to do with the outcome.

I worked out that the 'perimeter width test' from the wiki calibration page only really tested for dimensional correctness in the x axis, and I wanted a test part where I could measure the sizes achieved in x and y for male and female holes / features. Circles are hard to detect error in just 1 axes, so a male and female 10mm square 'plug and socket' arrangement seems perfect. I give instructions below on my take on calibrating for perfectly sized and shaped objects. Triffid Hunter has an EXCELLENT tutorial on setting x, y, z and e steps and calibrating the machine mathematically, but, unlike the digital world - we in the physical world have imperfections and variances that mean that as close as we might get, almost nothing is 100% perfect... You should follow this guide to calibrate your machine initially, and continue on from here if your results are not quite perfect.  It IS tedious, and it CAN take a while, but it saves so many prints from ending up on the scrap heap, it is worth the trouble.

Print this using your default, initially calibrated settings, the male piece should measure right on 10mm in x and y directions and the female socket should also measure 10x10mm internally.

Instructions for printing Male/Female Minimal Calibration Pieces

These instructions are PER AXIS (ie if your prints are a perfect 10mm in x, but y has issues, then the information below should only be applied to the y axis as the x is already correct! Although this print simultaneously TESTS x and y axes, you should troubleshoot them individually as they are not influenced by each other. 

1) If both pieces are too big, you have too much plastic being laid down on the perimeter and this will need to be adjusted to be lower OR the perimeters need to be 'inset' (I know at least kisslicer provides this function). What you need to configure here is your flow rate. This is related to your e-steps, but you can tweak the flow rate on the fly (in marlin firmware) by issuing a "M221 Sxxx" command, where xxx is the flow rate in percentage (M221 S95 will only use 95% of the plastic that would normally be used). If you notice your infill is a bit lacking after achieving correct dimensions you can turn the infill width up or down to achieve a 'nice fill'. I usually find this bit is a little 'trial and error' for myself at this stage. If you find you always use a M221 S95 to get perfect sized prints, it is probably best to update your firmware, specifically - reducing your e-steps to 95% of their current setting.

2) If the male is too big or too small and the female is correct OR the female is too big / small and the male is correct, you possibly have incorrect x and/or y steps set. Another test to prove that it is an x/y step issue before you go modifying firmware would be to print something larger - a 20mm box should do the trick. (you can measure the base of this test piece if your first few layers aren't 'squished out and fat' like they can be if your z height is incorrect).
If you find that the 10mm male and female pieces are actually 10.2mm AND you find that the 20mm piece measures 20.4 or so... You would also likely find a 100mm piece prints at 102mm - basically your print head moves a percentage MORE (or less) than it is being commanded to due to your controller telling it it needs to turn a certain amount of steps - if the number of steps it thinks it should move is incorrect, the position it moves to is incorrect, causing parts to basically be 'scaled' incorrectly.

If the parts are too large, your steps per mm will need to be lower.
If the parts are too small, your steps per mm will need to be higher.

Triffid Hunter explains how to calibrate steps in his guide - follow the instructions but instead of mathematically calculating your steps, adjust them by a small amount, retry the test and re-measure.

If your male is 10.2mm square and female is 10mm square, you hope to achieve something like 10.1mm square for both, this way you can then go back to step 1 above and reduce the width of the perimeter by reducing the amount of plastic laid to achieve correct dimensions. It is false to assume that because you are using a 2mm pitch belt with 20 tooth pulley on blah blah stepper motor that you can mathematically calculate your x and y steps. You will be extremely close, but if you want the precision and you are not achieving it - you should never assume that your motion system couldn't
possibly be incorrect.

3) If both male and female pieces are too large or too small you possibly have a scaling problem or your x/y steps are out. They may fit together, but the problem is your printer is not printing correct sizes. 2 parts from your printer will fit together, but if you print a part with a nut-trap or other feature which adapts to something it will not fit correctly!
Check first that you have any scaling options in your slicer turned off - they should not be used when calibrating. They will likely be off but some people turn them on in an effort to correct for undersize holes etc.
If they are off, the next thing to check would be x/y steps.


If the parts are too large, your steps per mm will need to be lower.
If the parts are too small, your steps per mm will need to be higher.

Saturday, 8 February 2014

3D Print Gallery

Updated 10/2/2014

This post will be an on-going gallery of parts that I've printed on my RepRapPro Mendel or pictures and videos related to the machine itself. The first section will be videos, the second shows a lot of my prints to date, including the first few prints and the third section is pictures related to the machine, calibration etc. The machine has come a long way from the blobby messes it was creating when I first set it up!


Video - 3D Printing a Screw Cup - One of my first prints!]

Video - A few layers of an Elephant shaped Cookie Cutter
(Showing off my new blue lights!)

Video - Testing Slic3rs new "Spiral Vase Mode"
If you look closely you can see the plastic as it flows out of the nozzle

3D Printed Parts:

In the beginning, before calibrating the machine.
It took me a long time in the beginning to understand why things like these holes were happening.
In this case it was just printed too hot!
Screw Cup - Natural ABS - .25mm layers
(Video here)
Swiss-Army Keys - Gold PLA - .25mm layers
Cat - Glow in the Dark PLA - .25mm layers
(Ironically for a cat, you can see IT in the dark and it cannot see YOU ;-)
Micro Heart-Gears - Gold PLA - .25mm layers - Really turns!
File Handle - Grey ABS - .33mm layers
An Antique Bicycle part replicated for a customer, the 3D printed part is the green one.
Decorative Roses - Natural and Green ABS - .33mm layers

3D Printed Lamp Base - Black ABS - 50 pieces in total

Pictures of my modified RepRapPro Mendel:

(only RepRappers and geeks need read on ;-)

My RepRapPro Mendel kit has arrived! Time to start making my 3D printer!
Machine frame and mechanics complete! Next the hot end and electronics! 
Just about ready to print now! Just have to hook up a few more connections.
Ready to begin! 

Monday, 3 February 2014

3D Design / Print Project - Ikea Lamp Upgrade

3D Printed Lamp

I've just moved into a brand new house with my girlfriend, we're moving things into the house and I've come across a lamp base that we bought from IKEA. The lamp suited the small space it was in previously, but it looked a bit anorexic in our lounge room. I wanted it to be just a little more... "bulky"

This is a CAD render of the lamp base so you have an idea of just how simple this lamp was originally.

See... VERY simple, a square plate as the base and 12mm shaft as the 'stem'.

I decided to jazz it up a bit by adding to it somehow. I have a 3D printer at my disposal so, why not use that to do something interesting! (I've wanted a nice big project to test it out on too!)


The printer I have is not large at all. It's great for parts that fit into its 200mm x 200mm x 100mm build volume, but this lamp is at least 1.2m high. The only way to 3D print something this size would be to make it in sections. I measured the lamp bases 'stem' with callipers and found it was 12mm diameter. I decided each segment of my design should 'clip' onto the stem. This seemed easiest. I sat down and sketched out a few ideas and came up with this design which I created in AutoCAD (note that I have added circular pads on the bottom which you can see in the pic below, these assist with printing and simply snap off later).

"You know they got in trouble for the 3D printed gun right? You can't go making crossbows..." - My Brother

My idea is that I will have many of these clipped onto the stem in succession, and that I can then rotate each one slightly more than the last so that they sort of 'screw' up in a helix around the lamp base... or I could just have a straight vertical strip or a zig-zag pattern, or just randomly arrange them! I think it could look neat! I was confident it would turn out good, and so after designing it I decided I didn't need to do a final render of the entire lamp, I would just go ahead and see how it turned out! At least print a few segments and see how they looked.

Preparing the print:

There are 2 main plastics I use for 3D printing, PLA and ABS. PLA is renowned for being very easy to print with, but it also has a lower melting point (a VERY hot day could make a PLA part droop or distort) and it is less flexible than ABS - Since I was after a "snap" fit between each part and the lamp base ABS is in the lead, it will easily stretch that little bit and snap onto the base. It is also plausable that the lamp would get a bit warm both in use and from hot sun coming in a nearby window, so ABS was chosen for this project.

ABS DOES have some caveats though, it tends to contract as it cools, which in turn can make it 'curl up' and become un-stuck from the build platform. This results in errors in the finished part or completely failed prints. I incorporated the circular pads on the bottom to overcome this - the pads give the part more surface area and act like suction cups or wads of Blu-Tack that hold the part to the build plate and resist the warping that naturally occurs.

There are 2 programs I prefer to use for 'slicing' the 3D models and preparing them for printing. One is named Kisslicer and is my go-to slicer. It is VERY fast, easy to use, and gives the highest quality printed parts. Printing with Kisslicer is also usually completed quicker and the machine is smoother / quiter due to its intelligent path generation. Slic3r is a good backup tool - I will ALWAYS use Kisslicer first, but if Kisslicer has problems or the part requires some really fine-tuned tweaking to work, Slic3r will often do the job. Slic3r also has a 'brim' feature which automatically inserts a brim (like a top-hat brim) around the bottom of the part which has the same effect as the circular-pads I added to aid printing.

Kisslicer showing the first 'slice' or 'layer' that will be printed.


I decided on black material, made the first part and noticed that it was a really easy print, without much detail and big long lines / curves. I could run it a bit faster and sped the time up from around 42 minutes to just under 30 minutes per part. Before starting the second part though I snapped the circular pads off the first part and went to check how it fit on the lamp base.

Snaps on perfectly!
Great! So I continued printing and got into a 30 minute routine, I would go into the printing room, remove the freshly printed part and begin printing the next. After I had printed a few more pieces I tested out my design to get an idea of how the finished product would look.

I didn't realise how dark this picture was! Might have to squint!

It looks... ok? yeah.... I think? Maybe?

I really wasn't sure at this stage! But continued anyway - and as time went on it looked better and better. Here are a few pics while it was still not quite finished, but I was trying different configurations to come up with my favourite.

After trying different variations of twists, zig-zags and random configurations (changing a few times a day for a week or so) we decided that a nice gradual helix was most appealing. I also decided the 2 lamp shades I have are ugly on this now, so, I will either get a plain white cylindrical lampshade the same diameter as the lamp base segments, OR 3D print a lamp shade continuing the design of the base up around the bulb (perhaps in white plastic instead of black). When I decide I will update the post with pics!

From concept to reality:

My 3D Printed Ikea Lamp Upgrade!

Sunday, 15 September 2013

Make the most of that huge tool you have in your hands

For those of us with a screen larger than 4 inches and multicore processors in our phones (most android users), apps like the two I'm about to mention are another reason you will be glad you didn't get an iPhone.
The first one is called Floating Stickies. I found this app a few months back, and it works brilliantly. The name says it all, but you may not realise just how useful it is until you try it out. It puts a little sticky note on your screen on top of whatever app you're running in the background. A good example of use is when you're looking up details on a website:

As you can see, its great for taking notes without the need to switch between apps - but equally as useful is the fact that it is dockable!

I've got three stickies 'docked' on the upper left side of my screen in the above pic, they're represented by a small 'pencil' icon and can individually be dragged onto the screen, resized, added to or copied from at any time, on top of any app! It isn't a huge leap in technology; desktop operating systems have used windowed applications for a long time, but we are so used to full-screen apps on smart phones that its refreshing to see some developers creating floating apps such as this - it brings multitasking on your phone to a new level. Have a 10 inch tablet? It makes a lot more sense to have floating stickies than a full-screen 'notes' app for jotting things down.

Floating Stickies is available for free on Google Play:
The second app I'd like to touch on is called Showtime. It does what the name says, plus a little more that you mightn't expect! (The developer has called it Showtime - this is the title when in the full-screen mode of the app, but search for Youtube Floating HD Player on the Play store or use the link provided below)

Here I've got a chat window open with one of my mates AND while I'm waiting on his replies, watching videos on YouTube! The window can be minimised (to your notifications bar) and still play audio, ready to be recalled at any time in a floating, windowed format or in full-screen glory. You can optionally pause first (so that you don't miss out on those videos you're actually watching as opposed to those you're just listening to.) AND it allows you to select the quality of the video, seek through the video, mute - all from the floating window!

It would be GREAT if the app could also play videos from your gallery - well guess what? IT CAN!
(Disclaimer, on my HTC One X running a custom ROM, it doesn't work correctly, but most people report it working for them!)

At this stage you have to browse to the desired video within your gallery, then "share" the video and choose "Showtime" as the target. This might be a tad clunky, but it's not hard, and I really think it was great that the app developer included this feature - a bit more polish and it will be nothing short of perfection! Infact, this app is worth getting even for smaller screens / older devices as it allows you to stream in whatever quality you desire (most older devices have a limit on maximum quality, this app overrides that limit.)

Showtime is available for free on Google Play:

I found these two apps a little while back, but I've since purchased a new Ainol 'Spark' 9.7" tablet (with retina display) and was looking for apps that would be useful on a larger display - These two apps will be great for a tablet or android-powered TV!

Leave us a comment if you've used one of these or similar apps before, or if you know any others which make the most of our large screens!

Monday, 3 June 2013

Why you should buy an iPhone (but not right now!)

Had an amusing conversation in the car with the missus the other day.

I better set the scene first...

My handset at the moment is HTC's flagship model (was when I bought it) the "One X"...
This MONSTER handset is actually faster and has as much RAM as the netbook I'm writing this post on, it's a Quad-Core 1.6GHz, 1GB RAM, 4.7" 720x1280 resolution device and mine is running Jelly Bean 4.1.2.

Missus has an iPhone 4... 1GHz single core, 512MB RAM, smaller screen.

We share a car with a Bluetooth enabled stereo in it. This stereo worked 100% every time when it was connected to my (old) iPhone, or the missus iPhone. Since I've been using it with my android however, I notice a few things:
  • With iPhone, the car connects automatically and you simply have to press "play" on the stereo to resume playing music. This doesn't SOUND like much effort, but it seems like one extra step... If you have a CD in, or the radio selected, it will start playing music as soon as you turn the car on, no need to press "play" to resume.
  • With an android phone you get a LOT more options here. Various apps and settings can allow you to resume playing music when Bluetooth connects, specify the volume, read SMS's out loud, turn on the GPS and open a navigation app. This is the reason I've moved to android, the ability to streamline things and personalize your settings a LOT more than the iPhone. If you found yourself constantly doing an array of tasks every time you get in the car or every time you arrive home, you can set your phone up to do all these tasks automagically.
  • THE CATCH: Although android does allow for all this customization, it is NOT flawless. On occasion I would jump into the car and the music would not play, the Bluetooth would not connect, or it would connect and play, but would have popping sounds and stuttering which made it "unlistenable".
    The only method I could find to get the android working happily again was the golden system technicians trick...

                                              Turning it off-and-on again.

This is where the amusing bit comes into it...

My past 12 months, at least once a week I jump into the car and have this audio stutter problem... So I reboot the phone, wait about 45 seconds and we're back in business - the thing will usually re-connect automatically and start playing music. Not hard, just something I've come to live with.

The missus (I should also point out she uses a Macbook) jumped in the car, and that reminded her that "Hey - I tried to connect my phone to the stereo the other day and it gave some error message about bluetooth."

So (while driving) I go through some troubleshooting steps with her.
  • Have a look under Bluetooth in settings, is Bluetooth turned on?
  • Have a look at your devices under Bluetooth, can you see the car stereo?
  • Ok, click on it and go to "forget this device", then we'll add it again.
         "Ok, tried that and it says there's a Bluetooth error"
  • ....
  • ummm.... Just try switching your iPhone off and on again?

The response I got was the amusing bit. As an android user (and a PC user), I am used to rebooting to fix a problem. Her response to this was "oh, oh yeah - I totally forgot you could do that!"

The reliability of the iPhone and Macbook really speak for themselves. She has a pretty geeky boyfriend (if I do say so myself :-p) and so she's no stranger to 'basic techie' stuff, choosing operating system at boot or changing settings on computers etc. But whenever I tell her to reboot the Macbook I get this "what?" sorta look, like, she's not sure if she heard me correctly.

THIS is how reliable apples products actually are, their users think of rebooting as a "What? ok, just give me a minute while I remember how to do that..." kind of moment - it's such a rare occurrence... Tell a windows user to reboot and they simply go "yep" - it's a completely different attitude...

Proof is in the pudding;

My android now has a host of 'reboot' options when I press the power button. I can do a quick reboot or a full reboot (I often do the full reboot to be sure). I have this Bluetooth 'bug' as well as occasional other problems which prompt you to 'turn off-and-on again' to give your phone a chance to clear it's head...

iPhones have a "shutdown" button and that's it, because, it's almost unheard of that you would need to reboot it. She has been happily playing games, writing messages and emails, browsing with tabs, installing and uninstalling new apps, playing music and videos - for close to 2 years straight! Without (purposely) turning the phone off-and-on again (I say purposely because on the odd occasion it HAS run out of batteries, so I can't say it's been constantly on for 2 years straight). This is the sort of reliability I would need if I were getting a smartphone for my mum, my nan, or anyone of those "I don't know what a smartphone does" types. Not because it is less customisable and therefor easier to use, but because they can take it out of their handbag and do something on it, confident that it will "just work".

Apples current offerings;

So after the iPhone 4 was released, there was the 4S - TO MOST PEOPLE they are almost the same phone, the camera was improved, and the specs were raised a bit, but, most people aren't playing full 3D high-graphic shooting games etc. on their iPhone, so the specs of the iPhone 4 weren't lacking in any way.

Then the iPhone 5 came out, with the infamous new "ultra-scuffable" aluminium body, and, well, a slightly taller screen and not too much else.

In about the same amount of time, android has had 2 or 3 MAJOR operating system updates, handset technology has been increased to offer handsets with up to 8 cores, 2GB of RAM, 5" screens, 3D cameras and 3D screens, the ability to plug in USB devices (keyboard, mouse, hard drive, camera etc) and the android ecosystem (the app store) has grown a LOT (where it used to be microscopic when compared to apples ecosystem).

What will they think of next?

The iPhone is, and should remain to be, a solid unit. But apple will need to come up with some new ideas soon, as the new iPhones will start to be overshadowed by increasingly impressive new androids. My advice to those in the market for a new phone right now is; WAIT... if you can, wait a little and see what happens in the next few months. The iPhone 5 is a renowned "flop" - it is "good" - but it's not 2 generations better than an iPhone 4. It will be interesting to see what the next iteration of the iPhone will be capable of - and with so many manufacturers competing in the android arena, we're sure to see some quick developments there too!

Sunday, 26 May 2013

JAVA Guessing Game

This post will take a look at a "Guessing Game" app I've created using JAVA. There are many ways of accomplishing this but this is one working method I've come up with after taking a few basic JAVA lessons. I though I might share in the hopes that someone like myself may find it useful.

The requirements of this program would be:
  1. A random number is chosen (between 1 and 100)
  2. User is greeted with a message and instructions
  3. User is then prompted to input a 'guess' (an integer)
  4. 'guess' is checked the random number
  5. User is instructed weather the guess was too high, too low or correct
  6. If the guess is not correct, repeat steps 3 to 5 until the guess is correct
  7. Once the guess is correct, tell the user they've guessed correctly and exit program

Since I'm new to Blogger and am yet to find a nice way of formatting my text here, I'm going to paste the entire program here first and then discuss parts of interest below so, without further a-do:

 /* A simple number guessing game  
  * call this  
  *    Written by Jarred Baines, 2013  
 import javax.swing.JOptionPane;  
 import java.lang.Math;  
 import java.util.Scanner;  
 public class GuessGame {  
     // Give answer a random int between 1 and 100  
     private static int answer = (int)(Math.random()*100+1);  
     private static int guess; // variable to hold users current guess  
     //Method to generate message based on the guess  
     public static String makeGuess(int guess, int answer) {  
         // if...else ladder to generate message for user  
         if (guess < 1) { // This guess is invalid  
             return "Nope! The number is between 1 and 100";  
         } else if (guess > 100) { // This guess is invalid  
             return "Nope! The number is between 1 and 100";  
         } else if (guess < answer) { // The guess is too low  
             return "Too low! Try again?";  
         } else if (guess > answer) { // The guess is too high  
             return "Too high! Try again?";  
         } else if (guess == answer) { // The guess is correct  
             return "Congratulations! You are correct!";  
         } else return "Error detected"; // end of if ladder  
     } // end makeGuess method  
     public static void main(String[] args) {  
         // you can uncomment the following line of code to  
         // display answer in console, useful for debugging  
         //System.out.printf("Answer is: %d\n\n", answer);      
         do {  
         guess = Integer.parseInt(JOptionPane.showInputDialog(  
             "I'm thinking of a number between 1 and 100.\n\nGuess what it is!"));  
         JOptionPane.showMessageDialog(null, makeGuess(guess, answer));  
         } while (guess != answer);  
     } // end main method  
 } // end GuessGame class  

A few points of interest I came across while creating this program:

Math.random() outputs a double value, greater than or equal to 0.0 and less than 1.0.
So to get a number between 1 and 100 we need to multiply it by 100.

Math.random()*100 outputs a double value greater than or equal to 0.0 and LESS THAN 100.0.
This means that it will never actually be 100, although it could be 99.99. Which in conventional maths would ROUND up to 100.

However, in a cast to int such as this:
We LOSE the fractional part of the number, it doesn't get rounded, it gets lost! This gives us an output of 0 to 99.

thus, to get our required 1 to 100 random numbers, we must add 1 to the expression, like so:


MechaSonics hey?

Sounds pretty cool, I think! Especially for a 4 pronged blog which will revolve around 4 of my main areas of interest, Computer Programming, Mechanical Engineering, Electronics, and Sound! The name is a bit of a play on the word "Mechatronics" - which is a combination of Mechanical Engineering, Electrical Engineering, Control Engineering and Computer Engineering. Add into the mix my love of Sound Engineering / Music Composition and DJ-ing and you've got to be crazy NOT to call it "MechaSonics", right?
So what better way to kick things off than an introduction?

My name is Jarred, I also use the handles "JazzyB" and "JBainesy" on various forums and sites around the web. I work as a CNC machinist and I also work as a DJ, spending my spare time composing electronic music, designing and printing out objects using my 3D printer, hacking my phone (to make it do things it couldn't / shouldn't do) and writing JAVA and Android apps (which I am learning how to do at the moment, through studying a Diploma of JAVA Programming through Fitzwilliam Institute).

As soon as I figure out the ins-and-outs of Blogger, I'll have one more hobby to add to the list ;-)