Sensor device for anomaly detection by machine learning and related control method
By integrating microcontroller units and processing circuits in sensor devices and using decision trees to classify data vectors, the problem of sensor devices relying on external computers during abnormal detection in the prior art is solved, and more efficient computing resource utilization and autonomous detection capabilities are achieved.
Patent Information
- Application Number
- CN202411168634.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2024-08-09
- Filing Date
- 2024-08-23
- Publication Date
- 2025-02-28
AI Technical Summary
When existing sensor devices perform abnormal detection, they require external computer support to perform training steps, resulting in excessive consumption of computing resources of the microcontroller, and the continuous execution of inference steps increases the complexity of the device.
A sensor device is designed, including a microcontroller unit and a sensor, which is coupled to the monitored device through a transducer to generate signals for detecting the function of the device. The processing circuit of the device includes a conversion level, a data generation level and a decision level. The microcontroller unit programms the decision level to classify the data vectors through a decision tree to realize abnormal detection.
This solution reduces dependence on external computers, uses processing circuits on the sensor to perform learning and inference steps, reduces the consumption of the microcontroller, and improves the device's autonomous detection capabilities.
Smart Images

Figure CN119536044A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to sensor devices for abnormality detection through machine learning and related control methods. Background Art
[0002] As is well known, there are currently many types of sensors available for use, which enable corresponding physical quantities to be monitored. In addition, as is well known, many sensors enable the occurrence of abnormal situations to be detected.
[0003] For example, it is known that sensors are coupled to corresponding equipment (e.g., mechanical equipment) in use in order to detect corresponding quantities (e.g., acceleration). In addition, it is well known that in order to be able to quickly take corresponding actions (e.g., shut down the equipment), it is now very necessary to be able to automatically (i.e., without operator supervision) detect the occurrence of abnormal behavior of the equipment coupled thereto by means of sensors.
[0004] For example, known sensors include corresponding microcontrollers that can be programmed to implement machine learning algorithms for identifying anomalies that occur in the operation of a device coupled to the sensor based on the value of a quantity detected by the sensor. As is known, these algorithms generally provide for the execution of an initial training step and a subsequent inference step; moreover, since the training step is generally cumbersome from a computational point of view, it is generally performed outside the sensor (e.g., by an external computer), while the inference step is performed by a microcontroller that has previously received a model of the relevant machine learning algorithm, wherein the model means a computer code encoding the structure and parameters / thresholds generated by the machine learning algorithm during the training step. However, these solutions often require the support of an external computer to perform the training step, and additionally provide a microcontroller to acquire sensor data and continuously perform the inference step, resulting in a consumption of the computing resources of the microcontroller, and resulting in a high consumption of the same microcontroller.
[0005] It is therefore an object of the present disclosure to provide a sensor device which at least partially overcomes the disadvantages of the prior art. Summary of the invention
[0006] In some embodiments, a sensor device includes a microcontroller unit and a sensor, the sensor including a transducer that can be coupled to a device to be monitored and is configured to generate at least one signal that indicates a physical quantity that depends on the functioning of the device to be monitored. The sensor also includes a processing circuit, which includes: a conversion stage, which is configured to generate a series of samples of physical quantities based on the signal; a data generation stage, which is configured to generate a series of data vectors based on the series of samples in a manner that can be programmed by a microcontroller unit, each data vector is formed by a corresponding set of values of multiple programmable quantities; and a decision stage; and wherein the microcontroller unit is configured to program the decision stage so that the decision stage is configured to classify the data vectors by executing a decision tree, the decision tree having a structure and multiple thresholds; the sensor device is also configured to operate: in a configuration mode, wherein the microcontroller unit programs the data generation stage; and then in a calibration mode, wherein the microcontroller unit obtains the corresponding set of data vectors, determines the corresponding range of allowable values for each programmable quantity and based on the corresponding set of data vectors, and then programs the threshold according to the range of allowable values; and then in a detection mode, wherein the decision stage alternately classifies the corresponding data vector as normal or abnormal by executing the decision tree based on the programmed threshold.
[0007] In some embodiments, a method for controlling a sensor device is provided, the sensor device comprising a microcontroller unit and a sensor, the sensor comprising a transducer, the transducer being coupleable to a device to be monitored and being configured to generate at least one signal, the at least one signal indicating a physical quantity, the physical quantity depending on the function of the device to be monitored. The method comprises: generating a series of samples of the physical quantity by the sensor according to the signal; generating a series of data vectors by the sensor according to the series of samples in a manner programmable by the microcontroller unit, each data vector being formed by a corresponding set of values of a plurality of programmable quantities; programming the sensor by the microcontroller to classify the data vectors by executing a decision tree, the decision tree having a structure and a plurality of thresholds; programming the generation of the series of data vectors by the microcontroller unit; and then obtaining the set of data vectors by the microcontroller unit, determining a corresponding range of permissible values for each programmable quantity and based on the set of data vectors, and then programming the threshold according to the range of permissible values; and then classifying the data vectors alternately as normal or abnormal by the sensor by executing the decision tree based on the programmed thresholds. In some embodiments, a collection of non-transitory computer-readable media stores content that, when executed by one or more processors, causes a method for controlling a sensor device to be performed. The sensor device includes a microcontroller unit and a sensor, the sensor including a transducer that can be coupled to a device to be monitored and is configured to generate at least one signal indicating a physical quantity that depends on a function of the device to be monitored. The method includes: generating a series of samples of a physical quantity according to a signal by a sensor; generating a series of data vectors according to the series of samples by the sensor in a manner that can be programmed by a microcontroller unit, each data vector being formed by a corresponding set of values of multiple programmable quantities; programming the sensor by the microcontroller to classify the data vectors by executing a decision tree, the decision tree having a structure and multiple thresholds; programming the generation of the series of data vectors by the microcontroller unit; and then obtaining the set of data vectors by the microcontroller unit, determining the corresponding range of allowable values for each programmable quantity and based on the set of data vectors, and then programming the threshold according to the range of allowable values; and then classifying the data vectors alternately as normal or abnormal by the sensor by executing the decision tree based on the programmed threshold. BRIEF DESCRIPTION OF THE DRAWINGS
[0008] For a better understanding of the present disclosure, embodiments will now be described, by way of non-limiting examples only, with reference to the accompanying drawings, in which:
[0009] Figure 1 and Figure 5 A block diagram of a sensor device is shown;
[0010] Figure 2 A block diagram of a portion of a sensor device is shown;
[0011] Figure 3A and Figure 3B shows representations of the same decision tree with different thresholds; and
[0012] Figure 4 A flow chart showing operations performed by the present sensor device. DETAILED DESCRIPTION
[0013] Figure 1 A sensor device 1 is shown comprising a corresponding transducer, which, by way of example only, and without loss of generality, is formed by an accelerometer 2, of a known type, and which serves to convert an acceleration into a corresponding electrical signal sX(t) of analogue type. In use, the accelerometer 2 is mechanically coupled (e.g. fixed) to a device 19 to be monitored (e.g. a machine comprising movable parts), so that the acceleration converted by the accelerometer 2 is indicative of the function of the device 19 to be monitored; Figure 1 In , this mechanical coupling is indicated by a dashed line.
[0014] The sensor device 1 also includes a processing circuit 3, which is an application specific integrated circuit (ASIC), electrically coupled to the accelerometer 2 and implements a configurable stage 6 and a memory stage 8. Although not shown, the processing circuit 3 and the accelerometer 2 can be formed in the same package, which is mechanically coupled to the device to be monitored 19; moreover, the processing circuit 3 and the accelerometer 2 form an acceleration sensor 7.
[0015] The configurable stage 6 includes an interface stage 10, a local memory 12, a calculation stage 14 and an analog-to-digital front end 16. Figure 1 Not shown in detail, but they are operably coupled to each other.
[0016] The sensor device 1 further comprises a microcontroller unit 20 and, in use, may be coupled to an external sensor; by way of example only, Figure 1 In the example shown, the external sensor is formed by a temperature sensor 30 which is used in a manner known per se to generate a series of temperature samples T[n]. Although not shown, the microcontroller unit 20 and the temperature sensor 30 may be formed in a respective package in addition to the package containing the processing circuit 3 and the accelerometer 2.
[0017] The microcontroller unit 20 can be programmed by an external device (not shown; for example, a computer) so that the microcontroller unit 20 in turn programs the configurable level 6. In this regard, it is contemplated that the microcontroller unit 20 can be programmed by an external device so that the microcontroller unit 20 in turn stores in the local memory 12 of the configurable level 6 filtering parameters, feature lists, control parameters, thresholds and instructions encoding the structure of the decision tree, i.e. instructions that, when executed, cause the execution of a decision tree having such a structure, the structure being understood as a series of conditional instructions (e.g., conditional instructions of the IF-ELSE type) and instructions that are executed when the conditions provided by the conditional instructions are met, this structure starting from a vector of values and being executed based on the aforementioned thresholds, as explained in more detail below. Furthermore, the microcontroller unit 20 can access the memory level 8, i.e., it can read the memory level 8; furthermore, the memory level 8 can be written by the configurable level 6.
[0018] In more detail, the interface level 10 is based on I 2 C communication protocol implementation such as a slave type interface, I 2 The I C communication protocol allows the configurable level 6 to establish a communication channel with the microcontroller unit 20, so as to allow the microcontroller unit 20 to program the configurable level 6; in addition, the interface level 10 communicates with the microcontroller unit 20 according to the I C communication protocol. 2 The C communication protocol implements a master type interface, which allows the configurable stage 6 to establish a communication channel with the temperature sensor 30, thereby allowing the configurable stage 6 to acquire a succession of temperature samples T[n]. Furthermore, in use, the configurable stage 6 receives an electrical signal sX(t), based on which the analog-to-digital front end 16 generates the aforementioned succession of samples X[n] of acceleration, i.e. it performs an analog-to-digital conversion.
[0019] Regarding the computing stage 14, it is configured as follows Figure 2 shown.
[0020] In detail, the calculation stage 14 implements a filtering stage 40 that receives acceleration samples X[n] and generates at least a series of filtered acceleration samples X′[n], implementing a first digital filter (e.g., of low-pass type) applied to the acceleration samples X[n]. In addition, the filtering stage 40 receives a series of temperature samples T[n] and generates at least a series of filtered temperature samples T′[n], implementing a second digital filter (e.g., of low-pass type) applied to the temperature samples X[n]. In addition, the calculation stage 14 implements each of the first digital filter and the second digital filter such that the filter type and the associated coefficients are defined by the above-mentioned filtering parameters, which are stored in the local memory 12 and are set by the external user through the microcontroller unit 20 as described above.
[0021] The calculation stage 14 also implements a feature extraction stage 42, which receives acceleration samples X[n], filtered acceleration samples X′[n], temperature samples T[n] and filtered temperature samples T′[n], based on which it generates a series of feature vectors FV[k] as a function of the control parameters stored in the local memory 12.
[0022] In more detail, the control parameter may indicate, for example, an integer NUM, in which case the feature extraction stage 42 generates a corresponding feature vector FV[k] which is a function of four sets formed by even numbers equal to NUM of the following: i) continuous acceleration samples X[n], ii) continuous filtered acceleration samples X′[n], iii) continuous temperature samples T[n], and iv) continuous filtered temperature samples T′[n]. Without loss of generality, the above four sets refer to the same time interval; therefore, the samples of the four sets can be written as X[n], X′[n], T[n] and T′[n], respectively, where n=n0, n0+1, ... n0+NUM-1. Furthermore, by way of example only, a continuous feature vector FV[k] may be a function of corresponding groups of four sets of samples, where the consecutive groups are disjoint, i.e., they do not share any samples, in which case two continuous feature vectors FV[k] are assumed, such that the samples of the four sets of the first feature vector FV[k] are indexed by n=n0, n0+1, ..., n0+NUM-1, and the samples of the four sets of the second feature vector FV[k] are indexed by n=n0+NUM, n0+NUM+1, ..., n0+2*NUM-1. In this case, the feature vector FV[k] is indexed by n=n0+NUM, n0+NUM+1, ..., n0+2*NUM-1. s / NUM frequency generation, where f s Indicates the frequency with which acceleration samples X[n], filtered acceleration samples X′[n], continuous temperature samples T[n] and filtered temperature samples T′[n] are processed. However, variations are possible in which the consecutive feature vectors FV[k] are functions of corresponding groups of four sets of samples, which are partially superimposed; in this case, two consecutive feature vectors FV[k] are assumed, so that the samples of the four sets of the first feature vector FV[k] are indexed by n=n0, n0+1, ..., n0+NUM-1 and the samples of the four sets of the second feature vector FV[k] are indexed by n=n0+1, n0+2, ..., n0+NUM, for example. In this case, with a value equal to f s In any case, the timing of generating the feature vector FV[k] and the associated selection of the sample set on which the feature vector FV[k] is based are independent of the function of the sensor device 1 and may be varied with respect to what has already been described.
[0023] In more detail, each feature vector FV[k] is composed of a number of elements equal to the number of features of the feature list stored in the local memory 12. In particular, assuming any feature vector FV[k], when calculated based on the four sample sets involved in the feature vector FV[k], each element of the feature vector FV[k] is equal to the value of the corresponding feature of the aforementioned feature list. For example, the sets associated with the feature vector FV[k] formed by the acceleration sample X[n], the filtered acceleration sample X′[n], the temperature sample T[n] and the filtered temperature sample T′[n] are indicated by IN1, IN2, IN3 and IN4, respectively, and the feature list can provide for calculating one or more of the following mathematical quantities for each of the sets IN1, IN2, IN3, IN4: mean, variance, standard deviation, peak-to-peak distance, etc. In general, features can vary from one set to another, and the feature list can also provide the presence of features that each depend on samples of two or more sets.
[0024] The calculation stage 14 also implements a data generation stage 44, which receives at its input acceleration samples X[n], filtered acceleration samples X′[n], temperature samples T[n], filtered temperature samples T′[n], and feature vectors FV[k]. In addition, for each feature vector FV[k], the data generation stage 44 generates a corresponding data vector DV[k], which includes the feature vector FV[k] and may also include additional elements, which are functions of the acceleration samples X[n], the filtered acceleration samples X′[n], the temperature samples T[n], and the filtered temperature samples T′[n], respectively; however, in general, the presence of these additional elements is optional. For example, an embodiment is possible in which the data generation stage 44 is not present, in which case the data vector DV[k] is consistent with the feature vector FV[k].
[0025] In practice, the data vector DV[k] is formed by quantities which are programmable by the microcontroller unit 20 .
[0026] The calculation stage 14 can also be programmed by the microcontroller unit 20 in order to implement a decision stage 46 which receives at input the data vectors DV[k] and applies a decision tree to each data vector DV[k] in order to classify the data vector DV[k].
[0027] In more detail, the decision stage 46 is configured to apply a decision tree to each data vector DV[k], the decision tree having a decision tree structure encoded in the local memory 12 and thresholds stored in (ie programmed in) the local memory 12 .
[0028] By way of example only, Figure 3AA graphical representation of a decision tree is shown, which refers to a simplified case in which each data vector DV[k] is formed by three elements, which are indicated by A, B and C, respectively. Figure 3A In the decision tree structure, each conditional instruction is represented in a purely qualitative manner by a pair of corresponding inequalities that are complementary to each other and vertically aligned, such that if the first inequality is not satisfied, the second inequality is satisfied, and vice versa, and such that when one inequality is satisfied, either the classification is performed or the instructions that are right-indented and in consecutive rows with respect to the inequality are executed alternately.
[0029] also, Figure 3A The decision tree shown classifies the data vector [A, B, C] as normal or abnormal, i.e., it performs binary classification. By way of example only, Figure 3A The thresholds of the decision tree shown in make the decision tree verify whether quantity A is included in the range (-0.1–0.1], and in the negative case, it classifies the data vector as abnormal, while in the positive case, it verifies whether quantity B is included in the range (-0.1–0.1], and in the negative case, classifies the data vector as abnormal, while in the positive case, it verifies whether quantity C is included in the range (0.9–1.1], and in the negative case, classifies the data vector as abnormal, while in the positive case, it classifies the data vector as normal. In other words, the decision tree structure makes it verify in turn whether quantities A, B and C fall within the corresponding range of values (each range is defined by a pair of corresponding thresholds), and classifies the data vector as abnormal when at least one of quantities A, B, C falls outside the corresponding range of values.
[0030] As described above, the sensor device 1 performs Figure 4 The action shown, for example at startup.
[0031] Initially, the sensor device 1 operates in a configuration mode (block 100), in which the microcontroller unit 20 configures the configurable stage 6. In particular, the microcontroller unit 20 stores in the local memory 12: filtering parameters, which define the first digital filter and the second digital filter, and therefore the filtering stage 40; a feature list, which defines the behavior of the feature extraction stage 42; control parameters; instructions encoding the decision tree structure; and initial values of the thresholds, which are, for example, predetermined, so that they are independent of the electrical signal sX(t) and the succession of temperature samples T[n]. It is contemplated that the initial values of the thresholds can be chosen arbitrarily, since they are independent of the function of the sensor device 1; therefore, storing these initial values is optional.
[0032] Thereafter, the sensor device 1 operates in a calibration mode (block 102 ).
[0033] In particular, when the sensor device 1 is operating in the calibration mode, the filtering stage 40 generates a series of filtered acceleration samples X'[n] and a series of filtered temperature samples T'[n], and the feature extraction stage 42 generates the feature vector FV[k], as described above. In addition, when the sensor device 1 is operating in the calibration mode, the data generation stage 44 generates the data vector DV[k] in the aforementioned manner, so that the data vector DV[k] depends in particular on the acceleration samples X[n] and the temperature samples T[n] acquired while the sensor device 1 is operating in the calibration mode, and the corresponding feature vector FV[k]; on the contrary, the decision stage 46 can be inactive.
[0034] In practice, the data vector DV[k] generated by the sensor device 1 while operating in the calibration mode depends inter alia on the filtering parameters and the feature list previously stored in the local memory 12 while the sensor device 1 was operating in the configuration mode. Hereinafter, the data vector DV[k] generated by the sensor device 1 while operating in the calibration mode is referred to as a calibration data vector.
[0035] Furthermore, when the sensor device 1 operates in the calibration mode, the configurable stage 6 writes the calibration data vector to the memory stage 8. Furthermore, when the sensor device 1 operates in the calibration mode, the microcontroller unit 20 reads the memory stage 8 in order to obtain the calibration data vector, and the microcontroller unit 20 calculates updated values for the above-mentioned thresholds, as described below.
[0036] In particular, the microcontroller unit 20 calculates a number of update values equal to twice the number of elements of each calibration data vector, since in the present example the number of thresholds is equal to twice the number of elements of each calibration data vector. In other words, assuming that the i-th element of each calibration data vector (and therefore, more generally, of each data vector DV[k]), where i=1,2,…,NUM_D (where NUM_D denotes the number of elements of each calibration data vector), represents the value of a corresponding quantity, each quantity being associated with two corresponding thresholds defining a corresponding range of permissible values, i.e., a range of values that the quantity can assume when the device 19 to be monitored is operating correctly.
[0037] As described above, for each of the quantities, the microcontroller unit 20 calculates an updated value for the corresponding threshold, for example by setting the updated value equal to μ+n*σ and μ-n*σ, respectively, where n is a positive real number selected by the user, and μ and σ represent the mean and standard deviation, respectively, of the elements of the calibration data vector corresponding to the quantity.
[0038] Alternatively, and again by way of example, for each of the quantities, the microcontroller unit 20 may calculate an updated value for the corresponding threshold value, for example by setting the updated value equal to max+α*(max-min) and min-α*(max-min), respectively, where α is a positive real number selected by the user and min and max represent the minimum and maximum values, respectively, among the elements of the calibration data vector corresponding to that quantity.
[0039] However, in general, the algorithm for determining the updated value of the threshold value, and therefore the range of permissible values, may vary with respect to what has been described.
[0040] Once the updated values of the thresholds are calculated, the microcontroller unit 20 stores these updated values in the local memory 12 of the configurable stage 6. By way of example only, Figure 3B Shows Figure 3A The same decision tree shown with updated values for the thresholds.
[0041] In practice, the decision tree is trained while the sensor device 1 operates in the calibration mode. In practice, it is assumed that while the sensor device 1 operates in the calibration mode, the device 19 to be monitored operates normally.
[0042] Subsequently, the sensor device 1 operates in a detection mode ( Figure 4 104).
[0043] As previously described, when the sensor device 1 operates in the detection mode, the filtering stage 40 generates a series of filtered acceleration samples X′[n] and a series of filtered temperature samples T′[n], and the feature extraction stage 42 generates a feature vector FV[k]. In addition, the data generation stage 44 generates a data vector DV[k], as previously described, so that the data vector DV[k] depends in particular on the acceleration samples X[n] and the temperature samples T[n] acquired while the sensor device 1 operates in the detection mode, and the corresponding feature vector FV[k]. In addition, the data vector DV[k] generated while the sensor device 1 operates in the detection mode depends on the filtering parameters and feature list stored in the local memory 12 while the sensor device 1 operates in the configuration mode.
[0044] Furthermore, when the sensor device 1 operates in the detection mode, the decision stage 46 applies a decision tree to each data vector DV[k], the decision tree being defined by the decision tree structure encoded in the local memory 12 and the updated values of the threshold values stored in the local memory 12. Thus, the decision stage 46 classifies each data vector DV[k] alternately as abnormal or normal; thus, the normal / abnormal classification (in Figure 2sCLASS[k] in the table) respectively indicate the correct / abnormal function of the device 19 to be monitored.
[0045] Furthermore, the configurable level 6 writes the classification of the data vector DV[k] into the memory level 8; the microcontroller unit 20 reads the classification written into the memory level 8 and, when it reads the abnormal classification, detects the occurrence of an abnormality of the device to be monitored 19. Furthermore, in a manner known per se, after reading the abnormal classification, the microcontroller unit 20 can implement a suitable control strategy; for example, the microcontroller unit 20 can warn the user and switch off the device to be monitored 19.
[0046] However, in general, the configurable stage 6 is able to communicate the occurrence of an exception classification to the microcontroller unit 20 in different ways, for example by generating a corresponding interrupt for the microcontroller unit 20 .
[0047] From the foregoing description, the advantages offered by the sensor device 1 are clear. In particular, the sensor device 1 implements an anomaly detection scheme that uses a machine learning algorithm that is not very heavy from a computational point of view, which can therefore be implemented by a processing circuit of a sensor (such as, for example, an accelerometer 7) and can be configured (filters, features and decision tree structures) depending on the device to be monitored. In addition, the scheme provides that the learning step is performed partly by a processing circuit that calculates a calibration data vector and partly by a microcontroller unit that calculates an updated value of a threshold, thereby exploiting the hardware resources available on the sensor without the need to use an external computer. In addition, the inference step is performed by the processing circuit without the need for additional involvement of the microcontroller unit until the moment when a possible anomaly is detected, resulting in a reduction in the consumption of the microcontroller unit.
[0048] Finally, it is obvious that modifications and variations may be made to the sensor device previously described and illustrated without departing from the scope of the present disclosure as defined in the appended claims.
[0049] For example, as previously described, the external sensor may be formed by a different external sensor (e.g. a magnetometer) instead of the temperature sensor 30. Furthermore, the external sensor (in the described example, the temperature sensor 30) may not be present, in which case the processing performed by the calculation stage 14 is modified accordingly.
[0050] Regarding the filtering stage 40, it may receive only a subset of the preceding series of samples; for example, it may receive only acceleration samples X[n]. Furthermore, as previously mentioned, the filtering stage 40 may include multiple filters for each series of input samples.
[0051] With respect to the feature extraction stage 42, the features calculated thereby may be different from those already described. For example, for simplicity, reference is made to Figure 2 In the case shown, features may be calculated only on some of the sets IN1, IN2, IN3 and IN4; thus, variations are possible in which the input to the feature extraction stage 42 differs with respect to the input already described. Moreover, in general, different features, even involving the same series of samples, may be calculated based on different numbers of such samples.
[0052] However, embodiments are possible in which no filtering stage 40 and / or feature extraction stage 42 is present, in which case the data vector DV[k] is modified accordingly.
[0053] Embodiments are also possible in which the accelerometer 2 generates a plurality of electrical signals, for example indicating acceleration along corresponding axes, in which case the digital-to-analog front end 16 generates a plurality of corresponding series of samples which are provided at the input of the filtering stage 40 and which, more generally, can be processed in the same manner as described for the reference series of acceleration samples X[n], thereby contributing to the formation of the data vector DV[k] and thereby affecting the relevant classification.
[0054] Any other protocol (e.g., MIPI I 3 C protocol) instead of I 2 C communication protocol.
[0055] The sensor device 1 may also include further sensors, such as, for example, a gyroscope 60, Figure 5 As shown. The gyroscope 60 generates at least one additional electrical signal sR(t) indicating at least one angular velocity about an axis of rotation; for example, the gyroscope 60 is mechanically coupled to the device to be monitored 19 so that the additional electrical signal sR(t) indicates the angular velocity of the device to be monitored 19. In this case, the analog-to-digital front end 16 also generates a series of samples R[n] of angular velocity, which samples can be processed by the configurable stage 6 in the same manner as described with reference to the acceleration samples X[n], except for any differences in the type of filtering and extraction of relevant features, so as to facilitate the generation of the data vector DV[k]. Although not shown, the gyroscope 60 can be formed in the same package containing the accelerometer 2 and the processing circuit 3.
[0056] Furthermore, as previously mentioned, a different transducer may be used instead of the accelerometer 2, the physical quantity of which depends on the function of the device to be monitored 19. In this case, the transducer may be coupled to the device to be monitored 19 in a different way than that already described; for example, the coupling may be of the electrical type or of the thermal type or of the chemical type, instead of of the mechanical type.
[0057] Furthermore, the configurable stage 6 can write further data to the memory stage 8 for what has been described, thereby allowing such data to be retrieved by the microcontroller unit 20. For example, the configurable stage 6 can also write acceleration samples X[n] to the memory stage 8.
[0058] The configurable stage 6 may also implement other blocks arranged upstream of the filtering stage 40 , such as for example a block (not shown) calculating the norm of the acceleration samples X[n] in order to generate a corresponding series of samples provided to the filtering stage 40 .
[0059] Furthermore, it is possible that the microcontroller unit 20 may allow the user to select from a plurality of decision tree structures; in this case, the microcontroller unit 20 stores in the local memory 12 a code encoding the decision tree structure selected by the user.
[0060] Finally, the order in which some of the aforementioned operations are performed may be changed. For example, since the decision stage 46 may be inactive while the sensor device 1 is operating in the calibration mode, the microcontroller unit 20 may store instructions encoding the decision tree structure in the local memory 12 after the updated values of the thresholds have been calculated before commencing operation in the detection mode.
[0061] In some embodiments, the sensor device (1) comprises a microcontroller unit (20) and a sensor (7), the sensor comprising a transducer (2; 60) which can be coupled to a device (19) to be monitored and is configured to generate at least one signal (sX(t)) indicating a physical quantity which depends on the function of the device (19) to be monitored, the sensor (7) further comprising a processing circuit (3), the processing circuit (3) comprising: a conversion stage (16) which is configured to generate a series of samples (X[n]) of the physical quantity from the signal (sX(t)); a data generation stage (12, 40, 42, 44) which is configured to generate a series of data vectors (DV[k]) from the series of samples (X[n]) in a manner programmable by the microcontroller unit (20), each data vector (DV[k]) being formed by a corresponding set of values of a plurality of programmable quantities; and a decision stage (12, 46); and wherein the microcontroller unit (20) is configured to program the decision stage (12, 46) so that the decision stage (12, 46) is configured to classify the data vector (DV[k]) by executing a decision tree having a structure and multiple thresholds; the sensor device (1) is also configured to operate: in a configuration mode, wherein the microcontroller unit (20) programs the data generation stage (12, 40, 42, 44); and subsequently - in a calibration mode, wherein the microcontroller unit (20) obtains a corresponding set of data vectors (DV[k]), determines a corresponding range of allowable values for each programmable quantity and based on the corresponding set of data vectors (DV[k]), and then programs the threshold value according to the range of allowable values; and subsequently - in a detection mode, wherein the decision stage (12, 46) classifies the corresponding data vector (DV[k]) alternately as normal or abnormal by executing the decision tree based on the programmed threshold value.
[0062] In some embodiments, the data generation stage (12, 40, 42, 44) includes a filtering stage (40) configured to generate at least a series of filtered samples (X'[n]) by applying a digital filter to the samples (X[n]); and wherein the data generation stage (12, 40, 42, 44) is also configured such that the data vector (DV[k]) is a function of the filtered samples (X'[n]); and wherein, when the sensor device (1) operates in a configuration mode, the microcontroller unit (20) programs the digital filter.
[0063] In some embodiments, the data generation stage (12, 40, 42, 44) further comprises a feature extraction stage (42) configured to generate a series of feature vectors (FV[k]) depending on the sample (X[n]); and wherein the data generation stage (12, 40, 42, 44) is further configured such that the data vector (DV[k]) is a function of the feature vector (FV[k]); and wherein, when the sensor device (1) operates in a configuration mode, the microcontroller unit (20) programs the features.
[0064] In some embodiments, the feature extraction stage (42) is configured to calculate the value of each feature of the feature vector (FV[k]) based on the corresponding set of samples (X[n]) or the corresponding set of filtered samples (X'[n]); and wherein each data vector (DV[k]) may include a corresponding feature vector (FV[k]).
[0065] In some embodiments, the sensor device (1) is configured to be coupled to an external sensor (30) configured to generate a series of external samples T[n] indicating a corresponding physical quantity; and wherein the data generation stage (12, 40, 42, 44) is configured such that the data vector (DV[k]) also depends on the external samples T[n].
[0066] In some embodiments, the transducer (2; 60) comprises an acceleration transducer (2) and / or an angular velocity transducer (60).
[0067] In some embodiments, the microcontroller unit (20) is configured to detect an abnormality of the device (19) to be monitored when the data vector (DV[k]) is classified as abnormal.
[0068] In some embodiments, a method for controlling a sensor device (1) comprises a microcontroller unit (20) and a sensor (7), the sensor comprising a transducer (2; 60) which can be coupled to a device (19) to be monitored and is configured to generate at least one signal (sX(t)), the at least one signal (sX(t)) indicating a physical quantity, the physical quantity depending on the function of the device (19) to be monitored, the sensor (7) also comprising a processing circuit (3), the processing circuit (3) comprising: a conversion stage (16) which is configured to generate a series of samples (X[n]) of the physical quantity according to the signal (sX(t)); a data generation stage (12, 40, 42, 44) which is configured to generate a series of data vectors (DV[k]) according to the series of samples (X[n]) in a manner programmable by the microcontroller unit (20), each data vector (DV[k]) consisting of a plurality of programmable values of the quantity a corresponding set of data vectors (DV[k]); and a decision stage (12, 46) which can be programmed by a microcontroller unit (20); the method includes: programming the decision stage (12, 26) by the microcontroller unit (20) so that the decision stage (12, 46) is configured to classify the data vector (DV[k]) by executing a decision tree having a structure and multiple thresholds; the method also includes: programming the data generation stage (12, 40, 42, 44) by the microcontroller unit (20); and then obtaining the set of data vectors (DV[k]) by the microcontroller unit (20), determining the corresponding range of allowable values for each programmable quantity and based on the set of data vectors (DV[k]), and then programming the threshold according to the range of allowable values; and then classifying the data vector (DV[k]) alternately as normal or abnormal by executing the decision tree based on the programmed threshold through the decision stage (12, 46).
[0069] In some embodiments, the data generation stage (12, 40, 42, 44) includes a filtering stage (40) configured to generate at least a series of filtered samples (X'[n]) by applying a digital filter to the samples (X[n]); and wherein the data generation stage (12, 40, 42, 44) is also configured such that the data vector (DV[k]) is a function of the filtered samples (X'[n]); and wherein programming the data generation stage (12, 40, 42, 44) includes programming the digital filter.
[0070] In some embodiments, the data generation stage (12, 40, 42, 44) further comprises a feature extraction stage (42) configured to generate a series of feature vectors (FV[k]) that depend on the sample (X[n]); and wherein the data generation stage (12, 40, 42, 44) is further configured such that the data vector (DV[k]) is a function of the feature vector (FV[k]); and wherein programming the data generation stage (12, 40, 42, 44) comprises programming the features.
[0071] In some embodiments, the feature extraction stage (42) is configured to calculate the value of each feature of the feature vector (FV[k]) based on the corresponding set of samples (X[n]) or the corresponding set of filtered samples (X'[n]); and wherein each data vector (DV[k]) includes a corresponding feature vector (FV[k]).
[0072] In some embodiments, the method further comprises: coupling the sensor device (1) to an external sensor (30) configured to generate a series of external samples T[n] indicating a corresponding physical quantity; and wherein the data generation stage (12, 40, 42, 44) is configured such that the data vector (DV[k]) also depends on the external samples T[n].
[0073] In some embodiments, the method includes: when the data vector (DV[k]) is classified as abnormal, detecting an abnormality of the device (19) to be monitored by the microcontroller unit (20).
[0074] The various embodiments described above can be combined to provide additional embodiments. All U.S. patents, U.S. patent application publications, U.S. patent applications, foreign patents, foreign patent applications, and non-patent publications cited in this specification and / or listed in the application data sheet are fully incorporated herein by reference. If it is necessary to adopt the concepts of various patents, applications, and publications to provide additional embodiments, then the various aspects of the embodiments can be modified.
[0075] Based on the above detailed description, the above and other changes can be made to the embodiments. In general, in the appended claims, the terms used should not be interpreted as limiting the claims to the specific embodiments disclosed in the specification and claims, but should be interpreted to include all possible embodiments and the full range of equivalents to which these claims are entitled. Therefore, the claims are not limited by this disclosure.
Claims
1. A sensor device comprising a microcontroller unit and a sensor, the sensor comprising a transducer, the transducer being coupleable to a device to be monitored and being configured to generate at least one signal, the at least one signal being indicative of a physical quantity, the physical quantity being dependent on a function of the device to be monitored, the sensor further comprising a processing circuit, the processing circuit comprising: a conversion stage configured to generate a series of samples of the physical quantity from the signal; a data generation stage configured to generate, from the succession of said samples, a succession of data vectors, each data vector being formed by a corresponding set of values of a plurality of programmable quantities, in a manner programmable by said microcontroller unit; as well as Decision-making level; and wherein the microcontroller unit is configured to program the decision stage such that the decision stage is configured to classify the data vector by executing a decision tree, the decision tree having a structure and a plurality of thresholds; the sensor device is further configured to operate: in a configuration mode, wherein said microcontroller unit programs said data generation stage; And then in a calibration mode, wherein the microcontroller unit acquires a corresponding set of data vectors, determines for each programmable quantity and based on the corresponding set of data vectors a corresponding range of permissible values, and subsequently programs the threshold value in accordance with the range of permissible values; And then In the detection mode, the decision stage alternately classifies the corresponding data vector as normal or abnormal by executing the decision tree based on the programmed threshold value.
2. A sensor device according to claim 1, wherein the data generation stage includes a filtering stage, the filtering stage being configured to generate at least a series of filtered samples by applying a digital filter to the samples; and wherein the data generation stage is further configured such that the data vector is a function of the filtered samples; and wherein, The microcontroller unit programs the digital filter when the sensor device operates in the configuration mode.
3. The sensor device according to claim 1, wherein the data generation stage further comprises a feature extraction stage, the feature extraction stage being configured to generate a series of feature vectors, the series of feature vectors depending on the sample; and wherein the data generation stage is further configured so that the data vector is a function of the feature vector; and wherein, The microcontroller unit programs the features when the sensor device operates in the configuration mode.
4. The sensor device of claim 3, wherein the feature extraction stage is configured to calculate the value of each feature of the feature vector based on a corresponding set of samples or a corresponding set of filtered samples; and wherein each data vector comprises a corresponding feature vector.
5. The sensor device according to claim 1 is configured to be coupled to an external sensor, the external sensor being configured to generate a series of external samples, the series of external samples indicating a corresponding physical quantity; and wherein the data generation stage is configured so that the data vector also depends on the external samples.
6. The sensor device of claim 1, wherein the transducer comprises at least one of an acceleration transducer or an angular velocity transducer. 7 . The sensor device according to claim 1 , wherein the microcontroller unit is configured to detect an abnormality of the device to be monitored when the data vector is classified as abnormal.
8. A method for controlling a sensor device, the sensor device comprising a microcontroller unit and a sensor, the sensor comprising a transducer, the transducer being coupleable to a device to be monitored and being configured to generate at least one signal, the at least one signal being indicative of a physical quantity, the physical quantity being dependent on a function of the device to be monitored, the method comprising: generating, by the sensor, a series of samples of the physical quantity according to the signal; generating, by said sensor in a manner programmable by said microcontroller unit, from said succession of samples, a series of data vectors, each data vector being formed by a corresponding set of values of a plurality of programmable quantities; programming the sensor, via the microcontroller, to classify the data vector by executing a decision tree, the decision tree having a structure and a plurality of thresholds; programming, by said microcontroller unit, the generation of a series of said data vectors; and subsequently acquiring, by the microcontroller unit, a set of data vectors, determining, for each programmable quantity and based on the set of data vectors, a corresponding range of permissible values, and subsequently programming the threshold value in accordance with the range of permissible values; and subsequently Data vectors are alternatively classified as normal or abnormal by the sensor by executing the decision tree based on the programmed threshold values.
9. The method according to claim 8, further comprising: At least a series of filtered samples are generated by applying a digital filter to the samples, and wherein the data vector is a function of the filtered samples.
10. The method according to claim 8, further comprising: A sequence of feature vectors is generated, the sequence of feature vectors being dependent on the sample; and wherein the data vector is a function of the feature vectors.
11. The method according to claim 10, further comprising: The value of each feature of the feature vector is calculated based on a corresponding set of samples or a corresponding set of filtered samples, and each data vector includes a corresponding feature vector.
12. The method according to claim 8, further comprising: The sensor device is coupled to an external sensor, the external sensor being configured to generate a sequence of external samples, the sequence of external samples being indicative of a corresponding physical quantity, and wherein the data vector also depends on the external samples.
13. The method according to claim 8, further comprising: When the data vector is classified as abnormal, abnormality of the device to be monitored is detected by the microcontroller unit.
14. A set of non-transitory computer readable media storing content which, when executed by one or more processors, causes a method for controlling a sensor device to be performed, the sensor device comprising a microcontroller unit and a sensor, the sensor comprising a transducer, the transducer being coupleable to a device to be monitored and configured to generate at least one signal, the at least one signal being indicative of a physical quantity, the physical quantity being dependent on a function of the device to be monitored, the method comprising: generating, by the sensor, a series of samples of the physical quantity according to the signal; generating, by said sensor in a manner programmable by said microcontroller unit, from said succession of samples, a series of data vectors, each data vector being formed by a corresponding set of values of a plurality of programmable quantities; programming the sensor, via the microcontroller, to classify the data vector by executing a decision tree, the decision tree having a structure and a plurality of thresholds; programming, by said microcontroller unit, the generation of a series of said data vectors; and subsequently acquiring, by the microcontroller unit, a set of data vectors, determining, for each programmable quantity and based on the set of data vectors, a corresponding range of permissible values, and subsequently programming the threshold value in accordance with the range of permissible values; and subsequently Data vectors are alternatively classified as normal or abnormal by the sensor by executing the decision tree based on the programmed threshold values.
15. The collection of non-transitory computer readable media of claim 14, wherein the method further comprises: At least a series of filtered samples are generated by applying a digital filter to the samples, and wherein the data vector is a function of the filtered samples.
16. The collection of non-transitory computer readable media of claim 14, wherein the method further comprises: A sequence of feature vectors is generated, the sequence of feature vectors being dependent on the sample; and wherein the data vector is a function of the feature vectors.
17. The collection of non-transitory computer readable media of claim 16, wherein the method further comprises: The value of each feature of the feature vector is calculated based on a corresponding set of samples or a corresponding set of filtered samples, and each data vector includes a corresponding feature vector.
18. The collection of non-transitory computer readable media of claim 14, wherein the method further comprises: The sensor device is coupled to an external sensor, the external sensor being configured to generate a sequence of external samples, the sequence of external samples being indicative of a corresponding physical quantity, and wherein the data vector also depends on the external samples.
19. The collection of non-transitory computer readable media of claim 14, wherein the method further comprises: When the data vector is classified as abnormal, abnormality of the device to be monitored is detected by the microcontroller unit.