Background of the Invention
The present invention relates in general to pulse width modulators and, more particularly, to pulse width modulator for performing voltage to duty cycle conversion.
Many circuit applications require signals to be transmitted over long distances and through noisy environments. In one example where a pressure sensor transducer monitors a pressurized system or other pressure source, the transducer converts pressure to an amplitude varying analog voltage signal. The analog signal is typically transmitted to a microcontroller to process the pressure status and possibly make appropriate adjustments to the system. The microcontroller may be located some distance from the pressure sensor, or possibly in a noisy industrial environment. Consequently, the analog signal is often subject to noise interference which can effect its instantaneous amplitude. Any noise introduced onto the analog signal creates misrepresentations of the actual pressure thereby causing the microcontroller to mis-report or mis-correct the system.
A common solution has been to use a voltage controlled oscillator to convert the amplitude varying analog signal into a frequency varying signal. The frequency varying signal is much less subject to common low frequency noise in the industrial setting. Filters may be used at the receiving end to remove any low frequency noise. Most microcontrollers are digital in nature thereby requiring the frequency varying signal to be converted to digital form before use. However for good performance, the transducer voltage to frequency conversion circuitry tends to be complex and expensive.
Hence, a need exists to convert an analog signal to a form that is robust to noisy transmission while requiring minimal re-conversion before end use.
Brief Description of the Drawing
FIG. 1 is a schematic and block diagram illustrating a pulse width modulator; and
FIG. 2 is a waveform diagram useful in explaining the present invention.
Detailed Description of the Preferred Embodiment
A pulse width modulator 10 is shown in FIG. 1 suitable for manufacturing as an integrated circuit using conventional integrated circuit processes. A transducer 12 represents a voltage source with differential outputs coupled to the non-inverting inputs of operational amplifiers (op amp) 14 and 16. Transducer 12 may for example represent a pressure sensor, e.g. Motorola part number MPX2100DP, for monitoring the pressure of a pressurized system (not shown). Another example for transducer 12 may include a temperature sensor. Op amps 14 and 16 provide gain to increase the magnitude of the differential signal from transducer 12 while converting it to single-ended form at the output of op amp 16. Resistors 18 and 20 are serially coupled between power supply conductor 22 operating at a positive potential V.sub.CC such as 5.0 volts and power supply conductor 24 operating at ground potential. The value of resistors 18 and 20 may be selected at 12.1K ohms and 300 ohms, respectively, to set up a voltage divider reference through resistor 26 to the inverting input of op amp 14. Resistor 20 may be used as an offset trim to calibrate the output signal of op amp 16 for zero pressure.
A feedback resistor 30 is coupled between the output of op amp 14 and its inverting input for providing gain. The output of op amp 14 is also coupled to the inverting input of op amp 16 by way of resistor 32. The value of resistors 26, 30 and 32 may be selected at 20K ohms, 137 ohms and 137 ohms, respectively. A feedback resistor 34 selected at say 20K ohms is coupled between the output of op amp 16 and its inverting input also for gain. An 8.45K ohm resistor 36 is coupled between the output of op amp 16 and node 38 at the inverting input of comparator 40. Resistor 44 selected at say 10K ohms is coupled between node 38 and power supply conductor 24. Resistors 36 and 44 operate as a voltage divider to reduce the amplitude of the single-ended signal coming from op amp 16. The nominal voltage at node 38 may thus be tuned by adjusting resistor 44.
A pulse signal from an output compare channel of microcontroller 46 is applied through resistor 48 to the base of transistor 50. The microcontroller determines the pulse width and frequency of the pulse signal. Microcontroller 46 may represent Motorola 8-bit microcontroller part number MC68HC05. Resistor 52 is coupled between the base of transistor 50 and power supply conductor 24. The value of resistors 48 and 52 may be selected at 4.75K ohms and 22.1K ohms, respectively. A node 54 is formed at the collector of transistor 50 receiving constant current I.sub.56, say 10 milliamps, from current source 56. Capacitor 58 with a value of say 1.0 .mu.f is coupled between node 54 and power supply conductor 24. A constant current source is important to provide a linear voltage ramp across capacitor 58, i.e. I=C*dV/dt. One possible selection for current source 56 is Motorola part number MDC4010A.
When the pulse signal is low, transistor 50 is turned off and current source 56 charges capacitor 58 in a linear fashion as shown in FIG. 2. When the pulse signal goes high, for example at time t.sub.3, transistor 50 turns on and goes into saturation to discharge capacitor 58. Thus, node 54 develops the sawtooth ramp waveform as shown in FIG. 2 which is applied to the non-inverting input of comparator 40. With proper selection of components and programming via microcontroller 46, the slope, frequency and DC offset of the sawtooth ramp waveform may be customized.
Between times t.sub.1 and t.sub.2, the voltage at node 38 is greater than the sawtooth waveform at node 54. Comparator 40 provides a low signal through resistor 60 to the base of transistor 62 turning it off. The output voltage V.sub.OUT at node 64 goes high through resistor 66 as shown in FIG. 2. At time t.sub.2, the voltage at node 54 exceeds that at node 38 causing the output of comparator 40 to change to a high state and turn on transistor 62. Transistor 62 sinks current from resistor 66 through its emitter to power supply conductor 24 causing the output voltage V.sub.OUT to go low. The pulse signal at time t.sub.3 begins the cycle again by discharging capacitor 58 at node 54 and switching the output of comparator 40 to a low state thus turning off transistor 62.
Assume the differential output signal from transducer 12 changes level just after time t.sub.3 due to change in the system pressure. The voltage at node 38 increases accordingly and changes the threshold for the sawtooth waveform. Now the voltage at node 54 does not exceed the voltage at node 38 until time t.sub.4. The output signal of comparator 40 goes high after time t.sub.4 thereby turning on transistor 62. The output signal V.sub.OUT goes low until time t.sub.5 at the beginning of the next cycle. Thus, the smaller the differential output voltage of transducer 12, the shorter the pulse width of the output signal V.sub.OUT. The greater the differential output voltage of transducer 12, the longer the pulse width of the output signal V.sub.OUT. The pulse width of the output signal V.sub.OUT, and its duty cycle (percentage high time to total period), are thus proportional to the output voltage level of transducer 12, e.g. the system pressure.
Pulse width modulator 10 has performed a voltage to duty cycle conversion. The duty cycle of the output signal V.sub.OUT may be made inversely proportional to the output signal level of transducer 12 by adding another inverter stage, or by switching the inputs of comparator 40. The pulse signal frequency as generated by microcontroller 46 determines the frequency of the sawtooth waveform which is the same as the output signal frequency V.sub.OUT.
Microcontroller 46 may be implemented as Motorola part number MC68HC05, assuming it is a version with an input capture channel capable of detecting high-low and low-high edge transitions of the output signal V.sub.OUT. Microcontroller 46 also includes an output compare channel for generating the PULSE train to drive transistor 50. Detecting edge transitions as opposed to detecting analog voltage levels provides improved noise immunity in adverse environments. Thus, microcontroller 46 may directly measure the output signal level of transducer 12 as the duty cycle of the output signal V.sub.OUT. The present invention is also useful in microcontroller-based systems that do not employ an analog-to-digital converter.
Another advantage of the present invention is that a single time base controls microcontroller 46 to generate the pulse signal to control linear ramp circuit 48-58 and to measure the pulse width modulated signal at node 64. Thus, the frequency of the output signal V.sub.OUT is programmable and may be easily modified as per the application. Moreover, the microcontroller allows the transducer to be calibrated under software control.
While specific embodiments of the present invention have been shown and described, further modifications and improvements will occur to those skilled in the art. It is understood that the invention is not limited to the particular forms shown and it is intended for the appended claims to cover all modifications which do not depart from the spirit and scope of this invention.