Patent Description:
An intersection where a railway line crosses a road or path is referred to as a level crossing. Level crossings utilize gate crossing mechanisms to control traffic on the road or path when a train or other vehicle is passing through the level crossing. The gate crossing mechanisms prevent vehicles, pedestrians, etc., from crossing the railway line while the gate crossing mechanism is engaged. <CIT> describes a failure diagnosis and countermeasure method of a three-phase motor. The method comprises a step of failure diagnosing which uses a Hall signal of a Hall sensor repeatedly outputted at a specific cycle during a three-phase motor start, and diagnoses at multiple stages whether an error is occurred in the Hall sensor of the three-phase motor. <CIT> describes a motor system with a motor including two Hall sensors configured to output binary values, and a controller configured to control the motor. The two Hall sensors are placed <NUM> or <NUM> electrical degrees apart. The controller is operable to monitor output signals of the two Hall sensors and to determine a third Hall sensor output binary value.

The present invention provides a method for fault detection of at least one hall sensor and a motor system with the features of the independent claims. Preferred embodiments of the present invention are defined by the features of the dependent claims.

The diagrams depicted herein are illustrative. The term "coupled" and variations thereof describes having a communications path between two elements and does not imply a direct connection between the elements with no intervening elements/connections between them. All of these variations are considered a part of the specification.

One or more embodiments of the present invention provide a computer-implemented method and a motor system, which can be applied in a gate crossing mechanism, including techniques for controlling a gate crossing motor and/or detecting and/or preventing faults of the gate crossing motor. A gate crossing mechanism protects motorists, pedestrians, and the like from oncoming trains by blocking level crossings or points at which public or private roads cross railway lines at the same level.

As one example, a gate crossing mechanism can include an arm or "gate" that, using a motor, selectively lowers/raises depending upon whether a train or other vehicle is passing through the level crossing. For example, if a train is approaching a level crossing, a gate can be lowered to prevent traffic on the road or path from crossing the railway line. A level crossing can be equipped with multiple gate crossing mechanisms. For example, each side of the railway line can include a gate crossing mechanism. In larger intersections, each side of the railway line can include two (or more) gate crossing mechanisms. Gate crossing mechanisms can further include lights, sirens, bells, or other similar devices that can provide visual and/or aural warnings.

Conventional gate crossing mechanisms can be susceptible to failures, malfunctions, etc., which can reduce their ability to control a level crossing safely. It is therefore describable to improve efficiency, reliability, and functionality of conventional gate crossing mechanisms.

The above-described aspects of the invention address the shortcomings of the prior art by providing examples of a computer-implemented method and a motor system as claimed.

Gate crossing mechanisms having the features and functionality described herein provide improve efficiency and address problems associated with conventional gate crossing mechanisms. For example, a gate crossing mechanism can include a brushless motor and digital control logic rather than a conventional brushed motor and mechanical cams. Motor brushes can experience uneven wear patterns, after which they must be replaced. This is both costly and time consuming for railways or those responsible for maintaining gate crossing mechanisms featuring brushed motors. Moreover, whereas conventional gate crossing mechanisms having brushed motors required eight cams, the brushless motors of the gate crossing mechanisms described herein can use substantially less than eight cams (e.g., two cams).

Additionally, the brushless motors of the gate crossing mechanisms described herein provide expanded fault detection such as overcurrent and overtemperature detection, which can be determined from measured three-phase motor currents. This active fault detection serves to increase the availability of the gate crossing mechanism. The brushless motors of the gate crossing mechanisms described herein also provide an improved user interface to give maintainers clear feedback on gate configuration. This improves efficiency and accuracy for maintainers to set gate attributes in the field, thereby decreasing human error. Finally, the brushless motors of the gate crossing mechanisms described herein support a configurable gate that can function as either an entrance or an exit gate, which can depend for example the FPGA firmware. This is a stark difference from the conventional gate crossing mechanisms, which can only function as an entrance gate unless an additional logic card is attached.

Turning now to <FIG>, a block diagram of a controller <NUM> for a motor <NUM> of a gate crossing mechanism <NUM> is depicted according to one or more embodiments described herein. In this example, the gate crossing mechanism <NUM> includes the motor <NUM>, the controller <NUM>, and a gate <NUM>. The gate <NUM> can be supported by any suitable structure, such as a gate support <NUM>. The controller <NUM> and/or the motor <NUM> can be coupled to, incorporated in, or otherwise associated with the gate <NUM> and/or the gate support <NUM>. The gate crossing mechanism <NUM> controls the gate <NUM> at a crossing <NUM> of a railway <NUM> and a road <NUM>. The gate <NUM>, when in a "down" or "closed" position, prevents traffic traveling along the road <NUM> from crossing the intersection <NUM>. In examples, the intersection can be controlled by additional gate crossing mechanisms (not shown).

The motor <NUM> can have hall sensors (HS) 103A, 103B, 103C (collectively hall sensors <NUM>) associated therewith. Although three hall sensors are shown and described, other numbers of hall sensors can be implemented in other examples. Hall sensors (or "hall effect sensors"), such as the hall sensors <NUM>, are devices that measure a magnetic field, particularly the magnitude of the magnetic field, and output a voltage that is directly proportional to the magnetic field strength. Hall sensors are useful in the context of a motor (e.g., the motor <NUM>) because they can be used to accurately determine position or speed of a shaft (not shown) extending from the motor <NUM> and connecting (directly or indirectly) to the gate <NUM> to control the gate <NUM>.

It is desirable to increase the availability of the gate crossing mechanism <NUM> given that motor commutation is reliant on the hall sensors <NUM>. Accordingly, the present techniques provide for hall sensor fault prediction and detection. In particular, the present techniques provide a proactive approach for hall sensor fault detection by predicting a hall sensor fault. The present techniques also provide a reactive approach for hall sensor fault detection by detecting a hall sensor failure when it occurs.

The present techniques account for the change of direction of the shaft of the motor <NUM>. According to one or more embodiments described herein, the motor <NUM> includes a shaft (also referred to as an "arm") and a plurality of hall sensors (e.g., the hall sensors <NUM>). The hall sensors <NUM> are configured to measure an electromagnetic field about the shaft of the motor and can be used to determine a position and/or speed of the shaft of the motor <NUM>. The controller <NUM> (i.e., a processing device) can be used to execute instructions stored on a memory (not shown) for performing operations. Such operations can include, determining a current state of at least one of the plurality of hall sensors, predicting a predicted next state of the at least one of the plurality of hall sensors based on the current state, and determining whether the at least one of the plurality of hall sensors is faulty based at least in part on an actual next state and the predicted next state.

According to one or more embodiments described herein, upon change of direction in the shaft of the motor <NUM> or upon initial shaft movement, the first six hall state changes are ignored to avoid unnecessary and incorrect fault detection. Depending on how many bad hall signals there are, the detection technique can become less strict. If all hall sensors are good, then two sensors are needed to confirm a bad sensor. If two hall sensors are good, then only one hall sensor is needed to confirm the other is bad. If there is a change in the state of any hall sensor, then it is assumed to be good (i.e., non-faulty) and unflagged so it can be used to flag other hall sensors. This is a dynamic way of checking the hall sensors against one another and allows recovery if a hall sensor returns to operation (i.e., the hall sensor changes state).

<FIG> depicts a trellis diagram for the hall sensors <NUM> of <FIG> according to one or more embodiments described herein. The example trellis diagram of <FIG> assumes each of the hall sensors <NUM> are functioning nominally (i.e., these hall sensors are "good"). The trellis diagram of <FIG> shows the states of the hall sensors <NUM> at four different cycles. Particularly, the states of the hall sensors at a first cycle are shown as state blocks <NUM>, <NUM>, <NUM>, <NUM>, <NUM>, <NUM>; the states of the hall sensors at a second cycle are shown as state blocks <NUM>, <NUM>, <NUM>, <NUM>, <NUM>, <NUM>; the states of the hall sensors at a third cycle are shown as state blocks <NUM>, <NUM>, <NUM>, <NUM>, <NUM>, <NUM>; and the states of the hall sensors at a fourth cycle are shown as state blocks <NUM>, <NUM>, <NUM>, <NUM>, <NUM>, <NUM>. The solid arrows represent a "high" signal (i.e., a logical "<NUM>") while the dashed arrows represent a "low" signal (i.e., a logical "<NUM>").

The hall sensors <NUM> are positioned about the shaft of the motor <NUM> such that a point on the shaft, while the shaft rotates, first passes a field monitored by the hall sensor 103a, then passes a field monitored by the hall sensor 103b, and finally passes a field monitored by the hall sensor 103c. In this way, the hall sensors <NUM> form a field about the entire circumference of the shaft of the motor <NUM>, and during a single revolution (<NUM> degrees) of the shaft, any point on the shaft passes through the three fields of the three hall sensors <NUM>.

Using the trellis diagrams of <FIG>, hall sensor fault detection can be accomplished by accumulating error over the whole shaft movement of the motor <NUM> as detected by the hall sensors <NUM>. A trellis state diagram is used to determine what the next state of the hall sensors <NUM> should be based on the previous state of the hall sensors <NUM> and the movement direction of the shaft. As an example, if the prediction does not agree with the next value of one or more of the hall sensors <NUM>, then an error (such as an error of <NUM>) is applied to the hall sensor(s) that do not agree with the prediction. If the error exceeds a maximum set value (threshold), then that hall sensor is flagged as faulty/bad until it can negate the error. The negation of an error occurs as an amount of <NUM> for <NUM> correct hall state. According to examples, for every incorrect prediction, a certain number (e.g., <NUM>) of consecutive correct predictions are used to negate the amount of error accumulated which represents a transition through all the hall states (as shown in <FIG>) without an incorrect state.

Each of <FIG> depict trellis diagrams for a single faulty hall sensor. In particular, <FIG> depicts a trellis diagram for the hall sensors <NUM> of <FIG> with hall sensor 103C being faulty according to one or more embodiments described herein. <FIG> depicts a trellis diagram for the hall sensors <NUM> of <FIG> with hall sensor 103A being faulty according to one or more embodiments described herein. <FIG> depicts a trellis diagram for the hall sensors <NUM> of <FIG> with hall sensor 103B being faulty according to one or more embodiments described herein.

In each of <FIG>, each state block indicates three values, with the first value corresponding to a signal of the hall sensors 103a, the second value corresponding to a signal of the hall sensors 103b, and the third value corresponding to a signal of the hall sensors 103c. Consider, for example, the state block <NUM> having a value "<NUM>" which indicates that the signal from the hall sensor 103a is low ("<NUM>"), the signal from the hall sensor 103b is low ("<NUM>"), and the signal from the hall sensor 103c is high ("<NUM>"). In the examples of <FIG>, the value "Z" indicates high impedance through a bad hall sensor. This could mean that the bad hall sensor is stuck low ("<NUM>") or high ("<NUM>").

With reference to the trellis diagram of <FIG>, consider the state block <NUM>. A next state block would be expected to be "<NUM>" indicated by the state block <NUM>. If the actual state of the hall sensor 103b does not change from "<NUM>" to "<NUM>" as predicted by the change from state block <NUM> to state block <NUM>, error accumulation begins for each of the individual hall sensors 103a, 103b, 103c (see <FIG>). If the next state is "<NUM>" indicated by the state block <NUM>, then the second hall sensor 103b did not transition as expected.

If a detected state is "<NUM>" (state block <NUM>), and the previous state is "<NUM>" (state block <NUM>), it is known that the direction is "<NUM>" and a next state can be predicted as "<NUM>" (state block <NUM>). Similarly, if a detected state is "<NUM>" (state block <NUM>) and the previous state is "<NUM>" (state block <NUM>), it is known that the direction is "<NUM>" and a next state can be predicted as "<NUM>" (state block <NUM>). The predicted next state is compared to an actual next state, and if they match, the hall sensor is considered to be functioning properly. However, if the predicted next state and the actual next state do not match, error is then added (see <FIG>) and waiting for a next transition beings. Upon detection of a next transition of the shaft of the motor <NUM> (meaning a change in direction of the rotation of the shaft of the motor <NUM>) the detected state is compared to the trellis diagram of <FIG> to predict a next state.

If a single hall sensor is bad, prediction can continue with two hall sensors based on the trellis diagrams depicted in <FIG> as applied to <FIG> described in more detail herein.

Faulty hall sensor detection is now described. Upon change of direction in the shaft of the motor <NUM> or initial shaft movement, a startup period number of hall state changes (e.g., <NUM>) are ignored to avoid unnecessary and incorrect fault detection. Depending on how many bad hall signals there are, the detection techniques described herein become less strict. If all (e.g., <NUM>) hall sensors are good, then two sensors are needed to confirm a bad sensor. If two hall sensors are good, then only one hall sensor is needed to confirm the other is bad. If there is a change in state of any hall sensor, then that hall sensor is assumed to be good, and it is unflagged so it can be used to flag other hall sensors. This provides a dynamic technique for checking the hall sensors against one another, which allows recovery if a hall sensor returns to operation (i.e., the hall sensor changes state). Also provided is a detection technique that accumulates error over the whole arm movement. In particular, faulty hall sensor detection is described with reference to <FIG>, <FIG>, and <FIG>.

<FIG> depicts a flow diagram of a method <NUM> for detecting a hall sensor fault for three good hall sensors (e.g., the hall sensors <NUM> of <FIG>) according to one or more embodiments described herein. The method <NUM> begins at block <NUM> with three good hall sensors. At block <NUM>, a current state and a predicted next state are determined (see the prediction models described with respect to <FIG>) for each of the hall sensors. At block <NUM>, it is determined whether the predicted next state matches the actual next state. If the prediction does not match the actual next state, an error is added to the incorrect hall sensor at block <NUM>, and a flag is set to flag the hall sensor if the error exceeds a maximum amount of error (i.e., maximum threshold). If the prediction matches the actual next state at block <NUM>, an error is subtracted from the incorrect hall sensor at block <NUM>, and the flag is cleared if the error is below the maximum amount of error (i.e., maximum threshold). This approach enables detecting a bad hall sensor over a period of time by accumulating error (e.g., block <NUM>) and/or reducing error (e.g., block <NUM>).

As an example, if the prediction does not agree with the next value of one or more of the hall sensors <NUM> at block <NUM>, then an error (such as an error of <NUM>) is applied to the hall sensor(s) that do not agree with the prediction. If the error exceeds a maximum set value (i.e., the maximum threshold), then that hall sensor is flagged as faulty/bad until it can negate the error. The negation of an error occurs as an amount of <NUM> for <NUM> correct hall state. According to examples, for every incorrect prediction, a certain number (e.g., <NUM>) of consecutive correct predictions are used to negate the amount of error accumulated which represents a transition through all the hall states (as shown in <FIG>) without an incorrect state.

The method <NUM> also proceeds from block <NUM> to block <NUM> for detecting a bad hall sensor upon a start from stop/idle condition of the motor <NUM>. At block <NUM>, a rise/fall is detected by waiting until a hall count is greater than a startup number of cycles (e.g., <NUM> cycles) following a change of direction. At block <NUM>, the hall sensor signals are checked against a rising/falling edge. Hall sensors that have the same value for the rising and falling edge are flagged at block <NUM> while hall sensors that have different values are unflagged at block <NUM>. Hall sensors that have the same value for the rising and falling edge could indicate that the hall sensor is faulty, and thus the hall sensor is flagged. However, hall sensors that have a change in value are unflagged because they are presumed to be functioning properly.

The method <NUM> also proceeds from block <NUM> to block <NUM> where a time (in milliseconds (ms) is counted since the last hall state change. The time since previous is stored as a previous time at block <NUM>.

The method <NUM> also proceeds from block <NUM> to block <NUM>, where a speed and position of the shaft of the motor <NUM> is calculated. At block <NUM>, a value of <NUM> is added to or subtracted from the position for every hall pulse for calculating the position of the shaft of the motor <NUM>. At block <NUM>, a number of hall pulses in a sampling window are counted for calculating the speed of the shaft of the motor <NUM>.

<FIG> and <FIG> depict a flow diagram of a method <NUM> for detecting a hall sensor fault for less than three good hall sensors (e.g., the hall sensors <NUM> of <FIG>) according to one or more embodiments described herein. The method <NUM> begins at block <NUM> with less than three (i.e., <NUM> or <NUM>) good hall sensors. At block <NUM>, a current state and a predicted next state are determined (see the prediction models described with respect to <FIG>) for each of the hall sensors. At block <NUM>, it is determined whether the predicted next state matches the actual next state. If the prediction does not match the actual next state, an error is added to the incorrect hall sensor at block <NUM>, and a flag is set to flag the hall sensor if the error exceeds a maximum amount of error (i.e., maximum threshold). If the prediction matches the actual next state at block <NUM>, an error is subtracted from the incorrect hall sensor at block <NUM>, and the flag is cleared if the error is below the maximum amount of error (i.e., maximum threshold). This approach enables detecting a bad hall sensor over a period of time by accumulating error (e.g., block <NUM>) and/or reducing error (e.g., block <NUM>).

The method <NUM> also proceeds from block <NUM> to block <NUM> where a time (in milliseconds (ms) is counted since the last hall state change. The time since previous is stored as a previous time at block <NUM>. A hall coverage range (i.e., an amount of coverage around the shaft covered by the particular hall sensor) is divided by the stored previous time to determine a degree/millisecond value at block <NUM>. This indicates how much distance since the last hall transition occurred in motor degrees, thus providing a hall coverage range.

The method <NUM> also proceeds from block <NUM> to block <NUM> where a value theta (which represents an angle of rotation of the shaft of the motor <NUM>), the hall coverage range (from block <NUM> and dependent on the number of bad hall sensors), and the minimum and maximum values for theta (i.e., the min/max rotor position for current hall state) are reset at a change in hall state. At block <NUM>, a value in degrees/millisecond (i.e., the speed) is added or subtracted from the coverage range depending on the direction to theta every millisecond (i.e., the calculated rotor position). At block <NUM>, the theta values are confined to minimum and maximum values if exceeded. At block <NUM>, an artificial hall signal is set based on the theta (i.e., the current rotor position) value (or confined theta values). According to one or more embodiments described herein, the artificial hall signals are generated from a calculated theta that represents an estimated rotor position based on minimum and maximum values for theta (i.e., min/max rotor position for hall state), a previous theta (i.e., an old estimated rotor position), and speed of the rotor, which can be measured degrees/millisecond, for example.

The method <NUM> also proceeds from block <NUM> to block <NUM> (see <FIG>), where a speed and position of the shaft of the motor <NUM> are calculated based on signals from the hall sensors <NUM>.

For example, the speed and position are compensated for based on the number of hall signals that are good. For example, for three good hall sensors (see <FIG>, <FIG>), each state transition is worth <NUM> hall pulse or <NUM>+/- to position. For two good hall sensors (see <FIG>, <FIG>, <FIG>), certain state transitions equate to <NUM>+/- hall pulse while others are <NUM>+/- hall pulses to position. If only one hall sensor is good, all transitions will equate to <NUM>+/- hall pulses.

Speed is similar to position in the sense that two good hall sensors result in the measured speed being multiplied by <NUM>/<NUM>, and for one good hall sensor, speed is adjust by multiplying by <NUM>. This allows for continued accurate positioning of the shaft of the motor <NUM> and the maintaining of speed control throughout the shaft's movement. Without accurate position or speed, the gate crossing mechanism <NUM> would exhibit erratic and/or slow movement and/or overrun position in the top and bottom of the movement of the gate <NUM>.

At block <NUM>, a number of hall pulses in a sampling window are counted for calculating the speed. At block <NUM>, a multiplier (e.g., <NUM>/<NUM> for two good hall sensors, <NUM> for one good hall sensor) is applied based on a number of bad hall sensors.

At block <NUM>, a transition from the previous hall sate is determined (see <FIG>). At block <NUM>, it is determined whether there are <NUM> or <NUM> bad hall sensors. At block <NUM>, if one bad hall sensor is determined, <NUM> or <NUM> pulses are added to the position depending on the previous hall coverage range (see block <NUM>). At block <NUM>, if two bad hall sensor are determined, <NUM> pulses are added to the position according to the hall state change.

The embodiments described herein may be implemented as one or more systems, methods, and/or computer program products at any possible technical detail level of integration. The computer program product may include a computer readable storage medium (or media) having computer readable program instructions thereon for causing a processor to carry out the computer-implemented method of the present invention.

The various components, modules, blocks, engines, etc. described herein can be implemented as instructions stored on a computer-readable storage medium, as hardware modules, as special-purpose hardware (e.g., application specific hardware, application specific integrated circuits (ASICs), application specific special processors (ASSPs), field programmable gate arrays (FPGAs), as embedded controllers, hardwired circuitry, etc.), or as some combination or combinations of these. According to aspects of the present disclosure, the various components, modules, blocks, engines, etc. described herein can be a combination of hardware and programming. The programming can be processor executable instructions stored on a tangible memory, and the hardware can include a processing device for executing those instructions. Thus a system memory can store program instructions that when executed by the processing device implement the engines described herein. Other engines can also be utilized to include other features and functionality described in other examples herein. In examples, the features and functions described herein can be implemented as an algorithm in an FPGA using a hardware description language. That is, one or more of the blocks of the method <NUM> can be implemented on or using an FGPA according to one or more embodiments described herein. Similarly, one or more of the blocks of the method <NUM> can be implemented on or using a general purpose processor, either individually and/or in combination with an FPGA, as described herein.

Various embodiments of the invention are described herein with reference to the related drawings. Various connections and positional relationships (e.g., over, below, adjacent, etc.) are set forth between elements in the following description and in the drawings. These connections and/or positional relationships, unless specified otherwise, can be direct or indirect, and the present invention is not intended to be limiting in this respect. Accordingly, a coupling of entities can refer to either a direct or an indirect coupling, and a positional relationship between entities can be a direct or indirect positional relationship.

Additionally, the term "exemplary" is used herein to mean "serving as an example, instance or illustration. " Any embodiment or design described herein as "exemplary" is not necessarily to be construed as preferred or advantageous over other embodiments or designs. The terms "at least one" and "one or more" may be understood to include any integer number greater than or equal to one, i.e. one, two, three, four, etc. The terms "a plurality" may be understood to include any integer number greater than or equal to two, i.e. two, three, four, five, etc. The term "connection" may include both an indirect "connection" and a direct "connection.

For the sake of brevity, conventional techniques related to making and using aspects of the invention may or may not be described in detail herein. In particular, various aspects of computing systems and specific computer programs to implement the various technical features described herein are well known. Accordingly, in the interest of brevity, many conventional implementation details are only mentioned briefly herein or are omitted entirely without providing the well-known system and/or process details.

Aspects of the present invention are described herein with reference to flowchart illustrations and/or block diagrams.

Claim 1:
A computer-implemented method (<NUM>, <NUM>) for fault detection of at least one hall sensor (<NUM>), wherein the at least one hall sensor (<NUM>) is one of a plurality of hall sensors positioned about a shaft of a motor (<NUM>), such that while the shaft of the motor (<NUM>) rotates, the shaft passes a plurality of fields monitored by each of the plurality of hall sensors (103A, 103B, 103C), the method comprising:
receiving a previous state of the hall sensor (<NUM>);
detecting a current state of the hall sensor (<NUM>); and
predicting a predicted next state of the hall sensor (<NUM>) based on the previous state of the hall sensor (<NUM>), the current state of the hall sensor (<NUM>), and a direction of a shaft of the motor (<NUM>),
comparing the predicted next state with an actual next state of the hall sensor (<NUM>) to determine whether the predicted next state matches the actual next state
performing the receiving, detecting and predicting steps for each of the hall sensors of the plurality of hall sensors (103A, 103B, 103C);
determining whether the predicted next state matches an actual next state for each of the plurality of hall sensors;
responsive to determining that the predicted next state does not match an actual next state, adding an error to an incorrect hall sensor signal (<NUM>) and flagging a hall signal responsive to the hall signal exceeding a maximum threshold; and
responsive to determining that the predicted next state does match an actual next state, subtracting the error from a correct hall sensor signal and unflagging the hall signal responsive to the hall signal being below the maximum threshold.