INTERFACE FOR POSITION DETERMINING DEVICE
Field of the Invention
This invention relates to position determining devices such as linear, rotary or angular encoders, and more particularly to interfaces for such devices.
Description of Prior Art
Linear or angular encoders commonly use a scale and readhead such as disclosed in U S Patent Nos . 4,959,542 and 5,302,820. As the readhead moves along the scale, it generates two or more phase-separated sinusoidal outputs, as a result of interaction between the readhead and periodic marks on the scale. These phase- separated outputs may be in quadrature or may be combined and processed to produce quadrature signals, and possibly converted to squarewave outputs. The quadrature signals are then sent to an external counter, which indicates the distance moved along the scale by the readhead by counting the cycles of the quadrature signals.
When installing such a scale and readhead system, it is necessary to adjust the orientation and rideheight of the readhead above the scale in order to achieve good quadrature signals. See for example U S Patent No. 5,241,173, in which a visual indication of correct set- up is given as the readhead is moved along the scale.
The set-up process also typically involves adjusting DC offsets for the quadrature signals (e.g. so that they would produce a circular Lissajous figure centred on zero if fed to the X and Y inputs of an oscilloscope) .
It may also involve a gain adjustment to the light output of a light source such as an LED in the readhead, which illuminates the scale.
It would be desirable to simplify this set-up process.
Summary of the Invention
In one aspect, the present invention provides a signal conditioning interface for a readhead for a position determining device, the interface having one or more inputs from one or more sensors of the readhead; a circuit which is connected to those inputs and which determines good set-up conditions, said circuit providing one or more outputs for a correction value for correcting the set-up; characterised in that said circuit determines whether the correction value is valid and only applies it to correct the set-up if so.
In another aspect, the present invention provides a signal conditioning interface for a readhead for a position determining device, the interface having inputs from the readhead; a circuit which is connected to those inputs and which determines good set-up conditions, said circuit providing one or more outputs for a correction value for correcting the set-up; and a memory connected to said circuit for storing said correction value; whereby said circuit stores the correction value in the memory during a set-up procedure, and then subsequently uses said stored correction value to correct the readhead outputs during normal operation of the position determining device.
The correction value may be a gain value for
controlling the level of light output of a light source in the readhead. Alternatively or additionally the correction values may be one or more offsets for correcting the readhead output signals .
Preferably an indicator is connected to said circuit for indicating that said output is producing a valid correction value, and a manual input device (such as a push-button or a switch) is provided, whereby said circuit stores the correction value in the memory on receipt of an input from the manual input device .
One advantage to this is as follows. Typically said circuit must sample the analogue inputs from the readhead, e.g. using one or more analogue-to-digital converters. These would normally have to be fast enough to sample the inputs validly, whatever the speed at which the readhead is moved along the scale. With the arrangement as above, a slower (and therefore cheaper) converter may be used, since it allows for invalidly sampled signals to be ignored if the readhead is moving too fast .
In a particularly economic practical arrangement, said circuit may be a microcontroller, and may have one or more analogue-to-digital converters built into it.
Brief Description of the Drawings
A preferred embodiment of the present invention will now be described with reference to the accompanying drawings, wherein:
Fig 1 shows an interface circuit and set-up device, in line between a readhead and a counter;
Fig 2 is a schematic circuit diagram of the interface and set-up device; and
Fig 3 is a flow chart of a program for a microcontroller shown in Fig 2.
Description of Preferred Embodiments
As shown in Fig 1, a readhead 10 runs along a scale 11, and its output is taken to a counter via an in-line interface 12, which provides signal conditioning. In normal use, the readhead 10 is connected directly to interface 12 by a cable 14 and "D" connector 16. The opposite side of the interface 12 is then connected by a "D" connector 18 and cable 20 to the counter.
However, for set-up purposes a set-up device 22 is interposed between the "D" connector 16 of the readhead and the interface 12. This comprises a short flying cable 24 with male and female "D" connectors 26,28 at each end, the connector 26 mating with the connector 16 of the readhead while the connector 28 plugs into the interface 12 in place of the connector 16.
The cable 24 of the set-up device 22 connects the signals received from the readhead 10 through to the corresponding inputs of the interface 12, in exactly the same way as if the connector 16 were directly plugged into the interface 12. Additionally, however, the connector 28 has a connection pin for a push-button 70 or other switch located on the housing of the connector 28.
Referring now also to Fig 2, the readhead 10 has sensors or photodetectors 30 which may be in the form
of an integrated circuit as described in US Patent No. 5,302,820. This produces multiple phase-separated sinusoidal outputs, which are taken down a corresponding number n of lines 32 in the cable 14 to the interface 12. If the readhead 30 produces quadrature (sine and cosine) outputs, then only two lines 32 may be required, feeding directly to respective buffer amplifiers 34 in the interface 12. Alternatively, if the readhead 10 produces more than two phase-separated outputs, and/or phase-separated outputs which are not accurately in quadrature, then these may be combined in a circuit (not shown) in the interface 12 to produce sinusoidal quadrature signals at the inputs to the buffer amplifiers 34.
The sine and cosine outputs of the buffer amplifiers 34 may if desired be taken directly as one of the outputs from the interface circuit 12 via the connector 18 and cable 20. Alternatively or additionally, these outputs may be squared up by squaring amplifiers 36, whose outputs are likewise taken via the connector 18 and cable 20. Additionally or alternatively, the outputs of the buffer amplifiers 34 may be fed to an interpolator circuit 38, of any suitable known type, which provides interpolated quadrature signals on lines 40 via the connector 18 and cable 20. These signals effectively multiply the frequency of the outputs of the buffer amplifiers 34, giving signals which interpolate between individual scale marks on the scale being read by the readhead 10.
The interface 12 includes a programmable microcontroller 42. This provides respective DC offset correction values via digital to analogue converters 44
to each of the buffer amplifiers 34. The microcontroller 42 also provides a gain signal to a driver amplifier 46, which provides an electrical current to a light emitting diode 48 in the readhead 10, via the cable 14. Thus, the gain signal from the microcontroller 42 controls the level of illumination of the scale which is being read by the readhead 10.
The microcontroller 42 has integral analogue to digital converters 43 which receive inputs 51 to sample the resulting sine and cosine outputs from the buffer amplifiers 34. Alternatively, the analogue to digital converters may be provided separately from the microcontroller .
A flow-chart of part of the program run by the microcontroller is shown in Fig 3. In normal operation, when it is switched on (e.g. at the start of a day) the microcontroller performs an initialisation routine 52. This derives the offset correction values and the gain value from values which have been pre- stored in a memory 50 shown in Fig 2, such as an electrically erasable and programmable read-only memory (EEPRO ) or other writable non-volatile memory. The offset values are applied to the buffer amplifiers 34 and the gain value is applied via the driver amplifier 46 to illuminate the LED 48 in the readhead. The values in the memory 50 may for example be factory defaults, or values which have been pre-stored in the memory during a set-up procedure as described below.
Fig 3 next shows an optional step 53. Here, the microcontroller interrogates an optional input from a switch 80 shown in Fig 2. This switch may be provided
in external equipment, and connected via a wire 82 forming a core in the cable 20. Alternatively, a customer may choose to hard-wire this input in an open or closed condition, e.g. using a link in the connector 18. This input enables a technician to indicate that the offset and gain correction values are not to be continuously corrected. In this case, the program of Fig 3 simply loops endlessly, and the interface functions with the values as pre-stored in the memory 50.
If the step 53 and switch 80 are omitted or if they indicate that continuous correction is required, then the program of Fig 3 proceeds as follows.
While the readhead runs up and down the scale, a step 56 of the program monitors the speed at which it does so (determined from the frequency of the sine and cosine signals) . The program only proceeds to the following steps if the speed is within a range falling below a predetermined threshold. If the speed is too high, the following steps cannot be successfully performed, and so the program merely loops back. This step allows for the use of relatively slow analogue to digital converters 43. Otherwise either more expensive, fast converters must be used, or there is a risk of incorrect operation at high speeds.
In step 58 of the program, the microcontroller measures the maximum and minimum values of the cosine signal from the corresponding buffer amplifier 34, and determines whether it is correctly offset from zero. Should the offset not be correct, an offset correction value is updated and applied via the corresponding
digital to analogue converter 44.
In a step 60, the same process is repeated in respect of the sine signal, in order to update and apply a sine offset value as required.
In a step 62, the microcontroller measures the maximum value of either the sine or cosine signal from one of the buffer amplifiers 34. If it is higher or lower than an optimum range of values, it calculates a decreased or increased gain value, and outputs this via the driver amplifier 46 to adjust the illumination of the LED 48.
On each cycle through the program loop of Fig 3, in a step 64, the microcontroller briefly flashes a LED indicator 66 on the housing of the interface 12. Thus, this LED 66 will only flash when the speed is low enough for the calculation of the offset and gain correction values in steps 58 to 62, and indicates that valid correction values are present.
So far, normal operation of the interface has been described. If no set-up procedure is to be performed, the program will now loop back to step 56.
Prior to such normal operation, however, a set-up procedure for the scale and readhead is preferably undertaken. The set-up procedure should be performed on installation of the scale and readhead, and may be performed at intervals subsequently.
For this, the set-up device 22 is inserted in line between the readhead and the interface 12 , as shown in
Fig 1, and the alignment and rideheight of the readhead above the scale are adjusted manually in the usual way. During this adjustment process, the technician who is setting up the scale and readhead runs the readhead manually up and down the scale, generating signals on the lines 32. The microcontroller samples the resulting outputs of the buffer amplifiers 34 via the lines 51. Its program may include steps (not shown in Fig 3) for detecting the levels of the resulting sine and cosine signals, providing analogous functionality to the circuitry described in U S Patent No. 5,241,173, and outputting a visual signal on a indicator LED 54. This indicates to the technician when the alignment and rideheight of the readhead above the scale are acceptable. Adjustments are made to the alignment and rideheight as necessary, e.g. by adjusting the mounting of the readhead.
To complete the set-up routine, the technician should desirably store appropriate offset and gain correction values in the memory 50, to replace the factory defaults. Since these values will be more appropriate than the factory default values, it ensures smooth, correct operation of the interface when first switched on, preventing erratic behaviour while the continuous correction process described above attempts to produce appropriate correction values.
To store these values in the memory 50, the technician presses the push-button 70 located on the "D" connector
28 of the set-up device. Step 68 of the Fig 3 program interrogates the push-button 70. If this push-button is not operated (or during normal operation when the set-up device is not connected) , no further action is
taken and the program loops back to step 56 for a further iteration. If however the push-button 70 is depressed, the updated correction values for the sine and cosine offsets and the gain are stored in the memory 50 (step 72) .
Thus, to complete the set-up routine, the technician should traverse the readhead over the scale at an appropriate low speed, until he notes that the LED 66 is flashing or flickering to indicate valid correction values. He then presses the button 70 to store those values in the memory 50. It will be noted that the values cannot be stored in the memory 50 if the readhead is moving too fast for the values to be valid.
The set-up device can then be disconnected, the connector 16 from the readhead 10 plugged directly into the interface 12, and the scale and readhead is ready for normal use .
During such normal use, the correction values stored in the memory 50 are initially applied on power-up via the digital to analogue converters 44 and the driver amplifier 46.
Optionally, the "D" connector 28 may also have connection pins leading to test points 74 on the housing of the connector 28, and connected within the interface 12 to the respective outputs of the buffer amplifiers 34. Thus, it is possible during the set-up procedure to take signals from the test points 74 to the X and Y inputs of an oscilloscope, to show the Lissajous figure resulting from the sine and cosine signals. This enables the technician to cross-check
that the Lissajous figure is circular and centred on zero, if desired.
It will be noted that, because the push-button 70 and test points 74 are found on the set-up device 22, they are only present when required, during the set-up procedure .
However, it may be found more convenient for the push- button 70 to be located directly on the housing of the interface 12 as indicated at 70a in Fig 2. No separate set-up device 22 is now required, and the connector 16 is connected directly to the interface 12 even during set-up. The test points 74 may be omitted in this case, or they too could be provided on the interface 12 itself .
The push button 70 (and optional test points) could instead be located on the readhead itself. Indeed, the whole interface may be provided in the readhead itself.
In another alternative, the LED 66 could be provided on the connector 28 of the set-up device, via another connection pin. The LED 54 could also be located on the set-up device if desired, but this is not preferred because it provides a useful diagnostic tool for the end user should the scale and readhead ever become misaligned in use.
In a further alternative, the push button 70 and the optional test points 74 could be provided on an output "D" connector 18, which may lead to a computer set-up device in place of the normal counter. This computer could for example display the Lissajous figure
resulting from the sine and cosine signals. In this alternative, the set-up device 22 (connectors 26,28 and cable 24) is not necessary.
The push button 70 could be replaced by one provided in the counter or other external equipment to which the interface is connected, as indicated at 70b in Fig 2. It is then connected to the microcontroller by a wire 84 forming one core of the cable 20.
Although "D" connectors 16,18,26,28, have been described for illustration, any other type of connector may of course be used. The push button 70 or 70a may be of the recessed type which is operated by inserting a pointed instrument through a small hole in the housing of the connector or interface.
The two LEDs 54,66 could be replaced by a single LED, e.g. which flashes at different rates or indicates in different colours to fulfil the two indicating functions .
The memory 50 and/or the digital to analogue converters 44 and/or the amplifier 46 could be integrated in the microcontroller 42 if desired.