Jump to content

Recommended Posts

Posted · Ultimaker 3 Octolapse-Style Timelapse

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!

 

https://github.com/starbuck93/um3timelapse

 

Thanks for reading!

  • Like 1
Link to post
Share on other sites

Posted · Ultimaker 3 Octolapse-Style Timelapse

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.

  • Link to post
    Share on other sites

    Posted · Ultimaker 3 Octolapse-Style Timelapse

    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!

    • Like 1
    Link to post
    Share on other sites

    Posted · Ultimaker 3 Octolapse-Style Timelapse

    + 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.

     

  • Link to post
    Share on other sites

    Posted · Ultimaker 3 Octolapse-Style Timelapse

    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!

  • Link to post
    Share on other sites

    Posted · Ultimaker 3 Octolapse-Style Timelapse

    @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.

  • Link to post
    Share on other sites

    Posted (edited) · Ultimaker 3 Octolapse-Style Timelapse
    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
  • Link to post
    Share on other sites

    Posted · Ultimaker 3 Octolapse-Style Timelapse

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

     

    • Like 1
    Link to post
    Share on other sites

    Posted · Ultimaker 3 Octolapse-Style Timelapse

    definitely!

  • Link to post
    Share on other sites

    Posted · Ultimaker 3 Octolapse-Style Timelapse
    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!

    • Like 1
    Link to post
    Share on other sites

    Posted · Ultimaker 3 Octolapse-Style Timelapse

    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!

     

     

  • Link to post
    Share on other sites

    Posted · Ultimaker 3 Octolapse-Style Timelapse

    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?

    can you please help?

     

    thanks. 

  • Link to post
    Share on other sites

    Posted · Ultimaker 3 Octolapse-Style Timelapse

    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.

  • Link to post
    Share on other sites

    Posted · Ultimaker 3 Octolapse-Style Timelapse
    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 :)

     

  • Link to post
    Share on other sites

    Posted · Ultimaker 3 Octolapse-Style Timelapse
    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"
    • Or you can add ffmpeg to your PATH. (something like this https://www.java.com/en/download/help/path.xml)
  • Link to post
    Share on other sites

    Posted · Ultimaker 3 Octolapse-Style Timelapse

    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

    timelapsetest.thumb.JPG.745c41d46ab588292be4d337c55edada.JPG

     

    dual.thumb.JPG.6dfd0e4fbb781b2a72859840aed66475.JPG

    dual.JPG

  • Link to post
    Share on other sites

    Posted · Ultimaker 3 Octolapse-Style Timelapse
    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.

  • Link to post
    Share on other sites

    Posted · Ultimaker 3 Octolapse-Style Timelapse

    @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.

  • Link to post
    Share on other sites

    Posted · Ultimaker 3 Octolapse-Style Timelapse
    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 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.

    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).

  • Link to post
    Share on other sites

    Posted · Ultimaker 3 Octolapse-Style Timelapse

    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 ?)

     

  • Link to post
    Share on other sites

    Posted · Ultimaker 3 Octolapse-Style Timelapse

    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

  • Link to post
    Share on other sites

    Posted · Ultimaker 3 Octolapse-Style Timelapse

    heres my gopro timelapse...... got a few ideas of moving the print head out of the way, especially at the end.

     

     

     

  • Link to post
    Share on other sites

    Posted · Ultimaker 3 Octolapse-Style Timelapse

    I have gotten everything working but like PaulMiles it takes 1 picture at the start and 30 at the end with none in the middle. I checked the wait position and I have multiple lines of test.py output at x213.0 y189.0 and x213.0 y207.0 also x212.04410000000001 y173.66469999999995 and x210.5625 y192.59999999999997. Out of desperation I have tried them all with the same result of 1 picture at the start and 30 at the end with none in the middle. Print progress: 00.00 % Image: 00001 is displayed at the bottom and doesn't update. I am using python3 3.8.2 home-brew-0.1.11 FFMPEG 4.2.2 on a MacBook Pro using Terminal. The print I am testing with is 18 mins long and 102 layers.

    • Like 1
    Link to post
    Share on other sites

    Posted · Ultimaker 3 Octolapse-Style Timelapse

    Hello Starbuck, 

     

    Im having trouble running your code. I have zero experience on python. Here are some screenshots. I don't understand how to put my printers IP correctly. I really need your help on this one.

    Screen Shot 2022-01-12 at 12.26.58 AM.png

  • Link to post
    Share on other sites

    Posted · Ultimaker 3 Octolapse-Style Timelapse

    Hi everyone,

    Does this still work with Cura 5.0?

    What's the best solution at the moment with Cura 5.0 to get a timelapse video of our prints?

    Thanks!

  • Link to post
    Share on other sites

    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now
    • Our picks

      • UltiMaker Cura 5.9 stable released!
        Here comes Cura 5.9 and in this stable release we have lots of material and printer profiles for UltiMaker printers, including the newly released Sketch Sprint. Additionally, scarf seams have been introduced alongside even more print settings and improvements.  Check out the rest of this article to find out the details on all of that and more
          • Like
        • 5 replies
      • Introducing the UltiMaker Factor 4
        We are happy to announce the next evolution in the UltiMaker 3D printer lineup: the UltiMaker Factor 4 industrial-grade 3D printer, designed to take manufacturing to new levels of efficiency and reliability. Factor 4 is an end-to-end 3D printing solution for light industrial applications
          • Heart
          • Thanks
          • Like
        • 4 replies
    ×
    ×
    • Create New...