Gauge driving system
This invention relates to a system for driving an air-core gauge, serving for example as a speedometer or tachometer for a road vehicle. 
     An air-core gauge comprises two coils disposed at right angles to each other and a freely-rotatable axle mounting a magnet and a pointer. The pointer can be deflected through any angle up to 360° by passing appropriate electrical currents through the two coils in order to turn the magnet (and hence the axle and pointer) through that angle. However, known electrical drive systems for such gauges are complex in various respects, requiring typically to the coils simultaneously (e.g. analogue signals representing respectively the sine and cosine of the angle to which the pointer is to be turned) and/or three supply rails to which the coils can be selectively connected. 
     We have now devised a driving system for an air-core gauge, which overcomes these drawbacks of the known systems. 
     In accordance with this invention, there is provided a driving system for an air-core gauge, comprising switching means for selectively connecting a junction between the two coils of the gauge to either of two signal levels, for selectively connecting an opposite end of one coil to either of said two signal levels and for selectively connecting an opposite end of the second coil to either of said two levels, and a drive circuit for controlling said switching means such that one of said junction and said opposite ends of the coils is connected alternately to said two signal levels with variable duty cycle depending upon the angle through which the pointer of the gauge is to be turned. 
     With this driving system, only two signal levels required and no complex arrangements are needed for generating variable analogue drive signals. In a preferred embodiment, for maintaining the pointer at any given angle between 0° and 360°, a variable duty signal is applied to only one of the three coil terminals (i.e. junction of the two coils and their opposite ends), whilst the other two terminals are maintained at one or other of the two signal levels. Moreover, in this preferred embodiment, the duty cycle of the variable duty signal changes from 0 to 1 (or from 1 to 0) over a range of angles for the pointer, to progressively change the respective terminal from one signal level to the other. Then for the next range of angles for the pointer, this terminal is maintained at its new signal level and another one of the three terminals receives the variable duty signal for progressively changing its signal level. 
    
    
     An embodiment of this invention will now be described by way of example only and with reference to the accompanying drawings, in which: 
     FIG. 1 is a diagram of the principal elements of an air-core gauge and a driving system in accordance with this invention; 
     FIG. 2 is a waveform diagram showing the signal levels applied by the driving system to the ends of the two coils of the gauge for producing any required deflection of the indicating pointer of the gauge: 
     FIG. 3 is a diagram of an integrated circuit switching means which may be employed in the driving system; 
     FIG. 4 is a block diagram of a timer control arrangement which may be employed in the driving system; and 
     FIG. 5 is a block diagram of an output steering circuit arrangement for use with the timer control arrangement of FIG. 4. 
    
    
     Referring to FIG. 1, an air-core gauge comprises two identical coils X,Y disposed at right angles to each other, or in quadrature, and a freely-rotatable axle A mounting a magnet M and an indicating pointer P. Each coil has one end connected to one end of the other coil and this junction of the two coils is connected to a terminal Tc. The opposite ends of the two coils are connected to respective terminals Tx,Ty. The driving system for the gauge comprises switching means for selectively connecting each of the terminals Tc,Tx and Ty to either of two voltage levels 0 or +V and FIG. 1 shows this switching means diagrammatically as comprising respective switches Sc, Sx and Sy each having a movable contact connected at one of its ends to the respective terminal and for connecting at its other end to the ground or +V voltage levels. A drive circuit D serves to control these switches in a manner which will now be described with reference to FIG. 2. 
     For any given angle of the pointer, two of the terminals Tc,Tx and Ty receive one or other of the two voltage levels continuously, whilst the other terminal receives a signal alternating between these two voltage levels with a duty cycle related to the angle at which the pointer is to be maintained. Referring particularly to FIG. 2, for pointer angles in the range 0° to 45°, switch Sc maintains terminal Tc at the 0 voltage level (which may be expressed as a duty cycle of 0) and switch Sx maintains terminal Tx at the +V voltage level (a duty cycle of 1), whilst switch Sy applies the variable duty signal to terminal Ty. It can be shown that for the angle range 0° to 45°, the duty cycle of this variable duty signal should be proportional to tan θ to produce a pointer angle of θ. 
     For pointer angles between 45° and 90°, terminal Ty now remains at the +V voltage level (being the level to which it progressively changed over the range 0° to 45°), terminal Tc remains at the 0 voltage level, and terminal Tx receives the variable duty signal, the duty cycle of which changes progressively from 1 to 0 in proportion to  1  /tan θ over the range 45° to 90°. 
     For pointer angles between 90° and 180°, terminal Tx now remains at 0 volts (duty cycle of 0) terminal Ty remains at +V (duty cycle of 1) and terminal Tc receives the variable duty signal, the duty cycle of which progressively changes from 0 to 1 in proportion to  1  /(1-tan θ) over this range of pointer angles. 
     For pointer angles between 180° and 225°, terminal Tc remains at +V (duty cycle of 1), terminal Tx remains at 0 volts (duty cycle of 0) and terminal Ty receives the variable duty signal with its duty cycle progressively changing from 1 to 0 in proportion to (1-tan θ). 
     For pointer angles between 225° and 270°, the terminal Ty remains at 0 volts (duty cycle of 0), terminal Tc remains at +V volts (duty cycle of 1) and terminal Tx receives the variable duty signal, changing its duty progressively from 0 to 1 in proportion to 1- 1  /tan θ. 
     Finally, for pointer angles between 270° and 360°, terminal Tx remains at +V volts (duty cycle of 1), terminal Ty remains at 0 volts (duty cycle of 0) and terminal Tc receives the variable duty signal, changing its duty cycle progressively from 1 to 0 in proportion to  1  /(1- 1  /tan θ). 
     It will be seen that the gauge driving system is required to provide only one variable duty signal at any one time (i.e. for any required pointer angle). Whilst this variable duty signal is applied to one of the three coil terminals, the other two terminals are connected to constant voltage levels 0 or +V volts. 
     It will also be seen that the pointer angle and duty cycle of the variable duty signal are always related by a tangent function and indeed tangent values for 0° to 45° are all that is required. Preferably the driving system comprises a microprocessor MP (FIG. 4) which calculates the required duty cycle, for any desired pointer angle, by reference to a look-up table LT containing tan θ values for θ between 0° and 45°. The look-up table requires relatively few values bearing in mind the shape of the tangent function between 0° and 45°. Moreover, the gradient of the tangent curve is steeper than the sine curve over a critical range so that better resolution is achieved for the same number of bits defining the duty cycle. 
     FIG. 3 shows an example of switching means for the gauge, comprising an integrated circuit IC which is a 4-channel push-pull driver (e.g. an L293 device). This has 4 gates G 1  -G 4 , three of which are used and have their outputs connected to the terminals Tc, Tx and Ty. The gates are enabled by a signal provided by an input EN and control inputs I 1  -I 3  are controlled from the microprocessor of the drive system to drive each terminal Tc, Tx, Ty to its required level of 0 or +V volts for the desired pointer angle. 
     FIG. 4 shows an example of timer arrangement of the microprocessor drive system. An oscillator OSC has its output connected to a divide-by-two circuit 2 to provide the internal processor clock and this also drives a 16-bit free-running counter 3. When this counter rolls over, its overflow is detected at 4 and this serves to set a timer overflow flag TOF in a timer control and status register 5, serving in turn to generate an interrupt via an interrupt circuit 6. Edge detecting circuits 7, 8 receive successive pulses on their inputs from the distance and engine-speed detectors: when these edge detecting circuits respond to a transition in their inputs, they serve to latch the value of the counter 3 into respective 16-bit capture registers 9, 10, and also to set respective input capture flags ICF A, ICF B in the control and status register 5. The microprocessor reads the input capture registers 9, 10 in order to determine the vehicle speed and engine speed, for driving the speedometer and tachometer gauges. The control and status register 5 also has control bits as follows: a timer overflow interrupt enable TOE which if set enables a timer interrupt when the overflow flag is set; input capture interrupt enables ICE A and ICE B, each if set enabling a timer interrupt when the respective input capture flag ICF A or ICF B is set; and input edges EDG A and EDG B which determine the transition direction of the pulse edges, received by detecting circuits 7, 8, which trigger the respective input capture. 
     A series A-F of 8-bit PWM (pulse width modulation) registers are provided, together with respective 8-bit compare logic circuits AC-FC, which provide outputs O A  -O F  for controlling the speedometer and tachometer gauges and other gauges of the vehicle. The microprocessor serves to write into the respective PWM registers values calculated from the measured vehicle speed, engine speed and other parameters, and determined for driving the gauges to provide the correct indications. Each compare logic circuit continuously compares 8-bits (bits 4 to 11) of the count accumulating in counter 3 with the value held in the respective PWM register and provides a logic &#34;1&#34; output so long as the count in counter 3 is less than the value held in that PWM register. Thus each compare logic circuit provides a pulse train of fixed duty cycle until the contents of its associated PWM register are changed. 
     Referring to FIG. 5, the outputs O C  -O F  of the compare logic circuits associated with PWM registers C-F drive respective minor gauges of the vehicle via output buffers 11 and individual drive circuits 12. The speedometer gauge has its three terminals driven via output buffers 13 and drive circuits 14 and the tachometer has its three terminals driven via output buffers 15 and drive circuits 16. However, these buffers 13 or 15 receive their control signals either from the outputs O A , O B  of the timer of FIG. 4, or from a data register 17, according to the setting of switches 18 controlled by a data source register 19. Thus in operation, data source register 19 controls the switches 18 to determine which one of buffers 13 will receive the pulse train from output O A  of the timer: the other two buffers of each set 13,15 will be connected to receive respective bits from the data register 17. Depending whether the respective bit of data register 17 is logic &#34;1&#34; or &#34;0&#34;, the gauge terminal controlled through the respective buffer will receive either the 0 or +V volts signal level.