Showing posts with label time lapse. Show all posts
Showing posts with label time lapse. Show all posts

Wednesday, July 1, 2020

YAFL: Yet Another Fractal Lamp

My brother, the distiller, built a bar in his living room, and I thought that he might like a bar-worthy lamp for it, so I got busy.

I recently bought a couple 5 lb spools of transparent PETG filament (edge glow glass from Keene Village Plastics) that has some bluing in it to make it look like the glass that old Coke bottles were made from- I thought it would be great for a lamp shade, especially for colored lights because the bluing in the filament emits a beautiful, pale blue fluorescence. I've used PETG filament before, but this is the best I've used. It printed without a lot of hairs or charred blobs ending up all over the prints. I will be buying more. I suspect that all the "edge glow" colors they sell are fluorescent.

In a single wall, the stuff really does look like glass:



I searched through my collection of fractal based designs and settled on one I had previously used. I made some changes to make it more printable and for esthetic purposes, and sliced it for the new filament.

The print failed twice with the controller complaining of a heater fault. The first time I thought it might be because of a power outage (that's not a heater fault, is it?) due to a local thunderstorm, so I examined the printer and restarted the print. It got to about 23 hours and failed again. I took the cover off the printer so I could access the controller board and found that the screw terminals on the PT1000 interface board were stripped and had let the pressure off the wire enough to make the connection intermittent. 

The nice thing about prints like this is that even the failures can be useful, and no one knows they're failures if you don't tell them!


I replaced the cable and switched to the other PT1000 input on the interface board, then restarted the print. It made it all the way this time- 564.5 mm. It used 759 g of filament.  I printed it with a 0.4mm nozzle at 50 mm/sec, 3 perimeters, 0.25 mm layers. Total print time was 36 hours, 13 minutes and 57 seconds. Print time was included about 2 seconds per layer in order to make the layer synchronized time lapse video. 564.5 mm x 4 layer/mm x 2 sec/layer = 4516 sec = 75.27 minutes.

The camera had a problem when shooting the photo sequence that would become a layer synchronized time lapse movie. Even though I locked white balance, focus, and exposure, the brightness of the images varied a lot resulting in some really annoying flickering in the video. This only seems to happen when the print is lit by UV. I couldn't see any brightness variation or flickering of the light in the printer, so I checked the EXIF data of some of the brighter and darker images and found that the camera was varying the ISO value. Maybe a bug in Open Camera? I also found that the Mooni button suddenly isn't reliably working with the camera. Sometimes it triggers the camera and sometimes it tries to change the speaker volume setting. Hmmm. More problems to solve...




Here are some still photos shot while the print was running and almost finished:













This lamp has a round base, printed with black PETG. Unfortunately, the filament pigmentation wasn't consistent so parts of the print look lighter than the deep black color it started with. I used concentric top solid infill that makes the base look like a stack of vinyl records.

The light source is the same type Feit Electric 1600 Lumen, multicolor, wifi controlled LED bulb that I used in the last lamp, treated the same way- the two PCBs were separated and laid flat. The LED board is clamped to the top of the base by three screws that go through the heatsink plate inside the base. Yeah, I know it isn't going to be very good at dissipating heat that way, but the original heatsink was smaller and covered with plastic, so how warm is it going to get?




Pink/purple light, which is a combo of light from red and and blue LEDs, looks particularly nice. The bright center of the lamp looks pink while the rest of the shade fluoresces a pale blue color because of the blue LEDs. This photo doesn't quite do it justice:



Thursday, April 23, 2020

Fancy, No-Hack, Layer-Synchronized Time Lapse Videos of 3D Prints

A while back I wrote up the method I use to monitor 3D prints and even make time lapse videos. I use an old cell phone with a cracked screen and an Android app called Open Camera to snap pictures at specified intervals. Google Photos backs up the images as they are snapped so they can be viewed on any web browser. When the print is done I batch scale and crop the pictures in Irfanview, and finally turn them into a timelapse movie using ImageJ.

Since the Open Camera app is snapping pictures based on time interval, the extruder carriage appears to bounce around all over the place while the movie plays. I use lift-on-retract, so the bed bounces up and down in the video, too, like this:




If you want to snap a picture without the extruder somewhere over the print, you need to do two things- move the extruder carriage away from the print and then trigger the camera. Moving the extruder away from the print is easy- use some custom layer-change gcode in the slicer. If you trigger the camera immediately before or immediately after a layer change, the bed will not bounce in the video. The trick is in triggering the camera once the extruder gets to wherever you send it.


If you're using a phone (or some SLR cameras) to take the pictures, the semi obvious answer to triggering the camera is bluetooth. A couple years ago I got a free selfie-stick (remember those?) with a little Mooni handheld bluetooth button to trigger a cell phone camera. I didn't think much of it at the time and it ended up sitting in a drawer for the last couple years. But now I have a use for it! If you do a search for "bluetooth camera shutter button" you'll find dozens of similar things available from $5-20.


I continue to use Open Camera, even though layer synchronized time lapse doesn't need its intervalometer function, because it has both exposure and focus lock capability, not found in the native Android camera app in my Droid Turbo. In the video above, I did not set the focus lock and you can see the focus changing throughout the video, mostly depending on where the extruder carriage was in the frame when each picture was captured.



Three Steps to Success


Step 1:  Make sure your bluetooth button works with Open Camera on your phone/camera. I paired the button with the phone, started Open Camera, and pushed the button.  It worked!  That was easy.


Step 2: Figure out how to drive the bluetooth button device from the printer's controller. 


I recently posted about the very high precision of optical endstops and wondered about applications for rehoming the extruder at every layer change.  Maybe you could wipe the nozzle clean, detect layer shifting, etc.  Now there's one more use- trigger a camera so you can make fancy time lapse videos in which the print appears to grow out of the print bed with the extruder nowhere near the print.


I thought about chopping into the bluetooth button's PCB to add some wires but then I had to figure out how to get a signal out of the controller on every layer change, after the extruder was moved away from the print.


Then it occurred to me that there's a much easier way to go - just mount the bluetooth button in a location where the printer mechanism can push it.  No weird configuration in the controller and no wiring hacks needed, just send the mechanism to the button using custom gcode on layer change in the slicer. It can, but doesn't have to be, the home position.

Step 3: Figure out the best place to mount the bluetooth button on the printer and how it will get pushed. I designed and printed a bracket to hold the bluetooth button on the right side Y axis corner pulley block, and a corresponding "bumper" on the right side X axis pulley block. The bumper has a screw adjustment to set the Y position where the button gets pushed over a few mm range. In operation, at every layer change, I'll move the extruder to a specific X coordinate, then home the Y axis. When Y hit's home, it will also push the button and snap a picture.


It took a couple quick test prints to get the shape and size of the bracket to fit the bluetooth button, but once it fit, I finished the bracket design and printed it.  Simple!  Here's the Fusion360 model of the Mooni button and the slot that holds it. You'll have to add whatever it's going to take to mount it on your printer.


Mooni bluetooth button mount and pusher mounted in UMMD.  The Mooni button just drops in the slot.



Custom GCODE


I can send the extruder to any X ordinate (left-right) because it has nothing to do with pushing the button to make the photo sequence, but the extruder has to go to the back of the printer (Y=150), which means sending the entire X axis back there, in order to push the button. I could just move the extruder to the back of the printer without sending it to a specific X ordinate, but then it would be bouncing back and forth at the rear of the printer in the timelapse videos. I decided it would be best to send the extruder to the center of the X axis (X=0 in UMMD) to minimize the time it spends traveling, and so minimize print quality issues because of the relatively long time the extruder spends away from the print.  It also makes for nice symmetry in the photos and finished time lapse video, and my brain likes symmetry.

I created a custom printer profile (called "UMMD TL") in PrusaSlicer for making these movies that includes this custom gcode in the "after layer change" box:

G01 X00.00 Y145.00 F9000        ; go to (0,145) at 150 mm/sec
G01 Y150.00 F1200       ; go to (0,150) at 20 mm/sec and push the button
G04 P200                       ;  hold button for 200 ms
G01 Y145.00 F1200       ; back off the button
G04 S1.2                           ; wait 1.2 seconds for the picture to be taken
G01 F9000                     ; go back to the print at 150 mm/sec

If your printer's origin is located elsewhere, just set up the appropriate coordinates.  The 2 second delay is there because there seems to be a lot of variability in the time between pushing the button and actually snapping the picture. 

Note: I didn't use a G28 Y command to home the Y axis because that calls the Y homing macro in RepRap Firmware which moves quickly to the home position, then backs up and then slowly moves to home again. I didn't want that type of behavior for this.

As you will see in the layer synchronized time lapse video, below, moving the nozzle away from the print for a few seconds leads to some blobbing at the start of the new layer. The retract and unretract settings in the custom printer profile have to be tweaked to eliminate that problem.


Other Considerations


Making pictures this way adds a total of 3 seconds per layer. If the print is 100 mm tall and made of 500 layers, it will add 1500 seconds, or about 25 minutes to the print time. The time taken to snap a picture will depend on how large the print is, where it's located on the bed, and how fast you can move the extruder carriage out of the way to take the pictures.

The Mooni bluetooth button shuts itself off after 10 minutes of no activity, so if any of your print layers take 10 minutes or more (this is most common when doing solid fill layers at the bottom and top of a print) you may have to babysit it to push the button manually on each of those layers to keep the bluetooth button awake. Unfortunately that type of information isn't usually provided in the instruction sheet for these devices.

The Mooni button is powered by a CR2032 coin cell. I don't yet know how long it will last- so far I've got about 40 hours on one battery and it is still going. If you're making a super long print, you might want to put a fresh battery in the bluetooth button to ensure that it will last for the duration of the print. 

When you move the extruder away from the print, you want it to do so after the filament retracts (that's why the custom gcode goes in the "after layer change" box).

Open Camera allows you to select the resolution of the pictures right up to the maximum that the phone is capable of. That means you can see details in the print, which can be very useful. It also allows you to crop to a specific area of the still images to make your time lapse video. But, you have to be careful about selecting the resolution. If Open Camera runs out of memory to store the pictures, it stops making them. So do a little math- if your phone has 8GB of memory available, and your pictures are 15 MB each, you'll only be able to make about 500 images before the memory fills up. The same is true of Google Photos- the space to store images is limited by your account with Google. Choose a resolution to ensure that the phone/Google Photos won't run out of space before the print finishes.






Operation


When it's time to make a time lapse movie of a print, I slice using the custom time lapse printer profile, connect the bluetooth button to the phone, slide the button down into the bracket, mount the phone on the printer, start Open Camera, lock the focus and exposure, and start the print. At every layer change, the extruder goes to (0,150) which is the rear of the printer at the center of the X axis. When the Y axis reaches 150, it pushes the button and snaps a picture. Printing then resumes.


When I'm not making a layer synchronized time lapse movie, I just slice with a "normal" printer profile and leave the Mooni button out of the bracket. The screw that bumps the button has nothing to bump so everything behaves normally.

The Mooni button doesn't seem to mind the 50C enclosure temperature when I'm printing ABS.



Making a Movie From an Image Sequence


Once I have a sequence of images in the phone/camera, I copy them to a folder in my PC and use Irfanview (free) to batch process the images- crop, resize, color correct, rotate, etc., in one operation. Finally, Import the image sequence to imageJ (free) and Save As an avi file. That's it!


The Result


Here's an example of a layer synchronized time lapse video made using this setup:
As you can see, there's some interesting looking blobbing taking place at the back of the print.  I need to tweak the extruder retract and unretact settings to eliminate that.

You can expect to see more of these videos in future blog posts.

The user manual for the Mooni button is here.

Saturday, April 11, 2020

Cell phone Mount #2 for UMMD

Who Needs RPi?


A while back I posted some info about using an old cell phone to monitor 3D print progress.  I used my old Droid Turbo phone with a 24 Mp camera, an app called OpenCamera, and Google Photos to capture the images and make them viewable via any web browser, all without any advertising or subscription fees.

The mount for the camera used suction cups to stick it to the clear front panel of the printer. 




That works fine when I need to keep the printer closed to print ABS, but looking through the cover reduces the image quality a bit. When I'm printing PLA (rarely), TPU, or PETG, I can keep the printer open, so I decided to design a mount that will allow me to put the phone on the printer's frame without the front cover in place.


The New Design


The mount prints in 6 pieces-  3 thumbwheels, the camera mount, an armature, and the frame bracket. It uses a t-nut to mount on the 4040 t-slot frame of the printer.


CAD rendering of the phone mount. The phone slides into the mount and is held securely.  Everything is repositionable. 
CAD rendering of the back side of the phone mount.



The thumbwheels are my "standard" type, that were detailed in this post.

Here is the finished phone mount on the printer:


The camera's field of view captures the entire print bed.


The underside of the phone mount.
Back side of the phone mount.


Another view.  The white dots on the back of the phone are the velcro tape that secures the phone to the original suction cup mount.


Mounted on the printer. This mount would work even when the printer is closed, except that the front slot gets covered by the lower front cover.


You can see what the camera sees here.  In operation the camera will be powered via the uUSB port on the far right edge of the phone.
The Fusion360 CAD file for this design is here- you'll probably have to make a lot of modifications to suit your phone and printer, but it's there if you want it.

I may cut a notch in the lower front cover of the printer to allow this phone mount to be used even with the cover in place.

Here's a high resolution time-lapse video of a 14+ hour print I made a week or so ago.  This one is looking through the front cover of the printer. I reduced the high res images to 720 vertical pixels to make the video.  The only thing I don't like about OpenCamera is there doesn't seem to be any way to fix the focus of the camera, so it tends to hunt a bit and focus on different areas in different frames, especially if the extruder carriage is anywhere near the center of the frame.  Actually, Open Camera does allow fixing the focus- it is one of the options in the settings menu, just not very clearly labeled. In the video below, I did not use the fixed focus setting, but will do so in the future.