Skip to content

Instantly share code, notes, and snippets.

@simonjamain
Last active September 12, 2023 15:42
Show Gist options
  • Save simonjamain/beeca3f692b087e0e27712971aa0842b to your computer and use it in GitHub Desktop.
Save simonjamain/beeca3f692b087e0e27712971aa0842b to your computer and use it in GitHub Desktop.
Custom timelapse script for CURA postprocessing plugin
@S7EVIN-SHAFE7
Copy link

@simonjamain Thank you for your scrpt. That solve my strings problem from cura Gcode edit. But give me shake picture because i cant select the position when picture is taked and position when triger is realised.
I have creality Cr10 v3.

@S7EVIN-SHAFE7
Copy link

S7EVIN-SHAFE7 commented Jan 11, 2021

@simonjamain Thank you for your scrpt. That solve my strings problem from cura Gcode edit. But give me shake picture because i cant select the position when picture is taked and position when triger is realised.
I have creality Cr10 v3.

Solved swaping shuter realease.

cura_4_8_0_customtimelapse_v2

@Yasuharu-Factry
Copy link

Hi, thanks for this awsome plugin.
I am Japanese. I am not good at English.

We changed the retraction.
Added work to return the filament after pressing the shutter.
I changed it because it was necessary for me.
Added the work to restore the drawn filament.

Gcode:
; STEP 5 : Move the head back in its original place
G0 F9000 X137.909 Y129.816
M83 ; switch to relative E values for any needed retraction
G1 F1800 E5;Retraction
M82;Switch back to absolute E values

Python:
# TODO skip steps 5 and 6 for the last layer
gcode_to_append += "; STEP 5 : Move the head back in its original place\n"
if enable_custom_return_speed:
gcode_to_append += self.putValue(G = 0, X = x, Y = y, F = return_speed) + "\n"
else:
gcode_to_append += self.putValue(G = 0, X = x, Y = y) + "\n"
gcode_to_append += self.putValue(M = 83) + " ; switch to relative E values for any needed retraction\n"
if enable_retraction:
gcode_to_append += self.putValue(G = 1, F = 1800, E = retraction_distance) + ";Retraction\n"
gcode_to_append += self.putValue(M = 82) + ";Switch back to absolute E values\n"

Please try to reference.

My machine is TRONXY XY-2 PRO.

@simonjamain
Copy link
Author

@simonjamain Thank you for your scrpt. That solve my strings problem from cura Gcode edit. But give me shake picture because i cant select the position when picture is taked and position when triger is realised.
I have creality Cr10 v3.

Solved swaping shuter realease.

cura_4_8_0_customtimelapse_v2

Nice workaround !
I indeed did not take into account the fact that some picture could be taken on release, I may (or may not, I'm not really active on this right now) add some code to deal with that or add your workaround in the readme.
please use the issues on the new repo to submit your issues -> https://github.com/simonjamain/CustomTimelapseCuraPlugin

@simonjamain
Copy link
Author

Hi, thanks for this awsome plugin.
I am Japanese. I am not good at English.

We changed the retraction.
Added work to return the filament after pressing the shutter.
I changed it because it was necessary for me.
Added the work to restore the drawn filament.

Gcode:
; STEP 5 : Move the head back in its original place
G0 F9000 X137.909 Y129.816
M83 ; switch to relative E values for any needed retraction
G1 F1800 E5;Retraction
M82;Switch back to absolute E values

Python:

TODO skip steps 5 and 6 for the last layer

gcode_to_append += "; STEP 5 : Move the head back in its original place\n"
if enable_custom_return_speed:
gcode_to_append += self.putValue(G = 0, X = x, Y = y, F = return_speed) + "\n"
else:
gcode_to_append += self.putValue(G = 0, X = x, Y = y) + "\n"
gcode_to_append += self.putValue(M = 83) + " ; switch to relative E values for any needed retraction\n"
if enable_retraction:
gcode_to_append += self.putValue(G = 1, F = 1800, E = retraction_distance) + ";Retraction\n"
gcode_to_append += self.putValue(M = 82) + ";Switch back to absolute E values\n"

Please try to reference.

My machine is TRONXY XY-2 PRO.

I'm not english either (french) ^^ Thank you for the contribution, I'll try to test this on my printer and add it to the codebase. A pull request on the repo (https://github.com/simonjamain/CustomTimelapseCuraPlugin) with your edits could certainly make things faster :)

@glen945
Copy link

glen945 commented May 26, 2022

Good afternoon bro, introduce me, Glen, I'm from Indonesia. I want to ask you the code for Creality CR 10 Smart, so how do you get to the right? Please answer immediately, Thank you.

@juanbu123
Copy link

@FlyingSuricate. I am using your script for my UMS5. I was wondering where I can find the pictures of the timelapse. Where are they saved.

@Flying-Suricate
Copy link

Flying-Suricate commented Nov 19, 2022

The Version of the script does not record any pictures. It moves the head on each layer out of the way to a specific point. A different programm is running on my pc and request the head position. If the head is in the right position, a request of the picture get called and stored. Unfortunatly I was not able to use the Camera trigger command on my Ultimaker. Also sometimes the connection get lost from too many request at the same time.

I am working currently on a new Version. Maybe with an GUI and .exe file. And new code with less beginner mistakes.

Direct download link of the program:
https://onedrive.live.com/download?cid=784DD878071E0AC6&resid=784dd878071e0ac6%21190115&authkey=AExf5rasOejQnd8

@juanbu123
Copy link

@Flying-Suricate Do you have a tutorial on how to use the program on the pc. Also, is the program myultimaker?

@Flying-Suricate
Copy link

I changed the file. Just redownload it.
Unzip the folder. Run the main.exe file. All missing folder/files should create itself. Close the terminal. Set the ip in the config.ini file. Reopen main.exe. The program is now running. Just start a print with the custome timelapse script active with default values. This should be all.

@juanbu123
Copy link

@Flying-Suricate Thank you so much

@juanbu123
Copy link

@Flying-Suricate how can i trigger a different camera connected to the u,timaker. im using the ultituner tool that smithy created which allow to add a second camera using the the front usb port.

@Flying-Suricate
Copy link

So my expermental program is working also on an Ultimaker 5. Good to know. To get the image I use an http request of the web stream. I dont know how the ultituner works but if you get the image on the web view, everything should work normaly. There is no configuration currrently to change the connection. You can use the existing connection by changing the camera. The internal camera is connected by microUSB. Just use this connecton to a different camera and this should also work. I rewire this cable back and out of the case threw the bottom of the case.

@juanbu123
Copy link

@Flying-Suricate Do you know if I can connect a DSLR to the printer?

@mortezajorak
Copy link

Hi.
I already used this and its great thanks!
but I have a problem here.
My printer is Creality K1 and the print speed that I using is 300mm/s
whit this script, after each layer the printer will go the shutter position by a very slow speed. how can I add a speed like "Return speed" that you already written it ?
Screenshot 2023-09-12 at 4 20 18 PM

@Flying-Suricate
Copy link

I dont know why It does not retreat the old Speed. I will look it up. It could take some time.

@mortezajorak
Copy link

I dont know why It does not retreat the old Speed. I will look it up. It could take some time.

Please take a look at this video.

71620424513__FFA43DB3-8308-4F67-9468-A15F47FE4D2C.MOV

@mortezajorak
Copy link

image
And here is the result

@Flying-Suricate
Copy link

Hi. I already used this and its great thanks! but I have a problem here. My printer is Creality K1 and the print speed that I using is 300mm/s whit this script, after each layer the printer will go the shutter position by a very slow speed. how can I add a speed like "Return speed" that you already written it ? Screenshot 2023-09-12 at 4 20 18 PM

It seams the 3000000 mm/m get ignored on your machine. Maybe it is too high and then it uses its standard speed. You could try to set the first Gcode line something like: G0 X15 F7000. Maybe this will work for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment