Programming Lessons from 3D Printing

Programming Lessons from 3D Printing

I am on a mission in my home studio to eliminate the need for tripods, without sacrificing functionality. To do this, I want to hang my equipment from the ceiling. There are many different ways to accomplish it - ranging from throwing money at the problem, to simple but inflexible DIY solutions. In guiding my process for solving this problem, I wanted to adhere to a couple of principles. And, in writing this up, I wanted to highlight that the principles in this build process are the same as the ones I use in programming.

  1. Be clear on your goals
  2. Use AI for help
  3. Iterate quickly
  4. Find the natural seams between components
  5. Use standards (managed services) as much as possible, and only invent what you’ll need
  6. Experiment inexpensively
  7. Limit the blast radius of potential failures

Sneak Peek - The End Product

I am lucky that I grew up in a household where engineering, making, building, and learning were important values - thanks Dad Jeff Barr .

Be sure to follow Jeff to see some of his really cool 3d printing projects! I have also caught the 3d printing bug and decided to solve this with 3d printing.

Goals and Project Requirements

  1. I want to be able to hang lights and cameras from a track mounted to the ceiling.
  2. Be able to slide the gear towards the wall and out of the way.
  3. Be robust, safe, and inexpensive.
  4. Be modular so I can adapt the system later.

The project would have 3 major components

  1. A rail which would be mounted to the ceiling
  2. A trolley for a light
  3. A trolley for a camera


For the rail, I considered using V-slot extrusion. However, it is expensive for this application. I may upgrade to V-slot later, but it seemed overkill for V1. I decided on using a 10ft piece of Unistrut. A 10 ft length is available at any Home Depot for ~$45. They are robust, and are perfectly capable of holding some A/V equipment.

A piece of Unistrut

Use AI For Help

I am not a mechanical engineer. Not by any means. I am mechanically inclined and have a good idea for what will and will not work. This is my first project where expensive pieces of equipment will be hanging above my head. So, I do want to be confident that the gap between light and head won’t suddenly close to 0mm.

My first step was to ask ChatGPT some rules of thumb.

Rules of Thumb for Printing Structural Components with PETG, Generated by GPT-4-Turbo

Adapting that to my use case:

  1. Material - ? PETG. I have some Prusament PETG in Prusa Orange, and some black Polymaker PETG. It’s readily available and with Amazon Prime, more PETG is always a few hours away.
  2. Orientation ?- The main stress of the part is going to be on the axis indicated by the green arrow. The printer prints in layers, indicated by the blue arrow. If I had it oriented with the green arrow pointing down as would seem more natural, then the strength of the part is determined by the layer adhesion of the weakest layer.

Trolley print orientation

  1. Wall Thickness and Infill ? - I’ll set to 25% and gyroid infill
  2. Layer Height and Width ? - Set to double the default (0.4 vs 0.2) and 4 perimeters vs 2.
  3. Print speed ? - I’m sticking with the default as that seems to be sufficient.
  4. Temperature control ? - I tested the Prusa PETG settings and they worked well
  5. Post-processing - It shouldn’t be needed for this application.
  6. Use of Supports ? - After some trial and error, I am sticking with the Organic Support option. This builds up some tree-like structures. They are cool to look at, don’t use too much filament, and they work really well.
  7. Testing and Iteration - See the next section!
  8. Software and Slicer Settings ? - Using the PETG settings that come baked into Prusa Slicer.

Some of the advice from ChatGPT I already knew, but it is really easy to forget to change certain settings and wind up with a messy pile of plastic spaghetti. Using AI, can help you remember the critical details.

Iterate Quickly

Iterations 1…5, from left to right


Iteration 1 - Print something from Printables

I wanted to see if something I could find online would meet my needs already. Searching for “unistrut trolley 3d print” led me to this.

https://www.printables.com/model/741148-unistrut-trolley?

This used press-fit skateboard bearings to ride in the track of the unistrut, and then things could be hung from the lower set of pegs. I initially thought that I could print this out, and then build “adapters” to hang stuff on to the lower pegs. I liked this approach because skateboard bearings are cheap - you can get 100 on Amazon for $17. Probably not the best quality for skateboarding, but good enough for this application.?

I printed out the trolley and it slid in the Unistrut reasonably. However, because I put nuts directly through the unistrut, the trolley was too tall.?

Iteration 2 - Modify something from Printables

To fix the problem with Iteration 1, I tried cutting some off of the top in Prusa Slicer. This worked, and iteration 2 successfully slid back and forth in the Unistrut mounted to my ceiling. However, it was a bit too short and stubby, and often bound if there was any sideways load on the strut. Also, the bearings were a tight fit and sometimes got stuck in the track. I suspect that this is because my ceiling is not perfectly flat, and the Unistrut has conformed to the contour of my ceiling.

Iteration 3 - Create a DIY solution

To fix the issues with Iteration 2, I decided to use smaller bearings. I started in Fusion 360 with a rectangle, with 4 pegs for small bearings sticking out of the side. This took a while to print, but it did work. However, when iteration 3 was in the track, it was a bit too narrow and would partially fall out! Also, I needed to iterate faster. 3d printing is slow!

Iteration 4 - Better tolerances

I made the pegs on iteration 4 wider. Crucially, I realized that I did not need to print out the full prototype in order to test how well it slides. I just needed the part that was in the unistrut. So, I fixed my prototype, and then cut off the bottom part (which would eventually be used to hold a camera or light), and just printed the sliding portion. This prototype was the best so far. However, I still had issues with it slipping from side to side. If I made the bearings stick out and farther to the side, they would bind against the side of the strut. I realized that bearings are really cheap, so why not use more??

Iteration 5 - Sideways bearings

I carefully measured the width of the Unistrut. Then, I subtracted 1mm because there may be a narrower portion of the Unistrut, as it is just a piece of rolled steel sheet - it is not a high precision part. I added some pegs for the larger skateboard bearings on the vertical axis, so it could roll against the side of the strut.

From the top, it looks like this:

Following my rapid-iteration process, I printed just enough of the component to test it out. Once it printed, I tested it and it worked great! I was satisfied with this design, that it was enough to go forward to the next part.

Iteration 6 - Holder/Slider Combo - the seams between components

I had initially thought that I would build a trolley for each component. But, it seemed like a much better idea to build a generic trolley and then have different “holders” which I could mount to the trolley. Mounting the light was the first priority. I ended up designing the following:

The idea was that I could make multiple of the trolley (left), and then make different holders as needed. The holder on the right is designed for my new light, a Godox S100D. The interface is an evenly spaced set of 8mm holes. This way, I can slide the holder onto the trolley and use M8 nuts and bolts to secure them together.

This is the seam between components that is going to make things simple. I can improve on the trolley mechanism without making new holders, and I can make new holders without needing a new trolley. This is exactly what I want. They may be slightly over engineered, but I am not making this for mass production.

This orange one is for the camera. The green one is for my light.

Use Standards where Possible

The bearings used in this project are 608ZZ and 2RS bearings, which are both cheap and readily available on Amazon. I am using PETG filament because it is a good balance of strength, ease of printing, and it is inexpensive. Unistrut is available at any Home Depot, and although it isn’t a precision piece of equipment, it is good enough for this application. Finally, the interface between the trolley and the holder is itself a standard within this system. It’s easy to model, and only needs M8 hardware to work. I also used a bit of teflon tape and some silicon grease to make it slide smoothly.?

Experiment Inexpensively

The best part about this project was that it works! I am using it right now. It’s easy to build new holders. All I need to do is match the bolt pattern and the width of the trolley, and I’m good to go. After using the light for a few days, I decided to work on the camera holder. I am going to build a camera mount onto some 3030 aluminum t-slot extrusion. I haven’t finalized the design in my head, but I know that 3030 is the next step in the path between “holder” and “camera suspended in air.” I quickly did a modification to the light holder to hold a piece of 3030 extrusion.

Lessons for Programming

This whole process was relatively straightforward. I was able to use AI to get good advice for printing structural components: material selection, print orientation, proper settings, etc. I was able to find a natural seam in the work, where different parts can be changed. Rahul Subramaniam(CloudFix co-founder) has a great saying: “Write code which is easy to delete.” In this case, it would be easy for me to change a holder or change a trolley, without re-inventing the entire system. This is because I have a good interface.?

I was also able to iterate quickly, because I had a clear goal in mind and was not trying to design the ultimate generic ceiling-mount system. I just wanted something which I understood and which worked for my needs. In programming, there is a constant idea that you could code up some abstractions and frameworks to solve a much more general version of the problem than the one you are currently facing. I’ve done this a lot of times, and often the investment does not pay off. The project becomes too expensive in terms of time and complexity. I am sure that there are better ways to mount a movable light to a ceiling, but my approach was effective and is working right now.

Also, I probably could have used less bearings in the trolley. I could have streamlined the design to use less filament. However, at this scale it doesn’t matter - I am not building something to be mass produced and be as cheap as possible. This is a problem I often see in cloud cost optimization - optimizing towards the wrong dimension. For example, if you are picking an EC2 instance, you can pick exactly the one you need at On Demand rates. Or, if you can be flexible, you can get a much larger machine at a lower cost using spot instances. My binding constraints were my time and my CAD skills. So, I would rather use more filament and more bearings than necessary in order to get something done now, rather than optimize towards constraints that aren’t important.

There is also a lesson about using standard components. Too often people are paying way too much to run their own software. For example, many people use EC2 and manually install and manage databases on their EC2 instances. This is an expensive and complicated way of running a database. A much better way to do this to use a managed service! Look at AWS as a set of building blocks that are readily available and work well together. Similarly, this project does not require special hardware of any kind - everything is standard and easy to find.

In the first picture, notice that there is a bungee cord. For my light holder, all of the strain is in the peg. If it ever breaks, it will break by shearing the peg, and the light will fall. The bungee cord is to keep the light from hitting the ground, or any kids that happen to be walking under the light. Lesson: always limit your blast radius! In the cloud, you limit your financial blast radius with billing alerts, practicing the principle of least privilege in your IAM credentials, and having guardrails in place so that you don’t get cost explosions.

Finally, a good lesson is to try the simple thing first! Use Haiku, it is really inexpensive and surprisingly good at even complex tasks. You don’t need to jump straight to gpt-4-vision or Opus. And speaking of Haiku, I better get back to Emacs. I’ve got some fun work extracting metadata from screenshots of my livestream, AWS Made Easy, which I host with Rahul Subramaniam . If you are into cloud, cost optimization, and AI, please tune in every Tuesday! Check out CloudFix for details.

Wrapping up

Taking a functional approach where you iterate quickly and inexpensively is a great way to build things - either software or 3d printed parts!


Emeric Marc

I help companies resuscitate dead leads and sell using AI ?????????????? #copywriting #emailmarketing #coldemail #content #databasereactivation

10 个月

Great insights. Can’t wait to check out the full article.

要查看或添加评论,请登录

Stephen J. Barr的更多文章

  • The Roomba Analogy in Cost Optimization

    The Roomba Analogy in Cost Optimization

    I came across a project on HackerNews earlier this week. Called "K8s Cleaner", it bills itself as the "Roomba for…

    3 条评论

社区洞察

其他会员也浏览了