Image may be NSFW.
Clik here to view.
I have been having fun with my camera slider controller. It is a cool, little, general purpose motion and camera controller that will soon to go on sale at Inventables. Taking a picture is very easy. You just plug the camera into it and run the takePicture() function. It has a lot of spare I/O pins that can be used for some cool hacks.
I always thought it would be cool to take a time lapse movie of a 3D print, but do it exactly one layer per frame and have the picture be taken at the exact same location every time so the print appears to grow out of thin air. I know people have done this before, and I could probably hack the circuit right onto the printer controller, but camera slider controller was ready to go with the circuit and connectors all ready to go. With less than ten minutes of coding and making a cable, I was ready to go.
GCode Hacking
The first task was hacking the GCode to output a a signal I could read remotely. Kisslicer has a feature where you can add a few lines of Gcode every “N” layers. I added the following GCode. Note the “1″ in the layers box. This means do it every layer.
Image may be NSFW.
Clik here to view.
G1 X0 Y0 means move to 0,0
G4 P500 means dwell for 500 milliseconds. This was added because the next command was happening before the move completed. I think this has to do with the way commands are buffered. I think there is a more elegant fix for this, but adding a little delay here was a quick fix.
M42 P11 S255 means set I/O pin 11 to full on (255 is max). Pin 11 is the first of the “servo” pins on my RAMPS controller. This three pin connector would map directly to the servo connector on the camera controller.
G4 P1000 is a 1 second delay. I had my DSLR on “auto” so it would need to focus for each shot, so I gave a little extra time.
M42 P11 S0 turns pin 11 off.
I ran a few test layers with my volt meter hooked up to the connector and it looked great.
Camera Slider Controller Hacking
The controller has 2 servo connectors that are intended to be used for hobby servos in a pan and tilt arrangement. The signal pin on the connector can also be used as and input. The code is simply going to watch for that pin to go high. When it does it will display the next layer number and take the picture
Arduino Code
In the setup() section you need to make the PIN_SERVO_1 pin an input because that is connected to the printer controller.
pinMode(PIN_SERVO_1, INPUT);
The loop() section looks for the PIN_SERVO_1 pin to go high. When it does the layer number is incrememented the picture is taken and the LCD is updated. The camSignalRead flag is set so we don’t go read the same pulse more than once. The flag is cleared as soon as the signal
void loop() { if (digitalRead(PIN_SERVO_1) == HIGH) { if (!camSignalRead) { // make sure we read once per pulse camSignalRead = true; // layerNumber++; lcd.cursorTo(2, 0); sprintf(sVal, "Layer %d", layerNumber); lcd.printIn(sVal); takePicture(); } } else { camSignalRead = false; //reset this. the pulse is over } }
Wiring
Simply connect the signal pin (D11) on the servo 1 connector of the printer controller to the signal pin on the servo 1 (J7) connector of the camera slider controller. You also need to connect together a ground pin on each controller.
Image may be NSFW.
Clik here to view.
Image may be NSFW.
Clik here to view.
Camera Setup
I setup my DSLR on fully automatic and disabled the flash. I am sure the movie would have been better if I manually focused and locked the speed and aperture settings, but I just wanted a quick result. The controller first sends a focus signal and then a shutter signal. The focus signal acts like the half button push you do to focus most cameras.
The Print
The printing was done on the Quantum Delta printer. I used my CNC Ninja Squirrel as the test print. It was scaled to 50mm tall. At at 0.25mm layer height, that gave 200 layers. The print took about 45 minutes with the added delays. It was run in a busy room at Pumping Station One so there was a lot of activity in the background and some light level changes.
Image may be NSFW.
Clik here to view.
The Result
Click here if the video is not displayed below.