So the new electronics on the prusa allowed me to experiment with something that I conceived when selecting the electronics for bigfoot. Though they are not exactly the same boards, they do have one thing in common. An Expansion port. A number of expansion ports, actually but one was sufficient for my purpose. +5, GND, and two signal lines is sufficient to drive a pair of relays connected to the remote port of my SLR camera, and allow gcodes to tell the camera to take a picture.
The Sony alpha A100 which I have had for years has a remote port on it. I’ve never used it, because the remote costs more than half what I paid for the camera itself. But a little searching on the web(for a discounted remote) led me to this: a DIY remote for Sony alpha SLR
I managed to make a connector, and I was going to print a handle for it, then I realized that it would be much better to wire the remote up to the printer itself instead of a human-actuated remote device. I had a few relays lying around, which I could use to actuate the remote mechanism. In case you didn’t read the instructable; bridge two of the pins to activate autofocus, bridge the third to take a picture. Autofocus must be engaged to take a picture.
So I wired up the relays to the expansion port and issued gcodes which I thought would activate the relays. One worked, and one didn’t. The expansion port I was using had 6 pins on it; +5V, GND, D10, A3, SDA, and SDK. The SDA and SDK pins are for serial communication, and I didn’t really want to muck with them, but I only need 2 digital output pins to make the two relays work. Pin 10 worked fine first time. No surprise, since I was using a digital output as a digital output.
I knew that an arduino could treat an analog input as a digital out, but the Gcode M42, which controls a pin directly, just ignored the A3 parameter. So I looked up the spec for the chip, an Atmel 1284P, which my Azteeg X1 was built on, and noticed that ADC pin 3 is pin 37. So I tried M42 with pin 37: still no juice. So then I checked the schematic, just in case the wiring diagram was wrong, and a different ADC is on that expansion header, and noticed their schematic labeled ADC3 as Pin 34. So I tried M42 with pin 34: nothing.
Then I decided to try the spaghetti approach; throw everything against the wall and see what sticks. I turned off power to the motors, and started doing M42 with every pin, skipping those explicitly called out in the config file. Pin 28 made the relay trip. So now I had my answer, but damned if I know why Pin 28 controls what is labeled as A3 as a digital output. In any event, the relays both working, I plugged the connector into the camera, and flipped them both. The camera did not respond. So I tried them again, this time in the reverse order from before. Eureka, a picture was taken.
At this point I wrote a quick gcode script to take a picture at layer change(see below). And I sliced a quick test object. It homed between layers, but the camera did not activate, despite both relays tripping. The dwell time was insufficient. So I brought my laptop back up and tested the script directly(without printing) to see how much dwell was needed to actually take a picture. Turns out the camera needed almost 2 full seconds to take a picture with the relays on. And this is without autofocus enabled. I knew the camera would be taking a picture of a fixed object, possibly in the dark, so I manually focused on the bed. Also despite the spec for dwell listing milliseconds as the parameter, it accepted the value as seconds of dwell time.
Working layer change picture script:
G28 X0 Y0
M42 S255 P10
M42 S255 P28
M42 S0 P28
M42 S0 P10
And here is an example of the printed test object with a timelapse movie made using this rig.