Module: Servo Pre-processor
Fall 2002
This project started life as something else, but like most stuff morphed into something I needed at the time. Now I've made it an official "module" for the ServoGizmo.
The idea behind this module was that there are times when I'd like to be able to use an R/C receiver with a computer but I don't have enough access to use it directly. A good example of this is sending commands using an R/C receiver to a laptop computer that is driving your robot. I don't know of any laptops that have been monitoring servo signals directly, I suppose you could simply "see" the pulses but it would be difficult to measure them.
Anyway, this project allows you to calibrate the gizmo to monitor the pulse coming from a receiver and then to send out an 8 bit value between +100 and -100 to the serial port. In this way your higher level processor can simply read its serial port to "see" where the current servo signal is and respond appropriately.
Hooking up a ServoGizmo in for this project is pretty straight forward. The servo connects to J2 and the data comes out of J1. See figure 1 for the hookup. In this case you might choose to simply power the gizmo from your receiver battery, or you can hook up an optional battery to provide power. Either way, make sure that your microcontroller connects to the ground on J1. Otherwise you might get either bogus or non-existent readings.
Figure 1. Hooking up the ServoGizmo as
a servo pre-processor
Given that you're not using the high current capabilities you could leave the 754410 chip off the board. If you're running from your receiver's battery pack you can leave the voltage regulator off too. This will minimize the current drawn by the gizmo board.
This module uses "standard button calibration." Which means you can calibrate it to any of your receivers or transmit channel ranges. Unfortunately, the serial format is fixed at 9600 8N1 in the firmware, however you can change that if you would like by editing the source code. For STAMP users this is a good speed.
Note that if you set the baud rate slower than 9600 then it can get to a point where the next servo pulse has come in before the previous value has been sent. That's not a Good Thing. You will get generally 50 - 60 servo pulses per second so keep that in mind when using this module.
You can hook up the serial port directly to a BASIC Stamp or an isoPOD or any number of embedded processors that can deal with a 5V level serial port. If you'd like to hook it to a lap top then feed the 5V and ground to a MAX233 chip, and connect the TXD line to one of the line drivers on that chip. The output will be a standard RS-232 level signal.
Final note, there is a "feature" in the 16F628 that if you use the serial port it dedicates both pins to it whether you use them or not. So if you need another I/O you will need to use either a pin from port A or one of the enable lines.