Prusa i3 Modifications for SB hackerspace printer class

I did much of the work to get the Santa Barbara Hackerspace to have it’s first printer build weekend with a Prusa i3. I wanted to note the modifications I made and other things here.

I initially was going to do this with the Mendel 90 because of how much care and detail Nophead put into the instructions, bill of materials and more, but I had some trouble building my printer and getting all the parts. Soldering ribbon cables is pretty terrible and I was never able to fully build the electronics board that goes on the extruder.

I looked at the Prusa3-vanilla but ended up going with the master branch of the Prusa3. This means I was bit by some bugs, such as the lack of room on the extruder for nuts on the hobbed bolt.

I also initially planned to go with the larger, more sturdy box frame. Aligning and building this is more difficult, and it did not end up happening because the space got their laser cutter just as I was about to start building. This meant on my prototype printer the X rods stick out an extra 70mm, but oh well.

I went with the grabber laser cut frame, modified to work on our 12″x20″ laser cutter (by shortening the frame to 12″) and extended the top Z rod holders to compensate for the lost Z height. My prototype has a max Z of 185mm which is quite respectable.

The configuration setting for the aluminum frame expects the screws to go into tapped holes in the aluminum, but at least on the Y carriage I wanted the bolts going the other direction, so I’ve tweaked the Y belt holder to have captive hex nuts.

You can see these changes and others I’ve forgotten on my fork:

Leave a comment

Talk about RepRap 3d printing at SoCal Code Camp 2013

I gave a talk on Saturday 11/10 about 3d printing with RepRap printers at SoCal code camp 2013.

You can download the slides as a 4MB PDF from here: RepRap introduction

I added another resources slide in the back with more references.

Leave a comment

Smoothie on a breadboard

I spent some time yesterday getting started with the Smoothie firmware (suitable for RepRap printers or laser cutters or CNC mills and such) on a breadboard. My notes/ramblings are below.

LPCXpresso 1769 on a breadboard running Smoothie firmware connected to some stepper drivers.

$30 ARM LPCXpresso 1769 on a breadboard running Smoothie firmware connected to some stepper drivers.

We have been kind of annoyed by the 40,000 steps/s limit in the AtMega 2560/Marlin firmware combination so I wanted to try the Smoothie firmware. The beta devices seem to be sold out, and the kickstarter ones don’t ship for a couple months, so it looked fun to try Smoothie on a breadboard.

You can buy the LPCXpresso 1769 for $30 from adafruit.

The stepper drivers are about $10 each: but I borrowed them from a printer.

We borrowed a Micro-SD adapter spare from another printer. It was probably the same as this one: . This one is a little trouble because it has a level shifter and a 3.3v regulator, but we were able to feed 5V in and talk 3.3v logic to it.

We didn’t connect thermistors or mosfets or USB port.

I used the OSEPP FTDI cable. It has a jumper to select 3.3V or 5V.

Getting Smoothie build environment and compiled.

Download master branch, double click win_install.cmd in explorer, then BuildShell.cmd, run “make clean all”. The win_install.cmd didn’t work on a friends windows 7 machine but worked for me in windows 8.1.

I didn’t have luck with the linux build in ubuntu. Getting the tools installed worked, but somehow it can’t find the new gcc in the path in the build environment.

Getting the board running.

Had some trouble fitting the LPCX on my breadboards. You need a single power rail between the breadboards, and the one I had did not have the power rails as removable, so I couldn’t get the breadboards close enough to fit the LPCXpresso board and still get jumpers connected.

Wire 5V from the FTDI to the [V in?]. The programmer side of the board has the 3.3V regulator. I used a female to male jumper from 5V pin of the voltage select jumper on the FTDI cable. (We chose to use the LPCXpresso programmer’s regulator because we’re not sure the FTDI’s 3.3v regulator can run everything)

Wire the FTDI things.

When the FTDI is connected, and powering the LPCXpresso board, the board came programmed with something blinking a LED as a heartbeat.

Connect the “reset” and “boot loader” buttons as instructed. We didn’t connect the play/pause button and didn’t try running gcode off SD to possibly need it. The instructions are odd in that they share that pin with one of the stepper outputs.

Follow the instructions to flash the SD boot loader using the FTDI and [FlashMagic]. The bootloader.hex is in the [bootloader] folder.

You need the SD adapter connected to run smoothie, and to install the firmware. We connected the 5V from the FTDI to the SD Ramps SD adapter because there is another 3.3v regulator and logic level shifter on that board.

Put main.bin from the LPC1768 directory to your SD card renamed to firmware.bin. Also copy the default config ConfigSamples\Smoothieboard and make the pin edits described at the bottom of . Insert the SD card then plug in the USB cable from the FTDI to power the board and see what happens. We saw lots of SD activity.

We waited a bit, disconnected the power, pulled out the SD and verified that firmware.bin was renamed to FIRMWARE.BKP.

Without the SD card inserted it didn’t seem like Smoothie starts up.

Now you can connect a terminal (like Putty) to the FTDI at 115200 baud. Smoothie has some commands that aren’t g-code like “help” and “ls”. Smoothie doesn’t echo your keys so you won’t see what you type when connected with Putty.

You can also try M114 (show endstop status) and M119 (get current position).

At this point we started wiring up the stepper drivers. The diagrams on the “Smoothie on a breadboard” page are a little odd. The top two stepper drivers shown on the top right have their micro-stepping pins pulled high, and their reset/sleep pins shorted, but the lower stepper drivers don’t have them configured the same way. I think the diagram is wrong for the lower stepper drivers.

We tested the X driver, and had to move the direction pin to the next pin away (pin 49? 2.10 I think) because something else was sharing that pin. I didn’t check the config enough to find out which pin. This exhibited itself as the machine moving up in X, but not reliably moving down.

– LPCX1769 datasheet. Shows which micro controller pins the 54 breadboard pins go to.
– see the example A4988 circuit

Leave a comment

SainSmart RAMPS is not worth it

I’m building another Prusa i3 to be done as a group printer build weekend in a similar way to the one that happened recently. To try to reduce costs I figured I’d try the SainSmart RAMPS bundle which at $80 is about $40 cheaper than the other sources I considered.

The pieces arrived in a couple weeks in bags in a plastic box. Unfortunately nothing protected the pins of the stepper drivers and RAMPS board so a few pins were bent. None of the pins were bent bad enough they couldn’t be bent back.

SainSmart order box, a jumble of everything

SainSmart order box, a jumble of everything

Bent pins on stepper board. These were annoying but not bad enough that I couldn't bend them back.

Bent pins on stepper board. These were annoying but not bad enough that I couldn’t bend them back.


I installed the stepper drivers in the RAMPS board making sure they were correctly oriented, twice, because I didn’t initially notice that the micro-stepping jumpers were not included. That’s okay for this one because I have a bunch of those I can use.

When first powered on the Arduino Compatible Mega 2560 released its magic smoke. That’s not supposed to happen. (I know that it can happen if the stepper driver boards are installed the wrong way around, but I am certain they were not installed wrong)

On further inspection, the current adjustment on all 5 of the stepper driver boards spins freely. These stepper drivers probably don’t even work.

The RAMPS board was tested with a stepper driver borrowed from another printer, and a working Arduino Mega 2560, and seemed to behave fine. I ordered new stepper drivers from Maker Farm where they shipped with the pins protected in foam via first class mail and arrived before the weekend.

So, yesterday I was able to try with another Arduino and the new stepper drivers. Motors moved, bed gets up to temperature, fan gets up to speed, but I wasn’t getting any heat out of the hot end. The hot end heater appeared to be working, but a meter wasn’t showing any voltage on the heater output. We fixed this by replacing the MOSFET.

I also bought their makerbot-style endstops and MK2 heated bed which work as expected.

The heated bed was not shipped well and has a gouge on one edge and is not flat, but didn’t destroy anything.

I will not be buying any further printer parts from SainSmart. I don’t mind spending $40 more to get the micro stepping jumpers, heat sinks, and electronics that actually work.

Those blue Micro-Stepping jumpers are not included.

Those blue Micro-Stepping jumpers are not included.

Dead ATMega 2560.

Dead ATMega 2560. This was toasted when power was applied to RAMPS.


Gouge on edge of heated bed.

Gouge on edge of heated bed.

The leftmost MOSFET didn't work. Also, a 10k resistor nearby seemed broken.

The leftmost MOSFET didn’t work. Also, a 10k resistor nearby seemed broken.


Leave a comment

Building Mendel 90, so far

Well, I have a Mendel 90 well under way. I have it printing and I have lots of fun time calibrating and designing better parts and such ahead of me. Here’s how getting parts and such went.

Assembled Mendel 90

Assembled Printer

Printed herringbone gears

Printed herringbone gears

Printed small audio equipment

Printed small audio equipment



Build options
I chose to go with the “Sturdy” variant of the Mendel 90 because I don’t have access to a CNC mill and don’t want to buy a frame. One of my original goals for choosing the Mendel 90 was to be able to make all the parts for it myself so that the Stana Barbara hackerspace could use this design for a 3d printer build fest. It also seemed like a good design considering the thought nophead has put into getting it to operate for many hours without parts failing or needing to be replaced, or even tightened.

The frame was pretty easy to cut and drill, but I failed the first board. I had the drill templates printed at Staples in actual size on 3 pages of 18″x24″ paper (two copies each) for about $11. The MDF was available in 2 foot by 4 foot sheets from Home Depot for $10, hiding way in the back. I failed the first sheet because the cuts I made through the wood weren’t at a perpendicular angle because of the way my circular saw was set. I didn’t have access to a table saw to do this right. The second set of holes were cut fine. I used the piece of MDF for the bed, and the cuts for the bed and hole in the gantry were cut (poorly) on a bandsaw at the hackerspace.

I didn’t update the configuration to have a 12mm thick bed plate, so the screws included in the BOM were too short and I had to buy more.

When building the Bill of Materials I took the full BOM text file and pivoted the columns so I could put it into a giant google doc. This was really helpful to find where each part went and such because the column headers in the text file are absolutely unreadable. That said, there are a bunch of places in the BOM and the google doc where I wish I had better options to see how a part was used or fit together, or able to better select options for it. For example, RepRap electronics are typically sold in bundles that include the main board, motor drivers (optionally 4 or 5) and endstops. Sometimes this bundle can include more things like the heated bed, heated bed thermistor and such (for example the gadgets3d bundles…). This wasn’t usefully represented in my spreadsheet.
Here’s where the vitamins on my printer came from:

  • Linear Bearings: Amazon (some really slow merchant shipping from china, so I bought extra)
  • Rotary Bearings: Amazon (VXB)
  • Most fasteners: Bolt depot
  • McMaster-Carr:
    • Smooth rods (I didn’t cut the smooth rods. I think I have 5 of the 400mm ones and one 500mm. I have cut none of them)
    • 8mm threaded rod. I cut this with a hacksaw and the bandsaw. I like the results from the hacksaw better.
    • Star washers
    • Bronze M8 nuts
    • Plastic tube and sheet
  • Maker Farm:
    • Magma nozzle. I need to write more on this later, I think it does jam a lot
    • Hobbed bolt
    • RAMPS and LCD
    • Z threaded rod couplers
    • Probably more plastic. Always need more plastic.
    • Polybelt
    • T5 belts. Their $15 min order size is annoying.
  • Misc:
    • Glass sheet from Home Depot. The local one doesn’t have it but the ones in nearby towns sell 8×10″ glass sheets for $2 each. A glass cutter is $12. I haven’t cracked any of these with heat yet, but catching the nozzle on the edge can cause problems.

Printing the parts
I printed all the printed parts myself on my 8″ i3 with .35mm nozzle in Orange ABS from Maker’s tool works on Kapton covered glass. I didn’t have much trouble following the instructions for how to slice the parts. I did have trouble with them not staying on my bed when I printed large plates, but I think that should be fixed now as I’ve leveled the bed on that printer better.  My i3 is leveled using washers and nylon spacers, but the bolts weren’t long enough to add more washers. This has now been fixed.

The X motor is really annoying to print on this printer. I printed at least 5 full ones before getting one that I thought was okay. At 15 hours each it took a while. It didn’t help I was printing ABS too hot. A box helped, and a 5mm brim helped, but there’s probably more required to get things working right.
Assembly notes:
I spent a bunch of time reading and watching different people’s instructions. I ended up watching watching maddyplays videos on youtube:
then I followed I wish I had read the instructions on the RepRap wiki more because a bunch of the mistakes I made were mentioned on the RepRap wiki build instructions.

I broke some parts during assembly and soon after so it’s nice to have a working printer to print better replacements. Here’s a quick list:
The extruder fan was quickly broken because it is a thin part with poor layer adhesion (ABS was printed too hot). The replacement was a little awakward to install because the fan duct nut traps didn’t hold the lock nuts in place (they spun in place). I’ve installed the new mount with the bolts going in the other way (the bolt head sits in the nut trap). This doesn’t work great because the bolt on one side runs into the X belt tensioner.
I’ve split a few rod holders by tightening the bolts too much. Part of this is that most of my rod holders were printed at the wrong temp and don’t have good stick between layers. When the bolt gets into the lock part of the nylock nut, the nuts twist and break the rod holders apart. I’m probably going to leave this for a while because I have only broken one bottom Z holder and one Y rod holder.
Don’t drill holes (at least by hand) in your pulleys or gears. I had originally drilled holes in the belt pulleys for X and Y, and these wobbled very badly. I printed new ones and just pushed them on backwards and they have been working well enough I leave them alone. My extruder gear probably also needs to be replaced.
I wasn’t able to etch or assemble the PCB for the extruder connector because I couldn’t find what I thought was the correct D-15 connector. I have the wires run in a bundle now which is fine and I may leave it that way. I used a thicker ziptie around the motor for strain relief, the bundle of wires is connected to this ziptie to direct them upwards and so the wires don’t take all the bed force themselves.

First prints

I managed to get this printer working reasonably quite quickly. My first few prints were in ABS with the 60mm duct fan on full time. This duct has the inner part removed so it blows both upwards and downwards on the extruder. (actually the duct didn’t stick on the print and I held on to the part because I thought it might fit better around the magma’s ceramic heater. I was right). I didn’t have the Z max value tuned so my first week or more of prints had me turning the Z rods at print start to get the right height and approximately level.

Pretty quickly however I started having jams, usually near when I started a print.

I tried a bunch of things (PLA jams also), and now have something reasonably working. I have a duct for a 40mm fan which I intended to use on my i3 zip tied to the extruder motor blowing air on the heatsink of my hot end. Except for sometimes at the beginning of prints I haven’t seen as many jams. I don’t currently use the 60mm fan or duct but I may in the future. I think the right option for me may be a small board or fan controller living on the X carriage so I can manually switch how the fans are configured. I do have the wires and pins to control them though, I just haven’t set that up.

I still have a number of tweaks to make happen:
On my bed my bolt heads stick higher than the glass plate. I need to get some different M3 bolts (I have M3 socket head cap screws now) that don’t interfere with the nozzle around 0,0.
I need to design a different extruder fan duct that holds two fans (one for the barrel and one for recently printed
Consider building the extruder PCB and replacing X and E wires with the fancy ribbon cable from nophead’s design.

Extra fan duct for cooling magma nozzle

Extra fan duct for cooling magma nozzle

Up next, ramble about ALL THE CALIBRATION.

Some time spent tuning retraction

Some time spent tuning retraction


I’m building a Mendel 90

I'm building a Mendel 90

I’ve started on the frame of a Mendel 90 variant of the RepRap 3d printers. More details soon.

Leave a comment

Building iPad VR Headset

Since hearing about the Oculus Rift kickstarter I’ve been interested in having one of my own. From the description and the posts I’ve seen others building their own online it looks like this is something pretty easy to do.

So I did, because I had most of the difficult pieces in my iPad. My goal was to build this without using anything I needed to acquire from ebay or other sellers I didn’t trust.

Here’s how mine was made.

Optics and Prototyping Without Code

I first started by searching for lenses. The best I was able to find were some 2″ diameter 4x Loupe lenses which sell for $5 each at Fry’s electronics. These didn’t have enough magnification because through a single set I was able to see beyond the edges of my iPad when positioned far enough away to be in focus. I ended up putting two of these lenses on each side. The lenses were mounted in foam core cut to the outline of the lens (using the plastic ring the lenses were mounted in as a guide), then taped together using gorilla tape and masking tape. The distance the lenses were placed from the iPad was chosen to have the iPad appear in focus. I didn’t do any real calculations to build this correctly.

V1 iteration of lenses to find focus distance. The lenses are taped to the packaging they came in.

Once I had lenses to play with I started working on getting an image or video working so I started with the Crytek Sponza and a stereoscopic camera script. I even did the lens distortion using the lens distortion node in the blender compositor.

First iteration of 3d was prototyped using blender, and displayed on iPad using XDisplay

First iteration of 3d was prototyped using blender, and displayed on iPad using XDisplay

I later worked on better lens mounting and purchased additional lenses so that I would have enough magnification to get a reasonable field of view.

A lens mounted in a hole cut in foam core

Mounting “hardware” for a single lens using a hole cut in foam core.


Distortion caused by a single lens. Also notice the red/blue accents caused by cheap lenses.


I started working on using the internal gyroscope on the iPad to rotate the world so that the view would change as the device is rotated around. This was easy because the documentation of the gyroscope is well written. The only potentially interesting parts are the code to copy floats from the CMRotationMatrix to GLKMatrix4.

Next, I worked on the software side to get the inverse lens distortion happening on the displayed image so when viewed through the lenses the world isn’t distorted. I did this by playing online with different formulas in a WebGL shader editor (the old shadertoy) by creating a shader that altered the distance of the texture sample from my distortion center using just a simple quadratic (essentially, sample from dist + constant*dist*dist from center instead of just dist from center). This looked okay when testing the same lenses on my laptop so I ported it to my iPad and tweaked the constant there with a regular grid until the grid as viewed through the lenses looked like straight lines. The iPad version of this application started with the OpenGL ES game project template and hasn’t been cleaned up much since.

I found sample code online to render to texture and soon had a textured cube rendering to a texture for each eye. This version allowed the player to look around at a skybox, but there wasn’t any other input to actually do any walking around. I created the skybox by extracting the original images from a Photosynth for iOS panorama. I’ve put code to make a single image from a photosynth panorama.

I used this panorama to calibrate the field of view. I took a photo from the panorama location in a direction with some recognizable objects, and tweaked the field-of-view in the application until a photo through the lenses displayed the same view of the world.


Panorama from a nearby park used as first skybox. (Photosynth created this image, I used a cube one extracted from Photosynth tiles)

Photo taken in park to calibrate field of view

Photo taken in park to calibrate field of view. This was taken on a different day from the panorama above.

Photo taken through lenses of iPad environment after field-of-view tweaking

Photo taken through lenses of iPad environment after field-of-view tweaking

A Game Controller?

To create a game controller, I was originally wanting to use the microphone line on the headphone jack connected to an arduino based game controller. I looked for code for this and found more than one Arduino soft modem implementation which synthesized sounds on the arduino which were translated into bits on the iOS side over the microphone jack, but I stopped persuing this because they were quoting data rates of 50 bits per second. This would be sufficent for a single button, but not at all enough bandwidth for a two axis analog stick and a handful of buttons.

At GDC I met Jon Manning who wrote a book on Objective-C and Cocoa and he suggested using Bluetooth Low Energy. Searching online I found the RedBear lab BLE shield for only $35 on the Maker Shed. Their sample applications and code were easy to modify to my needs. My Arduino sketch sends 3 bytes at a time for the control data and this works well.

Game controller iteration 1. Polymorph on bottom, mintyboost on left, arduino uno, RedBearLab BLE shield, sparkfun protoshield, and sparkfun joystick shield.

Game controller iteration 1. Polymorph on bottom, mintyboost on left, arduino uno, RedBearLab BLE shield, sparkfun protoshield, and sparkfun joystick shield.

When I was thinking about this before I wanted a mesh to work with so I started with the Sponza from the Crytek models page. Unfortunately this was sluggish on my laptop and I wanted some baked lighting so I built a lower polygon version of this and baked the original textures and some terrible lighting to a single 1024×1024 texture. My lower polygon version is about 5000 triangles. I built a simple export python script that just spits out the float array used in the sample code. This means that the mesh is in data as individual triangles rather than the much faster to render indexed triangle strip, but the model is simple enough this isn’t a problem yet.

Next Steps?

Honestly, I think the next step is to scrap all the code I’ve written so far and build the iPad side again in Unity3d. Unity3d would make it a lot easier to turn this into an actual game where I can make new models and textures happen without having to fiddle with the code. Unity also will do a bunch of the boring code things I don’t want to write like building and using indexed triangle strips and compressed textures. That said, I’m not sure if I will be able to access CoreBluetooth from Unity3d.

, , , , ,

1 Comment