Abstract:
A steering angle detection device of the type wherein a computer (12) calculates a steering angle. When a steering shaft (20) is turned, pulse signals (SS1, SS2) are generated from an encoder (10). In response to these pulses signals (SS1, SS2), the computer (12) detects the rotational direction and angle of the steering shaft (20). When a sampling signal is generated in relation to the running of a vehicle, the computer (12) calculates a mean value of a cumulative past rotational angles and further calculates the rotational angle of the steering shaft (20) relative to a neutral position indicated by the mean value.

Description:
BACKGROUND OF THE INVENTION 
     1. Field of the Invention 
     The present invention relates to a steering angle detection device for detecting the steering angle of a steering wheel. 
     2. Discussion of Background 
     Recently, it has been practiced to control the steering force generated by a power steering apparatus in dependence upon vehicle speed and steering wheel rotational angle by utilizing a microcomputer. In a steering angle detection device used for detecting the rotational angle of a steering wheel for this purpose, there is used an encoder which outputs a pulse signal each time a steering shaft is rotated a unit angle, and the pulse signal is input to a microcomputer to be counted. A steering angle detection device of this type is advantageous in respect of required space as well as accuracy. 
     However, in the above-noted steering angle detection device using an encoder, the absolute steering angle cannot be detected, and the turning-off of an ignition switch causes a steering angle being stored in a memory to be lost. Thus, a relative rotational angle which is calculated taking as an origin the position where the steering wheel was located at a previous stop state is detected when electric power is subsequently supplied, whereby a neutral position (straight running condition) of the steering wheel cannot be discriminated. 
     As one method of solving this problem, it may be conceived to back up the microcomputer by a constant voltage circuit of a small power consumption lest the turning-off of the ignition switch should cause the content of the memory to be lost. However, this method cannot be a complete solution because no countermeasure can be taken in the event of a battery exhausted. 
     SUMMARY OF INVENTION 
     The present invention is created to solve the foregoing problems, and the object of the present invention is to provide an improved steering angle detection device capable of approximating a detected neutral position of a steering wheel gradually to a true neutral position as the vehicle runs after the supply of electric power. 
     Another object of the present invention is to provide an improved steering angle detection device capable of varying a detected neutral position of a steering wheel considerably slower than the variation in the rotational angle of the steering wheel. 
     Briefly, a steering angle detection device according to the present invention is provided with a counter whose count goes up or down depending upon the rotational direction of a steering shaft each time the steering shaft is turned a unit angle after the supply of electric power, thereby to detect the rotational angle of the steering shaft. When a sampling signal is generated in relation to the running of the vehicle, averaging means reads the rotational angle being stored in the counter and calculates a mean value of cumulative rotational angles. Rotational angle calculation means is further provided, which by calculation, converts the rotational angle being stored in the counter into a rotational angle which is calculated taking as a starting point the mean value or neutral position obtained by the averaging means. 
     With this configuration, since the neutral position is determined by calculating a mean value of cumulative rotational angles of the steering shaft and the steering angle is calculated taking the neutral position as a starting point, it is possible to detect the steering angle taking the running state of the vehicle subsequent to the supply of electric power into account even after the turning-off of electric power causes the stored steering angle to be lost. Particularly, since the steering angle is determined based upon a mean value of the cumulative steering angles, it is possible to approximate a neutral position obtained by calculation reliably to a true neutral position as the vehicle runs after the supply of electric power. 
     Other objects, features, and the attendant advantages of the present invention will be readily appreciated when the following embodiment is considered by reference to the accompanying drawings. 
    
    
     BRIEF DESCRIPTION OF DRAWINGS 
     FIG. 1 is a block diagram of a control circuit for a rotational angle detection device, 
     FIG. 2 is a view showing an encoder, 
     FIG. 3 is a chart of the encoder output waves, 
     FIGS. 4 and 5 are flow charts, and 
     FIG. 6 is an explanatory view for describing the operation. 
    
    
     DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENT 
     An embodiment of the present invention will be described hereafter with reference to the drawings. Referring now to FIG. 1, 10 denotes an encoder, 11 denotes a shaping circuit, and 12 denotes a computer. This computer 12 is composed of steering direction discrimination means 13, counter means 14, averaging means 15, and rotational angle calculation means 16. 
     Referring now to FIG. 2, 20 denotes a steering shaft, which is connected to a steering wheel (not shown) at one end thereof and to a steering mechanism (not shown) at the other end thereof. A rotary disc 21 is secured to the steering shaft 20, and a plurality of slits 22 are formed at a circumferential porion of the rotary disc 21 at an equiangular intervals. An A-phase sensor 23 and a B-phase sensor 24 each of which comprises a pair of light emission and responsive elements facing each other with the rotary disc 21 therebetween are disposed respectively at circumferential angular positions with a phase difference corresponding to a 1/4 cycle, and these sensors 23, 24 are secured to a fixed part such as a steering column. The sensors 23, 24 are responsive to light passing through the slits 22 to generate pulse signals SS1 and SS2, whose phases are shifted a 1/4 cycle as shown in FIG. 3, each time the steering shaft 20 is turned a unit angle. These rotary disc 21 and sensors 23, 24 constitute the aforementioned encoder 10. 
     As shown in FIG. 3, the steering direction discrimination means 13 divides one cycle of the pulse signal into four region signals S including &#34;0&#34; through &#34;3&#34;, depending upon combinations of the two pulse signals SS1, SS2 which are generated by the encoder 10 with the pulse difference corresponding to a 1/4 cycle, and discriminates the rotational direction of the steering wheel by reference to a present region signal and a previous region signal. It is to be noted that the region signals are divided in such a way that they respectively have &#34;0&#34; with the signals SS1 and SS2 being both at a low level, &#34;1&#34; with the signal SS1 being at the low level but the signal SS2 being at a high level, &#34;2&#34; with the signal SS1 being at the high level but the signal SS2 being at the low level, and &#34;3&#34; with the signals SS1 and SS2 being both at the high level. 
     The steering direction discrimination means 13 and the counter means 14 will be described with reference to a flow chart shown in FIG. 4. It is assumed herein that in FIG. 4, S represents a present region signal whereas OS represents a previous region signal. First of all, it is ascertained in step 30 whether S is the same as OS or not, and when &#34;Yes&#34; is answered, the program return is effected because the steering wheel is regarded as having been stopped. If &#34;No&#34;, to the contrary, step 31 is then reached to ascertain whether S is &#34;0&#34; in step 31, whether S is &#34;1&#34; in step 32 and whether S is &#34;2&#34; in step 33, and when &#34;No&#34; is answered in any of these steps, S is judged to be &#34;3&#34; in step 34. When S is judged to be &#34;0&#34; in stepZ 31, step 35 is reached to ascertain whether OS is &#34;1&#34; or not. When &#34;Yes&#34;  is answered, the rotational direction of the steering wheel is judged to be a positive-going direction (clockwise direction), and in step 39, 1 is added to the rotational angle θ being stored in a memory of the computer 12. When the result of ascertainment in step 35 is &#34;No&#34;, the steering wheel is judged to being turned in a reverse direction (counterclockwise direction), whereby 1 is subtracted from the rotational angle θ being stored in the memory in step 40. Likewise, when S is judged to be &#34;1&#34; in step 32, whether OS is &#34;0&#34; or not is ascertained in step 36. Further, when S is judged to be &#34;2&#34; in step 33, whether OS is &#34;0&#34; or not is ascertained in step 37, and when S is seen to be &#34;3&#34;, whether OS is &#34;1&#34; or not is ascertained in step 38. Subsequently, as described above, the addition to, or subtraction from, the content of the rotational angle θ being stored in the memory is performed depending upon the results of these ascertainments in step 39 or 40. 
     The averaging means 15 and the rotational angle calculation means 16 will be described hereafter with reference to a flow chart shown in FIG. 5. When the vehicle speed sensor 15a outputs a pulse signal each time the vehicle runs a unit distance, an interrupt signal is forwarded, responsive to which a program shown in FIG. 5 is started. First of all, in step 50, 1 is added to a memory counter which cumulates processing numbers n, and the rotational angle θ being stored in the counter means 14 is read in step 51. In step 52, the rotational angle θ is added to the content θ1 of another memory counter which cumulates the rotational angles θ per unit running distance, and in step 53, a mean value of the rotational angle θ is calculated by dividing the cumulative value θ1 of rotational angles by the cumulation number n, so as to be stored as CENTER in the memory. It is ascertained in step 54 whether the cumulation number n has reached a set value n1 or not, and when &#34;No&#34; is answered, the CENTER is subtracted from the rotational angle θ to output the result as a steering angle A. 
     In this manner, the rotational angle θ is read each time the vehicle runs the unit distance, to calculate the CENTER from the mean value, and the rotational angle θ is then modified to a rotational angle taking the CENTER as a starting point, whereby the steering angle A which is almost reliable can be obtained. 
     More specifically, in the event that the ignition switch is turned on with the vehicle being stopped, the steerable wheels are not in a fixed orientation, and thus, the rotational angle θ obtained based upon the output of the encoder 10 indicates an angle which is calculated taking as the starting point a position where the steering wheel is located at the time of the supply of electric power. Moreover, although the steering wheel is usually turned right or left across the actual neutral position, the straight driving is kept during almost all the part of running except for such a particular case as a mountain road driving. 
     Accordingly, assuming now that the ignition switch is turned on in such a state that the steering wheel has been almost fully turned left as indicated at P1 in FIG. 6 and that the steering wheel is manipulated as indicated by the broken line after the starting of running, the rotational angle stored in the memory is calculated taking the P1 position as a starting point. Further, the CENTER obtained in step 53 indicates at an early stage a value which deviates from the actual neutral position towards the P1 position as indicated by the solid line in FIG. 6, that is, a smaller value than the angle of the P1 relative to the neutral position. However, as the running distance increases, the CENTER is approximated gradually to the neutral position, and after the vehicle runs several hundred meters for example, the CENTER comes into approximate coincidence with the neutral position. Therefore, a large turn of the steering wheel in such a state has almost no influence on the value of the CENTER. 
     In the flow chart shown in FIG. 5, when the result of ascertainment in step 54 changes to &#34;Yes&#34;, the cumulation number n is modified to n2 (0&lt;n2&lt;n1) in step 57, and a calculation according to the following equation is performed in step 58 to obtain a revised cumulative rotational angle θ1 proportional to the modified cumulation number n2, whereby the overflow of θ1 can be prevented. 
     
         θ1=θ1-(θ1/n1)×(n1=n2) 
    
     Although the above described embodiment is directed to an example wherein the rotational angle θ is sampled each time the vehicle runs a unit distance, such sampling may be done each time the vehicle runs a unit time period.