Nikola Tesla 3D print

How To Make A Wireless DSLR Remote Shutter and Make a Time-lapse – Part 2

This is part 2 of a 2-part post on making a Wireless/Wifi Remote Shutter for any DSLR and creating a time-lapse of a 3D print.  Part 1 contains the Wireless Shutter construction, while Part 2 deals with the time-lapse portion. Click on over to Part 1.

Setting up for a Time-lapse video

Now that you’ve upgraded your DSLR with Wifi remote-triggering, you need a way to sync your 3D printer software with your DSLR.

OctoPrint Screen CaptureI am running OctoPrint on a Raspberry Pi 3B+.  The software controls my 3D printer, adding quite a bit of functionality.  For example, it can queue my prints and save them to a folder for later.  This is very handy for calibration prints or any other print that you like to have handy.

OctoPrint has a plug-in system that adds features to OctoPrint.  The one plug-in we’re interested in today is OctoLapse.

I won’t go into details about how to install this software since there are already great write-ups. Still, I will show you how to configure the software to use your Wireless DSLR, how to have OctoLapse place the 3D print tray in position for a great photo and how to trigger your DSLR at the right time.

Step 1 - Add a Shutter Script to the Raspberry Pi

For this step, you’ll need to SSH into your Raspberry Pi.  Use your standard credentials unless you’ve changed them.

Username: pi    password: raspberry

Once you’re at a command prompt, enter the following command:

nano TakeDSLRShot.sh

TakeDSLRShot.sh

				
					#!/bin/sh
SNAPSHOT_NUMBER=$1
DELAY_SECONDS=$2
DATA_DIRECTORY=$3
SNAPSHOT_DIRECTORY=$4
SNAPSHOT_FILENAME=$5
SNAPSHOT_FULL_PATH=$6

# OPTIONAL : Let Node-Red know where we are
# Un-Remark the next line of script to add Node-Red support
#/usr/bin/curl 192.168.2.3:1880/setzlayer?zlayer=${SNAPSHOT_NUMBER} --silent

# Ensure Camera is awake and focused. This still wakes up the camera
# if its in sleep mode and in manual focus
/usr/bin/curl 192.168.2.122/focus --silent

sleep 2

# Now fire the camera
/usr/bin/curl 192.168.2.122/shutter --silent




				
			

Please copy the above text and paste it into your text editor.  To exit the editor, press CTRL+X.  It will ask you to save the file.  Press Y and hit enter.

You will need to make the file executable:

chmod +x ./TakeDSLRShot.sh

And test it.  Plug your Wifi Shutter in, turn on your camera and type the following:

./TakeDSLRShot.sh

If all the parts are in place, your DSLR will focus, wait 2 seconds, then take a photo.  Pay careful attention to the LEDs on your Wifi Shutter.  The status LED should light up when it receives commands from the network.  These lights are helpful when diagnosing malfunctions.

Now that we have added the shutter script and we know it works, we need to add our script to the etc/sudoers.tmp file.  This allows OctoLapse to run our script on its own.

Issue the command:

sudo visudo

Add the following line to the very bottom of the file:

pi ALL = (root) NOPASSWD: /home/pi/TakeDSLRShot.sh

Press CTRL-X followed by Y and enter to save the file.

And that concludes our SSH work on the Raspberry Pi.  For the next part, it’s time to switch to your browser.

Step 2 - Setting Up OctoLapse

Open a browser and head over to your OctoPrint installation.

http://octopi.lan

(or whichever address you used when you installed it) and call up your OctoLapse settings tab:

 

Add a Camera

We’re going to add a new Camera, so click on the Camera tab on the top right of the settings page.

OctoLapse Add Profile Screen Capture

And hit Add Profile.

OctoLapse Add Script Camera Screen Capture

Go ahead and give your profile a name and description.  I called mine “Pentax K5.”

Then, for Camera Type, choose External Camera – Script.

Under Snapshot Acquire Script, enter our script : /home/pi/TakeDSLRShot.sh

OctoLapse Add Script Camera Screen Capture

Add Stabilization

OctoLapse Stabilization Options Screen Capture

OctoLapse can move the print bed to a certain position to present the print to our camera when each layer completes.  You can find this setting in the Stabilization tab.  I prefer the “Back Center” setting, which means the print head is moved to the back and center of the build plate before each photo.  This has the effect of pushing the plate out to the front of the machine.

Obviously, OctoLapse gives you several options, including some nifty animations.  Later on, take some time and explore the Stabilization options for exciting results.

Set The Trigger

OctoLapse Add Trigger

Tell OctoLapse to trigger on every layer.

Now back in your new Camera settings, press the Test Script button.  If everything goes ok, your camera will fire, and you’ll be greeted with a SUCCESS or OctoLapse Partial Script Test SuccessPARTIAL SUCCESS message.  A partial success means the script was executed successfully, but OctoLapse didn’t get any pictures from our camera.  This is perfectly fine since we’re storing our pictures on our DSLR.

Save your configuration changes.  You are ready for the next step.

Step 3 - Choosing and Preparing a 3D Model

We need to choose a 3D model to print.  Ideally, the model will be interesting, but more importantly, the model should print without supports.  Remember, supports are extra pieces of plastic that the printer uses to hold up otherwise unprintable pieces of overhang, roof or angles that exceed the printer’s capabilities.

If you’re looking for inspiration, check out these great sites.  They all have free 3D models that you can download and print.

Thingiverse Logo
Thingiverse
https://www.thingiverse.com/
Thangs Logo
Thangs
https://thangs.com/
PRUSAPRINTERS Logo
PRUSAPRINTERS
https://www.prusaprinters.org/prints

We need to consider the height and width of the model since it will affect our lens choice. When DSLRs use wider apertures, the depth of field, DOF becomes narrower.  We can use this effect creatively by letting the model blur behind and in front of a well-chosen focal point.  Since we’re working with a close-up, the DOF will be even narrower, making aperture choice a critical element.  Using an aperture of f/1.4 might be too narrow, so consider stepping down to f/4 or f/5.6, or if you have enough light,  f/8.

When choosing a model, consider how it will look as it passes through your focal plane while it “grows.”

Preparing Your Model

Next, you need to slice your model. I use Cura for this purpose, but you can use any slicer software that you’re comfortable with.

Consider your layer height.  The taller the layer you print with, the fewer layers that are required to print your model.  Which also results in fewer pictures taken and fewer frames for your video.  Consider printing with a “FINE PITCH” layer height to smooth out your transitions and lengthen your video.

Yoda in Cura Slicer with Gyroid InfillOther choices you can make in the slicer include infill, rotation and placement of the model on the build plate.  Consider the angle you would like to shoot the model from and place it on your build plate accordingly.

Choose your infill, knowing it will be captured on your time-lapse. Cura has a “Gyroid” infill choice that produces 3-dimensional waves inside your print.  It produces some outstanding footage for time-lapses.  Be willing to experiment!

Getting your print from Cura to OctoPrint is a breeze, thanks to Cura’s OctoPrint Connection extension, available in their online marketplace.  You can get it directly from Cura by clicking Marketplace at the top left. 

Cura Print With OctoPrint

Step 4 – Light The Scene

Overall shot of LEDs Lighting My 3D Printer

I like to use RGB LEDs to light my scene.  They’re very cheap, infinitely variable and most importantly, run continuously.  I have a whole post on building your own LED lightbox, and I’m using something similar here to drive 300 RGB LEDs around my 3D printer.

The lights are controlled wirelessly by an ESP32 and can change to a different colour scheme at each layer.

Step 5 – Preparing The Camera

Because I’m using a preset in OctoLapse stabilization called “Back Center,” the print head will always move to the back center of the build plate when a photo is ready to be taken. The happy effect of this is the build plate moving all the way to the front of the printer.

Raw Or JPEG?

To me, the answer is obvious; I’m using RAW files rather than JPEG.  Why?  Because RAW files contain ALL of the information your sensor can produce.  JPEGs throw away much of this information to produce a minimal image size.  Editing RAW files lets you change white balance, brightness and contrast settings without destroying the photo.  JPEGs can take a little editing, but they fall apart pretty quickly when pushed too hard.

If you choose RAW photos, keep in mind you still need to use those files to produce a video. This means your video editor needs to understand your RAW files.  Using Lightroom, it’s easy to convert them to DNG, JPEG or another format that the video software understands.  As you’ll see later on, we’re using DaVinci Resolve to create our time-lapse video, so as a first step, I will convert my Pentax RAW files in Lightroom to Adobe DNG.  From there, DaVinci Resolve will recognize my RAW files.  More on this in the next section.  (Also of note, Pentax DSLRs can produce DNG files natively, eliminating the need for a conversion during processing)

You will need a tripod.  I’ll wait for you to get it out and set your camera on it. Then, be sure to point it at your 3D printer’s build plate.

Turn off your timer. Ensure your drive-mode is set to single-shot and not using a timer.  My Pentax camera offers a 2-second and 12-second timed delay, but we won’t need this feature.

Turn off image stabilization. Either your lens or camera may have its own optical stabilization mechanism. For example, my Sigma 17-50 f/2.8 has optical image stabilization built-in, but so does my Pentax K5. 

Turning off those mechanisms keeps your photos tack sharp when using a tripod.

We’re going to use manual exposure and manual focus.  Manual exposure keeps the exposure from frame to frame consistent, saving us much time in editing.  Manual focus isn’t strictly required, but auto-focus might sometimes fail depending on your light levels and other factors.  You don’t want to lose any frames due to a misfocus.

Most cameras have a Manual mode, marked with an “M” on your mode dial.  This is how you will switch to manual exposure.

In addition, most cameras have an Auto-Focus setting that can be changed to manual. For example, I have a switch on my Pentax body, plus one on my lenses.  Either of these switched to MANUAL will do the trick.

Measuring for FocalPointThe simplest way to pre-set your focal point is to use a stand-in model on the build plate.  Your stand-in model should be about the same height and width as your actual model. So first, move the build plate to its front location (where Octolapse will place it during a photo) and place your stand-in model in the centre.  Next, take some test shots and adjust your camera’s focus until your model is sharp and you’re happy with the composition.

You can choose to frame your model any way you wish, but I usually go for a wider view of the build plate to add panning and zooming effects in my video editor.

Pro Tip: Print the same model TWO or more times. If you’re not sure what part of the model should be focused on, don’t worry too much about it.  You can choose to quick-print the same 3D model using larger layer heights or other methods to print it quickly.  Then you have the actual model on the build plate to set your focus on.  Remove the model from the build plate and restart your print using finer layer heights.  Or, print both models with fine layer heights. The first time-lapse should have a larger DOF, so you don’t blow the focus. Having the first print ON the build plate lets you set your camera any way you wish, including narrow DOF and tricky focal points such as eyeballs.  Just don’t forget to remove the 1st model when you print the 2nd.

Next, adjust your camera’s exposure settings.  It’s easy to determine a starting point for your exposure.  I like to use Av mode, set my aperture to f/5.6 or f/8, ISO to 100 (or very low) then half-press the shutter button to get a shutter speed.  Remember the shutter speed.  Move your camera to Manual Mode and ensure the aperture and your new shutter speed are set.

Also, many cameras have an exposure indicator in manual mode, so you can see instantly if your photo is well exposed when you adjust your aperture, shutter or ISO.

Be on the lookout for blown highlights and loss of detail in the shadows.  If your picture is too dark, increase the shutter time.  If your picture is too light, decrease the shutter time.

Check Your Power Source!

If you’re using a battery like I am, make sure your battery is charged and have another one charging.  You can change the battery in your camera during a shoot as long as you don’t do it while the camera is taking a picture and you don’t change your camera’s position. This takes a light touch, so it’s better not to have to change your battery mid-shoot in the first place.

A DC power supply is a great idea for long shoots.

Prepare Your Memory Card

I like to format my memory card in my camera before a shoot. It helps my workflow later on if I only need to concentrate on a single shoot at a time.

Step 6 - Start The Print

OctoLapse Shot PlanIf you’re happy with your test shots, then you are ready to start your print.

OctoLapse analyzes your 3D print’s gcode file then presents a Snapshot Plan Preview. This is a run-through of what OctoLapse will do at each layer with the print head.

Hit “Accept and Continue”

Step 7 - Monitor The Print

As the print begins, I like to monitor the process to ensure the camera operates and the shot looks as expected.

Once the first or second layer has been captured, I like to leave the print and monitor it remotely.  Using OctoPrint’s Control screen, I can watch the whole process through my webcam and ensure my DSLR is operating and my lights are working.

When your print is done, move your stills from your DSLR to your computer.

Step 8 - Make a Video

DaVinci Resolve is an amazing video editor with features that eclipse many of its peers. They aim their software at Pros but provide a free version for personal use.

Click on the link and download the non-studio version. You will need to register for a free license but it’s well worth the effort.

When you start Resolve, you’re presented with the project window.  You can see a list of the projects you’ve created here.

Click New Project and provide a name.

At the bottom of the screen, choose the Media workspace.

DaVinci Resolve Screen Capture

In the media browser, select the folder where you saved your still images.

DaVinci Resolve Screen Capture

If your files are named sequentially, then Resolve automatically detects your still images as a time-lapse and shows a single preview image with the image names in square brackets.

Right-click your clip and select Add into Media Pool.  At the bottom of the screen, select the Edit workspace.

DaVinci Resolve Screen Capture
DaVinci Resolve Screen Capture

Drag your media clip to the timeline. It will show up as a clip of your individual stills.  Resolve automatically turns your still images into a video clip.

Now, click the Deliver workspace.

DaVinci Resolve Screen Capture

At the top left, click YouTube or set the video to your own specifications.  Set the video’s name and location. At the bottom of the same pane, click Add to Render Queue.

Once you’ve added your video to the render queue, you will see the job show in the Render Queue at the far right of the screen.  In the same pane, at the bottom press, Render All.

Congratulations, you’ve made your first time-lapse video.

Time-lapse Videos From This Post

During the making of this post, I produced 7 or 8 actual time-lapse videos.  A new skill takes time to “stick,” and experimentation is the key to making that happen.

With that said, here are two of my earliest videos made specifically for this project.  I hope you enjoy them, and I hope you find something useful in this post.  If so, drop me a line below!

Conclusion

Making a 3D print can be as easy as setting up a webcam and letting OctoLapse do all the work.  But, webcams don’t produce the same quality a DSLR does.

In addition, you can’t just point your camera at a 3D printer and hope for the best. It takes coordination to ensure the build plate isn’t moving when your camera is snapping your photos.

You now have the designs to make your own Wifi Remote Shutter Trigger for your DSLR.  You know how to trigger it with your phone or computer and you know how to make OctoLapse trigger it when printing your 3D model.

My recommended next steps are to spend time with DaVinci Resolve if you’re serious about time-lapse videos.  It can add titles, background music, pan and zoom effects, colour correction and more.

Now go and make some videos, but let me know about them in the comments below!

This is part 2 of a 2-part post on making a Wireless/Wifi Remote Shutter for any DSLR and creating a time-lapse of a 3D print.  Part 1 contains the Wireless Shutter construction, while Part 2 deals with the time-lapse portion. Click on over to Part 1.

Leave a Comment