Abstract:
A powerline communication system including a transmitter having a pair of terminals for connection to the power lines. The transmitter comprises a carrier frequency generator for generating a carrier frequency modulated by the data signal and a switching circuit connected to the carrier frequency generator for being switched by the carrier frequency generator for generating a carrier signal having the carrier frequency. The switching circuit is connected to the terminals for providing the generated carrier signal thereto. The switching circuit comprises at least one storage means for storing energy when generating a portion of a cycle of the carrier signal and providing the stored energy when generating another portion of the cycle of the carrier signal. The system also comprises a receiver coupled to the power lines. The receiver includes a filter means for filtering the carrier signal from the power line signal and a demodulator connected to the filter means for extracting the data signal from the carrier signal. Both the transmitter and receiver may utilize a digital algorithm in a computing device to synchronize the carrier signal to the power line frequency to adaptively track changes in the power line frequency to minimize interference with power line harmonics and provide accurate frequency alignment between the transmitter and receiver.

Description:
FIELD OF THE INVENTION 
     This invention relates generally to power line communications systems. In a particular embodiment, it relates to a power line communication system for use in communicating through a distribution transformer. 
     BACKGROUND OF THE INVENTION 
     Power line or “carrier-current” communication systems employ existing alternating current power lines to transfer information which would normally require an additional hard wire installation. Power line communication systems are well-known and extensively used. However, power line communication systems which are capable of communicating through a distribution transformer must overcome both the attenuation of high carrier frequencies due to the impedance of the distribution transformer and the noise on power lines at lower frequencies. 
     Power line communication systems that have the capability of sending data along a signal path that includes distribution transformers are known. However, the methods by which these systems have addressed the twin problems of attenuation of high carrier frequency data signals by the distribution transformer and noise on the power line at lower frequencies have disadvantages. 
     Where lower carrier frequencies are used, the transmitters tend to be expensive, bulky and power hungry and require special installation. In other cases where lower carrier frequencies are used, the transmitter may be small, but the receiver is bulky and expensive and the system is not capable of sending and receiving data at a useful rate. 
     Where known power line communication systems use high carrier frequencies for communication along a signal path that includes distribution transformers, they require additional elements beyond the transmitter and receiver in order to overcome the attenuation problems associated with communicating through the distribution transformer. As a result, these systems cannot be installed by simply plugging a transceiver into a typical wall outlet. 
     One earlier proposal that addresses the problem of attenuation when communicating through a power distribution transformer using a high carrier frequency is found in U.S. Pat. No. 4,406,249 issued to Pettus. U.S. Pat. No. 4,406,249 suffers from the disadvantage that coupling capacitors must be installed in common mode such that the carrier frequency signals can be introduced on both secondary leads. Common mode coupling requires access to both secondary leads from the distribution transformer and a typical wall outlet only allows access to one of these leads. Therefore, a transceiver according to this patent could not be installed by simply plugging it into a wall outlet using this system. Also, the high carrier frequency of 230 kHz which Pettus teaches is high enough to cause radio interference and produce signal node points along the power line where the signal is too weak to be picked up. 
     Another earlier proposal that addresses the problem of attenuation when using a high carrier frequency to communicate over power lines where the signal path includes distribution transformers, is found in U.S. Pat. No. 4,142,178 issued to Whyte. U.S. Pat. No. 4,142,178 does not teach a method of communicating through a distribution transformer, rather it teaches a high voltage signal coupler which is used to couple a high voltage distribution network primary conductor to the communication elements. This method bypasses the distribution transformers. While this alleviates the problem of attenuation, as the communication system is not connected to the secondary of the distribution transformers it cannot be installed by simply plugging the transceivers into wall outlets. Also, the coupling system requires installation of magnetic cores on the high voltage and ground conductors of the power line system which is relatively complex and adds cost. Frequency shift keying (FSK) is a known power line communication technique wherein the transmitter modulates a reference frequency signal based upon the data to be transmitted, so that the transmitted signal has a frequency which is either higher or lower depending on whether a logic 1 or a logic 0 is being transmitted. The receiver is designed to demodulate the transmitted FSK signal to produce a serial data stream at a predetermined rate (baud rate). In order to generate an accurate reference frequency, the nominally 60 Hz power-line frequency can be used. An earlier example of the use of the power line frequency as a reference frequency for generating the carrier frequency in an FSK system can be found in U.S. Pat. No. 4,556,866 issued to Gorecki. However, U.S. Pat. No. 4,556,866 suffers from the disadvantage of using a phase locked loop in conjunction with the power line frequency in order to generate the reference frequency. Phase locked loops are a source of noise, are prone to instability, and are sensitive to component values which can change with temperature and age. These disadvantages make it undesirable to use a phase locked loop in a FSK transmitter designed to communicate through a distribution transformer. 
     Known power line communication system transmitters use amplifier circuits in which the design is optimized for parameters not related to energy efficiency. The presence of energy losses results in heat dissipation, which requires additional energy for producing the signal, but more significantly results in a larger physical size being required for the transmitter. This is needed to provide the extra surface area required to remove the heat without high temperatures developing which could cause failure of the device. It is known that efficiency of the amplifier can be improved through the use of switch mode amplifiers instead of the more common but less efficient linear amplifiers, but even such devices will not achieve the best efficiency for a power line signal transmitter if they are optimized for parameters that are not relevant to this purpose. 
     It is also known to use a resonant coupling network which is “tuned” to resonate at the carrier frequency to couple the carrier frequency signal to the power line in order to increase signal level. The use of a resonant or “tuned” circuit to boost the transmitter signal is common. A resonant circuit comprises one or more inductors and one or more capacitors either in series or in parallel so that energy is transferred back and forth between the inductors and capacitors in a cyclic manner at the power line carrier frequency, in a manner that is analogous to the way a weight bobs up and down when suspended by a spring. In the simple case where there is only one inductor and one capacitor, electrical resonance is achieved by selecting the inductor and the capacitor such that:        f   =     d     2                 π        LC                                
     where: 
     f=power line carrier frequency in cycles/second 
     π=3.14159265358979 . . . 
     L=inductance in Henrys 
     C=capacitance in Farads 
     d=duty cycle (between 0 and 1) 
     Normally “d” is set to 1 unless the resonant network is switched. 
     When a resonant circuit is used to couple the carrier frequency signal onto the power line, an increase in transmitter efficiency is achieved. In some cases, energy efficiency may still be low, particularly if the network is primarily designed to attenuate unwanted frequencies. Also, the known techniques of producing resonance also tend to introduce energy losses which substantially reduce efficiency improvements. Sometimes these losses occur in resistive elements added to the resonant circuit. In other cases, the losses occur because the amplifiers or transistors, which drive the resonant network, are running in a linear mode. In this mode, they are neither completely off nor completely on. Therefore, they dissipate heat the way resistors do. Sometimes, the losses occur because of large current surges through semiconductor components, which result when capacitors are suddenly charged up or discharged. Even though these surges may be very brief, they can cause much heating since heating is proportional to the square of the current level. While the cost of the energy may not be a problem, heat dissipation, particularly in semiconductors increases the need for heat dissipation material which adds to the size weight and cost of the transmitter. 
     Examples of proposals using resonant circuits to improve transmitter efficiencies in power line communication systems can be found in U.S. Pat. No. 4,142,178, U.S. Pat. No. 4,323,882, U.S. Pat. No. 4,517,548, U.S. Pat. No. 4,636,771, U.S. Pat. No. 4,885,563, U.S. Pat. 5,485,040, and U.S. Pat. No. 5,870,016. However, each one of these references suffers from one or more of the disadvantages described in the preceding paragraph. 
     Efficiency is also an issue in the receiver circuit used in a power line communication system. The use of analog circuit methods in receivers is known. A disadvantage of analog circuit methods is that frequency pass bands are set by networks of reactive components whose values may change due to temperature and other factors. Unintended changes in component values can result in a loss of signal. 
     It is also known to use digital methods to process the received signals. The use of quartz crystal oscillator based digital frequency synthesis allows the frequency pass bands to be set much more accurately. However, the accuracy is still limited by the accuracy of the quartz crystal oscillator which also may be affected by temperature and other factors. Digital signal processing methods may also suffer from digitization errors, particularly if the signal level is small in comparison with the voltage resolution of the analog-to-digital converter that is used. The effect of this is to increase the need for averaging, thereby reducing the data rate achievable. 
     Accordingly, there is a need of a power line data communication system where both the transmitter and receiver are small in size and weight, and where both are easily installed, simply by plugging into an ordinary electrical outlet without the need for repeaters, coupling networks or additional equipment, and where data signals can sent and received at useful rates through distribution transformers. 
     One advantage of such a communication scheme would be to facilitate transfer of routine and relatively small quantities of date to individual customers or electrical utility, including both residential and industrial customers of an electrical utility, including both residential and industrial customers. Indeed, one expected usage is reading of electricity meters, to enable recording of the amount of electricity used and generation of bills. Currently, reading of meters has to be done manually, which is time consuming and expensive, and if, for example, a residential or other customer is not available, the meter may not be at an external location for reading. 
     It is also possible that such scheme could be used to read a variety of other utility meters, for example, gas and water meters. While other widespread telecommunication networks are known, using power lines has some advantages. The infrastructure is inherently in place. If a system is set up to bill customers on a periodic basis, e.g. monthly, then it is a simple matter to extend this to gathering additional data from other meters at the same location. 
     The quantity of data, to be transmitted is, by telecommunication standards, low, so that it is possible to consider collecting and transmitting data for various devices together. 
     BRIEF SUMMARY OF THE INVENTION 
     It is therefore desirable to provide a power line communications system for use in communication of data over power lines, including through a distribution transformer and capable of being installed by plugging into a wall outlet, said power line communications system comprising a transmitter having a pair of terminals for connection to the power lines. The transmitter comprises a carrier frequency generator for generating a carrier frequency modulated by the data signal and a switching circuit connected to the carrier frequency generator for being switched by the carrier frequency generator to generate a carrier signal having the carrier frequency. The switching circuit is connected to the terminals for providing the generated carrier signal thereto. The switching circuit comprises at least one storage means for storing energy when generating a portion of a cycle of the carrier signal and providing the stored energy when generating another portion of the cycle of the carrier signal. The system also comprises a receiver coupled to the power lines. The receiver includes a filter means for filtering the carrier signal from the power line signal and a demodulator connected to the filter means for extracting the data signal from the carrier signal. 
     In a further aspect, the present invention may also comprise a carrier frequency generator for continuously calculating a carrier frequency as a function of the power-line frequency for adaptively tracking changes in the power-line frequency. The carrier frequency generator has a synchronization input for connection to the power lines and the transmitter generates a carrier signal having the carrier frequency and provides the carrier signal. The system further comprises a receiver for connection to the power lines. The receiver comprises a filter means for filtering the carrier signal from the power signal, a demodulator for extracting the data signal from the carrier signal, and a synchronization input for connection to the power lines. The receiver continuously generates a carrier decode frequency as a function of the power-line frequency for adaptively tracking changes in the power-line frequency and for demodulating the carrier signal. Both the demodulator and carrier frequency generator utilize a digital algorithm for calculating the carrier frequency and the carrier decode frequency thereby providing frequency alignment between the transmitter and the receiver. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     The foregoing and other objects, features, and advantages of the present invention will be apparent to those skilled in the art from the following drawings which show a preferred embodiment of the present invention, and, in which: 
     FIG.  1 . is a block diagram of an implementation of a bi-directional power line data communication system, according to the present invention. 
     FIG.  2 . is a schematic diagram of a power line data transmitter according to the present invention. 
     FIG.  3 . is a schematic diagram of a power line data receiver according to the present invention. 
     FIG.  4 . is a flow chart of the algorithm implemented by the microcontroller shown in the transmitter in FIG.  2 . and by the microcontroller in the receiver in FIG. 3 according to the present invention. 
     FIG. 5 is a schematic diagram of an alternate embodiment of a power line data transmitter to that shown in FIG. 2, also according to the present invention. 
    
    
     DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENT 
     Reference is made to FIG. 1., which shows a portion of a typical high voltage electrical power distribution system  10 , with distribution transformers  11  and  12  connected thereto. At a transformer station  13  the three wire transmission line voltage  14 , for example in the range of 25 kV to 500 kV, and commonly in North America at 69 kV is stepped down and supplied to the distribution transformers  11  and  12  via the four wire power line  15 , which, for example, is at voltage in the range 8 kV to 35 kV, and commonly in North America at 25 kV. The houses  16  and  17  are supplied with electrical power at voltage which is stepped down from the power line voltage by the distribution transformers  11  and  12 . In North America two of the three phases are stepped down to 240V between phases and 120V for one phase. 
     Accordingly, two phases of the power line signal are supplied to the residences. At the transformer station  13 , distribution transformer  18  steps down the power line voltage for the purpose of the powering any auxiliary equipment which may be required at the transformer station  13 . 
     The foregoing components are conventional in a power distribution system. In accordance with the present invention, a power line-to-telephone interface unit  19  includes a power line data transmitter according to the present invention, a power line data receiver according to the present invention and a telephone data interface circuit commonly known as a modem. The interface unit  19  is connected to an ordinary electrical power outlet  20  by a power cord  21 . The electrical power outlet is connected to the secondary side of the distribution transformer  18 . The interface unit  19  is also connected to the telephone line  22  by a telephone cord  23 . Similarly, although not shown, at each electricity meter, as at the electricity meter  24  of house  16  and electricity meter  25  of house  17 , a power line data transmitter and a power line data receiver both according to the present invention are also located. Conveniently, a single unit including both the transmitter and the receiver, is provided for each customer. It will also be appreciated that, although residential installations are shown schematically in FIG. 1, such units can be located at any meter, e.g. an industrial customer, and for some uses could even be located at sites without electricity meters. 
     An electrical utility computer (not shown), is located anywhere where there is access to a telephone line (not shown), and, in use, dials up the power line-to-telephone interface unit  19 , via the telephone line  22 , and causes the transmitter of the interface unit  19  to send data in the form of an instruction to be sent down power line  15 , for example, to the data receiver at the electricity meter  24  of house  16 . An example of a typical instruction is a request for a meter reading. The power line data transmitter located at the electricity meter  24  of house  16  could then transmit the meter reading back along the power line  15 . Again, this would be encoded so that only the receiver at the interface unit  19  would respond to the data sent in response to the meter reading request. The power line-to-telephone interface unit  19  in turn transmits the data by telephone back to the electrical utility computer (not shown). In the process of this data communication, the data signal has had to pass through the distribution transformer  18  and the distribution transformer  11  in both directions. In addition to the example given above, the power line-to-telephone interface unit  19  could also communicate with a power line monitor  26  which collects data on power flow, as well as monitor and control other devices. 
     Referring now to FIG. 2. a carrier frequency generator is shown which generates a carrier signal using a computing device which can be synchronized to the power line at the synch input to the computing device  40 . The circuit applies the carrier signal to the power line to transmit the data. The circuit has a data input  30  for receiving a data signal. A capacitor  31  and an inductor  32  are connected in series to form a reactive network across the secondary side of the distribution transformer. The capacitor  31  and inductor  32  can have values of 1 uF and 2.76 mH to give a resonant frequency of 3.03 kHz. An additional inductor  33  and capacitor  34  are connected in series to form an additional reactive network. One outside terminal of capacitor  34  is connected to the junction between the first inductor  32  and the first capacitor  31 . The values of capacitor  31  and inductor  32  are chosen such that resonance is achieved in this reactive network at the selected carrier frequency. (Selection of the carrier frequency is detailed below). The values of inductor  33  and capacitor  34  are chosen so that they would resonate at twice the carrier frequency if they were not switched. However, because they are switched with a duty cycle of 50% or d=0.5, capacitor  33  and inductor  34  will in fact resonate at the carrier frequency. The effect of the switching is that, in accordance with waveforms  83  and  84  on FIG. 4, half of the time a circuit is made through inductor  33  and capacitor  34  because one of the field effect transistors  38  or  39 , is turned on. The other half of the time both field effect transistors are turned off and no circuit is made through inductor  33  and capacitor  34 . The effect of inductor  33  and capacitor  34  is to control the energy which flows through the field effect transistors  38  and  39 . If inductor  33  and capacitor  34  were to be replaced by a direct connection between field effect transistors  38  and  39  and the first inductor  32  and the first capacitor  31 , the resulting energy flow would be greater and field effect transistors  38  and  39  may overheat. If inductor  33  and capacitor  34  were replaced by a resistor of sufficient resistance to protect field effect transistors  38  and  39  heat loss in said resistor would reduce the energy efficiency of the circuit. A less efficient circuit would be larger and heavier than that which is disclosed in the preferred embodiment. If, instead of the resistor, a sole capacitor were used in place of inductor  33  and capacitor  34 , and the capacitor had an appropriate value, it may be able to control the said energy flow through field effect transistors  38  and  39 , with less loss than using a resistor. However, due to the performance characteristics of capacitors, if a capacitor were used to control energy flow, current would spike whenever either field effect transistor  38  or  39 , were turned on. These current spikes would cause additional heating in the field effect transistors  38  and  39  as heating is proportional to the square of the current. As a result, field effect transistors  38  and  39  could require heat sinks to dissipate this additional heat. Again, this would add to the size, weight, and cost of the circuit and reduce its energy efficiency. If a sole inductor were used in place of inductor  33  and capacitor  34 , and the inductor had an appropriate value, it may be able to adequately control the said energy flow, with less loss of energy than would be possible using a resistor. There would be no electric current spikes as with a capacitor. However, due to the performance characteristics of inductors, whenever field effect transistor  38  or  39 , were turned off the voltage across the inductor would spike. Again, the circuit elements required to protect against the voltage spikes would reduce the energy efficiency of the circuit. When inductor  33  and capacitor  34  are used to control the flow of energy through said field effect transistors  38  and  39  (as is done in the present embodiment) a high degree of energy efficiency is achieved. When field effect transistor  38  is turned on, the current through transistor  38  builds in a controlled manner until it is impeded by the charge in capacitor  34 . Once so impeded, the current through transistor  38  decreases again until said capacitor  34  is fully charged, by which point field effect transistor  38  turns off. When field effect transistor  39  turns on, the current through it builds up in a controlled manner, but flows in the opposite direction through inductor  33  and capacitor  34 , assisted by the charge on said capacitor  34 . Again, this continues until impeded by the charge in capacitor  34 , which occurs at the point when it becomes charged with the opposite polarity. Each half-cycle is assisted by energy collected in the capacitor  34  during the previous half-cycle, instead of this energy being lost as heat. Also, there are no current or voltage spikes. Thus, a very high level of energy efficiency is achieved. 
     A diode  35  rectifies the stepped down voltage power input  36  (120 VAC for one phase in the United States and Canada) and charges up the capacitor  37 ; as shown the inductor  32  is connected to the neutral line. The presence of inductor  33  which can have a value of 7.6 mH and capacitor  34 , which can have a value of {fraction (1/10)} of capacitor  31 , regulates current flow to inductor  32  as described previously. 
     The field effect transistor  38  is connected between the capacitor  37  and one terminal of the inductor  33 , and correspondingly a field effect transistor  39  is connected between the neutral line and the same terminal of the inductor  33 . Field effect transistors  38  and  39  are alternately switched on and off at the carrier frequency by a computing device, such as a microcontroller  40 , through field effect transistor driver  41  and field effect transistor driver  42  respectively, such that they are never simultaneously turned on, and such that excitation energy is added at the carrier/resonant frequency, as detailed below. By keeping the resistance of the inductive elements low, it is thereby possible to recover the unused energy from one half cycle, store it momentarily, and then re-use it for the next half cycle, with very high efficiency. Since the field effect transistors  38  &amp;  39  are either fully on or fully off, and because there are no current spikes flowing through them, the amount of heat dissipation in them is low. This low heat dissipation makes it possible for the transmitter to be very small in size, while still providing a large signal. Inductor  33  prevents current spikes by spreading the current flow into capacitor  34  over ¼ of a cycle, thereby reducing heat dissipation in field effect transistors  38  &amp;  39 . 
     Resistor  43  provides the microcontroller  40  with a synchronization signal at the power-line frequency so that the carrier frequency can be linked mathematically to the power-line frequency. The capacitor  44  helps to attenuate any spikes, which could otherwise interfere with the carrier frequency accuracy. The zener diodes  45  and  46  serve to limit the voltage input to the microcontroller  40  to a specified voltage range. An algorithm in microcontroller  40  modulates the carrier frequency according to a mathematical function of the power-line frequency and the data being transmitted. 
     Referring now to FIG. 3. a receiver circuit  50  is shown which includes a demodulator to demodulate the carrier frequency signal and recover the data. The power line signal is received at  49  and passes through a band pass filter  51  which allows a narrow band of frequencies to pass, including the carrier frequency, for example in a range of 2.8 kHz to 3.26 kHz. As well, the power line signal is fed through resistor  52  to a computing device shown as microcontroller  53 , to provide the microcontroller  53  with a synchronization signal at the power-line frequency. As for the transmitter circuit, Zener diodes  54  and  55  serve to limit the voltage input to the microcontroller  53  to a specified voltage range. The capacitor  56  helps to attenuate any spikes, which could otherwise interfere with the accuracy of the carrier decode frequency. 
     The microcontroller  53  controls a solid state switch  57  and a solid state switch  58  such that they turn on and off alternately at the carrier decode frequency to change the polarity of the output of operational amplifier  59 . The switches  57  and  58  could again be field effect transistors or transmission gates such as RCA CD4066. When solid state switch  57  is turned on and solid state switch  58  is turned off, the positive input of operational amplifier  59  is connected to 5 volts through resistor  60 . Resistor  61  acts as the input resistor while resistor  62  acts as the feedback resistor, and the operational amplifier  59  acts as an inverting amplifier for the signal coming from the band pass filter  51 . When solid state switch  58  is turned on and solid state switch  57  is turned off, the signal from the band pass filter  51  is routed directly to the positive input of the operational amplifier  59 . Resistor  62  then acts as a connection between the negative input and the output of the operational amplifier  59 , which therefore acts as a non-inverting amplifier for the signal coming from the band pass filter  51 . The output of the operational amplifier  59  is fed into a low pass filter  63  which averages the output of the operational amplifier  59 . Thereby, the output of said filter is an analog voltage related to the relative phase between the transmitted carrier frequency signal and the carrier decode signal from the microcontroller  53  which controls the solid state switches  57  and  58 . For example, if the two signals are in phase the output voltage of the low pass filter  63  will be high. If the two signals are 180° out of phase the output voltage of the low pass filter  63  will be low. If the two signals are 90° out of phase the output voltage will be at the halfway point, which in the preferred embodiment is 5 volts. The output of the low pass filter  63  is fed into the frequency selector input  64  of the microcontroller  53 . The carrier decode signal frequency is linked mathematically to the power-line frequency with the same algorithm used in the transmitter microcontroller, as detailed with respect to FIG.  4 . In the preferred embodiment, when the output of the low pass filter  63  is greater than 5 volts the frequency selector input will be a logic 1 or high, when it is less than 5 volts it will be considered to be a logic 0 or low. 
     When the frequency selector input  64  is high, the decode frequency will be the lower of the two possible frequencies. If the data input of the transmitter is also high, the transmitter will also transmit the lower of the two possible carrier frequencies. If the transmitted carrier frequency matches the receiver carrier decode frequency, the phase difference between them will remain constant. Therefore, the output of the low pass filter  64  and the data input to the transmitter  30  will remain at the same level, at logic 1. When the data input at the transmitter  30  changes, to low or logic 0, the transmitted carrier frequency will change, becoming the other of the two frequencies, in the preferred embodiment, this is the higher of the two possible frequencies. When this happens, the transmitted carrier frequency will be different from the receiver carrier decode frequency and the relative phase between the two signals will begin to change. The greater the difference between the two frequencies, the faster the relative phase will change. As the relative phase between the two signals changes, so does the output of the low pass filter  64 . After a certain period of time, the length of which depends on the difference between the two frequencies and the time constant for the low pass filter, the output of the low pass filter will change from high or logic 1 to low or logic 0. This in turn will cause the decode frequency to change to the other one of the possible two frequencies. The relative phase will remain the same when the frequency shifts because the circuit uses coherent frequency shift keying. At this point, the frequency selector input  64  will again match the data input at the transmitter and the frequencies will again match. Once the frequencies match again, the relative phase between the two signals will remain constant allowing the output from the low pass filter  64  to remain at logic 0. In this way, the frequency selector input  64  is caused to match the transmitter data input  30 , and thus a data signal is transmitted. 
     The analog means used for signal capture in this invention which compares the transmitted carrier frequency with the carrier decode, or comparison, frequency provides high resolution and therefore high information efficiency for low level signals, while the digital means for maintaining frequency control provides high accuracy, thereby minimizing signal loss due to frequency error. Additionally, because the carrier frequency is proportional to the power-line frequency, noise caused by the harmonics of the power-line frequency can be avoided by choosing a carrier frequency to be mid-way between two harmonics. 
     Using the power line frequency as a reference makes it easier to reduce the impact of one of the major sources of noise at lower frequencies, namely deviations from the nominally sinusoidal nature of the power waveform which are manifested in the frequency spectrum as harmonic components. Performance of the data communications system may be significantly reduced if a carrier frequency is chosen to be equal or close in frequency to one of these harmonics. Furthermore, the harmonics change in frequency when the power frequency changes, so that it is more likely that a harmonic will coincidentally align with the carrier frequency. By using the power-line frequency as a reference, the carrier frequency can be selected so as not to be in close proximity to the frequency of a power line harmonic. Also, the carrier frequency can float with the power-line frequency so as to follow variations in it, thereby ensuring that the carrier frequency is not at the same frequency as any power line harmonics even if the power-line frequency changes. 
     Referring now to FIG. 4., two flow diagrams  65  and  66  are given to show the algorithm which causes the carrier frequency to be generated from the power-line frequency. The microcontroller for the transmitter executes both diagrams simultaneously and continuously. This is possible because each diagram has a step where the microcontroller is instructed to wait either for a specified period of time, or for a synch input signal. During the waiting period of one flow diagram, the microcontroller can be executing instructions in the other flow diagram. At step  67  the microcontroller waits for a rising edge at the power-line frequency at the synch input. When this is received, the time value is stored in T n  At step  68  the previous time value is subtracted from this time value to yield P 60 , being the period of the power-line frequency (which is nominally 60 Hz in the United States and Canada). At step  69  P 60  is averaged together with P AV  which is the average of the previous periods of the power-line frequency. In this example, a {fraction (1/256)}th of P 60  is added to {fraction (255/256)} ths of the previous average P AV  to yield the new average P AV . In this way, the weighted average P AV  of the period of the power-line frequency is continuously updated as new rising edges are received at the microcontroller synch input. It is of course possible to use other fractional values instead of {fraction (1/256)} th and {fraction (255/256)} ths, and it is also possible, to have other mathematical terms in the averaging equation. What is important is that the transmitter and the receiver use the same averaging equation so that they both have the same carrier frequency. At step  70 , P C , the period of the carrier frequency, is calculated by dividing P AV  by a constant, in this case 50.5, to give a carrier frequency of 3030 Hz. This constant can be any number, within limits, provided that the transmitter and the receiver use the same number. An additional consideration is the presence of power line harmonic frequencies which can greatly reduce the signal-to-noise ratio. These harmonic frequencies appear at integer multiples of the power-line frequency. By using a non-integer constant, the carrier frequency can be placed in between two harmonics. Then, as the power-line frequency changes, and with it the harmonic frequencies, the carrier frequency will also be changed in a direction to keep the carrier in between the harmonics. At step  71 , the data input is checked. If it is high (logic “1”), then an additional constant, in this case 109 nanoseconds, is added to P C  at step  72  thereby causing the carrier frequency to become 3029 Hz. If the data input is low (logic “0”), then step  72  is omitted, and the carrier frequency is therefore 3030 Hz. Thus the algorithm provides frequency modulation of the data appearing at the data input of the microcontroller. 
     At step  73  the time value for the most recent rising edge is loaded into the T n−1  register in preparation for the next rising edge being loaded into the T n  register. The algorithm then loops back to step  67  and the process is repeated. 
     While waiting for the next rising edge at the synch input, the microcontroller executes the instructions in the flow diagram  65 . At step  74 , the microcontroller waits for a period of time of ¼ P C  before setting output “B” to a logic “1” at step  75 . At step  76  the microcontroller waits for the same period of time before setting output “B” to a logic “0”. In steps  78  to  81 , the same process is repeated for output “A” which is therefore 180° out of phase with output “B”, thereby producing the waveforms  83  and  84  at the carrier frequency. 
     In summary, a data carrier signal is injected into the secondary terminals of a distribution transformer. In a cyclic manner, electric charge and energy are efficiently recovered from a part of the carrier signal waveform, stored momentarily, and then reused to boost the signal strength in another part of the waveform. This is achieved through the use of a resonant network of active and reactive components, which has been specially designed to enhance energy efficiency. Digital data is applied to the carrier through coherent frequency shift keying in a manner that preserves the energy recovery advantages of the carrier signal generating circuit. The signal frequency and amplitude is such that it appears with sufficient strength on the primary terminals of the distribution transformer, and can travel for miles. Both the transmitter and receiver circuits use the power line waveform as a timing reference to eliminate timing errors. The receiver uses a phase detector and a dual frequency reference signal generator to decode the data being sent. Superior performance is achieved in the receiver circuit through the use of digital methods to maintain frequency control, while employing analog methods for signal capture. 
     From the foregoing, it will be observed that modifications and adaptations of the preferred embodiment may be effected without departing from the present invention. For example, more than two different frequencies could be transmitted and decoded at the receiver. A use for a three frequency system would be an industrial lift motor controller. One frequency could represent an up signal, a second a down signal and a third, a stop signal. Also, rather than connect to the secondary through a wall socket, the transmitter and receiver could be coupled to one secondary conductor through inductive coupling, or could be coupled to just one secondary conductor with the circuit completed through the use of a common ground mechanism. Also, alternative modulation techniques to coherent frequency shift keying could be used, such as amplitude shift keying and phase shift keying. Also, rather than use two resonant circuits, the transmitter could utilize only one resonant circuit. For example, minimization of current voltage and spikes could be achieved through the use of the second resonant circuit described in the preferred embodiment without the use of the first resonant circuit across the secondary of the transformer. Such alternate embodiment of a transmitter in accordance with the present invention is shown in FIG.  5 . The second resonant circuit controls current and voltage transients through the transistors  38 ,  39  and promotes efficient coupling of the carrier signal. However, the first resonant circuit, that would further promote efficient coupling of the carrier signal, is no longer present. This arrangement might be suitable to cost-sensitive applications. It is to be understood that no limitation with respect to the specific methods and apparatus illustrated herein is intended or should be inferred.