กลับไปหน้ารวมไฟล์
arduino-controlled-turntable-for-3d-photography-0f0e63-en.md

The whole idea for this project started when I was looking at an IKEA turntable, which is normally used for Chinese meals:

IKEA turntable, which was the trigger to start with this project

The idea was simple: why not make this thing turn automatically using a stepper motor and control it with an ARDUINO.

So, I started to 3D print some gears that would fit with a stepper motor that I already had available.

Initial steps in this project (the 3D printed gears) Initial steps in this project ( the stepper motor) the turntable with 3D printed gear the turntable assembly with stepper motor

It soon turned out that this construction was not going to work, simply because the stepper motor was not strong enough to move the mass of the wooden turntable.

So I got myself a more powerful stepper motor, a NEMA 17 HS 34:

the turntable assembly with stronger stepper motor

Although this construction worked (with pain), the stepper motor was barely able to turn the table due to the heavy wooden table and the friction in the plastic gears.

Therefor, I dropped the idea of using the IKEA turntable and 3D printed my own turntable which was much lighter and could easily be turned with the NEMA 17 stepper motor!

The 3D printed turntable with stepper motor

After building everything together this became the final result of this project:

The final result of the turntable

Of course my ambition was more than just make an object turnaround 360 degrees!

I wanted to remotely control my SONY HX400 camera (wirelessly, via Bluetooth) and automatically take a photo every xx degrees. This of course with the aim to convert all the single 2D photographs into a 3D photo and further process the object for 3D printing.

Here you can watch the result: https://youtu.be/ci-9449n2nU

In the following tutorial, you will read how this project has been built.

I wish you good reading, and I hope it is inspiring to build something similar.

Things

Hardware components:

See Step 2 and 3

Common tools & test equipment

Software apps and online services:

  • Arduino IDE
  • Fusion 360
  • CURA
  • Autodesk Fusion 360
  • ClickCharts Diagram and Flowchart
  • EasyEDA
  • Fritzing

Step 1: System Design

The Turntable design is shown in the below diagram:

The system design of the Turntable for 3D Photography

The system, basically consists of 2 main parts:

  • The TurntableAssembly (TA) with a ESP32 microcontroller acting as server:

  • The CameraControl Box (CCB) with an ESP32 acting as client:

The TA is equipped with an 0, 96 inch OLED display, which together with a pushbutton forms the HMI (human machine interface) for the system:

This HMI enables the user to select the turning modes of the turning table and to monitor the status.

The available turning modes are as follows:

  • 5 shots at 72° steps
  • 10 shots at 36° steps
  • 15 shots at 24° steps
  • 20 shots at 18° steps
  • Continuous rotation

There are 3 green buttons that are used for actions such as:

  • “go-to-Origin” which brings the turntable to a starting position determined by a mechanical switch (built underneath the turntable).
  • “Start/Pause” used to restart the set up to initiate another turning mode
  • “manual shot” intended to send a shoot command to the camera, but in the current design only used in the process for choosing the turning mode.

All electronics for the MCU as well as stepper motor and its driver are built in the turntable housing.

A blue LED indicates the status of the blue tooth connection to the camera client.

Power is provided with a 12V/3A power supply connected to the mains; a red LED indicates that power is switched on.

The CCB is a 3D printed box, that houses the ESP32, some LED’s (3mm) and a connector to the multiport micro USB plug of the SONY HX 400V camera. Power for the CCB is taken from the camera battery (3, 3V). The CCB also has a connector for a 3, 5mm plug that enables the on/off switching of a separate flood light LED for illuminating the object to be photographed.

The 3 LED’s (apart from the orange power indicator) have the following functions:

  • YELLOW LED: indicating that the Camera FOCUS is being activated
  • GREEN LED: indicating that the camera is getting the “SHOOT” command
  • BLUE LED: indicating the status of the Bluetooth connection with the turntable server.

Step 2: Making the Turntable Assembly

Things used

The following materials are used for the turntable:

The Electronic Design

The electronic design is shown in the following circuitdiagram. The power supply is 12 V/3A. The internal 5V supply for the ESP32 is taken from the L298N motor driver while the 3, 3 V for the OLED display is taken from the ESP32 board.

Circuit diagram of the server for the Turntable

Above diagram is made using EasyEDA.

The 0, 96” OLED display has128 * 64 pixels and has been put in a 3D printed housing:

The NEMA 17 Stepper Motor and driver are depicted below:

17HS3430 Stepper Motor L298N motor driver The microcontroller: ESP 32 (NodeMCU)

EXPANDED TECHNICAL DETAILS: The NEMA Stepper Micro-Stepping

Spinning an object continuously is insufficient for 3D Photogrammetry scanning; motion-blur completely destroys the algorithm! The camera must be totally still. This project executes a brilliant, synchronized State Machine. It commands a massive stepper motor to index an item precisely, brutally halts it completely solid, then triggers a camera shutter remotely for a flawless capture sequence!

You absolutely cannot use a cheap, low-torque motor. It has zero positional accuracy.

  1. The project uses a massive NEMA 17 Bipolar Stepper Motor.
  2. The 200-Step Math Equation: Standard NEMA steppers have 200 physical steps per revolution. That means each step is a massive 1.8 degrees. If scanning a tiny miniature, the rotation is too jerky!
  3. The C++ code commands the motor driver (like an A4988 Stepper Driver). You can physically set "Micro-Stepping" jumpers on many drivers (MS1, MS2, MS3).
  4. This mathematically forces the driver chip to create intermediate steps electromagnetically using complex PWM voltage mixing! 200 Steps can be transformed into 3200 Microsteps per revolution!. The turntable then moves with incomprehensibly buttery smoothness at 0.11 degrees!

The Turntable plateau has been designed with Fusion 360 and printed on a Creality CR10S Pro. The borehole is also printed and fits exactly with the spindle of the stepper motor.

3D design of Turntable plateau

The breadboard set up used for testing and building the software with the ARDUINO IDE, is shown inthe following picture:

breadboard set up

Note: the 3D printed plastic gear is part of the original construction idea, based on the IKEA turntable.

Mechanical and electrical assembly

The assembly of all mechanical and electronic parts is shown in the pictures below:

Electrical and mechanical assembly of all elements Electrical and mechanical assembly of all elements

Note that the whole turntable requires only 1 cable to be connected, namely the 12V power cable. A separate opening is made in the box for (temporarily) connecting the micro USB plug of the ESP32 board, to be used in case of software updates.

The complete building plate has been cut out ofthe IKEA cutting board and made to fit in the ACTION box.

The Software design

The following flowchart shows the high level design of the turntable server software:

Flowchart made with ClickCharts

In the set up phase a number of Functions are called:

  • Set up of the Bluetooth connection
  • WELCOME (); //displaying a welcome message until the red button is pushed
  • TURNTABLEMODES (); //displaying the possible turntable modes of operation
  • HOWTOSET (); //displaying an explanation how toselect the turntable modes
  • SETMODE (); //setting the turntable modes by pushing the red button and selecting with the green button
  • ORIGIN (); //controlling the turntable to an origin position

The menus, displayed on the 0, 96” OLED display, will appearas follows:

menus, displayed on the 0,96” OLED display

The “LOOP” function itself is pretty short and is listed below:

void loop() {
 CONNECTION();
 switch (turnmode) {    
     case 1:                   // Turnmode 1: 5 X 72 dgr)
       STARTandTURN();
       break;
     case 2:                   // Turnmode 2: 10 X 36 dgr)
       STARTandTURN();
       break;
     case 3:                   // Turnmode 3: 15 X 24 dgr)
       STARTandTURN();
       break;
     case 4:                   // Turnmode 4: 20 X 18 dgr)
       STARTandTURN();
       break;
     case 5:                   // Turnmode 5: CONTINUOUS
       STARTCONTINUOUS ();
       break;    
                 }  
}

The only things, that happen in the loop, are:

  • Making the Bluetooth connection
  • Running the selected turnmode (as selected during set up)

The complete ARDUINO sketch for the turntable server comprises about 600 lines of code. The complete listing is included as part of this tutorial, the ARDUINO code is provided with an ample amount of comments.

Step3: Making the Camera client

Things used

The following materials are used for the turntable:

The Electronic Design

The power supply 3.3 V is directly taken from the Camera and converted into 5V, needed for the supply of the ESP32 (which internally generates 3.3V)

The Fritzing diagram looks as follows:

Fritzing diagram (note: the 9V battery is just for testing) the breadboard set up

Nothing better than a good circuit diagram:

Circuit Diagram of Camera Client (made with EasyEDA)

Interface with the HX400V SONY camera

The Sony DSC HX400V Camera has a USB connector that looks like an ordinary micro USB connector (female) with 5 Pins and indeed a normal micro USB male connector can be plugged in for 5V charging and data transfer (see table below):

Standard micro USB pin allocation

In fact the Sony connector is what Sony calls “a Multi/Micro USB Terminal that Supports Micro USB compatible device”, with 10 additional pins, that can be used for remote control of the camera.

In this project only the following pins of the multiport connector are used:

Used pin allocation for Sony camera

On the Internet, I found 3 sources for buying the relevant Multiport connector:

https://www.studio1productions.com/parts/sony-multiport-connector.htm

https://www.ebay.co.uk/itm/15Pin-USB-Terminal-Plug-Socket-Connector-Shutter-Release-Adapter-for-Sony/253810092411

https://www.mobilexcopter.com/shop.htm#!/micro-USB-multiport-compatible-connector-10-5-pin-all-pads/p/61902479

On the website of Studio1 you can also find more details on the Pin out of the multiport connector.

I bought mine from the Slovenian company MobileExcopter, who had the cheapest shipment option (EU mail).

I used a 4-wire telephone cable for connecting the connector to the ESP32. The soldering of the wires to the

ข้อมูล Frontmatter ดั้งเดิม

apps:
  - "1x Fritzing"
  - "1x ClickCharts"
  - "1x Fusion 360"
  - "1x Arduino IDE"
  - "1x CURA"
  - "1x EasyEDA"
author: "Pedro52"
category: "Motors & Robotics"
components:
  - "1x connector female 5.5 mm"
  - "2x Resistor 221 ohm"
  - "1x Capacitor 220 µF"
  - "1x 3D printed box 57 * 77 * 28 mm"
  - "1x 3 mm LED: Red"
  - "1x Stepper Motor, Mini Step"
  - "1x end stop switch"
  - "1x 9V 1A Switching Wall Power Supply"
  - "1x Light box 30 * 22 cm"
  - "1x 3D Printer (generic)"
  - "1x ESP32"
  - "1x Common tools and test equipment"
  - "2x Resistor 4.75k ohm"
  - "1x Capacitor 1000 µF"
  - "1x LED 3 mm Blue"
  - "1x Industrial Pushbutton Switch, Push-Pull"
  - "7x Resistor 221 ohm"
  - "1x Capacitor 10 µF"
  - "1x plastic cutting board 34*24 cm"
  - "4x Capacitor 100 nF"
  - "1x Dual H-Bridge motor drivers L298"
  - "4x Switch Actuator, Head for spring return push-button"
  - "1x Parts needed for Camera Client"
description: "Photogrammetry synchronization! Rig a massive bipolar NEMA stepper motor to flawlessly execute microscopic 1-degree fractional increments, commanding physical camera shutter-releases automatically for total seamless 360-degree topographical scanning."
difficulty: "Intermediate"
documentationLinks: []
downloadableFiles:
  - "https://projects.arduinocontent.cc/a2318484-311b-44e7-8ef0-0166a3b46632.ino"
  - "https://projects.arduinocontent.cc/5172178a-ad51-48cd-8d41-b335bd9e187c.ino"
  - "https://projects.arduinocontent.cc/a2318484-311b-44e7-8ef0-0166a3b46632.ino"
encryptedPayload: "U2FsdGVkX19S2Tw2KjN/hiM8OR8Ju3qFSqh2dz3SuScpbCTVCrOJPzFOf04ajZOZZqmWK4bBDGPf5FHHNoAL8bQBirQNFH0oh/7rC/vkXgxwleSvwhcqLGgOhlSkSE5ZeHj62x7kUBN25uHRRicGack24pe1V+vCQiGq03lJ7LVHbbYXDhWMX5qmt7bcTl06"
heroImage: "https://cdn.jsdelivr.net/gh/bigboxthailand/arduino-assets@main/images/projects/arduino-controlled-turntable-for-3d-photography-0f0e63_cover.jpg"
lang: "en"
likes: 3
passwordHash: "8ae79a6a62a92d255f86535cb9b4ff90c43f1c53c6e1c5c0080092d2afd2360c"
price: 2450
seoDescription: "Build an Arduino-controlled 3D-printed turntable with a stepper motor and Bluetooth camera control to create 3D pictures for 3D printing."
tags:
  - "art"
  - "data collection"
  - "remote control"
title: "Arduino controlled Turntable for 3D Photography"
tools: []
videoLinks:
  - "https://www.youtube.com/embed/GEsRcFQ1_H8"
  - "https://www.youtube.com/embed/k4NTf0hMjtY"
  - "https://www.youtube.com/embed/M2VazVGm7TU"
  - "https://www.youtube.com/embed/2-bqABJPZFY"
views: 8340