1.  Technical Field
The present invention relates generally to control of headlights on commercial motor vehicles and more particularly to a control system implemented in a finite state machine which affords control flexibility while avoiding unanticipated responses. 
2.  Description of the Problem
Headlights serve several functions on a motor vehicle including: providing forward lighting for visibility under conditions of limited ambient light; increasing the visibility of the vehicle to other drivers (running light functionality); and affording a means of signaling to other drivers.  Local laws governing headlight operation may differ as to time of day the lights are to be on.  In addition, some locales require headlights to be illuminated if the windshield wipers have been turned on due to rain.  In other locations it may be required that headlights be turned off at a weigh-station.  Signaling to indicate an attempt to pass, or to indicate to a passing vehicle that a sufficient interval has opened to allow the passing vehicle to return to a lane may involve turning lights on, or off, depending upon the state of the lights prior to the signal. 
Headlights were formerly directly connected to switches installed in the vehicle passenger compartment or cab.  Contemporary control schemes for vehicle electrical systems have favored substituting programmable controllers and controller area networks (“CAN”) for direct wiring between switches and loads.  CAN systems and controllers afford a high degree of flexibility in application, the potential of a richer feature set and a commensurate opportunity for greater automation than direct wired systems.  Mechanically CAN systems are much simpler than the traditional wiring harnesses and, possibly more importantly, the basic wiring does not change with the additions of features.  However, providing against unanticipated operation stemming from programming omissions or changes in such systems takes on particular importance.  Headlights are an example of a system where avoiding unintended operations is important in view of the need for headlights for safe vehicle operation under low ambient light conditions. 
Finite state machine descriptions of desired system behavior have recently found favor as a method of programming a system to provide greater assurance of fault-free behavior.  It would be desirable to provide a control system for headlights which makes headlight operation for the desired function as simple as possible, which minimizes the chance of accidental illegal operation, which automates functions but automatically ensures headlight operation when legally required or on account of low ambient light conditions.