Many gyros require an auxiliary control channel to set gain and mode (AVCS/HeadingHold or Rate mode) from the transmitter. This circuit generates the control signal locally, thus freeing up the auxiliary channel for other uses.
The 12F683 (or 12F615/7) PIC microcontroller reads the voltage on the GAIN trimpot and the state of the MODE switch, then generates a servo pulse that is adjustable from 1.5 to 1.1mS (Rate Mode) or from 1.5mS to 1.9mS (AVCS Mode).
The control pulse is synchronized to the gyro's main input channel (ie. rudder or tail in a helicopter), and occurs immediately after it This is done because many gyros assume that the channels will always occur in sequence, and some cannot read the pulses properly if they are overlapping or change position.
The main gyro channel is passed through to the gyro unmodified. Connection to this channel also provides a convenient place to get power. An LDO (Low Drop Out) regulator provides the PIC with a stable voltage. If the receiver power is 6V or higher then a 5V regulator should have sufficient headroom. On systems running from 4.8V or 5V a lower voltage regulator (eg. 3.3V) should be used.
Only one contact is used for the control signal, because most gyros only provide a single wire for connection to the control channel.
Source code, HEX file for 12F683