PanCam is based on a tiny 8-Pin chip. It is actually a MicroChip Technologies PIC12C509x MCU (microcontroller) with some custom firmware. The PanCam controller uses a very modular design and its functionality is expanded by simply connecting more PanCam chips together. Think of it as using Legos to build circuits.
Cost is very low. You can build a PanCam proportional speed controlled Pan & Tilt servo controller with four parts (two of which are capacitors), all for under $10. Want to add still camera shutter control? No problem, just connect another PanCam Chip to a spare R/C channel. Need to turn some accessories on and off? Again, no problem; just use more R/C channels and add more PanCam chips.
The R/C equipment that the camera operator uses will NOT need to be modified in any way. You can use low cost 2 to 6 channel systems (AM, FM, PCM). For best results, I suggest that your transmitter include servo reversing switches, dual rates, and adjustable travels (all nice to have, but not totally necessary). Just keep in mind that a fancy R/C system is not needed. Be sure that the Tx channel will not conflict with your R/C model's channel.
Servos for the Pros
Standard servos normally provide about 120° of rotation. PanCam will expand the range to at least 140° movement, which should be plenty for nearly all applications. Be sure to select a servo that has enough torque to support the G-forces that will be imposed by your camera equipment while you pilot your model.
If you need more travel, then you can use a proportional retract servo. The Airtronics 94739Z offers 170° range and 74oz of torque, so it might be fine for this application. Please note that standard retract servos are NOT proportional and will not work with PanCam. I understand that the Multiplex MC/V2 servo family can be programmed for 180° travel, but their cost is higher. I have not tried any of these servos with PanCam, so please let me know if you give them a spin.
Digital servos are not recommended since some might not be compatible with PanCam. Besides, most are very noisy and they often draw high idle currents. Any standard servo or their high torque cousins should be fine. The final choice is really up to your exact application and budget.
The PanCam World Tour
There are eight pins on the PanCam chip. They exist as one of three kinds of signals: Power, Digital Input, or Digital Output.
The digital inputs are level sensitive and are said to be logic high when the voltage is > 2.0VDC and logic low when they are less than 0.5V. Typical designs will use the VCC voltage (pin 1) for a logic highs and GND voltage (pin 8) for lows.
Output voltages are easily defined. Logic high output voltage is equal to VCC and a logic low output is 0VDC. The output sink/source drive current is up to 20mA (plenty for our application).
If you are ready, let's take a quick tour of the various signals on the PanCam chip:
Pick Your PIC:
The chosen microcontroller is from the vast offerings of Microchip Technology. Actually, your exact PIC choices have some flexibility. You can use a PIC12C509, PIC12C509A, or PIC12F509.
You will need a PIC
chip programming system to "burn" the hex file's object code into the
microcontroller. Be sure to select the configuration fuses during chip burning
as follows (these are optional settings within your chip programmer's menus):
By the way, after you program the PIC it will fail the verify cycle. Do not be alarmed -- everything is OK. Just ignore the "failure." Whatever you do, do NOT program the chip twice!
If you have trouble burning the PIC, then please check your programmer. Whatever the fault, it is not a CamMan hex file issue. The most common problem is that the user has forgotten to burn the PIC's four config fuses, as shown above. More programming information can be found starting here.
You do not need to know anything about PIC software to build your PanCam system. All you need is the object code to program the PIC, which is provided at no charge for personal use. This means that any hobbyist can use the firmware for free. But programmed parts cannot be sold/traded/bartered, regardless of cost. Sorry, but I will not provide the text based source code.
There are several features in the PanCam controller. Some are not so obvious. So, let's talk about those that are the most interesting.
Proportional Speed: Servo speeds range from over six seconds (140° of travel) to under one second. Tx stick position determines servo wheel velocity. Center stick stops all motion. Servo resolution is better than 1° per step (Mode 1 only).
Power-Up Centering: When power is first applied to PanCam, the servo will automatically center. The R/C transmitter does not need to be on. This feature is disabled if Pass-Thru is enabled (Pin 2 at logic high).
Pulse Integrity Protection: If the Rx's (receiver's) servo pulse is outside the scope of a typical stick position, it is ignored. This will offer some protection from interference.
Fail Safe Hold: If the R/C signal is lost, the servo position will be held using a PanCam produced 15Hz frame rate. Holding current will be maintained on the servo to prevent camera movement. This feature is nearly the same thing as Fail Safe Hold on a PCM radio. PanCam's hold feature is only available in Mode 1 (Pin 4 at logic low). It is never available if Pass-Thru is enabled (Pin 2 at logic high).
EMI/RFI Safety: I often get nervous when a microcontroller is used next to R/C Rx's, especially when they share the same power lines. Unless some care is exercised, the external oscillators that run them can cause EMI and RFI related "noise." Multiple harmonics from the microcontroller's crystal and I/O lines are to blame. Some R/C Rx's are prone to servo twitching when exposed to external noise sources, especially if their filters are inadequate.
The chosen PIC chip prevents this altogether. Its oscillator is buried deep inside its silicon structure. Also, all I/O lines are operated at a low rep rate. The result is device that should be cheerfully accepted by your R/C system.
Tx Stick Hysteresis: Servo creepage is prevented when the Tx sticks are centered. The solution involves a small amount of hysteresis when at the center stick position. This also prevents false output changes on the Aux Out feature if it is used with a knob or stick.
Aux Out Control: All you have to do is flip the Tx's switch, knob, or stick of the connected R/C channel and the Aux output will turn off or on (logic low / logic high). When the Auxiliary Output is used, you do not connect a servo to the PanCam chip (but it can be done if you want both).
The Aux Out signal allows you to control the features of companion PanCam chips and to trigger your still-camera's shutter. Sheets 4 and 5 of the schematics offer examples on how this is done.
But it can also be used to control model lighting, drop bombs, honk a horn, operate relays, and control nearly anything else you can dream up. Sheets 6 and 7 of the schematics offer examples on how this is done.
Pass-Thru: Whenever the Pass-Thru input is enabled (Pin 2 at logic high) the PanCam chip becomes fully transparent. In other words, your R/C system will act as if the PanCam is not installed. All of the PanCam features are suspended. It is possible that you will see a small amount of servo jitter while using Pass-Thru. The jitter is due to the PIC's sampling time and is harmless.
When you exit the Pass-Thru mode (Pin 2 switched back to logic low) the servo will automatically return to the position it held before Pass-Thru was used (Mode 1 only). The stick must be in the neutral position for the automatic return to occur. For your convenience, there is a one second time delay before it returns so that you have time to release the Tx stick.
You can connect the Pass-Thru input signal to the Aux Output of another PanCam chip. This will provide toggle switch control from your R/C transmitter. Sheet 5 of the schematics offers an example on how this is done.
Auto-Centering: When the Center signal is enabled (Pin 5 logic high) the servo will automatically move to its neutral position. The servo speed is somewhat gentle to prevent sudden camera movement. The control signal is debounced for 100mS to prevent randomly corrupt R/C signals from triggering the event.
You should connect the Center input to the Aux Out of another PanCam chip for toggle switch control from your R/C transmitter. Sheet 5 of the schematics offers an example on how this is done.
a la Mode:
Note: Beginning with firmware release V2.3, Mode-2 operation was discontinued. For those that wish to experiment with Mode-2, the earlier V2.1 firmware is included in the hex file distribution.
PanCam has two totally different operating modes. Mode 1 occurs when pin 4 is logic low. Mode 2 is enabled when it is logic high. So, what is this mode stuff all about?
I expect that about 99% of you will be using Mode 1. It is used with standard R/C servos. This operating mode offers vastly superior servo resolution and its proportional speed control is superb. In light of this, plan on permanently connecting the Mode input to GND (logic low).
Mode 2 was created to offer crude proportional speed control to those of you that have existing pan and tilt platforms that utilize constant rotation servos. It is assumed that you have already added additional gear reduction (15:1 or more) to slow down the rotation speed.
During use you will see the servo stutter along as it is attempts to throttle its speed. Your added servo gear reduction will smooth the erratic motion quite a bit. Sadly, the range of speed control is very limited. There is some more bad news too: You will not obtain motor holding current when the servo stops or during fail safe hold. The power up centering feature is unavailable as well. Although there is no true center on a continuously rotation servo, the Auto-Center feature is still available.
Your success with using the Mode 2 feature will be depend on your specific servo, the added gear reduction, the servo's mechanical load (the more the better), and a bit of luck. But give it a try, since it should be better than no PanCam at all. If you do try it out, please report how it performed for you. Don't forget, you can always convert your servos back to normal operation, remove the added gear train, and employ Mode 1. This last idea gets my vote.
No matter what you intend to do with your PanCam chip, I highly recommend that you start by building the "Evaluation Board." With it, you can easily learn how to use the various features. This is a twenty minute exercise and will cost a couple of dollars to prototype (plus the PanCam chip). It is very simple and fun to use. Details are found on sheet 3 of the schematics.
The Evaluation Board can be built using nearly any technique you wish. The fastest and easiest method is to use a solderless breadboard. I used phenolic perfboard to build mine. This is very cost effective method for a final version as well.
My board was point-to-point wired using 30 gauge insulated Kynar wire. This wire is normally used for wirewrapping, but works fine with a soldering iron. I just strip a bit of insulation off and solder it to the parts. I recommend a 40 watt or less soldering iron (700° tip).
Layout is not critical except that the .1uF cap should be close to the PIC. Use a socket for the PanCam chip. If your servo voltage will be higher than 5V (e.g. five cell R/C pack) then you will need to add a voltage regulator. Sheet 7 of the schematics shows an example of a 5VDC low drop out Vreg.
The connections to the Rx and servo can be made by taking a six inch servo extension and cutting it in two. This will allow you to quickly insert the PanCam circuit onto any servo. Hard core folks may feel at ease with cutting the servo's cable and soldering the PanCam directly to it. Of course that method will void the servo's warranty.
Check your work carefully. Do NOT install the PanCam chip until you have verified that pin 8 is ground and the pin 1 has 4.5 to 5.25 VDC on it. Remove power BEFORE you install the chip. Double check the servo cable for correct polarity before you plug a servo in. Simple mistakes can destroy electronic parts, servos, and may generally ruin your day.
With PanCam connected to your R/C gear and Mode 1 selected (jumpers on J3, J4, and J5), slowly move the Tx stick's trim lever back and forth to find the starting points where the servo begins to move. Visualize these two extreme trim positions and then move the trim lever to the center of them. If your Tx has menu driven subtrims, you can dial in a precise offset so that your trim lever is centered too.
The trim setting is quite stable and digitally managed by PanCam. However, extreme swings in temperature and servo voltage may require you to readjust the trim lever. In many cases the "drift" issues will be the fault of the R/C Tx and not PanCam. Regardless of the cause, it is easily corrected with a nudge on the stick's trim lever.
You may also use your transmitter's Travel Adjust mix (ATV, EPA, T-ADJ) settings to customize the maximum servo speed. The transmitter's default settings are usually satisfying. However, please feel free to experiment to determine if you like something different.
The Sky is the Limit:
PanCam can be used in applications beyond positioning a model mounted camera. If you have not noticed yet, you can totally ignore the servo connection and use PanCam to control R/C accessories. Have it turn on some brake lights or honk a R/C car's horn. Or, control the siren and emergency lights on a tiny police vehicle. Anything that you wish to remotely turn on is now as simple as adding a PanCam chip. Sheets 6 and 7 of the schematics offer the details to building R/C Accessory Switches at VERY low cost.
PanCam can also slow down any proportional servo for other R/C applications. It could even be used to control retractable landing gear (but for that we recommend the LandTastic project instead). Up to six seconds are possible, with independent times for the up and down travel. All controlled by a single Tx switch and its travel adjust settings (which sets speed rather than travel limits). No doubt you can dream up other uses for PanCam too.
The technical details are available as file downloads. There is no charge for the information when used in a personal (hobby) project. Commercial users must obtain written approval before use.
Please be aware that the information is copyright protected, so you are not authorized to republish it, distribute it, or sell it, in any form. If you wish to share it, please do so only by providing a link to the RC-CAM site. You are granted permission to post links to the web site's main page (http://www.rc-cam.com/). Please respect this simple request.
How Does PanCam Work?
Model R/C systems provide proportional position control. As you have seen every time you twiddle the sticks, the servo follows your movement with good precision. Ignoring the R/C Rx and its decoder, all of this magic ends up on a single control wire (usually yellow, white, or orange in color) connecting the Rx to the servo. Of course you need power and ground, so servos utilize a total of three wires.
The servo signal is a simple digital pulse. It spends most of its time at a logic low (0V). About every 20mS it goes logic high (4-6VDC) and then quickly goes low again. It is this tiny window of logic high time, called the pulse width, that gets the attention of the servo.
Please refer to the drawing. The period labeled "A" is called the frame rate. In the example it is repeated every 20mS (50 times per second), which is quite typical for most radio systems.
Modern servos define center as a 1.5mS pulse width, as shown by detail "B" in the drawing. Full servo rotation to one side would require that this pulse width be reduced to 1.0mS. Full rotation to the other side would require the pulse width to increase to 2.0mS. Any pulse width value between 1.0mS and 2.0mS creates a proportional servo wheel position within the two extremes. The frame rate does not need to change and is usually kept constant.
The servo will not move to its final destination with just one pulse. The servo amp designers had brilliantly considered that multiple pulses should be used to complete the journey. This little trick reduces servo motor current draw and it helps minimize erratic behavior when an occasional corrupt signal is received. To move the servo, you must repeat the pulse every few milliseconds, at the chosen frame rate. Modern R/C systems use a 40Hz - 60Hz frame rate, but the exact timing is not critical. If your frame rate is too slow, your servo's movement will become rough. If the rate is too fast the servo may become very confused.
Now that we have that out of the way, let's talk about PanCam's trickery. As you may have noticed, it is inserted in between the Rx and the servo. It is this intimate connection that allows it to work its magic.
During Mode 1, PanCam intercepts the proportional position data and uses it to compute a proportional velocity value. For example, when the pulse width is 1.5mS (center stick) the velocity value is zero. As such, the servo will be given a pulse width signal that does not change. It merely maintains the current servo position.
If the stick is moved up, the magnitude of the stick movement is used to scale how fast the servo will be allowed to step, rather than where to step. The velocity value is used as the integration time while the PIC increments the pulse width. It is much like a digital capacitor.
If the stick is centered again, the velocity is again placed at zero, and the pulse width value stops changing. If the stick is moved down, the entire process starts up again except that the pulse width is in the opposite direction. Again, the computed velocity value determines the speed of the servo wheel movement.
During Mode 2, PanCam intercepts the proportional position data and uses it to devise a variable frame rate. It totally ignores the proportional position information. This trick capitalizes on the servo amp's one-shot timing. It is used to slowly pulse the servo motor in an effort to change its speed. It is a very messy technique and certainly a primitive way to do the job. Its success depends on the servo amp's behavior and the servo's mechanical aspects (load, gear train, etc.). It does work though, but no where near as well as Mode 1.
Servo Control -- Ez PIC'ns:
No doubt some of you have the desire to create your own microcontroller based servo gadgets. The good news is that there are documented projects (with source code) available on the Internet. Most of the information seems to come from the robotics hobbyists. From my brief search attempts, I found that they have posted examples on most of the popular microcontrollers (PIC, Motorola, Atmel, etc.) and single board computers (mostly Parallax Stamps). Just try a web search and be prepared to see a lot of servo related projects.
Here, let me get you started. If you enjoy working with the PIC family of MCU's, then start your research at MicroChip PIC Archive. This site has several PIC examples on interfacing R/C servos. Armed with this data, the world is at your control.
Servo Mount Ideas:
The Small Print:
All information is provided as-is. I do not offer any warranty on its suitability. That means that if you build and use this device, you will do so at your own risk. If you find software bugs then please report them to me. I can only make corrections if I can replicate the bugs, so please give me enough details to allow me to witness the trouble.
I would enjoy hearing from anyone that uses the PanCam. Please send me an email if you build it. Photos of your camera platform would be appreciated too.