Saturday, March 14, 2015

Replikeo Prusa i3 Rework Build - Part 4: Initial Prints and Modifications

This is Part 4 of my Replikeo Prusa i3 build account. This post will cover the initial modifications I made to the printer, how they effected print quality, issues I had with those modifications, and work for the future. It will also feature pictures of first prints and tests because I think those are obligatory when writing about a RepRap 3D printer. If you are interested in my other posts on this topic:

Printer Modifications

Board Mount
In my mind, the single most important upgrade I made to my printer was to mount it to a plywood board. This allows me move the printer easier without getting it out of alignment or level. It gave me a place to mount the PSU and several of the other upgrades I will discuss.

The board is 3/4" oak plywood, but any sort of plywood would likely work (just make sure it is flat). The board is 20.25" x 22.5" . I mounted it with 1/2" pipe mounting clamps from Home Depot as shown in the picture. I used 8 of them, and it is rock solid. The corners never get loose, and I don't worry about it shifting when I put it in my car or rotate it on my work table. On the bottom I used some no skid rubber feet also from Home Depot. It keeps the vibration down and makes it feel very steady.

Filament Spool Holder
This was actually the first modification I made to the printer. I quickly got tired of having to manually unwind printer filament. It is a combination of parts almost identical to THIS blog post.

This spool holder actually did work pretty well. It would probably work better if you used real 608 bearings. I eventually abandoned the OSFA spool holder and just hung it on the rod. That actually works better for me. Another note, the spool mount limits the z-height on the printer as the stepper hits the mount. It needs to be a little thinner. At some point I will get around to fixing it. It is also worth noting that without the z-axis support (next mod), this spool holder causes the z axis to bend over slightly. This causes the nozzle to raise off the build plate. This means when you put a heavier spool on the holder the nozzle gets pulled off the plate more. Not ideal. Overall I would recommend this setup, but if you have something better, go for it.

Z Axis Support
Downloadable HERE this modification supports the z axis so that it doesn't rock during the print. It bolts right on to the back of the z axis rod supports at top of the frame and screws into the plywood board. It requires 2 each of the printed parts and one 5/16" x 36" threaded rod cut in half. It works great. I highly recommend an upgrade like this.

PSU Mount
This is not so much about performance as it is convenience. I drew up a PSU mount in CAD for the PSU that comes with the Replikeo kit. A couple screws and some zipties and the PSU is firmly mounted to the plywood board. Now the printer is one unit that can be carried or put in a car without worry. Get the printed parts HERE.

Power Switch
I was going to wire up a fancy power switch on my printer, so I would not have to unplug it all the time. Then I realized I could just get a cheap surge protector and use that instead. I think I got a 2-pack for $6. Worth it in my mind.

X Axis Belt Tensioner
There are a couple of these drop in replacement x idlers that add tensioners. I liked THIS one the best. It went on with no problems. Now I can tweak the x axis tension however I want. This probably isn't a high priority upgrade, but it is something that I changed.

Z Axis Adjustable Endstop
THIS upgrade has been very helpful in tuning the printer. It allows me to change the endstop location with the turn of a screwdriver. It is a little flaky having the screw hit the limit switch arm. Someday I plan to put a larger pad on the end of the screw so that it hits more uniformly, but it works for now. I printed the tall version and snapped off the bits I didn't need with some wire cutters.

Print Cooling Fan
I use THIS cooling fan setup and it works great. I highly recommend that you shell out the extra $2 and get a centripetal fan. This fan setup blows more air than I need.It blows air right across the nozzle, so I had to wrap a little insulation around the extruder block to keep the temperature from fluctuating too much when the fan comes on. Possibly against common practice, I use it both on PLA and sometimes ABS depending on what I am printing and what other settings I am using. See the next mod as well.

Dual Fan Mount
THIS clips onto the Wade's extruder body that comes in the Replikeo kit where the fan would go and allows you to mount two fans. That means you can keep your current extruder cooling fan and also use a print cooling fan like above. If you are going to add a fan, it works great for me.

That is all of the modifications I have made to my Replikeo Prusa i3 printer thus far. To me, I would consider the first 5 "must have" improvements. They just improve the performance or convenience of the printer so much that they are definitely worth your consideration. If you have any other improvements you recommend, let us know in the comments. Now the obligatory first prints I promised.

First Prints

These are some of my first prints. The green is Hatchbox PLA. The white is the ABS that came with the kit. They are printed at various temperatures and layer heights using hairspray as the bed adhesive.
First ever prints. Learned the importance of bed prep right off the bat

Switched to the included ABS

Printed a few replacement parts

While I could post plenty more pictures I'd say this post is about long enough. If you want to see more, check out some of my other posts under the 3D printing tag to the right. If you have any questions or comments feel free to post below.


Tuesday, March 10, 2015

Fixing Autoscroll in GNU Octave for Windows

A quick and dirty post documenting an Octave "fix" for a problem I was having. Running GNU Octave version 3.8.2-5 from MXE installer found HERE on a Windows 7 64 bit PC on 3/10/2015.

The Problem

The output of GNU Octave as installed above has a feature that while I am sure is useful to some, is quite irritating to me. Outputs that are too long to fit on the screen of the terminal are paginated. It will display the values that will fit on the screen and then wait for you to press "f" to see the next page worth's of data. See below. It displays "-- less -- (f)oward, (b)ack, (q)uit" at the end of each page.

While this may be great if you want to see every single value, if you are running long programs where the output is mostly for debugging purposes or similar, this can be irritating. I finally decided to figure out how to change this. Here it is.

A Solution

While I don't claim to understand exactly what is going on above, it is clear that the "pager" being used on my install is "less". I wanted to change it to "more".

1) Check what pager you are using - Type "PAGER()". My guess is it will probably be "less". 

2) View help file on PAGER() - Type "help PAGER". A couple useful websites: Documentation from a German university and Documentation on the Octave Wiki.

3) Change pager to "more" - Type "PAGER("more")

This should make the output look like the picture below. As you can see it scrolled through my entire output just fine. I will note that "PAGER()" now returns "more". Honestly, I don't really know what I changed under the hood, but it worked. Also note that it will reset when you reopen Octave.

That is all I have on this. If anyone has a more detailed explanation of how this works or other ways to fix this "problem" feel free to post in the comments.

Thursday, March 5, 2015

Serial Port Communication with GNU Octave in Windows

This is not so much a finished post as it is a place to record progress. Use any information found on this page at your own risk.


I have been using GNU Octave in place of MATLAB on my laptop for a while now. It is free and serves my purposes well. One place MATLAB does have it beat though is in its ability to communicate with outside hardware through a serial port. I recently needed this functionality for Octave. This is how I made it work. My configuration:
  • Windows 7 - 64 bit
  • GNU Octave 3.8.2-5 using MXE installer
  • Instrument Control Package 0.2.1


Install Octave

If you found this post I will assume you are probably running Windows. There is a convenient unoffical installer for Windows HERE. At the time of this writing I am running 3.8.2-5. Anything greater than 3.8.0 has the nice MATLAB style GUI.

Install Instrument Control Package

The equivalent of MATLAB toolboxes are packages in Octave. You need the instrument-control package to access the serial ports. There are two ways to install it.

1) Install it from Octave forge. Assuming you have an internet connection, open Octave and type in the command window "pkg install -forge instrument-control-0.2.1.tar.gz" Replace the 0.2.1 with the newest version of the package.

2) Download it from HERE. Assuming you did a standard install, move it to the folder "C:/Octave/Octave-3.8.2/src". There you will find all the other packages that were included with the installer. Now open Octave and make that folder your directory. Type in the command window "pkg install instrument-control-0.2.1.tar.gz". Obviously you may need to change the name of the package if you download a newer version.

Both options will take a while. One of my first mistakes was thinking I had crashed my computer. I wasn't sure if it would work on Windows, so when it just sat there for a minute I thought it was hung. Just give it some time. Mine took a couple minutes. 

Load Instrument Control Package

You only have to install the package once, but you need to load it every time you open Octave (you can also set it to auto load. Google it.)

Type "pkg list" to see all your installed packages. If you don't see instrument-control then you need to go back to the last step. Any package with an * by it is loaded.

To load the package type "pkg load instrument-control". Now load the list of packages again to see if it worked.

Use the Package

Now the part you have been waiting for. It is important to note that at the time of this writing the instrument control package is not a drop in replacement for the serial capabilities of MATLAB. Here are some helpful links to illustrate this. It is fairly obvious that the function names are different or missing for Octave.
For my initial test I used an Arduino with a jumper between Rx and Tx. This essentially mirrored anything I sent back to me. To simplify things, go to the device manager and change the serial port number to COM1 through COM8. Over that and additional work is needed. Device Manager > your port > Port Settings > Advanced > COM Port Number.

My Additions
To better serve my needs I added a few files to make the package more MATLAB compatible. Just make sure they are in your path somewhere if you want to use them.

srl_fwrite: Download HERE. Similar to the MATLAB fwrite. The regular srl_write only accepts char and uint8s. I made this function to simplify sending other variable types. Accepts three inputs 
  • Serial Object
  • Data to be sent
  • Data Type - int8, uint8, int16, uint16, int32, uint32, int64, or uint64
srl_fread: Download HERE. Similar to MATLAB fread. Reads serial port and returns data type specified. Takes three inputs.
  • Serial Object
  • Number of values to be returned. (eg for 3 uint64s, enter 3 not 24)
  • Data Type - int8, uint8, int16, uint16, int32, uint32, int64, or uint64

Test Script
Test Script: This script was taken and modified from the wiki linked above. It opens a serial port, sends a couple values and then attempts to read them when the serial device mirrors them back. A "correct" output should look something like this.

Serial: Supported
s1 = 0x444
int8 = 200
intdata =

    0  142    1   44

That is all I have at the moment. I hope this tutorial was useful to someone out there. I plan to do another post on the way I am actually using this capability in the future as a more in depth example.