Post 1: Introducing RendAR
Post 2: The Turntable
Post 3: Capture Rig Lighting
Post 4: Motor Control
Post 5: System Integration & Bluetooth
In my last post I said I'd either talk about camera integration or load cell calibration next. Well hold onto your hat because they're both working now. Jumping right in, here's a demo capturing my running shoe. The app UI is shown on the left. (Note: this demo doesn't include image enhancement / background removal.)
I designed the iPhone app user interface (UI) in Figma and then built it in Xcode. The UI guides the user through a sequence of steps:
For those who care about software implementation, the app is built using the standard model-view-controller (MVC) design pattern. In step 1, a BLEManager class is initialized. The BLEManager is passed from view to view to maintain the Bluetooth connection. In step 2, a Product class is initialized. The Product object is passed from one view to the next to populate the data fields, including name, mass, and images. Eventually the product object will be sent to the cloud for image processing (enhancement + background removal) and then to the retailer's Shopify store.
Side note: Designing the UI was fun! Back in the day, I was a bit of an art kid so it's nice to remind myself of that. In the spirit of shameless self-promotion, here's some evidence of my old art skills. I won my high school art contest without entering for the painting and you better believe I'm still smug about it. Thanks to my grade 12 art teacher, Mrs. Skol, wherever you are.
The mass measurement and image capture happen in step 5. The iPhone and capture rig talk to each other over Bluetooth to synchronize their actions. This state diagram shows the states (blue), events (green), and conditions (black) that dictate when things happen:
Load Cell Calibration
The load cells were a pain in the butt to get working but I only have myself to blame. The capture rig has four load cells and I tried to calibrate them together. That didn't work very well — mass readings were inaccurate, noisy, and unreliable. I did the logical thing and avoided calibrating the load cells again until right before a demo with my professors. This timing wasn't totally by choice. I physically broke my microcontroller around this time and had to wait a few days for a new one to arrive 😬. Fortunately, once I sucked it up, disassembled the turntable, and calibrated the load cells individually, they worked great. Lesson learned -- procrastination works, kids 😉. Just kidding, don't recommend.
I also discovered that one of the load cell amplifiers is a dud. When a load cell supports a mass, it bends ever so slightly. This deflection changes the length of strain gauges within the load cell, which changes the resistance in the circuit, which changes the voltage signal read by the microcontroller. The voltage changes are so small that they must be amplified to be meaningful.
I removed the faulty amplifier and load cell leaving the capture rig with three functioning load cells. Not ideal in terms of balance, but it works. Here's a demo showing the accuracy of the load cells.
You may have noticed a couple of "Coming soon!" fields in the Capture Summary screen. Those fields are Type and Dimensions. I'm working on measuring product dimensions in the app using ARKit. I'm also taking a machine intelligence course and piggybacking my course project on my FYDP. I'll be training a model to populate the product type field.
Up next: Probably measuring dimensions with ARKit 📏