Vehicle steering control apparatus
BACKGROUND OF THE INVENTION 
     1. Field of the Invention 
     The present invention relates to a vehicle steering control apparatus which can automatically drive a vehicle along a road on the basis of both road end position information (e.g. leftward and rightward white lines) and in response to steering direction instructions. 
     2. Description of the Prior Art 
     An example of prior-art vehicle steering control apparatus will be explained with reference to FIG. 1. In FIG. 1, two cameras 7 and 8 mounted on a front portion of a vehicle 4 is switched from the leftward camera 7 to the rightward camera 8 or vice versa in accordance with a predetermined travel plan, in order to detect a road end position data such as a distance X L  between a leftward white line 5 and a vehicle longitudinal axis y at a frontward observation point OP (a distance L ahead of the vehicle 4) and a rightward road end position data such as a distance X R  between a rightward white line 6 and the vehicle longitudinal axis y, or a leftward inclination angle φ L  between the vehicle axis y and the white line 5 or 6 and a rightward inclination angle φ R  between the vehicle axis y and the white line 5 or 6. The steering operation of the vehicle 4 is self-controlled on the basis of these detected steering data. In more detail, in the case where the vehicle travel plan is previously determined in such a way that the vehicle is first turned to the left and then to the right, the leftward camera 7 mounted on the vehicle front portion detects the leftward data X L  or φ L  at the left turn and the leftward steering angle φ L  is determined on the basis of the detected leftward data. Further, the rightward camera 8 detects the rightward data X R  or φ R  at the succeeding right turn and the rightward steering angle θ R  is determined on the basis of the detected rightward data. Therefore, the steering angle θ out  to be outputted is simply determined as the leftward steering angle θ L  at the left turn and as the rightward steering angle θ R  at the right turn. 
     Here, the leftward camera 7 is switched to the rightward camera 8, for instance, at the timing when the leftward steering inclination angle φ L  detected as the leftward road end position (white line) data is reduced below a predetermined value (zero or almost zero) after a steering direction instruction (for switching the steering angle output θ out  to the rightward steering angle θ R ) has been inputted to the control system. This is because when the vehicle 4 has been steered almost in parallel to the leftward white line 5 after the left turn, it is possible to consider that the left turn has been completed. 
     In the prior-art steering control apparatus, however, when the vehicle is turned consecutively from the left to the right or vice versa, since the camera (i.e. steering direction) switching timing is determined on the basis of only the inclination angle, there exists a problem in that the steering angle is not switched smoothly at the same predetermined value at the left and right turns, so that the steering operation is not effected smoothly and continuously, thus causing steering vibration. 
     In particular, where the vehicle runs along a crank-shaped road with a short straight line section; that is, where the vehicle is quickly turned to the left and then right or vice versa, the camera switching timing is too late for the succeeding steering operation, even if the steering angle is switched from the left steering angle to the right steering angle or vice versa, after the inclination angle detected as the white line data has been reduced down to almost zero or the vehicle has been driven in parallel to the leftward white line, so that the vehicle is not sufficiently turned to the left. To overcome this problem, when the steering angle is switched from the left steering angle to the right steering angle before the vehicle is sufficiently steered in parallel to the leftward white line (e.g. when the inclination angle is reduced below 3 degrees), although the vehicle can be sufficiently turned to the right, since the steering angle obtained on the basis of the leftward white line immediately before the steering is switched is not continuous to that obtained on the basis of the rightward white line after the steering has been switched, thus also causing steering vibration. 
     SUMMARY OF THE INVENTION 
     With these problems in mind, therefore, it is the object of the present invention to provide a vehicle steering control apparatus which can smoothly switch the steering directions at appropriate timings. 
     To achieve the above-mentioned object, the present invention provides a vehicle steering control apparatus for automatically driving a vehicle along a road on the basis of both road end position information and in response to a steering direction switching signal, comprising: (a) leftward detecting means (7A) for cyclically detecting a leftward road end position data (X L ); (b) leftward steering angle calculating means (1) for calculating a leftward steering angle (θ L ) on the basis of the detected leftward road end position data; (c) rightward detecting means (7B) for cyclically detecting a rightward road end position data (X R ); (d) rightward steering angle calculating means (2) for calculating a rightward steering angle (θ R ) on the basis of the detected rightward road end position data; (e) switching means (3) for switching a vehicle steering angle output (θ out ) from the calculated leftward steering angle (θ L ) to the calculated rightward steering angle (θ R ) or vice versa in accordance with the steering direction switching signal (S sw ) at a timing when the calculated leftward and rightward angles match each other; and (f) steering driving means (11) for driving vehicle steering in accordance with the switched steering angle output. 
     The leftward detecting means (7A) comprises: (a) a leftward camera (7) mounted on a leftward front portion of the vehicle, for cyclically taking an image of the leftward road end position information (5); (b) a leftward image processor (9) for detecting a leftward distance (X L ) between the leftward road end position information and a vehicle longitudinal axis (y) at a frontward observation point (OP), and wherein said rightward detecting means (7B) comprises: (c) a rightward camera (8) mounted on a rightward front portion of the vehicle, for cyclically taking an image of the rightward road end position information (6); and (d) a rightward image processor (10) for detecting a rightward distance (X R ) between the rightward road end position information and the vehicle longitudinal axis (y) at the frontward observation point. 
     The switching means comprises: (a) a JK flip-flop (13) for outputting a first level setting signal (S set ) in response to a leftward steering direction switching signal (S sw ) and a second level setting signal (S set ) in response to a rightward steering direction switching signal (S sw ); (b) a comparator (14) for comparing the leftward steering angle (θ L ) and the rightward steering angle (θ R ) and outputting a compare signal (S com ) when differences between the two steering angles (|θ L  -θ R  |) becomes less than a predetermined small value (ε); (c) a D flip-flop (15) for outputting a leftward steering signal (S L ) in accordance with the first level setting signal and in synchronism with the compare signal and a rightward steering signal (S R ) in accordance with the second level setting signal and in synchronism with the compare signal; (d) a leftward switch (16) for outputting the leftward steering angle (θ L ) as a steering angle output (θ out ) in response to the leftward steering signal (S L ); and (e) a rightward switch (17) for outputting the rightward steering angle (θ R ) as a steering angle output (θ out ) in response to the rightward steering signal (S R ). 
     Further, to achieve the above-mentioned object, the present invention provides a method of automatically driving a vehicle along a road on the basis of both road end position information and in response to a steering direction switching signal, comprising the steps of: (a) cyclically detecting a leftward distance (X L ) between the leftward road end position information and a vehicle longitudinal axis (y) at a frontward observation point and a rightward distance (X R ) between the rightward road end position information and the vehicle longitudinal axis at the frontward observation point; (b) calculating a leftward steering angle (θ L ) on the basis of the detected leftward distance and a rightward steering angle (θ L ) on the basis of the detected rightward distance; (c) checking whether the steering direction switching signal is a leftward steering switching signal or a rightward steering switching signal; (d) if the leftward steering switching signal is checked, checking whether the leftward steering angle (θ L ) is approximately equal to the rightward steering angle (θ L ); (e) if approximately equal thereto, switching the steering angle output (θ out ) to the leftward steering angle (θ  L ) in accordance with the checked leftward steering switching signal; (f) if the rightward steering switching signal is checked, checking whether the rightward steering angle (θ L ) is approximately equal to the leftward steering angle (θ R ); and (g) if approximately equal thereto, switching the steering angle output (θ out ) to the rightward steering angle (θ R ) in accordance with the checked rightward steering switching signal. Even if the leftward steering switching signal is checked, the rightward steering angle (θ R ) is kept outputted as the steering angle output (θ out ) when the rightward steering angle (θ R ) is more than the leftward steering angle (θ L ); and even if the rightward steering switching signal is checked, the leftward steering angle (θ L ) is kept outputted as the steering angle output (θ out ) when the leftward steering angle (θ L ) is more than the rightward steering angle (θ R ). When the leftward steering switching signal is checked, and further the steering angle output (θ out ) has already been switched to the leftward steering angle (θ L ), the leftward steering angle is kept outputted as the steering angle output; and when the rightward steering switching signal is checked, and further the steering angle output (θ out ) has already been switched to the rightward steering angle (θ R ), the rightward steering angle is kept outputted as the steering angle output. 
     In the control apparatus according to the present invention, since the steering direction is switched when the leftward steering angle, for instance, matches the preceding (finally detected) rightward steering angle before the steering angle is reduced down to zero (in parallel to the white lines), it is possible to more quickly switch the steering angle, after the steering direction switching instruction has been received. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     FIG. 1 is an illustration for assistance in explaining the method of self-controlling the vehicle steering; 
     FIG. 2 is a block diagram showing an embodiment of the steering control apparatus according to the present invention; 
     FIG. 3 is a block diagram showing the essential portion of the embodiment shown in FIG. 2; and 
     FIG. 4 is a flowchart for assistance in explaining the operation of the embodiment shown in FIGS. 2 and 3. 
    
    
     DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS 
     An embodiment of the steering control apparatus according to the present invention will be described hereinbelow with reference to the attached drawings. 
     In FIG. 2, the apparatus comprises a leftward camera 7 mounted on the leftward front portion of a vehicle 4; a leftward image processor 9; a leftward steering angle calculator 1; a rightward camera 8 mounted on the rightward front portion of the vehicle 4; a rightward image processor 10; a rightward steering angle calculator 2; steering angle switching means 3 responsive to steering direction instruction signals S SW  ; and a steering driver 11. 
     Further, the assumption is made that a left side white line 5 is painted or drawn on the left side of a road along which the vehicle 4 is travelling, and a right side white line 6 is painted or drawn on the right side thereof, and the vehicle 4 is travelling along the road by turning to the left or the right. Here, without being limited thereto, it is of course possible to use three-dimensional objects (e.g. conical rubbers) arranged along both the sides of the road as the road end position information, instead of the white lines. 
     The leftward camera 7 cyclically takes images of the left side white line 5, and the leftward image processor 9 processes the image signals in accordance with binary image signal processing method to obtain digital distance data X L . That is, a leftward detecting means 7A composed of the leftward camera 7 and the leftward image processor 9 cyclically detects the leftward distance X L  between the left side white line 5 and the vehicle longitudinal axis y at an observation point OP a distance L ahead of the vehicle 4, as the leftward white line data. In the same way, a rightward detecting means 8A composed of the rightward camera 8 and the rightward image processor 10 cyclically detects the rightward distance X R  between the right side white line 6 and the vehicle longitudinal axis y at the observation point OP, as the rightward white line data. 
     The leftward steering angle calculator 1 calculates a leftward steering angle θ L  on the basis of the detected leftward distance X L  and the rightward steering angle calculator 2 calculates a rightward steering angle θ R  on the basis of the detected rightward distance X R  in accordance with an appropriate calculating method. One of these calculating methods is of regression model calculating method on the basis of the past several data as follows: 
     
         θ.sub.L (i)=a0.sub.L ×X.sub.L (i)+a1.sub.L ×X.sub.L (i-1)+a2.sub.L ×X.sub.L (i-2)+g0.sub.L 
    
     
         θ.sub.R (i)=a0.sub.R ×X.sub.R (i)+a1.sub.R ×X.sub.R (i-1)+a2.sub.R ×X.sub.R (i-2)+g0.sub.R 
    
     where a0 L , a1 L , a2 L , g0 L , a0 R , a1 R , a2 R , g0 R  are a constant, respectively. The above formulae indicate that the leftward steering angle θ L  (i) at a time point (i) can be obtained on the basis of X L  (i) detected as the leftward white line data at the current time point (i), X L  (i-1) detected at the time point (i-1) one cycle before the current time point (i) and X L  (i-2) detected at the time point (i-2) two cycles before the current time point (i), and similarly the rightward steering angle θ R  (i) at a time point (i) can be obtained on the basis of X R  (i) detected as the rightward white line data at the current time point (i), X R  (i-1) detected at the time point (i-1) one cycle before the current time point (i) and X R  (i-2) detected at the time point (i-2) two cycles before the current time point (i). 
     These calculated leftward and rightward steering angles θ L  and θ R  are inputted to the steering angle selecting means 3 to which a steering direction switching signal S SW  is applied from a travel control unit (not shown) for roughly determining a travel route on the basis of a previously determined travel plan (inputted to the control unit through a keyboard or a mouse), detected current vehicle locations, and map data stored in the control unit. The steering angle selecting means 3 switches the steering direction of the steering angle output θ out  when the leftward steering angle θ L  becomes roughly equal to the rightward steering angle θ R  or vice versa after the switching signal S SW  has been applied to the selecting means 3. 
     Further, the switching means 3 cyclically compares these two steering angles θ L  and θ R . After the steering direction switching signal S SW  has been inputted to the switching means 3, if the two steering angles θ L  and θ R  first match each other, the steering angle θ out  is switched from θ L  to θ R  or vice versa. Here, the matching of these two steering angles θ L  and θ R  is discriminated by checking whether |θ L  -θ R  |&lt;ε, where ε denotes a predetermined small value. This value ε is determined empirically because a smaller value is preferable to smoothly steer the vehicle but a larger value is preferable to securely turn the vehicle to the left or the right. 
     Once the steering angle direction has been determined, the steering angle output θ out  is inputted to the steering driver 11 to steer the vehicle 4 in accordance with the switched steering angle output θ out . 
     Here, the switching means 3 will be described in further detail with reference to FIG. 3. The switching means 3 comprises a JK flip-flop (JK-FF) 13, a comparator 14, a D flip-flop (D-FF) 15, a leftward analog switch (SW L ) 16 for outputting θ L , and a rightward analog switch (SW R ) 17 for outputting θ R . 
     In operation, when a steering direction switching signal S SW  is applied to the JK-FF 13, a setting signal S set  from the output Q of the JK-FF 13 changes in level from high to low or vice versa. That is, the level of the setting signal S set  is switched in response to the switching signal S SW . For instance, if S SW  is at a high level indicative of a left turn instruction, S set  is set to a high level, and if S SW  is at a low level indicative of a right turn instruction, S set  is set to a low level. On the other hand, the comparator 14 cyclically compares the leftward steering angle θ L  outputted from the leftward steering angle calculator 1 with the rightward steering angle θ R  outputted from the rightward steering angle calculator 2 and outputs a compare signal S com  to the D-FF 15 when the difference in absolute between the two |θ L  -θ R  | becomes smaller that a predetermined small value ε. In synchronism with this pulse signal S com , the D-FF 15 determines whether the analog switch 16 or 17 is turned on in accordance with the level of the setting signal 18. In more detail, if the setting signal S set  is at a high level, the output Q of the D-FF 15 is set to a high level in response to the compare signal S com , so that the analog switch 16 is turned on to output the leftward steering angle θ L . In contrast, if the setting S set  is at a low level, the output Q of the D-FF 15 is set to a high level in response to the compare signal S com , so that the analog switch 17 is turned on to output the rightward steering angle θ R . 
     With reference to the flowchart shown in FIG. 4, the operation of the control apparatus will be explained in further detail. When the vehicle 4 is running under self-controlled conditions, the leftward camera 7 and the leftward image processor 9 detect the leftward white line distance data X L  and the rightward camera 8 and the rightward image processor 10 detect the rightward white line distance date X R  (in step 1). The leftward steering angle calculator 1 calculates a leftward steering angle θ L  on the basis of the detected distance X L  and the rightward steering angle calculated 2 calculates a rightward steering angle θ R  on the basis of the detected distance X R  (in step 2). Control checks whether the steering direction switching signal S SW  or the setting signal S set  is at a high level indicative of the left turn or a low level indicative of the right turn (in step 3). If YES (left turn), control further checks whether the steering angle output θ out  is the leftward steering angle θ L  (in step 4). If θ out  has already been set to θ L , θ out  is kept set to θ L  (in step 8). If θ out  is not yet θ L  (in step 4), control compares θ L  with θ R  (in step 5). If θ L  is roughly equal to θ R , θ out  is set to θ L  in accordance with the left turn instruction (in step 8). If Q L  is not roughly equal to θ R  (in step 5), θ out  is set to θ R  in spite of the left turn instruction (in step 9). In contrast, if NO (right turn) (in step 3), control further checks whether the steering angle output θ out  is the rightward steering angle θ R  (in step 6). If θ out  has already been set to θ R , θ out  is kept set to θ R  (in step 9). If θ out  is not yet θ R  (in step 6), control compares θ L  with θ R  (in step 7). If θ L  is roughly equal to θ R , θ out  is set to θ R  in accordance with the right turn instruction (in step 9). If θ R  is not roughly equal to θ R  (in step 7), θ out  is set to θ L  in spite of the right turn instruction (in step 8). 
     Therefore, in step 8, θ out  is set to θ L  under the conditions that the switching instruction is the left turn (in step 3) and θ out  has already been set to θ L  (in step 4); the switching instruction is the left turn (in step 3), θ out  is not yet set to θ L  (in step 4), and θ L  is roughly equal to θ R  (in step 5); and further the switching instruction is the right turn (in step 3), θ out  is not yet set to θ R  (in step 6), and θ R  is not yet equal to θ L  (in step 7). 
     Similarly, in step 9 θ out  is set to θ R  under the conditions that the switching instruction is the right turn (in step 3) and θ out  has already been set to θ R  (in step 6); the switching instruction is the right turn (in step 3), θ out  is not yet set to θ R  (in step 6), and θ R  is roughly equal to θ L  (in step 7); and further the switching instruction is the left turn (in step 3), θ out  is not yet set to θ L  (in step 4), and θ L  is not yet equal to θ R  (in step 5). 
     In summary, when the steering direction switching signal S SW  is the left turn (in step 3), if the steering angle θ out  has already been switched to the leftward steering angle θ L  (in step 4), θ out  is of course kept at θ L  (in step 8). However, if θ out  is not yet switched to θ L  (in step 4), only when θ L  increases and therefore becomes roughly equal to the preceding θ R  (in step 5), θ out  is switched to θ L  in accordance with the left turn instruction (in step 8). Once switched to θ L  (in step 8), θ out  is kept at θ L  after θ L  has been more increased (in step 4). On the other hand, however, if θ R  is larger than θ L  (in step 5), θ out  is kept at θ R  (in step 9) even after the left turn has been instructed (in step 3). 
     Similarly, when the steering direction switching signal S SW  is the right turn (in step 3), if the steering angle θ out  has already been switched to the rightward steering angle θ R  (in step 6), θ out  is of course kept at θ R  (in step 9). However, if θ out  is not yet switched to θ R  (in step 6), only when θ R  increases and therefore becomes equal to θ L  (in step 7), θ out  is switched to θ R  in accordance with the right turn instruction (in step 9). Once switched to θ R  (in step 9), θ out  is kept at θ R  after θ R  has been more increased (in step 6). On the other hand, however, if θ L  is larger than θ R  (in step 7), θ out  is kept at θ L  (in step 8) even after the right turn has been instructed (in step 3). 
     The assumption is made that the vehicle 4 is now being turning to the left (L) and then will turn to the right (R). Under the left turn condition, the steering angle output θ out  is θ L  so that the setting signal S set  is at a high level and therefore the SW L  16 is kept on and the SW R   17 is kept turned off. When a switching signal S SW  for switching the left turn to the right turn is applied from the travel control unit (not shown) to the JK-FF 13, the setting signal S set  is set to a low level. After the setting signal S set  has been set to a low level, when the difference |θ L  -θ R  | becomes less than a predetermined value ε (i.e. θ R  becomes roughly equal to θ L ), a compare signal S com  is applied from the comparator 14 to the D-FF 15, so that the analog switch 16 is turned off and the analog switch 17 is turned on in order to switch the steering angle output θ out  from θ L  to θ R . 
     In the above-mentioned operation, when the vehicle is running along a straight line, there exists a certain steering angle vibration within a range of |θ R  -θ L  |&lt;ε. Therefore, when the steering angle vibration lies within this range, the steering angle will not be changed. However, when the steering angle exceeds this vibration range, the steering angle is switched only when θ R  and θ L  roughly match each other and after the steering direction switching signal S sw  has been applied from the travel control unit to the control apparatus. Once having been switched, the steering angle is kept at the switched direction until being switched again in accordance with the steering direction switching signal. 
     Further, since the steering direction is switched when the leftward steering angle, for instance matches the preceding (finally detected) rightward steering angle, before the steering angle is reduced down to zero (in parallel to the white line) which is different from the prior-art apparatus, it is possible to more quickly switch the steering angle, after the steering direction switching instruction has been received by the control apparatus. 
     In other words, the steering angle output θ out  is not switched on the basis of only the switching signal S sw , but switched when θ L  becomes roughly equal to θ R  or vice versa. Therefore it is possible to smoothly switch the steering direction at optimum timings, thus enabling the vehicle to be self-controlled stably.