Background of the Invention
1. Field of the Invention
The present invention relates in general to a detecting apparatus using a digital computer, and more in particularly to a detecting apparatus for rendering a control specification to coincide with a standard specification.
2. Description of the Prior Art
In a detecting apparatus using a digital computer, the resistance value of a heat-sensitive resistor or a variable resistor or the value of the electromotive force of a piezoelectric element used as an input element is provided usually as a converted value of a predetermined range of voltages, so that the A/D converted digital value of the voltage is used to determine the input condition of the digital computer thereby to control an output element. The characteristic variations of the individual elements directly affecting the voltage conversion, however, present themselves as variations of the control specification of a final product, and therefore, the variations of the control specifications are required to be held within a predetermined tolerance by preshipment adjustment.
In a widely-used method, the characteristics of the input elements, namely, the relation between the physical factors and the value of a generated voltage is adjusted within the range of the standard characteristics by use of a variable correction resistor or a pre-amplifier with the gain thereof controllable.
The greatest disadvantage of this method is that a considerable number of adjustment steps is involved.
Summary of the Invention
In view of the above-mentioned fact, the object of the present invention is generally to simplify the adjusting work and to reduce the steps of the adjusting work, and specifically to provide a control system in which in order to maintain the control specification within a standard or reference range, a control digital computer has an adjusting function by a calculation based on the program thereof, thus eliminating the need of adjustment of the input element itself.
As described above, according to the present invention, there is provided a detecting apparatus comprising a reference voltage source for correction under the control of the same power supply as an input element, means for converting the voltage generated from the input element into a digital value and means for correctional calculating by use of the reference voltage from a reference voltage source. This eliminates the need of manual adjusting work thereby to greatly reduce the number of steps for producing the control system. Further, the adverse effect of such vague variable factors as the change with temperature or time can be dampened.
Brief Description of the Drawings
FIG. 1 is a diagram showing an electrical connection of an embodiment of the present invention.
FIG. 2 is a flowchart generally showing a control program.
FIG. 3 is a detail flowchart of the correctional calculation routine of the control program.
FIG. 4 is a diagram showing an electrical connection of a modification of the input element.
Description of the Preferred Embodiments
A part of a control system for an air conditioner is shown in FIG. 1 as an embodiment of the present invention. Reference numeral 1 designates a transformer for dropping the voltage of a commercial power supply, numeral 2 a rectifier circuit using a diode bridge, and numeral 3 a constant-voltage circuit with its output source voltage expressed as Vcc. designates a microcomputer (such as M58840 of Mitsubishi Electric Corporation) includes a central processing unit (CPU) (not shown), a read-only memory (ROM) (not shown), a random access memory (RAM) not shown, and an A/D converter 4a, input ports I.sub.1 . . . I.sub.5 and an output port O.sub.1, a heat-sensitive resistor 5 for generating an analog voltage V.sub.1 corresponding to the temperature of the space controlled, and a variable resistor 6 for setting a control target temperature, which applies a setting voltage V.sub.4 to the input port I.sub.4 of the microcomputer and the voltages V.sub.3 and V.sub.5 of junction points of the clamp resistors R.sub.3 and R.sub.4 across the variable resistor to the input ports I.sub.3 and I.sub.5 respectively. A constant-voltage circuit 7 is provided for generating a reference voltage V.sub.REF for used by A/D converter 4a in microcomputer 4 and for applying the reference voltage V.sub.REF to the reference voltage input terminal of the microcomputer. Reference characters R.sub.1 and R.sub.2 designate fixed resistors for applying the voltage V.sub.2 to the input port I.sub.2 for correcting the voltage produced from the heat-sensitive resistor 5. The resistance value of the fixed resistors R.sub.1 and R.sub.2 is selected in such a manner as to produce a voltage equal to the voltage V.sub.1 of the heat-sensitive resistor 5 at a reference temperature (which is assumed to be Ts).
Numeral 8 designates an output relay connected to the output port O.sub.1 of the microcomputer 4. Numeral 9 designates a motor compressor for the air-conditioner which is connected to a contact 8a of the output relay 8 and operated and stopped by the output of the microcomputer. Output elements other than the compressor will not be described.
A flowchart generally showing a control program of the microcomputer 4 is shown in FIG. 2. The correctional calculation is always made during the execution of the program.
A detailed flowchart of the correctional calculation program is shown in FIG. 3.
A method of adjustment will be described below with reference to the flowchart of FIG. 3. FIG. 3 corresponds to the "correction calculation" block shown in FIG. 2. In the case where the source voltage V.sub.CC and the reference voltage V.sub.REF for A/D conversion take theoretical values, the A/D converted value of the voltage V.sub.1 generated at the ambient temperature of Ts of the heat-sensitive resistor 5 is assumed to be C.sub.T. Generally, the temperature Ts is selected to be a middle point of the control temperature range. Assuming that the A/D converted values CV.sub.1 and CV.sub.2 are applied from the input ports I.sub.1 and I.sub.2 respectively and that the value CV.sub.1 is corrected to obtain the value CV.sub.1 ', the correctional calculation is given by the equation (1) below.
The values V.sub.CC and V.sub.REF are not necessarily coincident with the theoretical values thereof due to the variations of the elements involved. Thus, in the case where the value CV.sub.2 is larger than the theoretical value C.sub.T, the correction is made to reduce the value CV.sub.1 ', whereas in the case where the value CV.sub.2 is smaller than C.sub.T, the correction is made to increase the value CV.sub.1 '.
Now, let us assume that the A/D converted value of the voltage V.sub.1 at the theoretical value To of the target temperature is Co when the variable resistor 6 is set at the middle point. Also assuming that the A/D converted values of the voltages applied from the input ports I.sub.3, I.sub.4 and I.sub.5 are CV.sub.3, CV.sub.4 and CV.sub.5 respectively, and that the corrected value of CV.sub.4 is CV.sub.4 ', the correctional calculation is expressed by the equation (2) below.
As in the case of the correctional calculation of the voltage CV.sub.1, the correction is made to reduce the value CV.sub.4 ' when the value (CV.sub.3 +CV.sub.5)/2 is larger than the theoretical value Co, whereas the correction is made to increase the value CV.sub.4 ' when the value (CV.sub.3 +CV.sub.5)/2 is smaller than the theoretical value Co.
The theoretical values CT and Co in the abovementioned correctional calculations are defined as a constant in the program. These values are not limited to a hypothetical middle point in a control range or the middle point of a variable resistor but may be defined at an appropriate value. In this case, the voltage-dividing ratio of the resistors R.sub.1 and R.sub.2 may be changed or the variable CV.sub.2 in equation (1) or the variable (CV.sub.3 +CV.sub.5) in equation (2) may be multiplied by an appropriate ratio (constant).
A specific calculation procedure of equations (1) and (2) above is appropriately set by a given combination of commands provided in the computer 4 and may be arranged in the significance indicated by the equations (1) and (2) respectively.
As shown in FIG. 2, the control system, namely, the air conditioner is such that in the case where the room temperature is higher than a set temperature on the basis of the value obtained by the correctional calculation, the output port O.sub.1 is turned on while in the case where the room temperature is lower than the set temperature, the output port O.sub.1 is turned off in order to control the compressor.
Each time the correctional calculation routine is passed, the A/D conversion is effected and a new correction value is calculated to be used for control. As a result, even under the operating conditions where the stabilization voltage V.sub.CC or V.sub.REF is changed by the change of the characteristics of the constant-voltage circuit 3 or 7 against temperature or the like, an always correct digital value of the physical quantity which should be exhibited by the input elements 5 and 6 is grasped for operation of the control system.
The aforementioned embodiment concerns the correction of temperature and a set temperature. The present invention may be further applied to the discrimination of the operating mode as shown in FIG. 4 where the operating position of an operating mode change-over switch is determined by use of a single input port I.sub.6 from the difference of the divided voltage, in a manner similar to the correction shown in equation (1).
Furthermore, a similar correction is possible also in a microcomputer having an A/D converter as an external element.
The present invention may also be applied to the case where a piezoelectric element or a differential transformer is used as an input element.