ROS Tutorial: C++ vs. Python Comparison

rosorg-logo1When it came to walking through writing actual code to build nodes in a ROS (Robot Operating System) network, the tutorial offered the reader the option to write the nodes in either C++ or in Python. I went through it in Python the first time around, then for curiosity’s sake, I looked over the C++ version for comparison.

The first glance was horrifying: Where the Python ‘talker’ sample was a small code listing with 20 lines of code, the C++ counterpart was sprawled over 100 lines of code. But a second glance quickly dispelled the impression: most of the lines in the C++ sample are comments explaining what’s going on. Comments are good! When counting the actual executable lines of code, the two samples are roughly similar in size, which surprised me as I expected the C++ version to have a lot more overhead as typical of a lower-level language.

A little reading of the comments and the tutorial page found the explanation: a lot of the tedious book-keeping that raw C++ programs have to contend with have been taken care of by Boost code libraries. This is how the C++ version of the demo ended up almost as concise as the Python version.

I still intend to continue my ROS education in Python, because I still think that’s an interesting way for me to train my Python programming muscles. But it’s nice to know that if I should ever need to do ROS coding in C++, I can get help to keep the complexities under control.

Historically I’ve been skeptical of C++ libraries – they are really wonderful when things work as designed, but when things go wrong things the code quickly become very difficult to debug. This may or may not be true for C++ code using Boost libraries, I’ll find out if I go there.

One trivial detail: the Python ‘talker’ sent out the current time but the C++ version just sent out a counted integer. Looking at the documentation of the ROS libraries, it looks like the time utility used by the Python version has a straightforward counterpart in the C++ library. Why wasn’t it used in the C++ tutorial to match the Python tutorial? It may just be simple oversight, but I wonder if there’s a more interesting story behind the scenes.

Getting Started on ROS: C++ or Python?

rosorg-logo1One of the items on my longtime to-do list is to investigate at least one of the publicly available robotics frameworks. Every robot project I’ve participated in so far has been a ground-up affair, everything built from scratch. At my simple hobbyist level I haven’t experienced a whole lot of tedious repetition across robots, but I definitely got far enough to see it looming on the horizon. My last robot (many years ago) was built around a very compact PC laptop as its brain, which made the project very powerful but also very expensive for its day. Today, I can get that kind of power in an inexpensive Raspberry Pi. Which happens to be one of the platforms supported by the Robot Operating System. So this is where I’m going to start.

I’m barely into the beginner tutorials but I see enough to appreciate what they have, and also to start having questions. I like the fact modules communicate over commodity network transports (TCP or UDP) and the master negotiation procedures are built around XML-RPC. It does add overhead but it’s the kind of overhead that allows a great deal of flexibility. But it is also a vulnerable security exposure. I haven’t seen anything talking about best practices to deal with rogue nodes on a ROS network but I hope that is coming up soon.

When the tutorial starts talking about writing code to create ROS nodes, it offers an option for the reader: write in C++, or write in Python? The prudent thing for me to do is to stick to C++, a language I know, while I learn ROS. If I go with Python I’ll be learning the programming language on top of learning the ROS framework.

Today I’m in a ‘chasing shiny objects’ kind of mood, so I’ll start down the Python path. Whether this turns out to be a wise or foolish choice is yet to be seen. Either way, it’ll be documented in upcoming posts!

 

Gigabyte Z270N-WiFi and its F1 Firmware

When I embarked on the Luggable PC project, the primary goal was to build a computer using components I already had on hand. This translated into the requirement to accommodate full-sized desktop PC components. Now that I’ve used it for a while and started to like carrying my full-time computer around, I’m building up for an upgrade. This time, instead of building a chassis around components I already had, I will buy smaller components with the intent of assembling a new luggable chassis.

First up: The motherboard. Out of all the commodity form factors, the best balance of small size, computation power, and reasonable price is the Mini-ITX form factor. I’ve already worked with a few boards of that form factor, but none with leading edge components. This changes with the purchase of a Gigabyte Z270N-WiFi.

GigabyteZ270N-WiFi
Image by Gigabyte

The specifications of the motherboard looked great on paper. In additional to the small Mini-ITX form factor, the features important to my project are:

  • Support for Intel’s latest Kaby Lake generation of processors
  • M.2 slot for SSD
  • PCIe x16 slot for full-power GPU
  • Wireless networking

Factors that were not critical, but used as tie-breakers against its competition:

  • Dual-port Intel gigabit wired Ethernet
  • 6 SATA ports
  • USB-C port
  • Bluetooth

Looks great on paper! Sadly in reality the motherboard made a very poor first impression due to the onboard firmware. It was heavy on flashy looks and light on usefulness. I ran into many problems with basic functionality.

Example 1: The USB mouse support was useless: I could move the cursor around with the mouse, but clicking has no effect.

Example 2: Upon startup, it shows a full-screen Gigabyte logo (basically an advertisement) that I find annoying. If I select the firmware option to disable the logo, the motherboard no longer boots: I have to reset the firmware settings via jumper to get back to square 1. This was such an unexpected thing that it took three resets before I determined it was the logo setting that caused the problem.

So the “F1” version of the motherboard firmware was a disaster. Fortunately by the time I bought the board, Gigabyte has released updates and is currently on “F4”. Upgrading allowed me to disable the Gigabyte advertisement and still have a functional computer, in addition to addressing other functional annoyances.

This motherboard was clearly pushed out the door with incomplete firmware and the expectation on users to upgrade. I now have a good motherboard, but there’s a sour taste in my mouth from the bad out-of-box experience.

Plastic Bottle Upcycling with TrussFab

csm_chair_FEA-nolable-02_ea4ad9b60f
Image from TrussFab.

A perpetual limitation of 3D printing is the print volume of the 3D printer. Any creations larger than that volume must necessarily consist of multiple pieces joined together in some way. My Luggable PC project is built from 3D printed pieces (each piece limited in size by the print volume) mounted on a skeleton of aluminum extrusions.

Aluminum extrusions are quite economical for the precision and flexibility they offer, but such capabilities aren’t always necessary for a project. Less expensive construction materials are available offering varying levels of construction flexibility, strength, and precision depending on the specific requirements of the project.

For the researchers behind TrussFab, they chose to utilize the ubiquitous plastic beverage bottle as structural component. Mass produced to exact specifications, the overall size is predictable and topped by a bottle cap mechanism necessarily precise to seal the contents of the bottle. And best of all, empty bottles that have successfully served their primary mission of beverage delivery are easily available at quantity.

These bottles are very strong in specific ways but quite weak in others. TrussFab leverages their strength and avoids their weakness by building them into truss structures. The software calculates the geometry required at the joints of the trusses and generates STL files for them to be 3D printed. The results are human-scale structures with the arbitrary shape flexibility of 3D printing made possible within the (relatively) tiny volume of a 3D printer.

Presented recently at ACM CHI’17 (Association for Computing Machinery, conference for Computer-Human Interaction 2017) the biggest frustration with TrussFab is that the software is not yet generally available for hobbyists to play with. In the meantime, their project page has links to a few generated structures on Thingiverse and a YouTube video.

 

Internal Fixture for Acrylic Box

Continuing my self-examination for assumptions that might be holding me back, I started thinking about the fact that all the fixtures I’ve built so far for the box exercise are external to the box. This seemed like an obvious approach – tools are almost always outside of the object that the tools are working on.

But while working with various fixtures, I’ve occasionally wished for something inside the box to brace against. At various points I thought about building an internal component to mate against the external fixture, but for one reason or another that hasn’t happened. So let’s try that now.

Internal Fixture

 

It turned out far more successfully than I had expected. When the fixture is on the outside of the box, my hands performing assembly had to work inside the tight internal volume. But when the fixture sits inside, my hands have far more freedom to move around outside and everything is easier to do. The assembly of a test box with this fixture was far smoother than any of the test box assemblies built with previous fixtures.

Since it worked so well, I went digging into the pile of scrap acrylic and cut panels for more boxes. While putting together these boxes by hand, I thought about how I’d automate the various tasks involved. The good news is that the fixture is no longer the biggest blocker, other aspects of box assembly now demand some problem-solving time.

Task #1: Peeling the protective paper backing off the laser-cut pieces of acrylic. At the moment this is a very tedious task that demands strong fingernails and luck. If we want to make a production line of a laser-cut acrylic product, we need a solution.

Task #2: Dispensing Weld-On 16 acrylic cement. Acrylic cements like Weld-On 4, with low viscosity and flows like water, have been outlawed by the South Coast Air Quality Management District government agency. So any dream of production will have to figure out how to work with the legal but far more viscous Weld-On 16. Applying by hand resulted in inconsistent beads of cement and aesthetically ugly joints.

Acrylic Box with External Frame

I took a pause from experimenting with fixtures for building a simple acrylic box, but it’s time to revisit the topic. While thinking about the external frames I had built, I started re-examining all the basic assumptions I had held during those experiments.

One assumption was that I must design the fixture to stay clear of the joints, lest I accidentally bond the fixture to the box with a bit of overflowing glue. So I started thinking what it might mean if i intentionally wanted to bond the box to its fixture. The result is the “exoframe box’, a box with an external support frame that also functions as the construction fixture for the box during assembly. This prototype led to the following observations:

Exoframe Box

Advantage:

It is stronger. Once everything is glued together, the external frame greatly increases the strength of the box. This either allows a box to handle a greater load compared to an equivalent frame-less box, or allow the box to be constructed of thinner acrylic.

It allows non-square profiles. The external frame in this prototype is rectangular, but there’s no reason why it has to be. The external frame can add contours to meet functional or artistic requirements. Say, make a network data storage computer look like an elephant, as a play on the urban legend that elephants never forget.

It lights up very nicely. The external frame adds a lot of edges and corners, which add light paths to any LED lighting in the acrylic construction. A quick test with an LED confirmed that the “bling factor” went up dramatically.

Disadvantage:

It took quite a bit of effort to keep the kerf compensation math straight. It probably shouldn’t count, though, as I assume I’ll eventually figure out a way to have the computer deal with the kerf compensation math for me instead of keeping it straight in my head.

Increased complexity in assembly since we have 9 interlocking pieces instead of 5. Somewhat mitigated by the fact that the external frame assisted in alignment of the box internal pieces, just like fixtures are supposed to, but overall a box with external frame is still much less friendly to automation than a plain box.

Water Damaged Nexus 5X Screen

The water-damaged Nexus 5X is somewhat functional again after cleaning off the swimming pool water chemicals, but suffers from a severe battery drain turning precious power into heat. This makes the phone unusable as a phone: it can only last an hour or two on battery, and being so hard on the battery raises worry of battery failure. Not “is the battery going to be flat?” kind, the really bad “is it going to burst into flames?” kind of worry. Before I put the phone aside (with battery disconnected) one final post about the screen assembly.

The screen is in bad shape even if the rest of the phone had fully recovered. The screen is legible and the touchscreen still works, but there are a lot of visually distracting marks left by liquid intrusion.

Liquid Screen.jpg

The big blotches in the center act like a bits of liquid still trapped in a gap. The size of the blotch changes depending on the pressure on the screen. I hope it evaporates in time, though I’m sure it’ll leave even more marks as it does. In contrast, the diagonal streaks do not respond to pressure and are likely residue left by drying liquid.

The obvious answer is to separate the touch digitizer layer from the display panel so I could clean the gap in between them. Unfortunately, even though the Nexus 5X is relatively easy to repair, this specific part is not repair-friendly. There are no more fasteners to access – the front of the phone, including the touch digitizer and the screen, appear to be a single bonded assembly.

Replacement assemblies are available online for $50-$60 dollars, which is a significant percentage of the $200-$250 asking price of a refurbished Nexus 5X. Even if the rest of the phone had recovered, I would have thought long and hard about spending that much money just for cosmetic concerns on a backup phone. And given the battery issue, the decision is clear to just leave it as is.

Nexus 5X, Hand Warmer

Power drain
Red rectangle marks the problematic hot area.

I’ve been pleasantly surprised at how far I was able to revive a Nexus 5X soaked in a public swimming pool for 30 minutes, but I think I’ve reached my limit.

All the phone functions I tested had worked, but using the phone for more than an hour uncovered a serious problem: something related to battery power management is very ill.

The first symptom was heat: the phone got far hotter than it used to, and trying to run the phone while plugged in to the charger resulted in a lot of heat and not a lot of increase in charge level.

I shut the phone down, unplugged it, and set it aside to wait for it to cool. It remained warm for many hours and never cooled. When I turned the phone back on briefly to check, I see the battery charge level has dropped dramatically. Something was draining battery power and turning it into heat even when the phone was turned off.

I knew most phones had two charging programs: One while the phone is on, running under the main operating system. And a second while the phone is off, run by a very minimal piece of code. I’ve already tried the first without success, so I turned off the phone and tried the second. Fortunately this was able to charge the battery though the phone still got pretty toasty.

After the battery was charged again, I disconnected the battery. Only then was the phone able to cool off. When I reconnected the battery, it was quickly obvious the heat source is under one of the pieces of metal shielding, marked in the picture by a red rectangle. I don’t know how to remove that metal shield without destroying the components underneath.

Two hypothesis are open: (1) this circuit was damaged earlier trying to run a ruined battery, or (2) the shield isn’t as watertight as it looks: there’s a lot of pool water chemicals in there corroding parts. Either way, it is beyond my current ability to address, so I have to stop here.

I can’t use this as a phone for more than an hour or two on battery. And I can’t store it with the battery connected because of the drain. So I’m going to disconnect the battery and put it aside in the hope I’ll have better ideas later.

Nexus 5X Reassembly after Cleaning

The Amazon Prime truck has delivered the aftermarket replacement battery and a syringe of thermal compound, so it’s time to put the phone back together.

The first order of business is applying a dollop of thermal compound on the frame where it accepts heat transferred from the CPU. Previously, there was a piece of pliable tape sitting in this square depression in the frame, but it was damaged by the alcohol and removed. The gray compound is intended for DIY PC builders to be applied between their computer CPU and its associated HSF (heat sink + fan) assembly. It is designed to bridge only a very small gap, since the CPU and the heat sink of a desktop PC are in physical contact and this compound only needed to fill the remaining tiny air gaps. Here it is asked to bridge a much large gap of almost 1 mm with no physical contact between parts.

Thermal compound

The reassembly went smoothly until I installed the aftermarket battery and found the connector cable is too long by a few millimeters. It is a large distance in the tight confines of a cell phone’s guts. Looking on the bright side, I guess it is better to have a connector cable that’s too long rather than too short.

Too long

With the connector plugged in to the appropriate location on the main circuit board, the cable is bent at an angle that won’t fit under the rest of the phone.

Bent

As much as I hated to do it, I pressed down the cable and made a sharp fold in it. This is a recipe for metal fatigue and the cable won’t last long if I keep doing this. Well, at least the battery is cheap.

Folded

Folding the battery cable allowed the rest of the pieces to be fully reassembled. The phone can power on and launch into Android, so the basics look OK and clear the way for more testing. Let’s see if the phone works well enough to justify replacing the screen assembly.

Powering Up the Waterlogged Nexus 5X

After waiting overnight for the re-cleaned parts to dry, I reassembled the phone and pressed power. The lack of response was no surprise. I then plugged the phone into the charger and was very encouraged to see the screen light up with the depleted battery icon. This tells me the some of the phone made it through the ordeal in at least partial working order.

But after a few hours, the situation did not improve. So I took the phone apart again to take a closer look at the battery. When I first took the phone apart to soak in distilled water, I measured the voltage across the connector terminals and got 3.0 volts. It was lower than healthy for a lithium battery but not necessarily fatal. I measured it now – after charging for several hours – and it read zero.

So, that’s not good.

I thought the battery cell might be dead, so I got another one to test my hypothesis. I wanted the connector from the existing battery so I cut apart the plastic wrap to extract it. I was surprised to find that there’s a tiny circuit board inside. I’m not sure what that circuit board does… but looking at its current condition, it’s not doing that job anymore. Since I didn’t know it was there, it didn’t receive the water + alcohol cleaning treatment received by the rest of the phone electronics. It has been under attack by swimming pool chemicals for the past few days.

Battery Board Toast

Well, I wanted the connector, and now I can access the connector. Let’s use it to wire up the lithium cell straight up. There were four soldering contacts on the connector, two with large conductors and two with small conductors. The two large ones were helpfully labeled “V+” and “V-” so that’s how I soldered the lithium cell.

Battery hackAnd it worked! This setup was sufficient to get into the Android OS. Now that the screen is showing more than the “depleted battery” icon, I could see that it was damaged in this adventure. Thankfully it was still legible, and the touchscreen still worked, so I could run the phone for about 40 minutes. Long enough to access the multi-factor authentication app so I could transfer my MFA security to another phone.

Since the phone appears to be running, I ordered a proper replacement battery. I don’t know if the corroded battery circuit board did anything bad to the rest of the phone. The charging circuit may have been damaged trying to charge a zero volt battery for hours. I’m going to see how the phone works with the replacement battery before spending money to address the damaged screen.

Drying Nexus 5X Off From Swim

My Nexus 5X phone took a 30-minute swim in a pool due to my negligence. It was unsurprisingly dark when retrieved from the pool. I’ve already ordered a replacement phone but I was curious: could it be brought back to life?

The first order of business was water removal. A public swimming pool has all sorts of chemicals unfriendly to electronics. The first thing I found upon return to home was a jug of distilled water originally intended for the car’s battery. Good enough for a starting point, I left the phone soaking in distilled water while I went online to read up on Nexus 5X disassembly on iFixit.

The information is promising – by modern phone standards, this model is very easy to disassemble and repair. Following the instructions, I disassembled the phone into its major components, performed a second round of rinsing, and laid the parts out to dry.

Disassembled

After drying overnight, it was obvious soaking in distilled water was not enough. There were enough chemicals remaining to leave a white residue on many surfaces and corrosion began eating many components. Here’s a close-up picture of the SIM slot and a few of the surrounding components. The brown stuff building up in the lower-right is especially worrisome.

Soak in Distilled

If gentle soak in distilled water wasn’t enough, it’s time to step things up. Isopropyl alcohol is easily available as a first aid disinfectant though at a lower concentration than ideal. First aid rubbing alcohol is 70% alcohol and electronics cleaning usually specifies alcohol content of 90% or higher. Since time is of the essence, the first aid stuff will have to do. Once the parts are soaking, I also ran a small plastic bristle brush over the surfaces to dislodge any remaining pool chemical and the corrosion that is accessible.

It’s not clear if the alcohol or the brushing was more useful, or if they were both required, but things look much better after the alcohol dried off overnight.

Alcohol and Brush

Some printed numbers were erased by the alcohol, which I wasn’t worried about. Some adhesives were dissolved by the alcohol, and I’m worried about the tape that used to sit over the CPU. I will need a replacement heat conductor to help transfer heat generated by the CPU to the chassis frame for dissipation.

Portable External Monitor 2.0: Stacking Plates

Enclosure2_CADPortable External Monitor version 2.0 (PEM2) explored a different construction technique from PEM1. Instead of building a box by assembling its six side pieces (top, bottom, left, right, front back) the box is built up by stacking sheets of acrylic.

With this construction technique, it is much quicker to place components in arbitrary locations in 3D space. Control along the X/Y laser cutting axis are trivial. Control in the Z axis takes a little more effort. The components can be aligned to the thickness of the sheet of acrylic, but if that’s not enough, it is possible to use engraving operations to precisely locate the component in Z.

In contrast, when we want to locate components inside a box at a specific coordinate, we’ll have to design additional pieces – supports and brackets – to mount the item at the appropriate location in the box.

It is also very easy to assure alignment between the parts of the box. Cut a few fastener holes at the same location across all the sheets. After they are stacked up, inserting the fasteners to align all the sheets.

The downside of this approach is that it is very wasteful of material. Each layer will consume an acrylic sheet of the overall X and Y dimensions. And if we only cut away the parts we need for the components, there is potential for a lot of unnecessary acrylic in the final assembly. They add weight without usefully contributing to the structure. Putting in the design time to cut away those parts reduces the time savings of this technique, as it starts approaching the work needed to design supports and brackets in an empty box.

If there’s an upside to the wasted material, it is the fact that this glue-less technique can be easily disassembled. When we’re done evaluating this prototype, every sheet of acrylic can be reused as material for future (necessarily smaller) projects.

Lesson learned: This “stacking plates” construction technique offer a trade off of reducing design time and effort at a cost of reduced material usage efficiency.

Enclosure2_Complete

Testing Heat-Set Inserts in Acrylic

As a beginner playing with plastic fabrication on a 3D printer, I hadn’t known about heat-set inserts for putting durable and reliable threads in plastic construction. In all my projects to date, I tapped threads into the plastic directly and made sure to be careful when tightening a screw threaded into plastic. The inserts look like a much, much better solution and they are easily available from hardware vendors like McMaster-Carr.

Before I put in an order, though, I wanted to do a quick experiment. I salvaged some M2.5 heat-set inserts from the dead Dell laptop, and I laser cut holes of various diameters into a scrap piece of 3 mm acrylic. When the hole is too large, the result seems to be obvious: insert will be unable to grip tightly. It’s less obvious to me what happens when the hole starts becoming too small. Recognizing the symptoms will help me determine proper diameter for future applications.

HeatSetTests

For their M2.5 inserts, McMaster-Carr recommends drilling a hole .152″ in diameter. This translates to about 3.86 mm. The largest hole in this test piece is nominally 3.75 mm, but with laser kerf will end up closer to 3.91 mm. The hole labelled 3.7 would, after laser kerf, end up right on the dot at 3.86 mm.

The experiment showed that they will all suffice to hold the insert into the acrylic, so in practice there is some amount of tolerance for the diameter precision. As the holes got smaller, more heating is required to install the insert, and more acrylic is visibly distorted around the insert due to the additional heat. Fortunately optical clarity seems to be mostly preserved, the distortion is barely visible in the above picture.

Once I got down to around “3.5” (actually ~3.66 mm with kerf) I started seeing the insert pushing plastic out of the way during installation. This results in a small ring of excess plastic around the base of the insert, which is undesirable. This is a good enough marker for “too small” and I stopped there. The holes smaller than “3.5” remain unused.

Experiment complete: In the future, the combination of optical distortion and excess plastic at the base will serve as my first warning sign that I’m installing heat-set inserts in too small of a hole.

Thread Tapping Failure and Heat-Set Threaded Inserts

Part of the design for PEM1 (portable external monitor version 1.0) was a VESA-standard 100 x 100mm pattern to be tapped with M5 thread. This way I can mount it on an existing monitor stand and avoid having to design a stand for it.

I had hand tapped many M5 threads in 3D printed plastic for the Luggable PC project, so I anticipated little difficulty here. I was surprised when I pulled the manual tapping tool away from one of the four mounting holes and realized I had destroyed the thread. Out of four holes in the mounting pattern, two were usable, one was marginal, one was unusable.

AcrylicTappedThreads
Right: usable #6-32 thread for circuit board standoff. Left: Unusable M5 thread for VESA 100 monitor mount.

A little debugging pointed to laser-cutting too small of a hole for the tapping tool. But still the fact remains tapping threads in plastic is time-consuming and error-prone. I think it is a good time to pause the project and learn: What can we do instead?

One answer was literally sitting right in front of me: the carcass of the laptop I had disassembled to extract the LCD panel. Dell laptop cases are made from plastic, and the case screws (mostly M2.5) fasten into small metal threaded inserts that were heat-set into the plastic.

Different plastics have different behavior, so I thought I should experiment with heat-set inserts in acrylic before buying them in quantity. It doesn’t have to be M5 – just something to get a feel of the behavior of the mechanism. Where can I get my hands on some inserts? The answer is again in the laptop carcass: well, there’s some right here!

Attempting to extract an insert by brute force instead served as an unplanned demonstration of the mechanical strength of a properly installed heat-set insert. That little thing put up quite a fight against departing from its assigned post.

But if heat helped soften the insert for installation, perhaps heat can help soften the plastic for extraction. And indeed, heat did. A soldering iron helped made it far easier to salvage the inserts from the laptop chassis for experimentation.

Portable External Monitor 1.0

LCD Enclosure 1 piecesOnce the LCD panel and matching frame had been salvaged from the laptop, it’s time to build an enclosure to hold it and the associated driver board together. Since this was only the first draft, I was not very aggressive about packing the components tightly. It’s merely a simple big box to hold all the bits checking to see if I have all the mounting dimensions for all the circuit boards correct.

It was also the first time I had the chance to try acrylic sheets in a color other than clear. There was a dusty stack of 6 mm green acrylic that I enlisted into this project. Since this is just an early draft project, I valued ease of construction over appearance or strength (6 mm is more than sufficient) and so I used the interlocking tab design for self-aligning assembly.

The resulting box was functional, but not very interesting from a design viewpoint. I just wanted to prove that all the components worked together before I proceeded to the next draft.

I did not design this enclosure to stand by itself. Instead, I had designed this enclosure with a VESA standard 100x100mm mounting pattern in the back and intended to tap those laser-cut holes to take M5 fasteners. Once so prepared, I can mount this enclosure on any existing stand that conforms to the standard. That little design detail – independent of the LCD panel and driver board – sent me off on a little side exploration of plastic construction techniques.

That is a story for the next update.

LCD Panel Frame From Laptop Lid

Drilling out plastic rivetsMy Luggable PC display was a LCD panel I had salvaged from an old laptop, which I’m doing again for this external monitor project. When I pulled the Luggable PC panel out of the old laptop, I left most of the associated mounting hardware behind. During the Luggable PC project I wished I had also preserved the old mounting hardware.

The first reason is dimension data. When I mounted the screen to my Luggable PC, I had to measure the panel and design my frame to match. A Dell engineer did this work years ago, and when I threw away the mounting hardware, I threw that away as well.

The second reason is strength. A LCD panel is fragile, but when backed with its sheet metal frame, it becomes quite a bit stronger. This is usually a worthwhile trade off against the increased size and weight.

The third reason, less obvious than the previous two, is to manage heat. The back light assembly across the bottom of the screen would get quite hot when the panel is just sitting by itself. However, when the panel is mounted in its frame, the frame served a secondary purpose as heat sink.

The metal frame I want to reuse is attached to the plastic outer cover of the laptop lid. The attachment is done via small plastic rivets: bits of the plastic lid cover melted into the metal frame. Pulling off the frame with brute force is likely to bend and damage the frame, so the assembly is put under the drill press. After cores of all of the plastic rivets were drilled out (above), the metal frame easily pops off the plastic lid cover (below).

Frame freed

The metal frame can now be used to build the rest of the enclosure. The frame can be cut, drilled, and generally manipulated in ways that I would never do to the LCD panel itself. And when I’m done with all the prep work, the panel itself will drop right in to the frame. This should be much easier than what I had to do for the Luggable PC screen.

Portable External Monitor Project

Thanks to a friend’s generous donation of a nonfunctional Dell Inspiron E1505, I have another LCD panel to play with. (And distract me from FreeNAS Box project.) The eventual ambition is to upgrade my Luggable PC to a multiple-monitor system but as a first step, I’ll learn to work with the new panel by turning it into a portable external monitor. If phase 1 is successful, it becomes an optional additional accessory I can lug alongside the Luggable PC. Then, if I’m feeling ambitions, I can move on to phase 2 of integrating everything into a multi-monitor Luggable PC.

The first order of business is to extract the panel and look at its specifications. Dell laptops around that vintage offer resolution as low as 1024×768, which wouldn’t even be worth the effort to resurrect. Fortunately, this LG Philips LP154W02 panel has a decently respectable 1680×1050 resolution.

Since the computer doesn’t work, next I have to see if the panel does. Off to Amazon to look for boards that claim to drive this panel. The first board (*) pictured here was able to present all the right info to a computer, and it can power the back light, but no picture showed on screen. At this time I was worried – did I get a bum board, or is the display dead?

After some diagnostic chatter with the seller, I was pointed to another board they carried. The first board was computer-focused, the second board was more TV and media focused. The upside is that it worked. The downside is that it seems to have trouble preserving 1:1 pixel information at 1680×1050. I wonder if its media-focused nature meant it up scale all signals to 1080p and then down sample to the panel resolution. That would explain the minor visual artifacts.

The artifacts does take a bit away from the success. But it’s lit, it shows a picture, and that’s good enough to proceed.


(*) Disclosure: As an Amazon Associate I earn from qualifying purchases.

Simplified Acrylic Box Fixture

After being humbled by my ambition overreaching my skills, I abandoned the idea of an articulated build fixture. To keep tolerance variations under control I wanted to build a simplified version just to make sure I can do at least the simple thing. Also, doing simple fixtures will be an useful skill for times when I want to build a one-off project that needs a fixture but doesn’t justify the investment for a complex fixture.

The simplified fixture is a stack of acrylic plates, made of a mix of designs depending on the task for that layer. The common thread along all the plates are strategic cutouts to keep away from the cement surfaces. This ensures any overflowing cement will not seep into the gaps between the box and the fixture and ruining everything.

The box is built upside-down with the side pieces going into the fixture first. Once they are in place and glued together, the bottom of the box is added last. The bottom-most plate in the stack keeps the box panels aligned vertically. The top-most plate locates the square panel that serves as the bottom of the box.

This fixture tells me the kerf compensation I had been using is a tiny bit on the aggressive side. In the previous fixture, the various errors masked this fact, but in this simplified fixture there is no escaping the truth. The four side pieces of the box inside the fixture have a very tight fit. So tight, in fact, that capillary action was unable to wick enough cement into one of the joints, which promptly fell apart after the box was removed from the fixture.

Fixture5
First run of the stack-of-plates fixture, with the very precise (but one corner not sufficiently bonded) box it built.

Which brings us to the advantage of the simple design: I could make an adjustment, cut replacement pieces, and have a better-fitting fixture in a fraction of the time of building the overly complex articulated version.

Laser Cut Acrylic Fixture Exercise

So after the successful kerf compensation and the reminder that thickness is important, the resulting construction fixture was much better than the 3D printed version but sadly still not good enough.

Fixture4 Open
Box assembly fixture in open position.

The holder for each of the four sides worked well – I’m especially happy at the fact they can grip the panel with just enough force to hold it in place. This was a super encouraging result of the kerf compensation math. If I were a tiny bit off one way, the side piece would be loose. If I were a tiny bit over the other way, the side piece would be gripped too hard and cause scratches. (Or wouldn’t fit at all.) Feeling the pieces fit “just right” was very satisfying.

Fixture4 Closed
Box assembly fixture in closed position.

The problem came from the multi-piece articulated design. Even though the kerf compensation was close to exact fit between two pieces (+/- 0.1 mm) the overall dimension of the fixture depends on perfect alignment of acrylic pieces across assemblies of 5-10 pieces. I was close, but each little error adds up and the resulting box built by this fixture has errors of up to 0.5 mm. Easily detectable by the eye.

Fixture4 Result
Close-up of box built with the fixture.

And, as should be obvious from the pictures, this fixture took a lot of work to assemble. Generally speaking, it is OK (and actually fairly typical) for mechanical design of a fixture to be more complex and time-consuming than the mechanical part itself, so the complexity itself is not a problem. The problem is that I have yet to learn all the ins and outs of designing the fixture so the desired tolerances can be maintained when my fixture starts getting complicated.

But that’s OK, learning from experiences like this is exactly why I’m doing it.

 

Building with Acrylic: Thickness Variation

Thickness failIn the previous post, the laser cutter kerf was successfully compensated, admittedly in a way that left plenty of room for improvement in the future. This post will look at a different challenge of building with acrylic: variation in thickness of acrylic sheets. So far experience showed different sheets of “6 mm” acrylic can actually be anywhere from 5.31 mm to 6.03 mm.

Since most laser-cut acrylic projects are 2D in nature, any variation in acrylic sheet thickness usually goes completely unnoticed. But when building 3D structures out of multiple interlocking pieces, the thickness dimension has a significant impact.

Fortunately for us, while thickness can vary across different sheets, the thickness is relatively consistent within a single sheet. There may be some variation from one corner of a 4′ x 8′ sheet of acrylic to another, but once cut into smaller pieces that can fit in a laser cutter, the thickness can be reasonably treated as constant.

This allows us to treat thickness as a parameter in a Fusion 360 CAD file. Any slots cut for acrylic pieces will need to reference the parameter. So that when it comes time to generate the cutting profile, the thickness parameter can be updated with the thickness of the actual sheet of acrylic, and Fusion 360 will automatically recompute all the slot widths to match.

Which brings us to the attached picture illustrating human error: the assembly on the left is built up to the proper dimensions. In contrast the assembly on the right was too thin. I made the mistake of measuring on one sheet and cutting on a different sheet that turned out to be 0.29 mm thinner. 0.29 mm is a small difference, but when the assembly is built by stacking seven pieces together, it results in a significant dimensional error of over 2 mm.