Patent Description:
Magnetic sensors, e.g. current sensors, proximity sensors, position sensors, etc. are known in the art. They are based on measuring a magnetic field characteristic at one or multiple sensor locations. Depending on the application, the measured field characteristic(s) may be used to deduct another quantity, such as e.g. a current strength, proximity of a so called target, relative position of a sensor device to a magnet, etc..

Many variants of magnetic sensor devices, systems and methods exist, addressing one or more of the following requirements: using a simple or cheap magnetic structure, using a simple or cheap sensor device, being able to measure over a relatively large range, being able to measure with great accuracy, requiring only simple arithmetic, being able to measure at high speed, being highly robust against positioning errors, being highly robust against an external disturbance field, providing redundancy, being able to detect an error, being able to detect and correct an error, having a good signal-to-noise ratio (SNR), etc. Often two or more of these requirements conflict with each other, hence a trade-off needs to be made.

Many arrangements, and associated algorithms for determining a position based on signals obtained from magnetic sensors are known in the art.

Artificial Neural Networks are known, and many types of artificial neural networks exist. They are typically used for solving complex problems for which no simple mathematical formula exists, such as e.g. for image recognition, face recognition, voice recognition, handwriting recognition, computer translation, etc..

Document <CIT> discloses a method for training a recurrent neural network to determine a position of a magnet, wherein the neural network takes as input the signals of two magnetic sensors located in different locations close to the magnet as input data.

It is an object of embodiments of the present invention to provide a method of determining a position of a sensor device which is movable relative to a magnetic source (e.g. a permanent magnet), or vice versa. The movement may have at most <NUM> or at most <NUM> or at most <NUM> degrees of freedom. The movement may for example be a pure translation (i.e. without a rotation) along a straight path or along a predefined curved path (<NUM> degree of freedom), or a pure translation in a plane (<NUM> degrees of freedom), or a pure translation in <NUM> dimensions.

It is also an object of embodiments of the present invention to provide a magnetic position system comprising a magnetic source (e.g. a permanent magnet), and a sensor device which is movable with <NUM> or <NUM> or <NUM> degrees of freedom relative to the magnetic source, or vice versa, wherein the system is configured for determining (or estimating) a position of the sensor device relative to the magnetic source.

It is also an object of embodiments of the present invention to provide a position sensor device for use in such a position sensor system, in case the proposed method is performed inside the position sensor device itself.

It is an object of embodiments of the present invention to provide such a system and method wherein the magnetic source is a relatively small permanent magnet, e.g. for a magnet having an outer dimension (e.g. length or diameter) of at most <NUM>, or at most <NUM>, or at most <NUM>).

It is an object of embodiments of the present invention to provide such a system and method wherein the relative position can be determined with good accuracy in <NUM> or <NUM> or <NUM> directions, e.g. with a mean square error (MSE) smaller than ±<NUM> micron, or smaller than ±<NUM> micron, or smaller than ±<NUM> micron for a measurement range from -<NUM> to +<NUM>; or e.g. with an absolute error or a mean square error smaller than <NUM>% of the measurement range; or e.g. with an absolute error or a mean square error smaller than <NUM>% of a largest outer dimension (e.g. largest of length, width, height) of the magnet.

It is an object of embodiments of the present invention to provide a relatively simple and lightweight system.

It is an object of embodiments of the present invention to provide such a system and method which is less sensitive to external disturbance field, and/or which is less sensitive to temperature variations, and/or which is less sensitive to demagnetisation of the magnet, and/or is less sensitive to mounting errors (e.g. lateral offset and/or height offset in case of 1D movement, e.g. height offset in case of 2D movement), and preferably two or three or all of these characteristics.

It is an object of embodiments of the present invention to provide such a magnetic sensor system using only a single type of magnetic sensors, e.g. using only vertical Hall elements, or only horizontal Hall elements.

It is an object of particular embodiments of the present invention to provide such a magnetic sensor system having only four or from five to nine magnetic sensor elements, and wherein the sensor device is movable with <NUM> degree of freedom relative to a magnetic source, or vice versa.

It is an object of particular embodiments of the present invention to provide such a magnetic sensor system having only four or from five to nine magnetic sensor elements, and wherein the sensor device is movable with <NUM> degrees of freedom relative to a magnetic source, or vice versa.

It is an object of particular embodiments of the present invention to provide such a magnetic sensor system having only four or from five to sixteen magnetic sensor elements, and wherein the sensor device is movable with <NUM> degrees of freedom relative to a magnetic source, or vice versa.

It is an object of embodiments of the present invention to provide such a method and such a system for precise position determination in anti-counterfeiting applications, automotive applications, industrial applications, and/or robotic applications.

These and other objectives are accomplished by embodiments of the present invention.

According to a first aspect, the present invention provides a method of determining a position (e.g. x, or e.g. x, y) of a sensor device which is movable relative to a magnetic source with <NUM> or <NUM> or <NUM> degrees of freedom, (e.g. a translation along a straight line, or a translation along a curved line, or a translation in a planar surface, or a translation in <NUM> directions); the sensor device comprising a semiconductor substrate comprising a plurality of at least two magnetic sensors situated in at least two different locations; the method comprising the steps of: a) obtaining a plurality of sensor signals from said plurality of magnetic sensors; b) determining (or estimating) the position of the sensor device relative to the magnetic source based on said plurality of magnetic sensor signals and/or signals derived therefrom (e.g. pairwise differences signals, gradient signals, a ratio of pairwise difference signals, etc.); wherein step b) comprises: determining said position using an artificial neural network; wherein the artificial neural network is a recurrent neural network (RNN) having a predefined number (N) of trainable parameters, which are trained for determining said position; the number of trainable parameters being at most <NUM> per degree of freedom.

The artificial neural network typically comprises an input layer, one or more hidden layers, and an output layer, and is trained to minimize a "cost function", e.g. to minimize the mean square error or the absolute error of a difference between the real (or ideal) position and the estimated (or predicted) position, over the training data set.

It is a major advantage of the present invention that it does not require the sensor elements to be arranged relative to the magnet in such as way as to provide quadrature signals.

The sensor device may be movable with only <NUM> degree of freedom (e.g. pure translation along a straight line or along a curved line, but no rotation), or may movable with only <NUM> degrees of freedom (e.g. pure translation in a plane, but no rotation), or may be movable with <NUM> degrees of freedom (e.g. pure translation in <NUM> directions, but no rotation).

It was quite surprising that the position accuracy obtainable by this method is surprisingly high, even when using a very simple neural network architecture (e.g. having only <NUM>, or only <NUM>, or only <NUM>, or only <NUM> GRU-units) with a relatively low total number of parameters (e.g. less than <NUM> parameters per degree of freedom, or less than <NUM> trainable parameter per degree of freedom, or less than <NUM> trainable parameters per degree of freedom, or less than <NUM> trainable parameters per degree of freedom, or less than <NUM> trainable parameters per degree of freedom; or at most <NUM> or at most <NUM> at most <NUM> or at most <NUM> or at most <NUM> or at most <NUM> or at most <NUM> or at most <NUM> trainable parameters for a system with exactly <NUM> degrees of freedom; or at most <NUM> or at most <NUM> or at most <NUM> or at most <NUM> or at most <NUM> or at most <NUM> trainable parameters for a system with exactly <NUM> degrees of freedom; or at most <NUM> or at most <NUM> or at most <NUM> or at most <NUM> or at most <NUM> or at most <NUM> or at most <NUM> or at most <NUM> trainable parameters for a system with exactly <NUM> degree of freedom, even when taking into account one or more of the following: having a low or a reduced sensitivity to an external disturbance field (also known as "strayfield"), having a low or a reduced sensitivity to mounting tolerances (e.g. air-gap, lateral offset), having a low or reduced sensitivity to temperature variations.

Even more surprising was the fact that, the recurrent neural network provides highly accurate results, even when the sensor device follows an arbitrary path at an arbitrary speed for which it was not explicitly trained. This offers the huge advantage that the neural network does not need to be trained with various specific movement paths or trajectories or profiles at various specific speeds, but excellent results can also be obtained when the network is trained with a relatively simple movement trajectory (or path or profile), for example a movement at a constant speed. It was found in particular that the position determination (or estimation) is still very good, even if the sensor device is actually moved (or moving) at a speed lower or higher than the speed at which the network was trained).

In some embodiments of the present invention, the sensor device can move with only one or only two degrees of freedom relative to the magnetic source, or vice versa.

In some embodiments of the present invention, the sensor device can move with more than two degrees of freedom relative to the magnetic source, or vice versa, for example with three degrees of freedom.

In an embodiment, the number of degrees of freedom is at most <NUM>, and the number of trainable parameters is at most <NUM>, or at most <NUM>, or at most <NUM>, or at most <NUM>, or at most <NUM>, or at most <NUM>, or at most <NUM>, or at most <NUM>, or at most <NUM>, or at most <NUM>, or at most <NUM>.

In an embodiment, the number of degrees of freedom is at most <NUM>, and the number of trainable parameters is at most <NUM>, or at most <NUM>, or at most <NUM>, or at most <NUM>, or at most <NUM>, or at most <NUM>, or at most <NUM>, or at most <NUM>.

In an embodiment, the number of degrees of freedom is at most <NUM>, and the number of trainable parameters is at most <NUM>, or at most <NUM>, or at most <NUM>, or at most <NUM>, or at most <NUM>.

In an embodiment, the magnetic source is a permanent magnet.

In an embodiment, the sensor device is configured for performing a mere translation with respect to the magnet.

In an embodiment, the magnet is configured for performing a mere translation with respect to the sensor device.

In an embodiment, the magnetic sensors are Hall sensors, e.g. horizontal Hall sensors and/or vertical Hall sensors.

In an embodiment, the semiconductor substrate comprises at least three or only three magnetic sensors situated in at least three different locations.

In an embodiment, the semiconductor substrate comprises at least four or only four magnetic sensors (H1, H2, H3, H4) situated in at least four different locations.

In an embodiment, the semiconductor substrate comprises a two-dimensional array or a two-dimensional arrangement of magnetic sensors (e.g. a 3x3 array, thus <NUM> sensor elements).

The at least three magnetic sensors may be collinear, or may not be collinear.

The at least four magnetic sensors may be collinear, or may not be collinear.

Simulations have shown that the accuracy of a system having a bar magnet (having a length of about <NUM>), wherein the sensor device can move over a distance of about <NUM>, e.g. from -<NUM> to +<NUM>, and wherein the sensor device has a semiconductor substrate of <NUM> to <NUM><NUM>, comprising:.

When only considering the basic function of "determining a position", it can be concluded that these examples produce similar results, but they may act differently under non-ideal circumstances, such as for example, in the presence of an external disturbance field.

It is an advantage of using only Horizontal Hall elements without IMC, inter alia because this is cheaper to produce (no steps are needed to provide IMC).

In an embodiment, the semiconductor substrate comprises at least two 2D-magnetic pixels, each 2D magnetic pixel capable of measuring a first magnetic field component Bx oriented in an X-direction parallel to the semiconductor substrate, and a second magnetic field component Bz oriented in a Z-direction perpendicular to the semiconductor substrate. The at least 2D magnetic pixels are located in two different locations, e.g. spaced apart in the X-direction (i.e. the direction of relative movement), or spaced apart in the Y-direction (i.e. in a direction transverse to the movement), or spaced apart in both the X and Y direction.

In an embodiment, the semiconductor substrate comprises, or comprises only horizontal Hall elements configured for measuring magnetic field components perpendicular to the substrate (i.e. horizontal Hall elements without IMC). The signals obtained from these horizontal elements may be directly input to the neural network. Preferably the sensitivities of the horizontal elements are matched to each other in known manners, e.g. as described in <CIT>), or as described in <CIT>), or in any other suitable way. Alternatively or additionally, if the sensor device has at least three horizontal Hall elements, pairwise differences ΔBz may be input into the neural network. Alternatively or additionally, if the sensor device has three horizontal Hall elements H1, H2, H3, an average Bz_avg of these signals may be determined, and three pairwise differences (Bz1-Bz_avg), (Bz2-Bz_avg), (Bz3-Bz_avg) may be input into the neural network.

In an embodiment, the semiconductor substrate comprises at least one 2D magnetic pixel, each comprising an integrated magnetic concentrator (IMC) and two horizontal Hall elements arranged near a periphery of the IMC and being <NUM>° angularly spaced with respect to each other. Such a sensor device with <NUM> IMC is capable of measuring Bx1, Bz1 at a first sensor location. If the device also has a second 2D magnetic pixel, spaced apart from the first magnetic pixel, it is also capable of measuring Bx2, Bz2 at a second centred location. In an embodiment, the signals obtained from these horizontal elements are input to the neural network. Alternatively or additionally, a sum and/or a difference of the signals obtained from horizontal Hall elements located on opposite sides of the IMC, is input to the neural network. Alternatively or additionally, if the sensor device has at least two IMC's, a pairwise difference ΔBx = (Bx1-Bx2) and/or a pairwise difference ΔBz = (Bz1-Bz2), may be input into the neural network. Optionally also a ratio ΔBx/ΔBz or ΔBz/ΔBx may be input into the neural network. Optionally also a sum of squares sqr(ΔBx)+sqr(ΔBz) may be input into the neural network.

In an embodiment, the semiconductor substrate comprises at least one 3D magnetic pixel, each comprising an integrated magnetic concentrator (IMC) and four horizontal Hall elements arranged near a periphery of the IMC and being <NUM>° angularly spaced with respect to each other. Such a sensor device with <NUM> IMC is capable of measuring Bx1, By1, Bz1 a first sensor location. If the device also has a 3D magnetic pixel, spaced from the first 3D pixel, it is also capable of measuring Bx2, By2, Bz2 at a second sensor location. In an embodiment, the signals obtained from the Hall elements are input into the neural network. Alternatively or additionally, a sum and/or a difference of the signals obtained from horizontal Hall elements located on opposite sides of the IMC, is input to the neural network. Alternatively or additionally, if the sensor device has at least two IMC's, a pairwise difference ΔBx = (Bx1-Bx2) and/or a pairwise difference ΔBy = (By1-By2), and/or a pairwise difference ΔBz = (Bz1-Bz2), may be input into the neural network. Optionally one or more ratio's of these pairwise differences (e.g. ΔBx/ΔBz, ΔBy/ΔBz, ΔBx/ΔBy) may be input into the neural network. Optionally also a sum of squares sqr(ΔBx)+sqr(ΔBy)+sqr(ΔBz) may be input into the neural network.

In an embodiment, the semiconductor substrate comprises, or comprises only vertical Hall elements configured for measuring magnetic field components parallel to the substrate. The vertical Hall elements may all be oriented in the same direction, but that is not absolutely required, and e.g. some may be oriented in the X-direction, and others may be oriented in the Y-direction.

In an embodiment, the semiconductor substrate comprises, or comprises only MR elements (magneto-resistive elements).

In an embodiment, the magnetic source is a two-pole magnet, e.g. an axially or diametrically two-pole ring or disk magnet, or a two-pole bar magnet.

In an embodiment, the magnetic source is a four-pole magnet, e.g. an axially magnetized four-pole ring or disk magnet.

In an embodiment, the network is trained for estimating the position (e.g. 1D position or 2D or 3D position) using training data derived from computer simulations and/or obtained from or derived from actual measurements.

The 1D neural network may be trained in stateless mode, and inference is done in stateful mode. This allows to reduce the on-board memory requirements and to limit the computational complexity. Using this technique, a new prediction is made for each new input sample.

The 2D neural network may be trained in stateful mode, and inference is done in stateful mode.

In an embodiment of the 2D neural network, the measurement range is sampled using loopable Bezier curves, e.g. at least <NUM>, or at least <NUM>, or at least <NUM> Bezier curves.

In an embodiment, the start point and end point of at least some of these Bezier curves is deliberately chosen outside of the actual measurement range. For example, if the X-range and the Y-range extend from -<NUM> to +<NUM>, the neural network may deliberately be trained for positions of X and Y varying from -<NUM> to +<NUM>.

In an embodiment, the network is trained for estimating the position (e.g. 1D position or 2D or 3D position) using training data derived from computer simulations with addition of artificial noise, and/or obtained from or derived from actual measurements, or a combination of both.

Applicant is of the opinion that the addition of artificial noise may be known in areas such as voice recognition or face recognition, but is counter-intuitive for the field of magnetic position sensors, where a position is to be determined accurately. In each case, it is not predictable that addition of artificial noise to a neural network having a relatively simple architecture and/or using a relatively small number of trainable parameters, will improve the accuracy of a position sensor system.

It is noted that "data obtained from actual measurements" contains "actual noise", hence no artificial noise needs to be added, although it may.

In an embodiment, the network is trained for estimating the position using training data derived from computer simulations and/or obtained from or derived from actual measurements, with the addition of a magnetic disturbance field (Bext).

Preferably, however, the values to which a constant value is added to all the sensors for all the sensors magnetic disturbance field is a homogeneous but time-varying disturbance field, meaning that the disturbance vector, or the disturbance value (if all sensors are oriented in the same direction), is the same for all sensor locations. The disturbance field can be added to the simulation results, or can be added to the actual measurement results, or the actual measurements can be performed in an environment having a disturbance field.

In other words, in this embodiment, the training data includes simulated data for a superposition of the magnetic field generated by the magnetic source and a homogeneous external disturbance field. For example, if all the sensor elements measure a Bz-value, then a given value Bz_ext may be added to the sensor signals of all the sensors that are measured substantially simultaneously. The values of Bz_ext may vary over time, e.g. may vary relatively slowly as a function of time, e.g. as a modulated signal, e.g. an amplitude modulated signal, or a frequency modulated signal.

In a particular embodiment, the training data uses at least <NUM> different values of the external field, or at least <NUM> different values, or at least <NUM> different values.

In an embodiment, the network is trained for estimating the position using training data derived from computer simulations and/or obtained from or derived from actual measurements, taking into account a mounting offset, e.g. an offset in the height position (air gap), and/or a lateral offset in case of a 1D sensor system.

In an embodiment, the sensor device furthermore comprises a temperature sensor, and the method further comprises the step of measuring a temperature of the semiconductor substrate using said temperature sensor, and providing the measured temperature to the neural network; and wherein step b) comprises: determining the position of the sensor device relative to the magnetic source based on said plurality of magnetic sensor signals and based on the measured temperature; and wherein the network is trained for estimating the position using training data derived from computer simulations and/or obtained from or derived from actual measurements, for different temperatures.

In an embodiment, step b) further comprises determining one or more additional signals, in one or more of the following ways: by determining one or more pairwise differences, by determining one or more magnetic field gradients, by determining at least one average signal and by subtracting this average signal from at least two measured signals, by normalizing the signals (e.g. by scaling all the signals), by calculating a ratio of two measured signals, by calculating a ratio of two pairwise differences, by calculating a ratio of two gradients, and feeding at least one of these additional signals into the neural network; and wherein the neural network is trained for estimating the position using training data derived from computer simulations and/or actual measurements, and trained with one or more of these additional signals.

In an embodiment, the sensor device comprises at least one group of sensors configured for measuring parallel magnetic field components (e.g. Bz1 and Bz2), and the sensor device is configured for determining one or more pairwise differences for said one or more groups, and the pairwise difference(s) is/are input into the neural network, and the neural network is trained for estimating the position based on training data that includes said one or more pairwise difference(s).

It is an advantage of this embodiment that, if pairwise differences, gradients, or average-compensated data is input into the neural network, the neural network does not need to be trained to reduce or eliminate a magnetic disturbance field.

Likewise, if a ratio of pairwise differences, or a ratio of gradients, or a ratio of average-compensated data is input into the neural network, the neural network does not need to be trained for temperature variations.

In an embodiment, the sensor device is configured for measuring at least two magnetic field components parallel to the semiconductor substrate (e.g. Bx1 and Bx2), and for measuring at least two magnetic field components perpendicular to the semiconductor substrate (e.g. Bz3 and Bz4 at the same locations or at different locations), and the sensor device would be provided for determining two pairwise differences ΔBx=(Bx2-Bx1) and ΔBz=(Bz2-Bz1), and/or a ratio of these pairwise differences, e.g. R1=(ΔBx/ΔBz) or R2=(ΔBz/ΔBx), and the neural network would be configured to receive <NUM> input signals, namely Bx1, Bx2, Bz1, Bx2, ΔBx and ΔBz, or to receive <NUM> input signals: namely Bx1, Bx2, Bz1, Bx2, ΔBx, ΔBz and R1, or to receive <NUM> input signals: namely Bx1, Bx2, Bz1, Bx2, ΔBx, ΔBz and R2.

In an embodiment, the recurrent neural network comprises one to four Gated Recurrent Units GRU-units. The GRU may use a tanh function and/or a sigmoid function.

A "GRU-node" is known in the art, and stands for "Gated Recurrent Unit", which is typically used for linguistic applications such as speed recognition, text classification, textual analysis, etc., and inter alia for this reason, but it is not a trivial choice for use in a position sensor system.

It came as a complete surprise that, using four Hall sensor signals as input, and using a GRU-network, only <NUM> parameters need to be trained, and yet, the accuracy is very comparable with that of "Kalmann-filtering" (which is often considered the "state of the art"), but can be calculated approximately <NUM> times faster, mainly thanks to the low number of trainable parameters.

The GRU or GRU's may be implemented in hardware, e.g. as described in <CIT>), incorporated herein by reference in its entirety.

Preferably the GRU uses a time-series of at least <NUM> frames, or at least <NUM> frames, or at least <NUM> frames, or at least <NUM> frames. As can be seen in <FIG>, the accuracy of the position-estimate can be improved by choosing a larger time-series.

In an embodiment, the sensor device is movable relative to the magnetic source along a straight line or along a curved line. In this case the method is a "method of determining a 1D position".

In an embodiment, the neural network has only one output node (for providing the estimated position value), and the hidden layers comprise only a single GRU-unit. In this case only about <NUM> to <NUM>, e.g. about <NUM> parameters need to be trained.

In an embodiment, the sensor device is movable relative to the magnetic source in a two-dimensional plane. In this embodiment, step b) may comprise determining a first coordinate (x) along a first axis (X), and a second coordinate (y) along a second axis (Y), preferably perpendicular to the X-axis. In this case the method is a "method of determining a 2D position". The neural network may have only two output nodes, and the hidden layers may comprise only two or only four GRU-units.

In an embodiment, the sensor device is movable relative to the magnetic source in three directions. In this embodiment, step b) may comprise determining a first coordinate (x) along a first axis (X), and a second coordinate (y) along a second axis (Y), preferably perpendicular to the X-axis, and a third coordinate (z) along a third axis (Z) preferably perpendicular to the X and Y axis. In this case the method is a "method of determining a 3D position". The neural network may have only three output nodes, and the hidden layers may comprise only three or only six GRU-units.

According to a second aspect, the present invention also provides a position sensor system comprising: a magnetic source (e.g. a permanent magnet); a sensor device comprising a semiconductor substrate comprising a plurality of at least two magnetic sensors situated in at least two different locations, or at least for magnetic sensors situated in at least two different locations (e.g. each measuring Bx and Bz); a processing circuit configured for performing a method according to the first aspect.

According to a second aspect, the present invention also provides a position sensor device comprising: a semiconductor substrate comprising at least two magnetic sensors spaced apart from each other, and configured for providing at least two magnetic sensor signals; and a processing circuit configured for performing a method according to the first aspect.

In this embodiment, the processing circuit is incorporated inside the position sensor device, e.g. in the form of a module with multiple chips, but preferably in the form of a single package.

In an embodiment, the position sensor device further comprises an Al accelerator for executing the neural network.

The Al accelerator may be implemented in the analog domain or the digital domain.

In an embodiment, the artificial neural network is implemented in software, executed by an embedded digital processor.

The processor is preferably a <NUM>-bit processor, or a <NUM>-bit processor with floating point capabilities.

The terms top, under and the like in the description and the claims are used for descriptive purposes and not necessarily for describing relative positions.

In this document, the abbreviation "DOF" means "Degrees of Freedom".

In this document, the abbreviation "ANN" means "Artificial Neural Network".

In this document, the abbreviation "RNN" means "Recurrent Neural Network".

In this document, the abbreviation "LSTM" means "Long Short-Term Memory Network".

In this document, the abbreviation "GRU" means "Gated Recurrent Unit".

In this document, the abbreviation "MSE" means "Mean Square Error", and is expressed in [mm], unless mentioned otherwise.

In this document, unless explicitly mentioned otherwise, the term "magnetic sensor device" or "sensor device" refers to a device comprising at least two magnetic sensor elements, preferably integrated in a semiconductor substrate. The sensor device may be comprised in a package, also called "chip", although that is not absolutely required.

In this document, the term "sensor element" or "magnetic sensor element" refers to a single vertical Hall element or a single horizontal Hall element or a single magneto-resistive element (e.g. a GMR element or an XMR element).

In this document, the term "magnetic sensor" or "magnetic sensor structure" can refer to a group of components or a sub-circuit or a structure capable of measuring a magnetic quantity, such as for example a group of at least two magnetic sensor elements, or a Wheatstone-bridge containing four MR elements.

In certain embodiments of the present invention, the term "magnetic sensor" or "magnetic sensor structure" may refer to an arrangement comprising one or more integrated magnetic concentrators (IMC), also known as integrated flux concentrators, and two or four or eight horizontal Hall elements arranged near the periphery of the IMC.

In this document, the expression "in-plane component of a magnetic field vector" and "orthogonal projection of the magnetic field vector in the sensor plane" mean the same. If the sensor device is or comprises a semiconductor substrate, this also means "magnetic field components parallel to the semiconductor substrate".

In this document, the expression "out-of-plane component of a vector" and "Z component of the vector" and " orthogonal projection of the vector on an axis perpendicular to the sensor plane" mean the same.

Embodiments of the present invention are typically described using an orthogonal coordinate system which is fixed to the sensor device, and having three axes X, Y, Z, where the X and Y axis are parallel to the substrate, and the Z-axis is perpendicular to the substrate.

In this document, the expression "spatial derivative" or "derivative" or "spatial gradient" or "gradient" are used as synonyms. In the context of the present invention, a gradient is typically determined as a difference between two values measured at two different locations which may be spaced apart by a distance in the range from <NUM> to <NUM>. In theory the gradient is calculated as the difference between two values divided by the distance "dx" between the sensor locations, but in practice the division by "dx" is often omitted, because the measured signals need to be scaled anyway.

For this reason, the terms "magnetic field gradient" and "pairwise difference" can be used interchangeably,
In this document, horizontal Hall plates are typically referred to by H1, H2, etc., signals from these horizontal Hall plates are typically referred to by h1, h2, etc.; vertical Hall plates are typically referred to by V1, V2, etc.; and signals from these vertical Hall plates are typically referred to by v1, v2, etc..

In this document, the expression "the neural network is trained" means that the neural network is trained using "machine learning" (ML) or using a deep learning technique. Software for deep learning are known in the art, and are commercially available, e.g. from Google Inc.

In this document, the expression "stateful neural network" means that prediction of the output signal(s) is done on a per-frame-basis.

In the present invention, a network topology having a single hidden layer with "n1" components, is noted as: "GRU n1", see for example <FIG>, <FIG>, <FIG>.

In the present invention, a network topology having two hidden layers, the first hidden layer having "n1" GRU-components, and the second hidden layer having "n2" GRU components, is noted as: "GRU n1, n2", see for example <FIG>, <FIG>, <FIG>.

In the present invention, a network topology having three hidden layers, the first hidden layer having "n1" GRU-components, the second hidden layer having "n2" GRU components, the third hidden layer having "n3" GRU components, is noted as: "GRU n1, n2, n3", see for example <FIG>.

The present invention relates in general to the field of magnetic position sensor systems, devices and methods. More in particular, the inventors had the task to find a method and a system for precise position determination of an object that can move with only <NUM> or only <NUM> or only <NUM> degrees of freedom (DOF), for use in anti-counterfeiting applications, automotive applications, industrial applications, and/or robotic applications.

The inventors came to the idea of using an artificial neural network, but in order to be commercially viable, the solution has to be "relatively lightweight", e.g. in terms of number of layers, in terms of number of nodes, and/or in terms of trainable parameters. Thus, they had to solve the problem of finding whether a Neural Network could be built that is relatively lightweight, and at the same time, provides a high accuracy, and can be processed almost in real-time (e.g. within <NUM>), in other words, they had to find out whether such a lightweight neural network exists, and/or how many trainable parameters would be needed to achieve a sufficient accuracy for the envisioned applications, etc..

Artificially Neural Networks (ANN) exist already since several decades. According to some sources at least six types of Artificial Neural Networks are being used in Machine Learning: (<NUM>) Feedforward Neural Network, (<NUM>) Radial basis function Neural Network, (<NUM>) Kohonen Self Organizing Neural Network, (<NUM>) Recurrent Neural Network (RNN), (<NUM>) Convolutional Neural Network, and (<NUM>) Modular Neural Network.

Artificially Neural Networks (ANN's) are typically used for solving highly complex mathematical problems, such as e.g. facial recognition, voice recognition, handwriting-recognition. These networks typically requires tens of thousands of nodes, and need to be trained with many thousands of training images or sound clips. The execution of such a network requires a considerable amount of time.

At least for the reasons above, the use of an Artificial Neural Network is not an obvious choice for building a position sensor system having only <NUM> or only <NUM> or only <NUM> degrees of freedom, not because it was believed that such a system would not work, but because it was believed that such a network would be highly complex, and/or would require considerable processing power and/or memory resources and/or processing time, and for these and other reasons would not be suitable for use in automotive applications, industrial applications, and/or robotic applications where a nearly real-time response, e.g. a response within about <NUM>, is an absolute requirement.

<FIG> is a perspective view of a position sensor arrangement <NUM> comprising a magnetic source <NUM> and a sensor device <NUM>. The magnetic source of <FIG> is a two-pole magnet, but magnets having more than two poles may also be used, for example having four poles. The shape of the magnet shown is a bar magnet, but that is not required for the present invention to work, and other magnet shapes can also be used, for example a ring magnet or a disk magnet. The sensor device is preferably a packaged integrated chip. In the example of <FIG>, the sensor device <NUM> has a fixed position, and the magnet <NUM> is movable along a straight line X. In other embodiments, the magnet <NUM> may have a fixed position, and the sensor device is movable relative to the magnet <NUM>. The present invention is limited to position sensor systems allowing a movement having only <NUM> degree of freedom (e.g. illustrated in <FIG>), or having only <NUM> degrees of freedom (e.g. illustrated in <FIG>), e.g. a pure translation along a straight line, or a pure translation along a curved line, or a pure translation in a plane XY, or having only <NUM> degrees of freedom (not shown), e.g. a pure translation in <NUM> dimensions. In preferred embodiments of the sensor arrangement of <FIG>, the position in the Y-direction (transverse offset) is preferably constant and equal to zero, and the position in the Z-direction (in the height direction) is also preferably constant and typically has a value in the range from <NUM> to <NUM>, or in the range from <NUM> to <NUM>, but due to mounting tolerances the actual value of Y and Z may be slightly different.

<FIG> shows a high-level block-diagram of a classical position sensor device <NUM>, which can be used in the position sensor system of <FIG> to determine the position of the magnet <NUM> relative to the sensor device <NUM>. The sensor device comprises a first magnetic sensor providing a first signal s1, e.g. a sine-like signal, and a second magnetic sensor providing a second signal s2, e.g. a cosine-like signal. The first and second magnetic sensor may be two horizontal Hall elements spaced apart in the X-direction, or two vertical Hall elements spaced apart in the X-direction. The sensor device <NUM> may comprise a "front-end" <NUM> configured for biasing and reading-out the sensor elements, and for digitizing the measured signals s1, s2 using an analog-to-digital convertor (ADC). The digitized signals may be further processed using an arctangent function in block <NUM>, and the result may be "linearity-corrected" in a "post-processing" block <NUM>, for example using a look-up-table (LUT) with optional interpolation, or using a piece-wise-linear approximation, optionally with programmable data points. Such circuits are known in the art, and hence need not be explained in more detail here. It is noted that the partitioning of the various functions over the blocks <NUM>, <NUM> and <NUM> is somewhat arbitrary, e.g. because the functions of the blocks <NUM> and <NUM> may be implemented in hardware or in software executed by a programmable processor, and the ADC may be considered a separate block situated between the front-end <NUM> and the programmable processor, etc. The main purpose of <FIG> is to show that a classical solution to determine the position X of the magnet <NUM> typically comprises a goniometric function and a post-processing step, contrary to solutions proposed by the present invention, which will be described further.

<FIG> show the magnitude of magnetic field components Bx, By, Bz as would be measured at various locations (x, y) in a plane XY at a distance of about <NUM> from the two-pole bar magnet <NUM> of <FIG>. The amplitude is expressed in arbitrary units. <FIG> is a grayscale picture. <FIG> is a dithered picture, provided for illustrative purposes. Such graphs can be obtained by actual measurements, or by computer simulations. In the example shown in <FIG>, the graphs provide amplitudes of Bx, By and Bz for X-values and Y-values ranging from -<NUM> to +<NUM>, while the measurement range for the system shown in <FIG> is limited from -<NUM> to +<NUM>. It shall be clear that this is only an example, and embodiments of the present invention may use other magnets.

<FIG> is a high-level block-diagram of a position sensor system proposed by the present invention, configured for determining the position of a sensor device (e.g. the sensor device <NUM> of <FIG>) relative to a magnetic source (e.g. the magnet <NUM> of <FIG>), or vice versa, for a sensor arrangement having only <NUM> or only <NUM> or only <NUM> degrees of freedom, such as for example the arrangement <NUM> shown in <FIG>, or the system <NUM> shown in <FIG>. The magnetic source is not shown in <FIG>.

The proposed system <NUM> comprises a plurality of at least two, or at least three, or at least four magnetic sensors. The magnetic sensors may be Hall elements, e.g. horizontal Hall elements, vertical Hall elements, magneto-resistive (MR) elements, or combinations hereof. The system <NUM> further comprises a "biasing and readout-circuitry" for obtaining signals from the magnetic sensors, e.g. comprising one or more of: a current source, a voltage source, a Wheatstone-bridge, etc. The biasing and readout circuit may be part of a front-end block <NUM>, which may be identical to or different from the front end block <NUM> of <FIG>. The block <NUM> may also comprise at least one amplifier (not shown), and/or provisions for sensitivity-correction of the various sensor elements. The system <NUM> may also comprise at least one analog-to-digital converter ADC, which may be part of the front end block <NUM>, but does not have to be. The magnetic sensors and the biasing and readout circuit will typically be implemented in a sensor device, e.g. an integrated sensor chip. The sensor device may further comprise a temperature sensor, and the block <NUM> may be further configured for performing a temperature correction of the measured signals.

According to an important aspect of the present invention, the system <NUM> comprises a trained Artificial Neural Network (ANN), configured for processing signals obtained from the magnetic sensor elements, and/or signals derived therefrom. The ANN may be implemented partially in hardware and partially in software, or completely in hardware or completely in software. Part of the ANN may even be implemented in the analog domain, e.g. using a so called hardware accelerator.

In an embodiment, the system <NUM> comprises an analog hardware accelerator. In this case, the front end <NUM> may be configured to provide analog signals to the hardware accelerator, and to digitize at least one output of the hardware accelerator using at least one ADC, and to further process these digitized signals using a digital circuit and/or a programmable processor.

In an embodiment, the system <NUM> comprises a digital hardware accelerator. In this case, the front end <NUM> may comprise an ADC, and be configured to provide digital signals to the digital hardware accelerator, and be configured to further process at least one digital output provided by the hardware accelerator using a digital circuit and/or a programmable processor.

In an embodiment, the system <NUM> does not comprise a hardware accelerator. In this case, the front end <NUM> may comprise an ADC, and be configured to provide digital signals to a programmable processor, which performs the algorithm of the ANN completely in software.

From the above, it can be understood that the ANN block <NUM> may be implemented in various ways, for example:.

In some embodiments, the sensor device comprises a temperature sensor, but the temperature correction is not performed by the front-end, but is performed by the ANN.

In all embodiments of the present invention, the system <NUM> uses an artificial neural network (ANN) <NUM> trained for determining a 1D or a 2D or a 3D position, based on signals obtained from magnetic sensors and/or signals derived therefrom, and optionally also based on a temperature signal.

While not explicitly shown in <FIG>, when the ANN <NUM> is performed by an external device, of course the sensor device and said external device would have to be communicatively connected, e.g. using a wired interface or a wireless interface. Any suitable interface can be used to establish such communication. Such interfaces are well known in the art, and are not the main focus of the present invention, and are therefore not described in more detail.

<FIG> schematically illustrate various examples of generating "training data" that may be used for training the artificial neural network of <FIG>, based on computer simulations.

The examples given assume that the sensor device has four horizontal Hall plates, providing signals Bz1, Bz2, Bz3, Bz4, but as already mentioned above, the present invention is not limited thereto, and may have less than four or more than four sensor elements, and/or may use other magnetic sensor elements, or a mixture of magnetic sensor elements. The number, the type and the location of the sensor elements in the simulation has to correspond with the actual number, type and locations of the sensor elements in the sensor device. A few examples are shown in <FIG>.

The present invention proposes to use a recurrent neural network (RNN). The RNN is trained with a relatively large set of "training data". The "training data" can be seen as a list (or file, or sequence) of groups or sets of corresponding values (also referred to as "frames"). A frame for a 1D position sensor system, wherein the sensor device comprises four horizontal Hal elements, may consist of <NUM> values: (X, Bz1, Bz2, Bz3, Bz4), wherein X is the position of the sensor device, and Bz1 to Bz4 are the values (or signals) obtained from the four magnetic sensor elements for said position.

The values for the positions X are not randomly chosen, but are chosen assuming that the sensor device follows a certain "trajectory". Several examples of 1D trajectories are illustrated in <FIG>, referred to herein as: "constant speed", "teleport", "sine", "flat top", "bouncing", "sharp top", and "step" respectively. The trajectories may be continuous and change relatively smoothly, or may change abruptly. For the 1D position sensor system, a "trajectory" can thus be represented by a list (or file) of positions (e.g. X) that the sensor assumes at various moments in time. In the example of <FIG> each trajectory contains one hundred thousand samples (also written as <NUM>), but that is not absolutely required, and trajectories with a smaller or larger number of positions will also work. During some experiments a training set of <NUM> frames was used, during other experiments <NUM> frames were used to train the network. Both provided adequate results, but of course, the present invention is not limited hereto, and in certain embodiments the neural network of a position sensor system with only <NUM> degree of freedom may be trained with a training set containing a different number of frames, e.g. from one thousand (<NUM>) to ten million (<NUM>) frames, or from ten thousand (<NUM>) to one million (<NUM>) frames, or from twenty thousand (<NUM>) to five hundred thousand (<NUM>) frames, or from fifty thousand (<NUM>) to two hundred thousand (<NUM>) frames.

For each position X, the values Bz1, Bz2, Bz3, Bz4 that the magnetic sensors of the envisioned sensor device having a particular size and sensor arrangement would measure when the sensor device is at that position, can be determined for example by a simulation tool.

In the example of <FIG>, the neural network is "only" trained to detect the position X, based on measured sensor signals, and thus the network is not explicitly trained for an external disturbance field, temperature variations, a lateral offset, a height offset, random noise, or combinations hereof. In other words, the simulation tool of <FIG> would assume for example that the magnet generates a magnetic field as illustrated in <FIG>, that the value of Y (lateral offset) is exactly equal to <NUM>, that the value of Z (height) is exactly equal to <NUM>, that the magnetic external disturbance field (Bext) is exactly equal to zero, that the temperature is constant, and that there is no random noise, but in practice these assumptions are only approximately true due to various reasons such as mounting tolerances, environmental effects, etc. This the most simple example, and provides "basic functionality".

In the example of <FIG>, the simulation tool allows to input not only values for the position X, but also for an external magnetic disturbance field. In case the sensor device only contains horizontal Hall elements, only the Bz component of the external disturbance field is relevant: Bz_ext. It is assumed that the magnetic disturbance field, if present, is a homogeneous field, meaning that the disturbance is the same for all sensor locations. Since the values of Bz_ext is not explicitly measured by the sensor device, its value is not explicitly stored in the training data file, but the values of Bz1 to Bz4 are changed because of the external disturbance field. In an embodiment, the trajectory file contains a plurality of sub-trajectories, e.g. in the range from <NUM> to <NUM> sub-trajectories, or from <NUM> to <NUM> sub-trajectories, or from <NUM> to <NUM> sub-trajectories, or from <NUM> to <NUM> sub-trajectories, or from <NUM> to <NUM> sub-trajectories, or from <NUM> to <NUM> sub-trajectories, or from <NUM> to <NUM> sub-trajectories, or from <NUM> to <NUM> sub-trajectories, or from <NUM> to <NUM> sub-trajectories. The X-values of each sub-trajectory may be as or similar to the trajectories illustrated in <FIG>, and the value of the external disturbance field Bz_ext along this sub-trajectory may be constant. But different sub-trajectories would have different values for the external disturbance field Bz_ext.

In the example of <FIG>, the simulation tool allows to input not only values for the position X, but also a temperature value, e.g. a temperature of the semi-conductor substrate. In an embodiment, a single temperature on the semiconductor substrate is measured, and the simulation assumes that the temperature distribution over the semiconductor surface of the sensor device is "stable". It is noted that this assumption allows that the temperature is different at the various sensor locations. Since the value of the temperature is explicitly measured by the sensor device, its value "Temp" is added to the training data file as an additional input. In an embodiment, the trajectory file contains a plurality of sub-trajectories, e.g. in the range from <NUM> to <NUM> sub-trajectories, or <NUM> to <NUM>, or <NUM> to <NUM>, or <NUM> to <NUM>, or <NUM> to <NUM>, or <NUM> to <NUM>, or <NUM> to <NUM>, or <NUM> to <NUM>, or <NUM> to <NUM>. The X-values of each sub-trajectory may be as or similar to the trajectories illustrated in <FIG>, and the value of the temperature Temp along this sub-trajectory may be constant. But different sub-trajectories would have different values for the temperature.

In the example of <FIG>, the simulation tool allows to input not only values for the position X, but also values for lateral offset. Since the sensor device cannot measure the lateral offset itself, the value of Yoffset is not explicitly added to the training data, but is "incorporated" into the Bz-values. In order to cope with various lateral offset-values, an approach with a plurality of sub-trajectories can be applied here as well.

In the example of <FIG>, the simulation tool allows to input not only values for the position X, but also values for noise. The idea behind this embodiment is to try to train the neural network to cope with random noise, or pseudo-random noise, as will occur for example with Hall sensors. Since the noise will typically be different for each sensor and for each moment in time, the simulation tool may take as input five values: one for the position X, and one noise value for each sensor element. It is of course also possible to implement the noise addition in the simulation tool itself.

Various non-idealities (e.g. external disturbance field, temperature variations, lateral offset, noise, etc.) may also be combined, as illustrated in <FIG>.

Alternatively, or additionally, the neural network may be trained with a combination (e.g. the sum) of the various "training data files" obtained from <FIG>, or any subset thereof.

<FIG> illustrate that training data can also be generated by performing actual measurements in a test-setup, instead of, or in addition to using a computer simulation. It is noted that actual measurements automatically include noise.

<FIG> shows a relatively simple example wherein a sensor device is physically moved to known positions X relative to a magnet, and the values measured by the sensor are output and stored in a file, along with the position X. In an experiment the sensor device was physically moved to two thousand (<NUM>) different positions over a <NUM> distance (from -<NUM> to +<NUM>) for training the neural network, and the results were good.

<FIG> shows a slightly more complicated example wherein furthermore a magnetic disturbance field is applied to the sensor. As described above in relation to <FIG>, the sensor device may be moved to follow a plurality of sub-trajectories, and a different magnetic disturbance field may be applied for each of these sub-trajectories.

<FIG> shows an even more complicated example, wherein furthermore the external temperature of the sensor device is varied.

It is of course also possible to combine training data obtained by simulation, and training data obtained by actual measurement.

<FIG> shows a block-diagram of position sensor system <NUM> which can be considered a variant of the block-diagram of <FIG>, further comprising a "pre-processing" block <NUM>, configured for receiving one or more or all of the measured signals, and configured for generating "additional signals" (e.g. pairwise difference signals, gradient signals, an average signal, a difference between a measured signal and the average signal, a ratio of measured signals, a ratio of difference signals, a ratio of gradients, a normalized signal, and the like), and for providing one or more or all of these additional signals to the Artificial Neural Network <NUM>.

As an example of a sensor device having four horizontal Hall elements H1 to H4, the normalized signals may be determined in accordance with the following set of formulas: <MAT> <MAT> <MAT> <MAT> <MAT> wherein sum is the sum-signal, h1 to h4 are the signals obtained from the Hall sensors H1 to H4 respectively, a1 is a normalized version of h1, a2 is a normalized version of h2, etc. The signals sum, a1, a2, a3, a4 are additional signals which can be fed into the ANN.

The neural network <NUM> of <FIG> receives more input signals than the neural network <NUM> of <FIG>, and thus needs to be trained with other training data. The training data described in <FIG> can also be used here, but needs to be extended with additional information. An extended version of the training data of <FIG> may comprise a plurality of frames containing the following values: (x, Bz1, Bz2, Bz3, Bz4, sum, a1, a2, a3, a4) or containing the following values: (x, Bz1, Bz2, Bz3, Bz4, Temp, sum, a1, a2, a3, a4).

In another example of a sensor device having four horizontal Hall elements H1 to H4, the additional data may be determined in accordance with the following set of formulas: <MAT> <MAT> <MAT> and the training data may comprise a plurality of frames containing the following values: (x, Bz1, Bz2, Bz3, Bz4, a1, a2, a3) or (x, Bz1, Bz2, Bz3, Bz4, Temp, a1, a2, a3).

But of course the present invention is not limited to these examples.

The pre-processing block <NUM> may be implemented in the analog domain, in the digital domain, or partly in the analog domain (e.g. pairwise subtraction) and partly in the digital domain (e.g. calculating a ratio). Depending on the implementation, the pre-processing block <NUM> may comprise an analog to digital convertor (ADC), an arithmetic or logical unit (ALU), etc..

Using a pre-processing block <NUM> in front of the ANN may yield more accurate results.

<FIG> show a few examples of sensor arrangements as may be used in embodiments of the present invention, but of course the present invention is not limited to these examples. Results of position sensor systems using these sensor arrangements, and variants thereof, will be discussed further. In the examples shown in <FIG>, the sensor devices contain only horizontal Hall elements, without flux concentrators. Two different die sizes were simulated: a first die size having an area of about <NUM> x <NUM>, a second die having an area of about <NUM> x <NUM>. Various numbers of Hall elements in various arrangements were simulated, for example: 1x2 on a horizontal (see e.g. <FIG>), 1x4 on a horizontal as two pairs (see e.g. <FIG>), 1x4 on a diagonal equidistantly (see e.g. <FIG>), on the <NUM> crossings of a regular 2x2 grid (see e.g. <FIG>), on the <NUM> crossings of a regular 3x3 grid (see e.g. <FIG>), <NUM> pseudo-random locations (see e.g. <FIG>), but the present invention is not limited to these examples.

<FIG> shows a plot with the simulated signal waveforms of the signals h1. h9 was would be measured by the sensor elements H1. H9 of the sensor device shown in <FIG>, when moving along the X-axis. As can be seen, the signals h4, h5 and h6 are close to zero, hence the locations of the sensor elements H4, H5, H6 for this particular sensor system is a rather poor choice. This example shows that using more Hall elements does not necessarily imply that the results will be more accurate, if their positions are poorly chosen.

<FIG> shows the simulated signals of <FIG> with artificially added noise, e.g. Gaussian noise. Simulations have surprisingly shown that the accuracy of the predicted location X may in fact be slightly improved when the ANN is trained with data containing added noise. This was very surprising.

<FIG> shows a graph illustrating an influence of the "length of the time-series" of several recurrent neural networks (RNN) on the mean absolute error (MAE in mm) of a linear position sensor system as shown in FIG. 1A, when using a sensor device having an area of <NUM> x <NUM>, and having 3x3 = <NUM> horizontal Hall elements, arranged as shown in <FIG>.

Three plots are shown: a first plot (indicated with a black circle) using an RNN <NUM><NUM> architecture (<NUM> layers each having <NUM> components) with <NUM> trainable parameters, a second plot (indicated with a black triangle) using an LSTM <NUM> architecture (<NUM> layer with <NUM> component) with <NUM> trainable parameters; a third plot (indicated by a black square) using a GRU <NUM> architecture (<NUM> layer with <NUM> component) with <NUM> trainable parameters.

It is noted that neural networks having a Recurrent Neural Network (RNN) architecture, a "Long Short-Term Memory" (LSTM) architecture and a "Gate Recurrent Unit" architecture, as well as methods for training them using Deep Learning techniques are know per se in the art of artificial neural networks, but as far as known to the inventors, such networks are not used in the field of magnetic position sensor systems. Yet, as can be appreciated from <FIG>, the absolute error of the position determined (or predicted or estimated) by the artificial neural network can surprisingly be reduced by increasing the "length of the time-series" of the Recurrent Neural Network. Furthermore, and this came as another big surprise, the number of trainable parameters for such networks can be surprisingly low, especially when compared to neural networks for facial recognition, voice recognition, handwriting recognition, etc. requiring tens or even hundreds of thousands of trainable parameters.

As can be seen from <FIG>, a "time-series with a length of <NUM>" already provides some improvement, a time-series having a length of at least <NUM> may reduce the mean absolute error (MAE) by a factor of about <NUM>, but time-series having a length of at least <NUM> or at least <NUM> can also be used.

Other simulations were performed, in order to test the influence of other parameters, such as die size, and number of Hall elements. For these simulations, a time-series of length equal to <NUM> was used (indicated herein by "t50") in order to get the "best possible" results, and/or to reduce the influence of the time-series length as much as possible. This does not mean, however, that in practical implementations, a time-series of <NUM> needs to be required, but a time-series having a length of <NUM> or even smaller, e.g. <NUM> or <NUM> or <NUM> may also be used.

For completeness, it is noted that recurrent networks (RNN) can work in either stateless mode, or in stateful mode. "Stateless mode" means that the network resets its internal states after a given time-series. In this case, the network needs to be fed an entire time-series, and the length of the time-series matters. In "stateful mode" a new prediction is produced for each new "frame", and the internal states are not reset after the time-series. In this case, the input of the NN is not a time-series of multiple frames, but only a single frame. For this mode, the time-series length is not applicable.

In preferred embodiments, the RNN is configured to work in stateful mode.

<FIG> shows a graph illustrating the influence of the number of Hall elements on the mean absolute error (MAE). These simulations are performed for a sensor device having a die size of <NUM> x <NUM>.

Three plots are shown: a first plot (indicated with a black circle) using a Dense <NUM><NUM><NUM> architecture (i.e. a RNN with <NUM> hidden layers, each comprising <NUM> fully connected nodes), a second plot (indicated with a black triangle) using a GRU <NUM> architecture (i.e. a single GRU component) having a time-series of length <NUM> (t50); and a third plot (indicated by a black square) using a GRU <NUM><NUM><NUM> architecture (i.e. a RNN with <NUM> hidden layers, each comprising <NUM> fully connected nodes, each node comprising a GRU-component).

This graph can be interpreted as follows:.

From the above, it can be concluded that the "GRU <NUM> t50" architecture in combination with a sensor device having <NUM> to <NUM> sensor elements, preferably having <NUM> to <NUM> sensor elements, seems to be the best solution in terms of "high accuracy" and "low complexity". Taking into account the conclusions of <FIG>, that the MAE of an neural network with a "GRU <NUM> architecture" does not dramatically increase when the length of the time-series is reduced to a value of at least <NUM>, the same conclusion applies to a "GRU <NUM>" architecture using a time-series of at least <NUM>.

<FIG> shows a graph illustrating the influence of the die size on the mean absolute error (MAE). In this plot, "die size <NUM>" has an area of <NUM> x <NUM>, and "die size <NUM>" has an area of <NUM> x <NUM>. The simulations were done for two of the three architectures that yielded the smallest MAE in <FIG>, namely "GRU <NUM> t50" and GRU <NUM><NUM><NUM>", in order to see how these curves would change when the die size is decreased. It is noted that the curves with the black triangle and the black square of <FIG> are the same as those of <FIG>, but a different vertical scale is used.

As can be seen in <FIG>, the MAE-curve with the black triangle for the "GRU <NUM> t50" architecture will shift slightly upwards, (i.e. the MAE will slightly increase) when the die size is decreased from <NUM><NUM> to <NUM><NUM>, but the MAE is typically worsened only by a factor of about <NUM>.

The MAE-curve with the black square for the "GRU <NUM><NUM><NUM> t50" architecture, does not seem to be much influenced by the die size either. According to the plot, the MAE seems to increase for certain points, and decrease for other points, but as mentioned above, this may be due to the fact that the position of some of the sensor elements may be a bit unfortunately chosen.

Not surprisingly, the MAE curves with the black square and the black diamond for the "GRU <NUM><NUM><NUM> t50" are below the MAE curves with the black triangle and the black circle for the "GRU <NUM> t50" architecture, but the network complexity of the latter is much, much simpler.

It is also interesting to see that the accuracy does not decrease by the same factor as the scaling factor of the die size area, but the price of a silicon die typically does. This allows a skilled person to make a trade-off between die size and accuracy.

From the above, it can be concluded that the die size is not critical for the invention to work.

<FIG> shows a block-diagram of a trained artificial neural network ANN <NUM> proposed by the present invention, as may be used in a magnetic position sensor system having only <NUM> degree of freedom, e.g. as illustrated in <FIG>, <FIG> and <FIG>, and <FIG>, or variants thereof, e.g. comprising another kind of magnet, or wherein the path of relative movement is curved, etc..

This ANN has an input layer, a single hidden layer comprising a single GRU-component, and an output layer.

The input layer is configured for receiving a plurality of magnetic sensor signals (e.g. h1, h2, h3, h4), and optionally also a temperature signal, for example from a front end block <NUM> (see <FIG> and <FIG>), and optionally also "additional signals" such as pairwise differences, a gradient, a ratio, etc. for example from a pre-processing block <NUM> (see <FIG>).

For a 1D position sensor system, the output is only a single position, e.g. a value X.

The GRU is trained for determining a 1D position, e.g. a value of a position x along an X-axis, using training data, e.g. any of the training data described in <FIG>, or combinations thereof.

<FIG> is a table showing a typical number of trainable parameters for a 1D position sensor system comprising a single GRU (e.g. as illustrated in <FIG>), depending on the number of input signals. The number of trainable parameters may increase if "additional signals" are added.

During the experiments, a particular GRU component was used from a particular vendor, for which the number of trainable parameters N of a single GRU layer can be calculated in accordance with the following formula: N = <NUM>(n<NUM> + n*m + 2n), where m is the number of inputs, n is the number of outputs. The output of the GRU layer equals the number of units. The output of the GRU layer is also attached to the output layer, which is a dense layer with its own parameters. A dense layer is sometimes also called a "fully-connected" layer. As an example, if the NN needs to estimate one variable (e.g. x) based on the signals obtained from four magnetic sensors (m=<NUM>), the number of trainable parameters for the GRU layer is N=<NUM>*(<NUM>+<NUM>+<NUM>)=<NUM>*<NUM>=<NUM>. For a network with a single output, the output layer may e.g. have <NUM> additional parameters, thus <NUM> trainable parameters in total. If the NN also uses the temperature as an input, then n=<NUM>, m=<NUM>, and N=<NUM>*(<NUM>+<NUM>+<NUM>)=<NUM>*<NUM>=<NUM> for the GRU layer, and assuming <NUM> parameters for the dense layer, yields <NUM> trainable parameters in total. If the NN gets <NUM> magnetic sensor signals, and <NUM> temperature signal, and three "additional signals" (e.g. two two gradients, and a ratio of these gradients) as inputs, then n=<NUM>, m=<NUM>, and N=<NUM>*(<NUM>+<NUM>+<NUM>)=<NUM>*<NUM>=<NUM> for the GRU layer. Assuming the output layer has <NUM> additional parameters, that means <NUM>+<NUM>=<NUM> trainable parameters in total.

This number may be slightly different for GRU components obtained from another supplier, and therefore should be used only as an estimate. Whatever the exact number, it came as a total surprise that an artificial neural network with a number of parameters smaller than <NUM>, or smaller than <NUM>, or smaller than <NUM>, or smaller than <NUM>, or smaller than <NUM>, or smaller than <NUM>, or smaller than <NUM>, or smaller than <NUM>, or smaller than <NUM>, or smaller than <NUM> can provide very accurate results.

According to the simulation results, the mean absolute error (MAE) for the 1D position sensor system of FIG. 1A, comprising a two-pole magnet having a length of approx. <NUM>, and comprising a sensor device having a die size area in the range from about <NUM><NUM> to about <NUM><NUM>, and having at least <NUM> or at least <NUM> horizontal Hall elements, and having a neural network architecture as shown in <FIG>, is only about <NUM> to about <NUM>, for a measurement range from -<NUM> to +<NUM>, i.e. an absolute accuracy in the order of about <NUM>% to about <NUM>%.

It came as a surprise that such a good accuracy can be reached with such an extremely simple neural network, having much less than a thousand trainable parameters, e.g. less than <NUM> trainable parameters, or even less than <NUM> parameters. It is almost unbelievable that a sensor device having only four sensor elements in combination with an ANN having only a single GRU, can do the job with only about <NUM> to <NUM> trainable parameters.

It is noted that the ANN can be executed very fast. As an example, during an experiment, it required only about <NUM> to execute an ANN of <FIG> with <NUM> trainable parameters, on a laptop having an intel core i7-<NUM> running at a speed of <NUM>, completely in software. This number should only be used as a rough estimate, to get an impression of the order of magnitude.

It is expected that performing the same (or a similar) algorithm on a fast digital signal processor (DSP), optionally with at least some hardware acceleration (analog or digital) will also be sufficiently fast for many applications.

<FIG> show examples of "frame sequences" which can be used to train the neural network of a 1D position sensor system. These sequences were already discussed above in relation to <FIG>. The illustrative sequences shown in <FIG>, are referred to herein as: (a) "constant speed", (b) "teleport", (c) "sine", (d) "flat top", (e) "bouncing", (f) "sharp top", and (g) "step" respectively. What was not yet discussed above, and came as another big surprise is that simulation experiments have shown that the position predicted by the ANN was highly accurate, even when the sensor device performed movements quite different from any of those shown in <FIG>, for which the network was not explicitly trained.

<FIG>, <FIG> and <FIG> show three block-diagrams of other trained artificial neural networks (ANN) <NUM>, <NUM>, <NUM> as may be used in a magnetic position sensor system having only <NUM> degree of freedom, e.g. as illustrated in <FIG>, <FIG> and <FIG>, and <FIG>, or variants thereof, e.g. comprising another kind of magnet, and/or wherein the path of relative movement is curved, etc..

Each of these neural networks <NUM>, <NUM>, <NUM> of <FIG> can be seen as a variant of the ANN <NUM> of <FIG>, the main difference being that these ANN comprise <NUM> GRU or <NUM> GRU components instead of only one. While the number of trainable parameters of these networks is higher than that of <FIG>, these networks are thus more powerful, and should be able to provide at least equally good results, maybe slightly better.

<FIG>, <FIG> and <FIG> show a typical number of trainable parameters for these networks, depending on the number of input signals, but of course, the present invention is not limited to these examples.

<FIG> is a perspective view of a position sensor system <NUM> having two degrees of freedom (DOF). The system <NUM> comprises a magnet <NUM> for generating a magnetic field, and a sensor device <NUM> for sensing the magnetic field using a plurality of magnetic sensors.

The 2D-position sensor system <NUM> can be seen as a variant of the 1D-position sensor system <NUM> of <FIG>, the main difference being that:.

Most or everything else described above is also applicable here, mutatis mutandis.

For example, the block-diagram of <FIG>, <FIG>, and <FIG> are also applicable for a 2D position sensor system; Since the sensor device <NUM> comprises at least four sensor elements, the sensor arrangement of <FIG> cannot be used, but those of <FIG> can be used.

Suitable trajectories for creating training data will be described in <FIG>. Illustrative network-topologies will be described in <FIG> and <FIG>. An example of achievable accuracy will be illustrated in <FIG>. The number of trainable parameters and corresponding achievable accuracy will be described in <FIG> for a sensor having only four sensor elements.

In preferred embodiments of the 2D-position sensor system, the movement is a "pure translation" without a rotation. While not absolutely required, preferably the magnet <NUM> is a four pole magnet, e.g. an axially magnetized four pole disk magnet.

<FIG> shows a plurality of <NUM> Bezier curves, which may be used as "trajectories" for creating "training data" for training the neural network for determining a 2D position. Indeed, where a single "trajectory" suffices for a 1D position sensors system, typically a relatively large number of trajectories is used (in the example of <FIG>: <NUM> trajectories) for training a 1D position sensors system.

Much of what has been described above in <FIG> is also applicable here, e.g. that each trajectory may have number of sub-trajectories for coping with external disturbance field, and/or temperature variations, and/or noise, except that the trajectories of a 2D position sensor system should vary the values of x and y over the measurement range, rather than keeping one of them constant. As can be seen in <FIG>, the variables of x and y are varied over an area covering at least the measurement range, defined as a square region in which both variables x and y can range from -<NUM> to +<NUM>.

It is noted that other trajectories can of course also be used, optionally in combination with Bezier curves, for example a set of trajectories parallel to the X-axis, a set of trajectories parallel to the Y-axis, a set of trajectories forming an angle of about <NUM>° with the X-axis, a set of trajectories forming an angle of about <NUM>° with the X-axis, etc..

Similar as described in <FIG>, the training data can be provided by a simulation tool, which would not only take the value of X as an input, but also a value of Y, and optionally also a value of an external disturbance field, a temperature, and noise. Similar as described in <FIG>, the training data may also be provided by physically moving a magnet relative to a sensor device, and capturing the sensed data.

<FIG> shows a block-diagram of a trained artificial neural network ANN <NUM> proposed by the present invention, as may be used in a magnetic position sensor system <NUM> having only <NUM> degrees of freedom, e.g. as illustrated in <FIG>, or variants thereof, e.g. comprising another kind of magnet.

The ANN <NUM> has an input layer, a single hidden layer comprising two GRU-components, and an output layer.

The output layer needs to provide two independent output values, e.g. x and y.

The two GRU's are trained for determining a 2D position, using training data as described above (in relation to <FIG>).

<FIG> shows a typical number of trainable parameters for this network, depending on the number of input signals, but of course, the present invention is not limited to these examples.

<FIG> shows an example of resulting predictions of a neural network having a topology as shown in <FIG>, which was trained using the <NUM> trajectories shown in <FIG>. The ideal position is shown by a circle having a radius of <NUM>; the positions estimated by the ANN <NUM> are indicated by dots close to the circle. As can be seen, the absolute error for this example is about <NUM>, which is about <NUM>% of the measurement range. This ANN has two GRUs, each GRU unit having only <NUM> trainable parameters, the total network having <NUM> trainable parameters in total, and has an MSE of <NUM> on average.

<FIG> shows a block-diagram of another recurrent neural network <NUM> proposed by the present invention for estimating a 2D position of a position sensor system, e.g. as shown in <FIG>. This network can be seen as a variant of the network <NUM> of <FIG>, having the same input layer and the same output layer, but having two hidden layers, each having two GRU units, thus four GRU units in total.

<FIG> is a table showing the number of trainable parameters for a 2D position sensor system comprising a two-pole magnet and a sensor device having four magnetic sensors arranged on a straight line (e.g. as illustrated in <FIG>), and having at least two GRU units organized in one or more GRU layers each having one or more GRU units, and an estimate of the resulting accuracy in terms of MSE in mm.

As can be seen, the MSE for these sensor systems is about <NUM> to <NUM>, which is about <NUM>% of the measurement range. This table shows that using a sensor arrangement with four sensor collinear elements, in combination with the two-pole magnet of <FIG>, does not lead to highly accurate results, irrespective of the number of GRU units used. But of course, if an accuracy of about <NUM>% is good enough for certain applications, then a simple ANN having a single layer with <NUM> GRU units (as illustrated in <FIG>), the single layer having <NUM> parameters, can be used (first row of <FIG>).

<FIG> is a table showing the number of trainable parameters for a 2D position sensor system comprising a two-pole magnet <NUM> and a sensor device <NUM> having four magnetic sensors arranged on a regular 2x2 grid (e.g. as illustrated in <FIG>), and having one or more layers, each having one or more GRU units, and an estimate of the resulting accuracy (in terms of MSE in mm).

As can be seen, the MSE for these sensor systems is about <NUM>, which is about <NUM>% of the measurement range, when using an ANN having a single hidden layer with only <NUM> GRU-unit, e.g. as shown in <FIG>. Comparison with the table of <FIG> shows that locating the four sensors on a grid does not really help to improve the accuracy, if the ANN contains only <NUM> GRU unit.

However, when the ANN contains one hidden layer with at least two GRU units, the MSE drops to a value of at most <NUM>, which is smaller than <NUM>% of the measurement range. The result for <NUM> layers with <NUM> GRU units is <NUM>. As can be seen, the MSE can be further decreased by a factor of about <NUM>, but at the expense of using more GRU units and a larger number of trainable parameters.

The best trade-off between accuracy versus complexity seems to be the solution provided on the second row of this table, namely an ANN architecture as illustrated in <FIG>, requiring only <NUM> parameters in total. But of course, the present invention is not limited thereto, and other solutions will also work, for example an ANN having two or more hidden layers, each having at least two GRU units. And of course, solutions with more than four sensor elements will also work.

<FIG> shows a block-diagram of another recurrent neural network <NUM> as may be used for estimating a 1D or 2D or 3D position of a sensor arrangement, e.g. as shown in <FIG> or <FIG>. The network has three hidden layers, each comprising four GRU units, thus twelve GRU units in total. <FIG> and <FIG> show some performance characteristics of these networks.

<FIG> show a flow-chart of a method <NUM> for determining a position (e.g. a 1D position or a 2D or a 3D position) of a sensor device <NUM>, <NUM> which is movable relative to a magnetic source <NUM>, <NUM>, or vice versa, with only <NUM> or only <NUM> or only <NUM> degrees of freedom, e.g. a 1D movement along a straight line or along a curved path, or a 2D movement in a plane, or a 3D movement in <NUM> directions, e.g. a pure translation without a rotation.

In a variant of the method, the sensor device may further comprise a temperature sensor, and the ANN may further take into account the measured temperature.

Claim 1:
A method (<NUM>) of determining a position (x; x,y) of a sensor device (<NUM>; <NUM>) which is movable relative to a magnetic source (<NUM>; <NUM>) with <NUM> or <NUM> or <NUM> degrees of freedom, or vice versa;
the sensor device comprising a semiconductor substrate comprising a plurality of at least two magnetic sensors (H1, H2) situated in at least two different locations;
the method comprising the steps of:
a) obtaining (<NUM>) a plurality of sensor signals (h1, h2) from said plurality of magnetic sensors (H1, H2);
b) determining (<NUM>) the position of the sensor device (<NUM>; <NUM>) relative to the magnetic source (<NUM>; <NUM>) based on said plurality of magnetic sensor signals (h1, h2) and/or signals derived therefrom;
step b) comprises determining said position (x; x, y) using an artificial neural network;
wherein the artificial neural network is a recurrent neural network having a predefined number (N) of trainable parameters, which are trained for determining said position;
characterised in that
the sensor device furthermore comprises a temperature sensor,
and wherein the method further comprises the step of measuring a temperature (Temp) of the semiconductor substrate using said temperature sensor, and providing the measured temperature as an additional input signal to the neural network;
and wherein the number of trainable parameters is at most <NUM> per degree of freedom.