Back in the day, I did a degree in kinesiology and learned about something called proprioception. Proprioception is how you know where your body is in space. Try this — close your eyes and touch your nose with your right pinky finger. Easy peasy. Why is that? How does your finger know where your nose is? The answer is proprioception.
Long story short, we have little stretch sensors in our muscles called muscle spindles and Golgi tendon organs. They're embedded in muscle fibres and tendons and send signals to the brain as they're stretched and compressed. Our brain interprets these signals to understand where the muscles are located compared to the rest of the body.
So when you go to touch your nose, your brain a) outputs signals telling certain muscles to contract, and b) receives feedback from stretch sensors about your body location. This tells your brain where your pinky is versus where you want it to go. Controlling a motor works basically the same way.
A little to the left.
In the RendAR system, a motor rotates the turntable using closed-loop feedback to capture product photos at specific angles. This is important because it ensures consistency across a retailer's online catalogue. It doesn't look good to a customer if you have a page of products facing different directions.
For RendAR, a microcontroller is the brain, a motor is the muscle, and a motor encoder is the muscle spindle. Closed-loop feedback is to machines what proprioception is to humans.
To start, let me tell you what we're working with. The motor I'm using to rotate the turntable is a 12V, 16.7 RPM DC motor with a rotary encoder. The main factors that went into choosing the motor were RPM and power.
The turntable needs to rotate pretty slowly in the range of 5-10RPM. For reference, a microwave rotates at about 6RPM. I control the speed of the motor using pulse-width modulation, but it's better if the motor is low-RPM to begin with.
I also need a 12V motor that draws less than 2.25A to fit within my power budget (power = voltage x current). Finally, I wanted the motor to have a built-in encoder, which is a sensor that measures how far the shaft rotates.
Controls Appreciation Paragraph
Automatic control systems has to be one of coolest things I've learned in engineering school. It's also the subject I knew nothing about beforehand. Now I think controls is kind of like peak-engineering. It combines physics, mathematical modelling, mechanical engineering, electrical engineering, simulation, and software.
In a nutshell, controls is how you make a dynamic (moving) system do what you want it to. Control systems engineering is how NASA can land Perseverance on Mars, SpaceX can launch and land rockets, and Boston Dynamics can make robots dance.
And now, controls is how I accomplish the infinitely less complex but deeply satisfying feat of making a motor rotate exactly 90 degrees.
There are two types of control systems — open-loop and closed-loop. In open-loop, you send a signal to an actuator, cross your fingers, and hope for the best. In closed-loop, you measure the output of the system and compare it to what you wanted to happen. If there's a difference between your input and your output, you try to correct it. This difference is called error.
RendAR uses a closed-loop negative feedback system with a PID controller. Negative feedback means the controller aims to reduce error, as opposed to positive feedback, which increases it. The PID controller is a mechanism that calculates how to reduce the error. It says, "Given this error...*does math*...send this voltage to the motor."
Here's a block diagram of my closed-loop negative feedback system:
Now for a side-by-side demo! Here's a comparison of the motor rotating with open-loop and closed-loop feedback. In the open-loop system, you can see that error accumulates with every rotation. In the closed-loop system, the motor rotates 90 degrees each time.
This is what happens for each rotation of the closed-loop system:
The PID controller determines how steps 4-6 pan out. The parameters Kp, Ki, and Kd shown in the diagram above can be varied to adjust how quickly the motor reaches its reference angle, how much the motor oscillates before settling, and how much error remains when the motor reaches steady state and stops moving.
I tuned the values of Kp, Ki, and Kd through trial-and-error to find ones that produced smooth rotation without any overshoot and oscillation. Simple but satisfying!
Up next: Connecting the capture rig and iPhone via Bluetooth
Another find in my Dad's workshop — a day-of-the-week clock. What a concept. In fact, a very useful concept when you're working in a basement during a pandemic and the days start to blend together.
This clock used to live in my Grandpa's workshop before he passed away in 2014. He knew how to build everything. Here's a photo from when he helped me tear my room apart and put it back together when I was about 14.
What's a Softbox?
Lighting is one of the hard parts of DIY product photography. One retailer said they photograph products in the same spot at the same time of day using only natural light. Rainy day? No bueno.
To solve this problem, the capture rig includes a built-in lighting solution. The lid of the capture rig functions as a softbox, which is a go-to light source in photo studios. A softbox provides soft, even illumination and usually looks something like this:
I started off building an open plywood box and lining it with tinfoil to make the inside reflective. Next, I cut and placed strips of LEDs with a colour temperature of 6000K (daylight white). There are close to 600 LEDs in this bad boy.
I wired up the the LEDS in parallel to reduce the amount of current going through any single strip. Soo much soldering. Electrical tape prevents the wiring connections from shorting. One side of the circuit connects to power and the other to ground and then out to the wall adapter through a barrel connector.
Moment of truth...it turned on! And it's BRIGHT. It was satisfying to see it work on the first try after the lengthy assembly process. Electrical debugging avoided, phew.
The LEDs are a little too bright and harsh on their own. To get soft, even illumination, I needed to diffuse the LEDs. I ordered white "diffusion fabric" off of Amazon. This is the kind of material used in actual softboxes to scatter light.
I cut the fabric to size and stapled it to the softbox frame. It took three layers to achieve the kind of glow I wanted. Finally, I added plywood edge banding to tidy things up.
In hindsight, it would have been cool to make the brightness of the softbox "smart." I could have included an ambient light sensor and varied the LED voltage automatically to suit lighting conditions. For now, there's one level...💡BRIGHT💡.
Up next: Controlling the motor 🤖
Check out my first post for context: Introducing RendAR
I'm writing this from the workshop at my parents' house. Campus labs and workshops closed for the lockdown in Ontario so this is where I’m posted up. Lucky for me, I have very handy parents who don’t mind having their adult kid around.
It’s a pretty sweet workshop. Exhibit A — this is a jigsaw from the 1930s my dad bought at a garage sale when he was 25.
And just because, here’s me in my dad’s workshop growing up. Same vibe and same lamp and jigsaw in the background.
So back to building…
When I think of a turntable, I think of a record player. That analogy stuck and became the inspiration for the capture rig form factor. Functionally, there are a few things the capture rig needs to do:
I ordered parts before Christmas and started assembling the base in early January. The turntable/scale subassembly includes four load cells, a DC motor, a Lazy Susan bearing, and a platform for the product to sit on. The subassembly is isolated from the rest of the capture rig to ensure the full product mass is measured by the load cells. The housing goes on last and is easily removed so I can access the mechanical/electrical parts as needed.
Originally I planned to 3D print and laser cut some parts, but I pandapted (pandemic-adapted) the design to rely on woodworking given the tools I have. As a result, this thing is SOLID.
The capture rig is powered by a wall adapter and controlled by an Arduino Nano 33 BLE. Once I got everything wired up, I tested it out with the help of my 8-year-old niece, Evie. Just a couple of school kids learning remotely! We got the motor to rotate and the load cells to give uncalibrated readings. (The platform isn't screwed to the bearing here, so it looks a bit wobbly.)
Quote from Evie after filming this:
I can't believe you did so much work and that's all it does.
Just over here inspiring the next generation 🥲.
A few things I learned from assembling the turntable/scale:
Up next: how I built the softbox lid 💡
Hey, welcome to RendAR! I'm Laura, a fourth-year Mechatronics Engineering student at the University of Waterloo. I'm building RendAR (partly) for my fourth-year design project. I researched and designed RendAR during fall 2020 and am in the process of building a functional prototype this winter.
So why RendAR?
Last summer, a friend of mine helped a retailer set up an online store for the first time. Like many businesses, the retailer felt they had to be online to survive the pandemic. His experience taught me about some of the hard parts of managing an online store.
Think about the last time you bought something online. You probably don't have to think too hard. For me, it was two days ago. Unsurprisingly, the COVID-19 pandemic accelerated the already increasing trend of Ecommerce. In 2020, Ecommerce retail sales in the US jumped a whopping 30%.
Brick-and-mortar retailers have been pushed to move their stores online or risk going out of business. In the words of one retailer I spoke to,
Stores without an online footprint are on palliative care.
One of the primary platforms enabling this transition is Shopify, which powers over 1,000,000 businesses worldwide. Shopify is a game changer for merchants, no doubt. But after talking to a few retailers, I learned they still have challenges. Two big ones are product photography and data entry.
It turns out taking great product photos isn't that easy and nobody likes tedious admin. This is especially true for non-technical retailers who are already stretched thin. They can either learn to do it themselves, which takes time, or hire someone, which takes money.
Retailers need an easy and inexpensive way to capture quality, consistent product photos and data and add them to their online store.
So that's what I'm working on. An interesting thing about these two problems (product images + data entry) is that they have something in common -- they're repetitive. This means they're candidates for automation, and that's what I aim to do with RendAR.
RendAR automates product photography, data entry, and Shopify integration.
RendAR lets retailers digitize their products and get them online with the press of a button, no technical skills required. The system includes an all-in-one capture rig with lighting and a motorized turntable, an iPhone app, cloud-based image processing, and Shopify integration.
It works like this:
In this proof-of-concept, 2D photos are a starting point, but could definitely be expanded to 360 images and 3D captures. Similarly, I chose to measure mass and dimensions since that info is needed for shipping, but other data types could also be captured. In the future, more (all?) Shopify product data fields could be auto-captured so that RendAR completely digitizes the product. Fully digitizing products opens up ideas for other cool/useful applications...but that's for another day.
Building RendAR gives me chance to design and build an end-to-end system and play around with things like mechanical design, motor control, sensor calibration, bluetooth, iOS development, image processing, UX, and APIs. I'll share some of that here in future posts.