Hey guys, here's a little something I've been working on. It's a single-axis controller/driver based around the openmoco engine. A modified version of the timelapse engine runs on it, to allow for addressable motors, and one uC per motor for more advanced capabilities. (There are versions under development in SVN of the TLE, slim, and perl drivers - look in the branches for nanomoco.)

The entire board size is 1.5"x1.5" (3.8cm x 3.8cm).
The controller/driver has an ATmega328p chip and is compatible with the Arduino IDE - you can upload sketches using the TTL serial interface, or burn them directly with an ISP header. However, for long multi-node networks of devices, the board has built in RS-485 using the standard Arduino hardware serial libraries. (Well, you have to control the driver enable line when writing, but a simple wrapper function takes care of this.) A simple jumper will disable the RS-485 network to allow normal use of the TTL serial lines. You can use either type of communication with a computer using one of several inexpensive USB adapter cables.
Also on board is an A4983 bi-polar chopping stepper driver from Allegro. The CPU has control over the step, dir, each microstep, and enable lines on the driver. In theory, one could go up to 2A/coil but that would be unrealistic with a board this small, unless one had extensive cooling capabilities. Max use would be recommended at 1A/coil. Voltage input range is 8-16V, and an on-board regulator is provided for 5V needed to run the uC.
With the RS-485 network you can use as few as two wires (A+B) to communicate over several meters. Each node is fail-safe terminated for 16 node network over short runs of cable (a couple of meters), or 8 nodes at longer distances (several meters). The SN75176A buffer is used on each node. Or, some of the GPIO pins have been labeled specifically for interconnects between boards. These are designed to be shared real-time control lines for the devices to trigger actions among themselves during the execution of their programs. RJ-45 cabling will work well in a daisy-chain fashion between the nodes.
For camera control, there are two opto-isolated outputs, but I may consider adding another OK or two to make them switchable ins/outs via software.
There are 5 GPIO pins generally, or 8 if you don't use certain functions of the board, like the opto-isolated outputs or ISP programming. Two of these are connected hardware interrupt lines, and thus can be using for interrupt-driven signaling between nodes, or for encoder input for more accurate stepper control.
There are also pins marked to monitor the status of the exposure output (one of the isolated outs) and the driver enable line. The exposure watching line is from a transistor-switched control, and therefore can both drive the OK at correct current and a bright LED without damaging the 328's output pin. One input is conveniently placed next to a GND pin to allow for use as an (non-interrupt-driven) input. There are additional 12V and GND pins as well.
Everything has tested out well in this prototype, except for some resistor selection issues and a few bad routes. 0402-sized components make it a challenge to solder by hand, and is best reflowed in skillet or oven. I'm going to build another prototype soon correcting some of the component issues, a minor change to header arrangement, and adding some LEDs to the board to see status.
Any comments or feedback are much appreciated!
!c

Hi Chris, I have given this a
Hi Chris,
I have given this a lot of thoughts since you told me about this board and I still love this! This is exactly what I was looking for. Are you publishing the final Eagle files for this when you have ironed out the last issues? I would really like to order a few PCB's so that I can give this a try.
What do you think about the following? Maybe we can create another node in the RS-485 network that is mainly meant to connect a camera. The use of more than one camera can be supported by adding additional camera nodes to network or by using a USB hub (see below). This board could hold an RTC and other functionality that is currently in the MicroEngine. This way the real TLE and MicroEngine could be functionally merged together. The camera node can handle studio strobes, growth lights etc. while the TLE handles motion control.
It would be great if the camera node can connect cameras through PTP. That way we can connect cameras directly though their USB port. Another advantage is that we can have much more control over the connected camera like changing aperture, shutter speed, ISO. The camera node can take care of bulb ramping like the little Bramper is doing right now. It seems that there are a lot of vendor specific extensions in the PTP protocol, which could make it hard to fully support all major cameras. This can be an issue for me because I am a Nikon shooter. PTP is fairly new to me and I am still investigating the protocol, but I might give this a try if a board like this looks feasible. My only problem right now is that I can work this out on a breadboard, but I still lack the Eagle skills to design the actual board itself.
You can have a look at: http://www.circuitsathome.com/tag/ptp for more about connecting cameras to an Arduino via the PTP protocol.
A camera node like this removes the need for a laptop that is continuously connected during a time lapse run. You just program the nodes and give it a go. Have you ever thought about storing all settings in the EEPROM? My final version would need something like this. Just program your parameters on all nodes upfront. You can then place your gear in the field and run your time lapse as soon as you power it on.
Hey Andre, I will share the
Hey Andre,
I will share the Eagle files publicly as soon as the changes I've made are tested (added LEDs and all that stuff, tweaked some things) - but I can also email them to you in the mean-time. And, if you want some PCBs... My proto batches usually come w/ about 60 boards in this size, due to the panel size!
A separate camera controller is definitely in-line with the concept and design. One of the shared lines is specifically intended as a "camera sync" line - that is, all nodes but one are slaves to the sync timing, and the "master" node (-not- the "control interface", but the one which originates camera timing - although they could be one in the same) changes state on this shared line when the camera cycle has completed and any SMS or post-shot activities are clear to run.
As for PTP, to be honest, I'm not a big fan of doing this on the Arduino! Limiting support to one or two camera types, and a whole lot of writing software vs. using a platform that's already made for doing this, has good open-source libraries, and lots of local storage available (say, through SD card), would make a lot more sense in my mind. The cost would only be -slightly- higher using a SC32416-based processor running linux, or even better - an S5PC110 running @ 1GHz - they make modules for these such that all you really have to design is the connectors (like USB, it supports it, you just have to wire up the interface). These can be gotten fairly inexpensively even in single unit counts (< $50 for SC32416). Check out: http://www.armdesigner.com/MINI110.html Then, running linux, it could easily handle gphoto2 for camera control and copying images back to device for any further processing/backup... Could even run a GUI if one really wanted =)
But, if one wanted to have a "canon models x,y,z" and "nikon model a,b,c" kind of firmware setup, it would probably work out ok w/ an ATmega device, I would just normally want a lot more firmware space for PTP/MTP control due to the size of a generic library like gphoto2.
It's definitely a concept to run without a computer connected - the nodes still operate independently and are only configured via the control interface. Some settings are moving to EEPROM, but not everything. A ptp-style camera control, of course, would need a lot more information in EEPROM.
Eagle is just a matter of practice =) Once you get comfortable with the fact that you have to design nearly any part you come across (create a new library and footprint for it), then you will be at peace with Eagle. The routing takes patience, but is quite rewarding when it works!
!c
Hey Chris, nice to see the
Hey Chris, nice to see the idea get real :)
For argument sake, let's say I'm programming a WIFI enabled PIC(I am!) and want to talk SPI the one of this boards.
Can I do it while maintaining the ability to have the RS-485 network and talk to the other nodes?
Some of those gpio pins could also be used for sensors, like at the end of the rail, stopping motion for safety.
When can we start buying those boards? I'm eager to try one out and control it wirelessly on my iphone :)
Joao, hmm.. Is SPI the only
Joao, hmm.. Is SPI the only available method? Would need to re-route some pins to use hardware SPI, since I'm using MISO and SCK for the camera controls, not to mention, would need to add another header for the SPI connection. Or, at least replace some of the existing outputs with the required pins miso, mosi, ss, sck.
Definitely can use some of the GPIO pins for sensors - switches would be easy to wire up, as would encoders and other higher-speed inputs, since there are two HW interrupts at the ready.
Don't know how long it'll take to get boards made and assembled, but I should have the next round of prototypes done in a couple of weeks, after everything comes in.
!c
Chris, missed where you
Chris, missed where you mention the TTL UART and that will suffice :)
Do you have the serial API documented already?
Oh, no worries - yeah, it has
Oh, no worries - yeah, it has TTL UART, which you can use instead of RS-485. The nodes don't actually talk amongst themselves, you control the network from outside. The shared control lines handle signaling between the nodes in the TLE-style of operation. That is, the arrangement should be largely familiar - you configure the nodes (either pre-configure, or send commands to them as you go) like with the OMTLE, except you select one on the network for a "timing master" when doing shoot-move-shoot, and it just signals the rest whenever a shot is complete and they are clear to operate. In fact, right now, it's just OMTLE with required changes for network operation - that is, there's now a command packet header that creates a start sequence and has addressing, so that no one gets mixed up and sees the middle of someone else's command. I'm working on ripping out the multi-motor stuff, and changing the way "keyframes" operate to make more sense in a moco setup, so instead of the combination of actions and keyframes, you'll set points the motor should arrive at, at certain times, and it'll figure out (based on other parameters), the right way to get there. So, that gets simplified, but the ways in which it can get there will be more rich (continuous, shoot-move-shoot, and it will always be asynchronous - so no more blocking moves). Real-time control will be much easier, etc.
There will still be some actions, like for camera repeat, but freeing up the old keyframe/action stuff will make available a lot more points of freedom in a pre-set program - I'm thinking 32 points in space for starters, maybe more. Basically, each point is a distance from the home position.
Serial protocol isn't documented yet, b/c there're a lot more changes to make, but I have a (mostly) working multi-threaded Qt/c++ library now, and slim/perl libraries are working with the current dev version. That is to say, the only difference is the start sequence =)
All commands, except status requests, will also end up supporting "broadcast" messages, i.e. - all nodes start now, stop now, or move 100 steps. Status requests, obviously, would be a problem for the controller =)
Of course, you don't necessarily need a "timing master" node, you can make them all slaves and control the timing line from the other device, to tell them when to advance. But, to talk to all of the nodes from your wi-fi enabled PIC, you'll need to talk over RS-485. A driver's a few cents to convert from TTL to RS-485 and really easy to wire up. (Otherwise, how do you communicate with each? Would you want some serial com then repeated from one to another node? How should responses return? Should this block other operations? Some questions raised there.)
!c
I understand the setup now
I understand the setup now :)
It's serial for me anyway, just need to add the converter =)
How's every node address defined, hard coded on the sketch on the ATmega328p?
I want to know how every node
I want to know how every node address is defined too
I'm envisioning the addresses
I'm envisioning the addresses being set via software. The current address is stored to eeprom, and they all start out with a low address (2 - 0 is the controller and 1 is broadcast). A command to the device can set the address, and I presume the first step in any network is to set the address of each node, you can either do each independently (1:1 network), or do the first, then add the second node, set its address, and so on.
I considered using a dip-switch style setting, but it uses either several inputs (2 inputs = 4 possible addresses, 3 inputs = 8 addresses, 4 = 16, and so forth.) or more external components... Camblock uses a rotary switch, which I presume one could do similar, but I hated the idea of the extra hardware and forced interface requirements on all users. (And my plans for packaging in the rig we're working on requires a much smaller interface footprint.)
!c
Chris, I have 2 ideias for
Chris, I have 2 ideias for that:
- dip switches: you can use that with a resistor pack like you're doing with the buttons on the MX2 and with just one input :)
- auto address setting per connect order. You connect a new controller and it broadcasts to the network to see who's there. After receiving the answers it sets itself to the highest ID + 1. Could work :)