Ultimaker Community of 3D Printing Experts

Ultimaker 3 Octolapse-Style Timelapse

Recommended Posts

Hey everyone! I was inspired by a Facebook post to fork unlimitedbacon's Ultimaker 3 timelapse Python code to create an Octolapse-style timelapse. The Facebook post had printed hardware, a bluetooth shutter and a smartphone mount to do it. I used their idea and made it work by using the position that the UM3 parks in when switching nozzles.

Octolapse is a piece of software that links into Octoprint to move the print head and/or bed out of the way to systematically take a series of pictures to make a timelapse. If you don't know what Octolapse timelapses look like, here are a few examples! https://www.instagram.com/adamsprints/  https://www.instagram.com/wildrosebuilds/

Check out the GitHub repository to see how to set it up. I don't go into too much detail about installing, but this thread might help more. If you have questions, I'd love to help out.

Here's a video of how well it works! I think this was the 2nd iteration of the script after I forked it. It's a little bit more refined now.

Feel free to clone the repository, submit pull-requests and check out the timelapses!

• 1

Share on other sites

I like the timelapse script of unlimitedbacon and ported it to python 2.x because most of my devices uses python 2.x out of the box and there are only very few lines to change.

I also like the idea behind your fork, but I am not sure if it is really practical. I am not sure if it is good for the nozzle to heat up without filament or without flow, so could happen, that the nozzle will clog sometime. (ok could be fixed with a lower temp setting for head 2 in Cura).

And I assume the print time will increase drastically due the print core switch in each layer. But on the other hand, to use the switch position is great, print head is out of sight and the video looks great.

Maybe only for some special prints, where time is not a factor. But very useful for prints where you use both cores anyway - there should be no additional increase in print time.

Thanks a lot, will definitely install it (after porting to 2.x) and use if for dual prints.

Share on other sites

The print time is increased by the nozzle switching. I increased an 8.5 hour print to 9 hours by adding the ghost tower for extruder 2 in the corner. I feel that is an acceptable amount of time for the reward.

I haven't had any nozzle clogs yet but I've only done this a handful of times already. I suspect you're correct and that the 2nd nozzle will clog after a little bit of time doing this.

Also, I've added support for the Ultimaker S5 as well and I'm testing that right now with the print I mentioned above!

• 1

Share on other sites

+ 0.5 hours is ok, I expected something more.

Regarding nozzle, I mean you could set the temperature for the core 2 to something really low, then nothing should happen with the nozzle.

Share on other sites

Real nice job man! Looks great!

Would love a step by step tut on how to implement this. this was done using the inbuilt camera i assume? Hope its not too technical!

Share on other sites

@cloakfiend yep! It uses the built-in API to access the required information including the camera. The original code just has a time delay for when it takes pictures to build the timelapse, but I wanted the head to move out of the way too. So I looked at the X and Y position when the printer changes printcores and does its thing and told my forked code to watch for that exact position. Therefore whenever the printcores change, we take a picture and build a timelapse!

Setting it up to work on any given computer should be fairly easy. I'm using a Linux server (Raspberry Pi) so it was not hard for me to set up. All you need to do is install Python 3 (latest) and install ffmpeg for your system. Then run the script on the command line with the IP address of the printer, the number of seconds of postroll you want (probably 1) and the output file like timelapse_1.mkv or something.

Share on other sites
1 hour ago, starbuck said:

All you need to do is install Python 3 (latest) and install ffmpeg for your system. Then run the script on the command line with the IP address of the printer

where do i run the script? where do the frames/video get saved?

p.s. your z screw looks like it could do with a clean!

Edited by cloakfiend

Share on other sites

This concept should be integrated in the standard firmware, I think. Maybe best as an option?

• 1

definitely!

Share on other sites
3 hours ago, cloakfiend said:

where do i run the script? where do the frames/video get saved?

p.s. your z screw looks like it could do with a clean!﻿

The latest code is on GitHub here https://github.com/starbuck93/um3timelapse. Use the "Clone or Download" green button and then click "Download ZIP". Or "Clone" it if you're so inclined! Go ahead and unzip it where you downloaded it, probably in the Downloads folder, or your Desktop or wherever. After that, go to the unzipped folder, and at this point it depends on your operating system. For Windows I'd say to run cmd and then all you'd do is cd to the unzipped folder and run python3 timelapse.py 0.0.0.0 1 video.mkv and let it run! It handles the frames automatically so you'll never see a folder full of pictures and the video is saved in the same folder you run the python script in.

3 hours ago, geert_2 said:

This concept should be integrated in the standard firmware, I think. Maybe best as an option?

﻿

That would be really cool. I suspect there would have to be support for saving to the USB stick as there is not much onboard storage for these types of things!

• 1

Share on other sites

Thanks for the info, your video inspired me so much I just went and ordered myself a gopro7 hero black!

I wanna give this a go badly!, been meaning to do time-lapses for a while but was too lazy, now I'm better I'm super motivated, just finishing up a sculpt first though!

Share on other sites

hi all,

i'm just trying to use this application.

i've installed python 3.7, downloaded both the GitHub files and ffmpeg, when i try to runt he command as stated in the installation guide i get this error message:

B:\timelapse\um3timelapse-master>timelapse.py 192.168.140.189 1 test.mkv
Traceback (most recent call last):
File "B:\timelapse\um3timelapse-master\timelapse.py", line 4, in <module>
from requests import exceptions
ModuleNotFoundError: No module named 'requests'

am i using the command wrong?

thanks.

Share on other sites

Hey @PaulMiles! Here's the information in your error message that's important: ModuleNotFoundError: No module named 'requests'

To fix that, I'd use python-pip to install the package called requests like this

pip install requests

or "pip3" if just plain "pip" doesn't work for some reason. pip3 is the python3 specific version.

Share on other sites
16 hours ago, starbuck said:

Hey @PaulMiles! Here's the information in your error message that's important: ModuleNotFoundError: No module named 'requests'

To fix that, I'd use python-pip to install the package called requests like this


pip install requests

or "pip3" if just plain "pip" doesn't work for some reason. pip3 is the python3 specific version.

hi Starbuck!

that's great it worked!

but now when creating the video i'm facing another error, i think it's failing to use ffmpeg for some reason, not sure why.

:: Encoding video
ffmpeg -r 30 -i C:\Users\<username>\AppData\Local\Temp\tmp9ifx3knq\%05d.jpg -vco
dec libx264 -preset veryslow -crf 18 -loglevel panic test.mkv
'ffmpeg' is not recognized as an internal or external command,
operable program or batch file.

does the .exe need to be in the same folder of the script or something?

thanks again for your help :)

Share on other sites
3 hours ago, PaulMiles said:

does the .exe need to be in the same folder of the script or something?

Yes, I believe it does. It sounds like you might be using windows? You can either

• copy the ffmpeg.exe to the same folder as timelapse.py
• you can edit timelapse.py to include the full path to ffmpeg around line 126 starting with ffmpegcmd
• ffmpegcmd = "B😕path\to\ffmpeg.exe ...rest of the line stays the same"

Share on other sites

Thanks Starbuck

I'm getting closer! it's now creating a video but it doesn't show the build.

I have checked the temp folder where the the captures are saved and it has one image from when the print starts with the buildplate lowered and 30 images from when the print has finished, again with the build plate lowered.

It doesn't seem to be taking any captures during the print.

I think I have my file set up as you describe, dual colour with printcore 2 doing a dummy model 1mm x 1mm the height of the main model.

Any ideas?

Thanks

Paul

Share on other sites
13 hours ago, PaulMiles said:

Any ideas?

Yes, I think I know what's going on. It's the (x,y) position of the head in the corner there. I mean the physical position of where the Ultimaker head parks, not the tall 1x1mm dummy object. I wonder if the coordinates are exactly the same as mine or if something like firmware or Cura versions change it.

Here's how to test it,

During the first couple of layers of your print, run this python3 test.py:  https://github.com/starbuck93/um3timelapse/blob/master/test.py after editing IP_ADDRESS in the script to be the IP address of your printer. While the (benchy, calibration cube, whatever) print is running like you have set up in the screenshot, the test.py script will output X and Y coordinates of the head. When the head is parked in the corner waiting for PrintCore 1 or 2 to reach the correct temperature to resume printing, check what the X and Y coordinates are. When I was testing, I saw the same coordinate set around 3 times in a row.

After that, in timelapse.py, go edit the location_check function (link to github) to have the X and Y coordinates you discovered with the test.py script.

For UM3 I found test.py output x213 y189 and I also saw x209.375 y193.0 several times too. I ended up with 213,189 in mine, but yours could be different.

Share on other sites

@starbuck You could improve the script and check if x and y is within a range to compensate small differences. But be careful you also need to manage that you already took a photo for this layer, because when using a range, your script will fire more than once. I would check also the z position and if you already shoot a photo for this z layer, then don't trigger again.

Share on other sites
10 hours ago, Smithy said:

@starbuck You could improve the script and check if x and y is within a range to compensate small differences. But be careful you also need to man﻿age t﻿hat you already took a photo for this layer, because when using a range, your script will fire more than once. I would check also the z position and if you already shoot a photo for this z layer, then don't trigger again.

I like your thought process here! Checking the Z position would be very helpful. Perhaps I can make a second script to "run once" and double check the values during a test print (calibration cube type thing).

Share on other sites

I would try to give it a range of about 10 steps (maybe more ?), then the user who is using the script don't have to check his exact position and have to modify the values in the script - it will always work (hopefully, was just an idea 🙂)

Share on other sites

Thanks for the tips. I have had to run the printers for actual jobs this week so will try and get it working at the end of the week. I will let you know how it goes!

Thanks

Create an account

Register a new account

• Our picks

• Designing for light-weight parts is becoming more important, and I’m a firm believer in the need to produce lighter weight, less over-engineered parts for the future. This is for sustainability reasons because we need to be using less raw materials and, in things like transportation, it impacts the energy usage of the product during it’s service life.
• 12 replies
• An easy guide towards a 3D print via ArchiCAD for new users. Also a Q&A!
• 6 replies
×