Thursday, April 19, 2018

Octopi and Octoprint

Cura used to hang during long print jobs, when I used it to drive the printer from my desktop. (Lulzbot Mini has a USB connection, no SD card slot.) Octopi addresses that problem, and adds some additional useful features.

Octopi is a Raspberry Pi linux build that runs Octoprint, connecting on USB. It's basically a mini-computer that acts as the printer server.

The benefits of Octoprint:
  • A dedicated server - nothing else is running on it, making it very stable
  • Built-in web-based GUI - you can upload files directly to it, start/cancel jobs, extrude/retract, heat bed/nozzle...
  • Plugins are available, including API access (I use it for the Octowatch app for my Pebble)
  • Any computer on your network can access it (and there is id/password for control)
  • USB webcams can be easily added in for monitoring/time lapse
  • Modern Cura/slic3r plug directly into Octoprint, allowing you to send gcode directly from your laptop/desktop slicer application - can print these files without proper settings in Octoprint
  • If the micro SD card stops working correctly, wipe it, reinstall
The challenges of Octoprint:
  • Must open the web browser to reconnect to the printer, after the printer has been off
  • Has its own printer settings (used ONLY when uploading stl files to Octoprint)
It took a number of failures. Starting with a Raspberry Pi 2 B+, with a wifi USB stick, keyboard, mouse, monitor...Octoprint didn't work. I put the Octopi image on the micro SD card from my desktop OSX, following the instructions. Could see it on the network, log into it from ssh, but couldn't see it as http://octopi.local from a browser. Eventually it did work, after repeating the process again. Either the micro SD card's image got corrupted, or I don't follow directions easily.

I picked up a Raspberry Pi 3 and created the image (and made the changes to wifi) from a linux laptop. The only thing I plug into the USB ports are the $5 USB webcam from Goodwill and the printer's USB connection. It's magic. There's even a Pebble app (Octowatch, Gullickson Laboratories) that can connect to Octoprint with minimal fuss. Octowatch has some basic functions: time remaining, pause/restart, and my favorite "run again"/stop. Run again is pretty sweet, especially if you're duplicating a previously successful print.

Tips for setting up Octoprint correctly:

  • If you are on ANY system that auto-corrects you, be cautious when you are editing the octopi-network.txt file on your pre-Pi run. Smart quotes suck. Make sure it gets saved as plain text. (Edit: Current Octopi, edit octopi-wpa-supplicant.txt instead, as octopi-network.txt is non-functional.
  • If you are having problems later on, wipe the card and reinstall. Your image can get corrupted, through no fault of your own.
  • Change your password, when you first log in. When I set up my first pi, I thought I needed a keyboard and monitor...no. Maybe if you are going to troubleshoot it, otherwise...just remote into the pi from your existing computer.
  • Use the IP address seen from the router - your router might let you reserve the local IP for your Octopi, this is a benefit from finding it again on a webpage. (For example, Octoprint #1 is 192.168.1.11, while #2 manages a different printer on 192.168.1.12.) If you don't reserve an IP, the router will assign random IPs whenever it is powered back on. If you have octopi.local working 100%, maybe you won't be using IP anyways.
  • Sending files through web browser - that's when Octoprint's Cura set-up matters. If you are just sending it gcode through your Cura desktop application...I don't think settings need to be accurate. Nozzle size, etc...as long as you have it correct where you generate the gcode, you should be fine. (I ran Octoprint with an incorrect nozzle setting, and didn't notice it until I was trying to use Octoprint to measure how much filament was being sent through vs. e-steps. Impossible numbers.)

Useful Linux commands for your Pi:

  • ps -ef | grep oct
This will show any octoprint services running. If you don't have a line with "/home/pi/oprint/bin/python /home/pi/oprint/bin/octoprint serve --host=127.0.0.1 --port=5000" - this means you can't log in through the web browser. 

  • passwd
Changes the password for the user "pi", that you are logged in as. Always change the default from "raspberry".
  • exit

Will log you out.

For future readings, I also plan on looking at this: https://discourse.octoprint.org/t/how-do-i-backup-my-octoprint-settings-on-octopi/1489 - backing up an entire card (in addition to maybe backing up Octoprint settings).

Blender Things I Did Not Know (Part 1)

Blender has a lot of techniques, for doing the same thing. It's great, in some ways - multiple paths to find a solution. There are faster techniques, there are more accurate techniques. If you're like me, you watch tutorials on YouTube when you're considering a problem.

At two years into Blender, I know some things. It means that tutorials will typically cover 95% of what I already know, and...I have to watch the whole thing to squeeze out 5% of the value.

This starts sharing my reading list of things that I didn't know.

Joining, Merging, and Filling Holes:

Repairing a Mesh

I've used his first two methods. "(F)ill" has always been "(f)ace" in my head. His second method, he chose a single edge to make a face from. I usually (f)ace from two opposing edges, or the 4 vertices. A single edge? Well, saves me small amounts of time.

His third method, eek. I didn't know the "alt"-when selecting an edge helps with edge loops. (Saves me button clicks of Select>Edge Loops.) And I didn't use J to join to vertices to make an edge within a plane...I've been using the Knife Tool. The Knife tool has some cool benefits to it, but J is fast.

Jimmer's 4th method, not covered...I would have extruded a vertex along a x/y/z axis to get a corner, and get the x/y/z axis correct by inputing the numbers in (make sure you are in Global, not Local). Create edges to the other axis vertices (f). Subdivide the edge a correct number of times, make faces. You only need to get coordinates right for that corner, and subdividing is a fast Ctrl-E away...you can add more than one cut as needed.

Reading the YouTube comments, there was some slightly more complex things to get vertices lined correctly, using the third method. Change the Pivot to Active Element (this is found on the bottom bar), grab the vertices you want to line up, and the final one is what you want them to align with. Then (s) for scale, (y) for the y-axis, (0) to zero them. Interesting and fast.

Normals

A friend asked me how to fix normals when importing things in from Maya. I wasn't familiar with it, so I basically just pointed to Mesh>Normals as the solution. Sometimes when working in Blender, I've noticed off-color faces...I had to delete faces, rebuild them...I now understand what those faces mean. And what the Shading/UVs tab in the upper right gets you....and you can Flip Direction on a single face. A much faster and cleaner response to the occasional "Blender doesn't know what you're doing" trigger.

Wednesday, February 14, 2018

Dying Printers and Rebirth

In December 2017, there were printer woes. My trusty Lulzbot Mini 1.03 from October 2015 was having issues. Watching Octopi, I could see it wasn't holding a steady temperature for the hot end.

I attempted just fixing the thermistor, which heats up the aluminum hot end. It was pretty involved - taking the whole printer head apart. Putting it back together, there was a wire feeding into the hotend - I couldn't tell if it was supposed to be covered by heatshrink or not. ZAPPPP!

It caused a short, causing my printer to go a bit crazy. Crashed the head down hard, then *through* the washers. This is where I went completely wrong. One of the z-axis motors was making bad noises, so I tried to adjust all of that. I should have just focused on the short first, then...other things.

The hotend was replaced, to avoid more shorts, and reduce what could be wrong with the machine. The left z-axis motor can work, but it grinds. I did some print jobs as an experiment - the second one caused my x-axis to decant...one side was all the way up, the other side was halfway down.

This leads to the story: when do you leave a hobby behind? Was 3D printing going to be a did-it-for-2-years thing, or a longer project?

Future options as I saw them:
  • Retire the hobby
  • Buy a new printer
    • Another Mini?
    • Prusa mk3 (drawback, it uses 1.75mm filament, and I have a lot of 3mm)
  • Buy refurbished Mini (1.03 is $750, 1.04 is $1000)
  • Buy a craigslist Mini (1.04 with the extra Flexystruder head for $1k total)
  • Fix original printer (or buy another from the above options)
I was still learning things. I loved printing. I loved making things. Retiring wasn't something I wanted to embrace. Just designing seemed...boring. There was a risk that if I sit around trying to fix my broken machine, that interest is lost (based on others' experiences). I ended up buying the Craigslist Mini. The guy was okay, he had used it to prototype some cool, flexible iphone cases with a built-in spot for the dongle.


The 1.04 has some nice features. An extra blower fan (nice, but also blocks seeing the nozzle straight on), noise dampeners on ALL of the motors (I had modded my 1.03 to have a dampener on the y-axis), and the filament feeder was much more reliable (probably my only real complaint on the 1.03, and it wasn't that big of a deal).

I have kept working on my 1.03, but the grinding is tough - the next step is to research "squaring" to see if it's my x-axis out of alignment. I was going to replace the z-axis motors, but they are solidly screwed in. More research.

I really enjoy designing and printing, and feel fortunate that it can continue.

Thursday, February 8, 2018

3D modeling and printing for Gloomhaven storage

I've been designing upgrade components for Gloomhaven for the past several weeks. So much, that everything for storing Gloomhaven efficiently went into one Thingiverse project download: https://www.thingiverse.com/thing:2774773



I started with the toolbox frame, being a Harbor Freight "20 Bin Portable Parts Storage Case" (any of the mustard-yellow bins came with it). $10 for each one, and two was more than I needed. It's completely possible to have remade the basic box myself, but I cheated. This project by cpodbob was a fine start - I really liked the feet they had made.

Most of my new boxes needed to be a 2x2 - big enough for playing cards. Before I started modifying THAT box, I printed a basic box to get a feel for how thick the walls would turn out, that the feet would fit properly...the boxes that came with the Harbor Freight tray had small pegs for feet.

First box, the walls were a bit thin at 1.5mm. 3 was more solid than I needed, so I evolved down to 2mm. Did you notice the crosses embossed in the bottom of the lid? The trays needed to either fit in them or at least not be interfering with them. 2mm was good.

In Blender, I made a copy of the 2x1 box, multiplied its width by two...but that made those awesome feet stretch out. I went back to the original box, went into wireframe mode (z), used the (b)ox selection tool in edit mode, and grabbed one side to match the copy's new width.

Good Design: I added a hole in the bottom in each of the boxes, to push things through from the back. This means there's no awkward "slamming down a box upside-down to get something out". This will come back even more with the trays later. (A simple Boolean operation, selecting the box and choosing difference with a cylinder.)

Event Card Boxes (City & Road)

Event card decks were my next consideration. It needed three compartments - 30-ish unlocked cards that would be pulled out often, a tray for the cards that had been experienced but not removed from the game, and room for 30-ish locked cards (needing an event to put them into the unlocked deck).



The first attempt had the dividers opening up in different directions. One set of holes on one side of the box, halfway up. Another set of holes at the other side, slightly further up on the box.
Bad Design: the underside divider got caught.
Good Design: there was enough room between them, when they were both pivoting from the same side, that both could open.

Difficult to see, the event box dividers were not flat pieces with pegs slapped on - I wanted the pegs to be pushed in, so when they popped into the holes they would stay. PETG is great as a filament - I made the original "arms" too thick to push easily. Slimming it down to 11mm meant that it was still solid, but just flexible enough for the posts to pop in.

Monster Trays

One of the organization needs of Gloomhaven, is to find the correct monster standees for what is going to fight that scenario. When playing other people's games, a huge plastic baggie was the worst. You didn't know how many to find and you needed to compare and contrast against hundreds of other monster tokens. Except, these are 3x2 boxes, instead of the 2x2 boxes I remixed earlier.


It works out that you need 6 trays for the different monsters. Each of the mini trays for each monster, had a hole in the back - you don't need to dump the whole tray to get just one stack out. You can also fit 6 monster standees per mini tray (sometimes 10 for the smaller monsters)...and the Harbor Freight tray is tall enough for exactly 3 trays.

Bad Design: I should have designed for the Earth Spirit. I had to remake the tray because I thought I could eyeball the dimensions "enough".
Bad Design: I also didn't know how many mini-trays I needed. I got lucky. I should have done my homework, counted it all out, then recounted it.
Good Design: The trays were stackable, so they needed foot cut-outs to sit in. I could have just made them all flat with no feet, but this gives them better stacking. I was happy with adding the cutouts.

Making the mini-trays - it was important for them to line up.  For this, I was in edit mode, and used the knife tool with "c" to make the cuts straight across, and "z" to cut through as if in wireframe.

To cut out the area for the feet, I copied the bottom outside vertexes of the feet, and dragged them to the top, then started merging vertexes (alt-m) first to last. This meant I didn't need to redo all of the planes. It was still tedious, but only 10 minutes of work. Measuring 3 trays from top to bottom, it worked out to tray+feet+tray+tray, as the second and third feet fit into the tray beneath them.

You can also see the Boss Standee tray - there's a mini-tray for the huge Stone Golem standees, and the rest of the "large size" standees fit loose in the un-trayed area.

The red tray holds the monster stat cards & envelopes. Mostly just a big 3x2 tray, but added lips inside the box so the envelopes would sit on those. Again, a hole in the back to push things out. This tray was 2 stacks high, combined with the Boss Standee tray it fit flush to the Harbor Freight Tray.

Dead Card Box

I also made a dead-card box, for the cards removed from game. I considered gluing shut, but haven't done it...yet. For the embossed "broken card" icon for the cover, I took a card-shaped cube, used the knife tool to make cuts in a zig-zag fashion, and then used the "p" selection tool to break it into two parts. This allowed me to rotate only part of the total card-cube, and then I "j"oined them back together, so I could face the two bottom parts of the ripped card back together.

The cover rests on some extruded shelves, instead of the cards so that more cards can be shoved in.

Store Divider

The store is frequently messy. You have the store, future store cards from prosperity, item designs from chests and events, and random item designs. Hopefully they will all end up in the store, but in the beginning, each separate.
I thought about redesigning the box and incorporating the lengthwise stand into the side of the box, but...maybe that would be good for people who sleeve their store cards.

The design challenge was to have the dividers stay upright and solid, but be able to slide to accommodate more/less cards in the various stacks.
I originally made a groove in the stand and the dividers had little tongues to fit inside the groove - too many tolerance problems can come up that way.

Good Design: Don't make more headaches than you need - reduce complexity, especially multiple tolerances.

I removed one side of the groove (on the part closest to the box) and thickened the tongue to take up the same space. I also made the dividers thicker so they would stay vertical more easily.

Overall

  • My Gloomhaven storage method turned out really well. I might tweak some more storage boxes later, as demands come up.
  • I learned the knife tool a lot better. 
  • I addressed card mix-up issues for the store and events. 
  • I probably could have made the box from scratch, instead of a remix. 
    • Is it lazy to use code that's already there and suits your purposes? Existing box gets repurposed, I'll call that a mixed-win.





Sunday, March 12, 2017

How to Remix an STL or object in Blender

Premise:
I need to modify a poop bag holder that will hang off the dog's leash.

Goal:
Original STL is set for 70mm-tall cylinder for its bags, I'm going to adjust this to a 63mm-tall cylinder.

What you'll need:
Blender (MeasureIt plug-in hugely recommended, File>User Preferences>Add-ons>3D View: MeasureIt)
STL to be modified (I chose www.thingiverse.com/thing:1369224)

Importing the Robot into Blender:
File > Import > Poop_bag_robot_body.stl (from wherever you've stored it)

Moving the camera view:
NumPad-9 flips the orientation, NumPad-2 & -8 raise and lower your view, NumPad-4 & -6 change side-to-side. I changed the view to look from the robot's bottom, so I could look at the top and spike that I will be pulling down.

Prep Work
You're in Object Mode - it'll show this at the bottom of the primary window. You can mouse it to Edit mode, or just hit <tab>. Everything now shows up as orange lines, because this was imported from an STL. This is doable, you'd just have to make sure you select everything you want to move correctly.


Instead, we're going to lightly cheat. Mesh > Clean Up > Limited Dissolve. Clean! There is a risk that you could dissolve details, but it would take multiple applications of that, as well as changing the constraints.

Click "a" on the main screen to deselect everything.

MeasureIt
You're in Edit mode, nothing is selected. There are three boxes on the bottom of your screen — Vertex, Edge, and Plane selection tool. If you choose one, the others will turn off.  Choose the Edge selection box in the center, then click on any line runs the length of the cylinder.

Click on the MeasureIt tab on the far left, click Show, then <-> Segment. You can now see a blue line with a ".07m" measurement attached to it, running along that edge/line you selected. This measurement will change if either vertex moves — useful later on, when we start moving things.

On the right hand side of your primary window, there's a tab for MeasureIt. Any line that you measure will show up in that tab...you can hide them, change their colors, but I'm concerned about .07m being rounded up. Change the number of decimal precision to 3 - it now shows the line length as .069m!



The modification:
Next, we'll hit "a" again to deselect everything. Choose Plane selection, hit "c" for an area selection tool, then left-click your mouse over the spike. This should select the spike as well as the top of the cylinder.



With those highlighted, hit "g" for grab, "x" to only move it on the X-axis, then move your mouse so that the .069m becomes a .063m.

Conclusion:
That's all! It wasn't a huge amount of work, but you can save the Blender file (File>Save), or just export the STL (File>Export). There are more complex things you could try — if you wanted more room for bags, use MeasureIt to find the width of the cylinder, select the whole object in Edit mode ("a" will select/deselect all), "s" for scale, "shift-x" means you scale everything BUT the x-axis...then use your mouse to scale. (You might want to deselect the spike on the inside before scaling, unless you want that to become bigger as well.)

Personal Preference:
I felt the spike at the top of the cylinder wouldn't print without supports (the 45 degree overhang angle rule). In Vertex selection, scrolled my mouse wheel to view it closely (you can also use the "." on the number pad). I grabbed "g" the tip, hit "x" to only move on the x-axis, then moved it towards the top of the sideways cylinder.


Tuesday, February 28, 2017

Using Blender as a 3D modeling tool for 3D printing

As I was getting into 3D printing, I needed a tool to modify objects. Thingiverse has got a respectable library, but not all of the projects are complete...or they don't fit what you need. I covered use of the 3D Print Toolbox plugin in a previous post "Optimizing prints (aka the BB-8 cookie cutter)".

So you'll need a tool. TinkerCAD, AutoDesk, Fusion 360, Maya, SketchUp — they're all possibilities. I chose Blender. It is open source, works the same across platforms (Windows/OSX/Linux), and had more features than I would ever probably use. (This also means that if I needed a tool, I just had to go to youtube and browse.) I could have chosen a simpler software, but then would need to learn a NEW tool when the existing one didn't work.

There are some great tutorials out there. I would suggest searching for the user inventimark - he does covers the basics, as well as going into 3D printing aspects of Blender.

One of the things that we can talk about, without actually teaching you Blender...is the setup. When you start Blender, it'll always use the same basic setup until you change & save it.

First, go to the plugins. There will be a couple I highly recommend — MeasureIt & 3D Print Toolbox. First, we'll go to where the plugins are found. File>User Preferences>Add-ons takes you to the plugins, and you can search for any of the plugins you want to include on starting Blender. (Or you can scroll down, choosing "3D View: MeasureIt" & "Mesh: 3D Print Toolbox".)

At this point if you want to stop, File>Save Startup File will save those preferences.

If you want things in metric, go to the Scene selection (upper right corner), then in the box below choose Scene (currently the middle of 5 options, the graphic is a circle, a cylinder, and a light source. Under Units, choose Metric. Unit scale should be .001. Next, expand the bar to the left of these two boxes (there's a plus sign that you click on to pop out if needed). Scroll down to Display, then change the lines and scale. For my printer bed, I put 200 lines, and the scale as .001. (200mm by 200mm is about the size of my print bed.)

You can save your preferences again, if you went metric.

Your Blender window now has a large grid space, with the thicker lines being centimeters, the thinner lines being millimeters. On the far left edge, you'll notice a MeasureIt tab. The 3D Print Toolbox doesn't appear until you've selected an object (right-click), and then the tab will appear above MeasureIt.

The 3D Print Toolbox has several useful features - Overhang will outline any parts that exceed the setting...I set mine for 45 degrees. When I am in edit mode, and click the "Check All" box, there will be clickable boxes for anything that is found. If you still have the starting square, it will return "Overhang Face:1" and outline the bottom face - it's showing you the bottom doesn't have support, which is correct...it's going to be sitting on the printer bed.

The other useful feature I have needed, was "Thickness". This should be the nozzle of your printer. My Lulzbot Mini has a .5mm nozzle, a lot of other printers use .4mm...this is going to be the thinnest free-standing wall that you can print. I had a BB-8 cookie cutter that I shrunk down, but parts of the cookie cutter wouldn't show up even though they were visible in Blender (and Cura, my printer slicer software). It turned out that the walls were too thin for my "thick" nozzle. Setting the thickness to my nozzle size, it outlines all of the parts that were too thin...I manually adjusted the walls and everything printed just fine.

The final "common" use I have for the 3D Print Toolbox, is great to track revisions. Once you've saved the Blender file, you can click the "Export" button in the 3D Print Toolbox tab...whatever object you have selected will be saved as filename-objectname.stl. This can be useful if you have multiple objects in your blender file, but you want to save/print them as separate objects.

Monday, October 3, 2016

Optimizing prints (aka the BB-8 cookie cutter)

There's a lot to catch up on - I print about 20-50 hours a week, and there's so much information to share.

Recently a friend asked for a BB-8 cookie cutter. Yes, designing from scratch is awesome. If I were to print only things I designed...egads. I found a nice one with not TOO much heavy design on Thingiverse. It turns out to be 5" tall and 4" wide...a little big for my tastes in cookie size. (Incidently, it allowed commercial use - Etsy had several of these...$6-$7 apiece for 60 cents of plastic. Maybe more cost-of-goods, depending on the maker's cost of plastic...I had gotten some random PETG filament from makergeek for $18/kg.)

Adding a link to Imgur for the next bit.

I remixed the cookie cutter in Blender to give it a lip to help pull it off the cookie dough. In the Cura slicer software, I scaled it from 100% down to 50%. It looked good in Cura - print! It lost lines...but..why? Well, print it at 60% - more lines back, but not complete.

I could have continued to print over and over again, until all of the lines came back with the object creeping back up in size. At this point, we can assume that the line is just too thin to print occasionally. (This was a learning moment for me from here on.) One - how do we keep a smaller size, and two - how do we identify a bad print before we waste time and plastic?

I'll start with identifying bad prints. Cura has something call the LAYER mode in the upper right corner (where it starts with NORMAL). Right there, I can see where items disappear. Now we have that nailed down, we can look at possible fixes to the object file before prints...great. Incidentally, 90% seemed to have all of the lines back - it was too big of a cookie though.

Next, getting a small size, we'd run into the same situation if we just did scaling in Blender instead of Cura. There's a useful plug-in for Blender called "3D Printing", already included...you just need to turn it on. (It'll show up as a tab on the left-hand side, if you have an object loaded in Blender.)

In Blender - select the object, go to edit view, and de-select all. ("a" selects all or deselects all.) Then click the "Check All" box in the 3D Printing tab. Down below, you'll notice the Output box is now full of information. (If you want to fully duplicate my experience, download the cookie cutter, scale it to 70% in Blender, then do the above to see the output.)



Let's make another change before we go further - Thickness is the size of your nozzle. My Lulzbot Mini has a stock nozzle of 0.5 mm. I'm running the standard blender unit scaling, which means 1 blender unit = 1 mm. If I set the Thickness at .7 - the Output display will show a lot of Thin Faces. If your nozzle/Thickness is .3mm, you'll have much LESS for Thin Faces. This makes sense - a bigger opening = bigger lines; small opening = thinner lines.

Depending on your nozzle and calibration accuracy - you might consider changing the thickness setting. I think I was fortunate starting out with a Lulzbot Mini for my first experience into printing (no calibration necessary, even after a year).

At .5 Thickness, it shows me more thin faces than I need to be concerned about. I only care about the walls that are too thin - not the bases or tops. Click on the "Thin Faces" box in output - it will select all of the thin faces. Fix the walls that weren't printing, Check All again, fix walls...then check the new object file in Cura. It's possible that you'll need to go back to fix walls before printing, but I had good fortune. Printing it at 70% worked out great - my first run after my adjustments had no errors.

Below is the image of the "thin faces" I mentioned:


Good luck!

EDIT:
As a follow-up to this article, the current release of Blender has the 3D printing information as part of the object information ("n" when you're selecting the object). I haven't upgraded yet, but moving from a plug-in to part of how Blender is used is a great acknowledgment on how Blender is developing. I've been using 2.76, I think 2.78 has this feature but is buggy in other respects.