Serial Control December 28
The controller is based on a simple serial control protocol. There are four switches and a potentiometer on the landside controller, the state of each needs to be communicated to the kiteside controller. Rather than use binary commands that I would likely not remember, I put together a very simple ASCII protocol.
The basic commands are:
- Pan left (’L')
- Pan right (’R')
- Stop panning (’X')
- Take picture (’S')
- Set tilt to new value (’T’ + Byte)
- Set mode to Manual (’M')
- Mode to Intervalometer (’I')
- Mode to Autokap (’A')
- Mode to New (’N') (undetermined yet what this will do)
Tilt is the only one that’s giving me some trouble, mainly due to a small type conversion error that was overrunning its variable. Nonetheless, that should be fixed. The tilt routine would simple read the value from the potentiometer, and if it has changed send out a new tilt setting and then wait 10ms before checking again. So if the pot is set half-way, it would send out T and then 0×80 as a single byte. The kiteside controller converts this into a tilt setting for the servo, and updates it appropriately. If the pot isn’t moving, there is no delay, but the short wait prevents the servo from getting every single setting of the pot as it’s moved.
The timer routine is set up so that it throws an interrupt every millisecond or so, into that function I’ll add a statement that will re-send the ‘X’ every 100ms or so as a keepalive ping, but also to keep the camera from spinning uncontrolled if the receiver misses an ‘X’ for whatever reason.
The kiteside will also be watching for those X’s (if it’s not currently panning) to see if it’s out of range. If it doesn’t get a control signal for say 5 seconds, it’ll go into autokap mode (well, not if it’s flying the film camera…) and just start taking shots at it’s current tilt setting. This will let me still get images, even if the camera is not within range.
In autokap mode, the kiteside controller will still respond to tilt setting messages, but otherwise will not pay mind to pan/shutter commands. In intervalometer, it’ll trigger the shutter every 5 seconds, but still respond to pan/tilt/shutter commands.
The other cool thing about these commands is that I can plug a serial cable directly into the kiteside board and trigger the commands from my keyboard without having a working landside controller.