CN110275043B - Method and device for detecting rotating speed of direct current motor, storage medium and electronic equipment - Google Patents
Method and device for detecting rotating speed of direct current motor, storage medium and electronic equipment Download PDFInfo
- Publication number
- CN110275043B CN110275043B CN201910544590.7A CN201910544590A CN110275043B CN 110275043 B CN110275043 B CN 110275043B CN 201910544590 A CN201910544590 A CN 201910544590A CN 110275043 B CN110275043 B CN 110275043B
- Authority
- CN
- China
- Prior art keywords
- sample
- determining
- sampling
- sequence
- zero
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01P—MEASURING LINEAR OR ANGULAR SPEED, ACCELERATION, DECELERATION, OR SHOCK; INDICATING PRESENCE, ABSENCE, OR DIRECTION, OF MOVEMENT
- G01P3/00—Measuring linear or angular speed; Measuring differences of linear or angular speeds
- G01P3/42—Devices characterised by the use of electric or magnetic means
- G01P3/44—Devices characterised by the use of electric or magnetic means for measuring angular speed
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01R—MEASURING ELECTRIC VARIABLES; MEASURING MAGNETIC VARIABLES
- G01R31/00—Arrangements for testing electric properties; Arrangements for locating electric faults; Arrangements for electrical testing characterised by what is being tested not provided for elsewhere
- G01R31/34—Testing dynamo-electric machines
- G01R31/343—Testing dynamo-electric machines in operation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2218/00—Aspects of pattern recognition specially adapted for signal processing
- G06F2218/08—Feature extraction
Landscapes
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Control Of Direct Current Motors (AREA)
Abstract
The invention discloses a method and a device for detecting the rotating speed of a direct current motor, a storage medium and electronic equipment, aiming at calculating the rotating speed of the direct current motor according to a voltage signal of the direct current motor without external hardware detection. The embodiment of the invention has the advantages of low implementation cost, small calculation amount, strong calculation real-time performance and low cost and high efficiency of the calculation process.
Description
Technical Field
The invention relates to the technical field of computers, in particular to a method and a device for detecting the rotating speed of a direct current motor, a storage medium and electronic equipment.
Background
In a transmission system, the rotation speed of a motor is usually required to be detected and controlled to judge the performance of the motor and improve the accuracy of the system. The existing direct current motor rotating speed detection methods comprise two methods, one method is to detect the rotating speed of the motor through external equipment, such as a speed measuring sensor, an optical sensor and the like, and the method is easy to malfunction, break down, generate heat and has low efficiency in the long-time use process. The other method is to extract voltage or current signals and extract rotating speed harmonic waves by utilizing a signal processing technology, the method is excessively dependent on the specific characteristics of the signals, and when the signals are interfered, the acquired signals are distorted to generate large errors. And the calculation process of extracting the rotating speed harmonic waves through the signal processing technology is complicated, the calculated amount is large, and the calculation efficiency is low.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method, an apparatus, a storage medium, and an electronic device for detecting a rotational speed of a dc motor, which aim to calculate the rotational speed of the dc motor according to a voltage signal of the dc motor without external hardware detection.
In a first aspect, an embodiment of the present invention provides a method for detecting a rotational speed of a dc motor, including:
sampling a driving voltage signal of a direct current motor to determine a sampling signal sequence;
intercepting a part of sampling signal sequences according to a preset sample point number to determine a sample set, wherein the sample point number is not less than the preset number of sampling points acquired in two sample periods, and the sample period is the time between two commutations of the direct current motor;
determining a characteristic value set according to the sample set, wherein the characteristic value is used for representing the signal fluctuation condition of a corresponding sampling point;
determining a zero-crossing point sequence according to the characteristic value set, wherein the zero-crossing point sequence is used for representing the position of a sampling point at the steering moment of the direct current motor;
and determining the rotating speed of the direct current motor according to the zero-crossing sequence.
Further, the number of the sampling points is determined according to the rotating speed range of the direct current motor and a preset sampling frequency.
Further, the truncating the partial sequence of sampled signals according to the predetermined number of sample points to determine the set of samples comprises:
intercepting part of the sampling signal sequence according to the preset number of sample points;
and performing a mean value removing operation on the intercepted partial sampling signal sequence to determine a sample set.
Further, the determining a set of eigenvalues from the set of samples comprises:
determining a first set of vectors { D } from the set of samplesN,DN+1,…,DMAnd a second vector DM+1Element D of the first vector setiFor the ith sampling point in the sample set as the M sampling points intercepted as the starting point, the second vector DM+1M sampling points are intercepted by taking the M +1 th sampling point in the sample set as a starting point, wherein N is a preset sliding window starting position, and M is a preset sliding window length;
according to the first vector set { DN,DN+1,…,DMEach element in the tree and a second vector DM+1Determining a quantity product set by the inner product;
calculating a difference of each value in the set of quantity products from an adjacent previous value to determine the set of eigenvalues.
Further, the N and the M are determined according to the maximum value and the minimum value of the rotating speed of the direct current motor and the sampling frequency.
Further, the determining a sequence of zero crossings from the set of eigenvalues comprises:
and determining the position of the element with the value larger than zero in the feature value set as the element in the zero-crossing point sequence.
Further, the determining the rotational speed of the dc motor according to the sequence of zero crossings comprises:
determining the number of sampling points in a sample period according to the zero-crossing sequence;
determining the rotation period of the direct current motor according to the number of sampling points in the sample period;
and determining the rotating speed of the direct current motor according to the rotating period and the sampling frequency.
Further, the determining the number of sampling points during the sample period according to the zero-crossing sequence comprises:
and in response to the zero-crossing sequence only containing one element, determining the element value as the number of sampling points in one sample period.
Further, the determining the number of sampling points during the sample period according to the zero-crossing sequence further includes:
in response to the number of elements in the sequence of zero crossings being greater than 1, calculating a difference of each value in the sequence of zero crossings to an adjacent previous value to determine an approximate set of derivatives;
determining the average of all elements in the set of approximate derivatives as the number of sample points during one sample period in response to the difference between the maximum and minimum values in the set of approximate derivatives being less than a threshold.
Further, the first element in the zero-crossing sequence is also included in the set of approximate derivatives.
Further, after determining the set of approximate derivatives, the determining the number of sampling points during the sample period according to the zero-crossing sequence further includes:
determining the maximum element value in the zero crossing sequence as the number of sample points during one sample period in response to the difference between the maximum value and the minimum value in the approximate derivative set being greater than a threshold value.
In a second aspect, an embodiment of the present invention provides a device for detecting a rotational speed of a dc motor, including:
and the sampling module is used for sampling the driving voltage signal of the direct current motor to determine a sampling signal sequence.
The first calculation module is used for intercepting a part of the sampling signal sequence according to a preset sample point number to determine a sample set, wherein the sample point number is not less than the preset number of the sampling point number acquired in two sample periods, and the sample period is the time between two commutations of the direct current motor.
And the second calculation module is used for determining a characteristic value set according to the sample set, wherein the characteristic value is used for representing the signal fluctuation condition of the corresponding sampling point.
And the third calculation module is used for determining a zero-crossing point sequence according to the characteristic value set, wherein the zero-crossing point sequence is used for representing the position of a sampling point at the steering moment of the direct current motor.
And the fourth calculation module is used for determining the rotating speed of the direct current motor according to the zero crossing point sequence.
In a third aspect, an embodiment of the present invention provides a computer-readable storage medium on which computer program instructions are stored, which when executed by a processor implement the method according to any one of the first aspect.
In a fourth aspect, an embodiment of the present invention provides an electronic device, including a memory and a processor, where the memory is used to store one or more computer program instructions, where the one or more computer program instructions are executed by the processor to implement the following steps:
sampling a driving voltage signal of a direct current motor to determine a sampling signal sequence;
intercepting a part of sampling signal sequences according to a preset sample point number to determine a sample set, wherein the sample point number is not less than the preset number of sampling points acquired in two sample periods, and the sample period is the time between two commutations of the direct current motor;
determining a characteristic value set according to the sample set, wherein the characteristic value is used for representing the signal fluctuation condition of a corresponding sampling point;
determining a zero-crossing point sequence according to the characteristic value set, wherein the zero-crossing point sequence is used for representing the position of a sampling point at the steering moment of the direct current motor;
and determining the rotating speed of the direct current motor according to the zero-crossing sequence.
Further, the number of the sampling points is determined according to the rotating speed range of the direct current motor and a preset sampling frequency.
Further, the truncating the partial sequence of sampled signals according to the predetermined number of sample points to determine the set of samples comprises:
intercepting part of the sampling signal sequence according to the preset number of sample points;
and performing a mean value removing operation on the intercepted partial sampling signal sequence to determine a sample set.
Further, the determining a set of eigenvalues from the set of samples comprises:
determining a first set of vectors { D } from the set of samplesN,DN+1,…,DMAnd a second vector DM+1Element D of the first vector setiFor the ith sampling point in the sample set as the M sampling points intercepted as the starting point, the second vector DM+1M sampling points are intercepted by taking the M +1 th sampling point in the sample set as a starting point, wherein N is a preset sliding window starting position, and M is a preset sliding window length;
according to the first vector set { DN,DN+1,…,DMEach element in the tree and a second vector DM+1Determining a quantity product set by the inner product;
calculating a difference of each value in the set of quantity products from an adjacent previous value to determine the set of eigenvalues.
Further, the N and the M are determined according to the maximum value and the minimum value of the rotating speed of the direct current motor and the sampling frequency.
Further, the determining a sequence of zero crossings from the set of eigenvalues comprises:
and determining the position of the element with the value larger than zero in the feature value set as the element in the zero-crossing point sequence.
Further, the determining the rotational speed of the dc motor according to the sequence of zero crossings comprises:
determining the number of sampling points in a sample period according to the zero-crossing sequence;
determining the rotation period of the direct current motor according to the number of sampling points in the sample period;
and determining the rotating speed of the direct current motor according to the rotating period and the sampling frequency.
Further, the determining the number of sampling points during the sample period according to the zero-crossing sequence comprises:
and in response to the zero-crossing sequence only containing one element, determining the element value as the number of sampling points in one sample period.
Further, the determining the number of sampling points during the sample period according to the zero-crossing sequence further includes:
in response to the number of elements in the sequence of zero crossings being greater than 1, calculating a difference of each value in the sequence of zero crossings to an adjacent previous value to determine an approximate set of derivatives;
determining the average of all elements in the set of approximate derivatives as the number of sample points during one sample period in response to the difference between the maximum and minimum values in the set of approximate derivatives being less than a threshold.
Further, the first element in the zero-crossing sequence is also included in the set of approximate derivatives.
Further, after determining the set of approximate derivatives, the determining the number of sampling points during the sample period according to the zero-crossing sequence further includes:
determining the maximum element value in the zero crossing sequence as the number of sample points during one sample period in response to the difference between the maximum value and the minimum value in the approximate derivative set being greater than a threshold value.
The embodiment of the invention calculates the rotating speed of the direct current motor according to the voltage signal of the direct current motor, and has the advantages of low implementation cost, small calculated amount, strong calculation real-time performance and low efficiency and high cost in the calculation process.
Drawings
The above and other objects, features and advantages of the present invention will become more apparent from the following description of the embodiments of the present invention with reference to the accompanying drawings, in which:
fig. 1 is a flowchart of a method for detecting a rotational speed of a dc motor according to an embodiment of the present invention;
FIG. 2 is a flow chart of an alternative implementation of an embodiment of the present invention for determining a set of eigenvalues from the set of samples;
fig. 3 is a schematic diagram of a method for detecting a rotational speed of a dc motor according to an embodiment of the present invention;
fig. 4 is a schematic diagram of a dc motor rotation speed detection apparatus according to an embodiment of the present invention;
fig. 5 is a schematic diagram of an electronic device according to an embodiment of the invention.
Detailed Description
The present invention will be described below based on examples, but the present invention is not limited to only these examples. In the following detailed description of the present invention, certain specific details are set forth. It will be apparent to one skilled in the art that the present invention may be practiced without these specific details. Well-known methods, procedures, and procedures have not been described in detail so as not to obscure the present invention.
Further, those of ordinary skill in the art will appreciate that the drawings provided herein are for illustrative purposes and are not necessarily drawn to scale.
Unless the context clearly requires otherwise, throughout the description and the claims, the words "comprise", "comprising", and the like are to be construed in an inclusive sense as opposed to an exclusive or exhaustive sense; that is, what is meant is "including, but not limited to".
In the description of the present invention, it is to be understood that the terms "first," "second," and the like are used for descriptive purposes only and are not to be construed as indicating or implying relative importance. In addition, in the description of the present invention, "a plurality" means two or more unless otherwise specified.
Fig. 1 is a flowchart of a method for detecting a rotational speed of a dc motor according to an embodiment of the present invention, and as shown in fig. 1, the method for detecting a rotational speed of a dc motor includes:
step S100: and sampling the driving voltage signal of the direct current motor to determine a sampling signal sequence.
Specifically, the method includes the steps of firstly conducting preliminary detection on the direct current motor before sampling the driving voltage of the direct current motor, setting a threshold value and a sampling frequency, sampling the driving voltage of the direct current motor in a plurality of preset continuous periods according to the sampling frequency, determining that the period of a voltage signal of the direct current motor is basically stable when the difference value of the number of sampling points in each two periods is not larger than the threshold value, and then sampling the voltage signal to determine a sampling signal sequence. And when the difference value of the sampling points in the two periods is larger than the threshold value, determining that the period of the voltage signal of the direct current motor is unstable, and judging that the direct current motor fails.
Step S200: a portion of the sampled signal sequence is truncated according to a predetermined number of sample points to determine a set of samples.
Specifically, the number of the sample points is not less than a predetermined number of the sample points collected in two sample periods, where the sample period is a time between two commutations of the dc motor. The preset number of the preset sampling points can be determined according to a preset rotating speed range, the number of times of commutation of each rotation of the direct current motor and the sampling frequency. For example, when the rotation speed range of the dc motor is 3000 rpm to 10000 rpm, the dc motor is commutated 3 times per revolution, and the sampling frequency is 10ksps, the range of the number of sampling points per revolution is [60,200], and since the number of commutations per revolution is 3 times per revolution in the present embodiment, the range of the number of sampling points in one sample period is the range of the number of sampling points per revolution multiplied by 1/3, and the range of the number of sampling points in one sample period is calculated as [20,67], so the range of the number of sampling points in two sample periods is [40,134 ]. In order to improve the calculation accuracy, if the predetermined number of the sampling points is determined to be the maximum value of the range of the number of the sampling points in the two sample periods, the predetermined number of the sampling points in the embodiment is 134. Further determining that the number of the sample points is not less than 134, and randomly intercepting continuous sampling points not less than 134 in the sampling signal sequence determined in the step S100 according to the number of the sample points to determine a sample set.
In this embodiment, if the dc motor commutates 3 times per rotation, the range of the number of sampling points in the one sample period is 1/3 times the range of the number of sampling points in one rotation. It should be understood that when the dc motor commutates P times per rotation, the range of the number of sampling points in one sample period is the range of the number of sampling points in one rotation multiplied by 1/P, resulting in the range of the number of sampling points in two sample periods being 2/P.
Further, after sampling points are intercepted according to the number of the preset sample points, the average value removing operation is carried out on the intercepted partial sampling signal sequence, and a sample set is determined. Specifically, an average value of all element values in the intercepted partial sampling signal sequence is calculated, a difference between each element in the partial sampling signal sequence and the average value is calculated, and a set containing all the differences is determined to be a sample set.
Step S300: a set of eigenvalues is determined from the set of samples.
Specifically, the characteristic value is used for characterizing the signal fluctuation condition of the corresponding sampling point. Because the brush of the DC motor controls the DC motor to commutate in the rotating process, the voltage signal fluctuates during each commutation, and the adjacent characteristic value relation in the characteristic value set is used for representing whether the sampling time corresponding to the characteristic value fluctuates. In this embodiment, when the eigenvalue in the eigenvalue set is not greater than zero, it indicates that the driving voltage signal corresponding to the sampling time does not fluctuate, that is, the dc motor is not commutated; when the characteristic value in the characteristic value set is larger than zero, the driving voltage signal corresponding to the sampling moment is fluctuated, namely the direct current motor is commutated. And judging the sample period according to the time of the reversing of the direct current motor, and further calculating the rotating speed of the direct current motor. For example, when the set of characteristic values is { -1,0, -7,3, -6, -2}, the driving voltage signal fluctuates at the sampling time corresponding to the characteristic value 3, the dc motor commutates, the sampling time corresponding to the characteristic value-1, 0, -7 is located during the first sample, and the sampling time corresponding to the characteristic value-6, -2 is located during the second sample.
It should be understood that the characteristic value is used to characterize the signal fluctuation of the corresponding sampling point, and those skilled in the art can also adopt other values for characterizing the signal fluctuation of the corresponding sampling point as the characteristic value.
Fig. 2 is a flowchart of an alternative implementation of the embodiment of the present invention, in which a set of feature values is determined from the sample set. As shown in fig. 2, said determining a set of eigenvalues from said set of samples comprises:
step S310: a first set of vectors and a second vector are determined from the set of samples.
In particular, a first set of vectors { D } is determined from the set of samplesN,DN+1,…,DMAnd a second vector DM+1Element D of the first vector setiFor the ith sampling point in the sample set as the M sampling points intercepted as the starting point, the second vector DM+1And M sampling points are intercepted by taking the M +1 th sampling point in the sample set as a starting point, wherein N is the starting position of a preset sliding window, and M is the length of the preset sliding window. In this embodiment, N and M are determined according to a maximum value and a minimum value of the rotational speed of the dc motor and a sampling frequency. The maximum value and the minimum value of the rotating speed of the direct current motor form the rotating speed range of the direct current motor, and the number range of sampling points in one sample period can be obtained by calculating the rotating speed range and the sampling frequency of the direct current motor. Wherein N is the minimum value of the range of the number of sampling points, and M is the maximum value of the range of the number of sampling points. For example, when the number of sampling points ranges from [20,67]]Said sampling point passing GiWhen it is indicated, theElement D of the first vector set20Is { G20,G21,…,G86D, the second vector D68Is { G68,G69,...,G134}。
Step S320: a set of quantitative products is determined from the first vector set and the second vector.
In particular, according to the first set of vectors { D }N,DN+1,…,DMAnd a second vector DM+1The inner product determines a set of quantitative products. Each element in the quantity product set is an element in the vector set and the vector DM+1Is used to represent the signal characteristics of each of the sampling points.
Step S330: calculating a difference of each value in the set of quantity products from an adjacent previous value to determine the set of eigenvalues.
Specifically, the eigenvalue set is obtained by taking an approximate derivative of the quantitative product set, that is, an element in the eigenvalue set is a difference between each element in the quantitative product set and an adjacent previous element. When the direct current motor is not commutated, the element values in the quantity product set are decreased, and the element values in the characteristic value set are not larger than 0; when the direct current motor commutates, the element values in the quantity product set are increased in number, and the element values in the characteristic value set are larger than 0. Therefore, the moment of the commutation of the direct current motor can be judged according to whether the element values in the characteristic value set are larger than zero.
The method for calculating the characteristic value is simple, small in calculation amount, strong in real-time performance and high in efficiency.
Step S400: and determining a zero-crossing sequence according to the characteristic value set.
Specifically, the position where the element whose value in the feature value set is greater than zero is determined as the element in the zero-crossing sequence. The zero-crossing point sequence is used for representing the position of a sampling point at the turning moment of the direct current motor, and since the characteristic value in the characteristic value set is not greater than zero in the embodiment, it indicates that the driving voltage signal corresponding to the sampling moment is not fluctuated, that is, the direct current motor is not commutated; when the characteristic value in the characteristic value set is larger than zero, the driving voltage signal corresponding to the sampling moment is fluctuated, namely the direct current motor is commutated. Determining positions of elements in the feature value set larger than zero, wherein the element values in the zero-crossing sequence are positions of the elements in the feature value set larger than zero. For example, when the feature value set is { -1,0, -7,3, -6,2}, and the element positions in the feature value set are 0,1,2,3,4,5 in sequence, the zero-crossing sequence is the positions 3 and 5 where the feature values 3 and 2 are located in the feature value set, i.e., the zero-crossing sequence is {3,5 }.
Step S500: and determining the rotating speed of the direct current motor according to the zero-crossing sequence.
Specifically, the element values in the zero-crossing sequence are used for representing the positions of the sampling points at the turning time of the direct current motor, so that the number of the sampling points in the sample period can be determined according to the zero-crossing sequence, and then the rotation period of the direct current motor is determined according to the number of the sampling points in the sample period, wherein the rotation period is the number of the sampling points recorded in each rotation of the direct current motor. And finally, determining the rotating speed of the direct current motor according to the rotating period and the sampling frequency. Wherein different sample time determination methods can be selected for different cases of zero crossing sequences.
Determining the element value as one sample duration in response to only one element being included in the sequence of zero crossings. Specifically, when only one element value is included in the zero-crossing sequence, the direct current motor is characterized to turn only once in two sample periods corresponding to the sample set. And determining the element value in the zero-crossing sequence as a sample period, wherein the sample period is the time between two commutations of the direct current motor, the element value of the zero-crossing sequence is used for representing the position of a sampling point at the turning moment of the direct current motor.
Calculating the difference between each value in the zero-crossing sequence and the adjacent previous value to determine an approximate derivative set in response to the number of elements in the zero-crossing sequence being greater than 1, and determining the average value of all elements in the approximate derivative set as a sample period in response to the difference between the maximum value and the minimum value in the approximate derivative set being less than a threshold value. For example, when the zero-crossing sequence is {1,7,14,20}, the set of approximate derivatives is {7-1,14-7,20-14} ═ 6,7,6 }. Specifically, when the zero-crossing point sequence includes more than one element value, the dc motor turns more than once in two sample periods corresponding to the sample set. And when the difference value of the sampling point positions at the turning moment represented by every two adjacent elements is smaller than a preset threshold value, the sample period is considered to be relatively stable, and the sample period is determined by the mean value of all the sample periods obtained through calculation. Further, to improve the calculation accuracy, the first element in the zero-crossing sequence is also included in the approximate derivative set.
Calculating the difference between each value in the zero-crossing sequence and the adjacent previous value to determine an approximate derivative set in response to the number of elements in the zero-crossing sequence being greater than 1, and determining the maximum element value in the zero-crossing sequence as one sample period in response to the difference between the maximum value and the minimum value in the approximate derivative set being greater than a threshold value. Specifically, when the zero-crossing point sequence includes more than one element value, the dc motor turns more than once in two sample periods corresponding to the sample set. And when the difference value of the sampling point positions at the turning moments represented by every two adjacent elements is greater than a preset threshold value, the acquired sample period is considered as the maximum value in the zero-crossing point set.
After the sample period is determined, determining the rotation period of the direct current motor according to the sample period, and determining the rotation speed of the direct current motor according to the rotation period and the sampling frequency.
According to the method, the rotating speed of the direct current motor is calculated according to a voltage signal of the direct current motor without external hardware detection. The embodiment of the invention has the advantages of low implementation cost, small calculation amount, strong calculation real-time performance and low cost and high efficiency of the calculation process.
Fig. 3 is a schematic diagram of a method for detecting a rotational speed of a dc motor according to an embodiment of the present invention, as shown in fig. 3, when the dc motor is detected according to the method for detecting a rotational speed of a dc motor provided in the embodiments shown in fig. 1 and fig. 2, specific steps are as follows:
specifically, the driving voltage signal of the dc motor is first sampled to determine a sampling signal sequence 30, which is { a } sequence1,A2,A3,…,AH}. Then, a part of sampling signal sequence is intercepted according to the preset number of sample points, the intercepted part of sampling signal sequence is subjected to mean value removing operation, and a sample set 31{ G }is determined1,G2,G3,…,G2M}. The predetermined number of sample points is determined by the range of the number of sample points, and is not less than the predetermined number of the number of sample points acquired in the two sample periods. Further, the number range of the sampling points in the one sample period can be obtained by calculating the rotating speed range and the sampling frequency of the direct current motor, and the predetermined number of the sampling points is determined in the number range of the sampling points. Wherein N is the minimum value of the range of the number of sampling points, and M is the maximum value of the range of the number of sampling points. Determining a first set of vectors 32{ D ] from the set of samples 31N,DN+1,…,DMAnd a second vector 33DM+1Element D in the first vector set 32iA second vector 33D of M samples, which is obtained by taking the ith sample in the sample set 31 as a starting pointM+1M sampling points { G) intercepted by taking the M +1 th sampling point in the sample set as a starting pointM+1,GM+2,GM+3,…,G2M}. By computing the first set of vectors 32{ DN,DN+1,…,DMEach element in the lattice and a second vector 33DM+1Inner product determines a quantity product set 34, i.e. each element in the first vector set 32 is dot-multiplied with the second vector 33 to obtain the quantity product set 34 as SMD ═ DN·DM+1,DN+1·DM+1,…,DM·DM+1In which element D in set 34N·DM+1As a SMDN、…、DM·DM+1As a SMDMThen, an approximate derivative is obtained from the quantity product set 34 to determine the feature value set 35, that is, the difference between each value in the quantity product set 34 and the adjacent previous value is calculated, so that the feature value set 35 is Diff-SMD ═ { SMD ═ SMD [ ]N+1-SMDN,SMDN+2-SMDN+1,…,SMDM-SMDM-1Determining a zero-crossing point sequence 36 according to the characteristic value set 35, wherein element values in the zero-crossing point sequence are positions of the zero-crossing points in the characteristic value set 35, and sampling point positions Valid-Diff-SMD ═ ZCP for characterizing the steering time of the dc motor1,ZCP2,…,ZCPIAnd finally, determining the rotating speed of the direct current motor by calculating the zero-crossing point sequence 36, namely determining the sample period according to the sampling point position, specifically, when the zero-crossing point sequence 36 only contains one element ZCP1Determining the element value ZCP1Is one sample period. When the number of elements in the zero crossing sequence 36 is greater than 1, the difference of each value in the zero crossing sequence 36 from the adjacent previous value is calculated to determine the set of approximate derivatives { ZCP2-ZCP1,ZCP3-ZCP2,…,ZCPI-ZCPI-1-determining an average of all elements in the set of approximate derivatives as one sample period in response to a difference between a maximum and a minimum in the set of approximate derivatives being less than a threshold. For example, when the zero-crossing sequence 36 is {1,7,14,20}, the approximate derivative set is {7-1,14-7,20-14} ═ 6,7,6}, and the sample period is determined to be 19/3. When the number of elements in the zero-crossing sequence 36 is greater than 1, calculating the difference between each value in the zero-crossing sequence 36 and the adjacent previous value to determine an approximate derivative set, and in response to the difference between the maximum value and the minimum value in the approximate derivative set being greater than a threshold value, determining the maximum element value in the zero-crossing sequence 36 as a sample period. After the sample period is determined according to the method, the rotation period of the direct current motor is determined according to the sample period, and the rotation speed of the direct current motor is determined according to the rotation period and the sampling frequency.
According to the method, the voltage signal of the direct current motor can be acquired without external hardware detection, and the rotating speed of the direct current motor can be obtained by simply calculating the voltage signal.
Fig. 4 is a schematic diagram of a dc motor rotation speed detection apparatus according to an embodiment of the present invention, and as shown in fig. 4, the dc motor rotation speed detection apparatus includes a sampling module 41, a first calculating module 42, a second calculating module 43, a third calculating module 44, and a fourth calculating module 45.
Specifically, the sampling module 41 is configured to sample a driving voltage signal of the dc motor to determine a sampling signal sequence. The first calculating module 42 is configured to intercept a part of the sampling signal sequence according to a predetermined number of sampling points to determine that the number of sampling points in a sample set is the number of sampling points acquired in two sample periods, where the sample period is a time between two commutations of the dc motor. The second calculating module 43 is configured to determine a set of eigenvalues according to the sample set, where the eigenvalues are used to characterize the signal fluctuation condition of corresponding sampling points. The third calculating module 44 is configured to determine a zero-crossing sequence according to the characteristic value set, where the zero-crossing sequence is used to represent a sampling point position of the dc motor at the turning time. The fourth calculating module 45 is configured to determine the rotation speed of the dc motor according to the zero-crossing point sequence.
The device does not detect through external hardware, and calculates the rotating speed of the direct current motor according to the voltage signal of the direct current motor. The method has the advantages of low implementation cost, small calculation amount, strong calculation real-time performance, low calculation process cost and high efficiency.
Fig. 5 is a schematic view of an electronic device according to an embodiment of the present invention, as shown in fig. 5, in this embodiment, the electronic device includes a server, a terminal, and the like. As shown, the electronic device includes: at least one processor 52; a memory 51 communicatively connected to the at least one processor; and a communication component 53 communicatively coupled to the storage medium, the communication component 53 receiving and transmitting data under control of the processor; wherein the memory 51 stores instructions executable by the at least one processor 52, the instructions being executable by the at least one processor 52 to implement the steps of:
sampling a driving voltage signal of a direct current motor to determine a sampling signal sequence;
intercepting a part of sampling signal sequences according to a preset sample point number to determine a sample set, wherein the sample point number is not less than the preset number of sampling points acquired in two sample periods, and the sample period is the time between two commutations of the direct current motor;
determining a characteristic value set according to the sample set, wherein the characteristic value is used for representing the signal fluctuation condition of a corresponding sampling point;
determining a zero-crossing point sequence according to the characteristic value set, wherein the zero-crossing point sequence is used for representing the position of a sampling point at the steering moment of the direct current motor;
and determining the rotating speed of the direct current motor according to the zero-crossing sequence.
Further, the number of the sampling points is determined according to the rotating speed range of the direct current motor and a preset sampling frequency.
Further, the truncating the partial sequence of sampled signals according to the predetermined number of sample points to determine the set of samples comprises:
intercepting part of the sampling signal sequence according to the preset number of sample points;
and performing a mean value removing operation on the intercepted partial sampling signal sequence to determine a sample set.
Further, the determining a set of eigenvalues from the set of samples comprises:
determining a first set of vectors { D } from the set of samplesN,DN+1,…,DMAnd a second vector DM+1Element D of the first vector setiFor the ith sampling point in the sample set as the M sampling points intercepted as the starting point, the second vector DM+1M sampling points are intercepted by taking the M +1 th sampling point in the sample set as a starting point, wherein N is a preset sliding window starting position, and M is a preset sliding window length;
according to the first vector set { DN,DN+1,…,DMInElements and a second vector DM+1Determining a quantity product set by the inner product;
calculating a difference of each value in the set of quantity products from an adjacent previous value to determine the set of eigenvalues.
Further, the N and the M are determined according to the maximum value and the minimum value of the rotating speed of the direct current motor and the sampling frequency.
Further, the determining a sequence of zero crossings from the set of eigenvalues comprises:
and determining the position of the element with the value larger than zero in the feature value set as the element in the zero-crossing point sequence.
Further, the determining the rotational speed of the dc motor according to the sequence of zero crossings comprises:
determining the number of sampling points in a sample period according to the zero-crossing sequence;
determining the rotation period of the direct current motor according to the number of sampling points in the sample period;
and determining the rotating speed of the direct current motor according to the rotating period and the sampling frequency.
Further, the determining the number of sampling points during the sample period according to the zero-crossing sequence comprises:
and in response to the zero-crossing sequence only containing one element, determining the element value as the number of sampling points in one sample period.
Further, the determining the number of sampling points during the sample period according to the zero-crossing sequence further includes:
in response to the number of elements in the sequence of zero crossings being greater than 1, calculating a difference of each value in the sequence of zero crossings to an adjacent previous value to determine an approximate set of derivatives;
determining the average of all elements in the set of approximate derivatives as the number of sample points during one sample period in response to the difference between the maximum and minimum values in the set of approximate derivatives being less than a threshold.
Further, the first element in the zero-crossing sequence is also included in the set of approximate derivatives.
Further, after determining the set of approximate derivatives, the determining the number of sampling points during the sample period according to the zero-crossing sequence further includes:
determining the maximum element value in the zero crossing sequence as the number of sample points during one sample period in response to the difference between the maximum value and the minimum value in the approximate derivative set being greater than a threshold value.
In particular, the memory 51, as a non-volatile computer-readable storage medium, may be used to store non-volatile software programs, non-volatile computer-executable programs, and modules. The processor 52 executes various functional applications and data processing of the device by running nonvolatile software programs, instructions and modules stored in the memory, so as to implement the above-mentioned dc motor speed detection method.
The memory 51 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store a list of options, etc. Further, the memory 51 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some embodiments, memory 51 may optionally include memory located remotely from processor 52, which may be connected to an external device via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
One or more modules are stored in memory 51 and, when executed by one or more processors 52, perform the dc motor speed detection method of any of the method embodiments described above.
The product can execute the method provided by the embodiment of the application, has corresponding functional modules and beneficial effects of the execution method, and can refer to the method provided by the embodiment of the application without detailed technical details in the embodiment.
The present invention also relates to a computer-readable storage medium for storing a computer-readable program for causing a computer to perform some or all of the above-described method embodiments.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims (20)
1. A method for detecting the rotating speed of a direct current motor is characterized by comprising the following steps:
sampling a driving voltage signal of a direct current motor to determine a sampling signal sequence;
intercepting a part of sampling signal sequences according to a preset sample point number to determine a sample set, wherein the sample point number is not less than the preset number of sampling points acquired in two sample periods, the sample periods are the time between two commutations of the direct current motor, and the sampling point number is determined according to the rotating speed range of the direct current motor and the preset sampling frequency;
determining a characteristic value set according to the sample set, wherein the characteristic value is used for representing the signal fluctuation condition of a corresponding sampling point;
determining a zero-crossing point sequence according to the characteristic value set, wherein the zero-crossing point sequence is used for representing the position of a sampling point at the steering moment of the direct current motor;
determining the rotating speed of the direct current motor according to the zero-crossing sequence;
said determining a set of eigenvalues from said set of samples comprises:
determining a first set of vectors { D } from the set of samplesN,DN+1,…,DMAnd a second vector DM+1Element D of the first vector setiFor the ith sampling point in the sample set as the M sampling points intercepted as the starting point, the second vector DM+1M sampling points are intercepted by taking the M +1 th sampling point in the sample set as a starting point, wherein N is a preset sliding window starting position, and M is a preset sliding window length;
according to the first vector set { DN,DN+1,…,DMEach element in the tree and a second vector DM+1Determining a quantity product set by the inner product;
calculating a difference of each value in the set of quantity products from an adjacent previous value to determine the set of eigenvalues.
2. The method of claim 1, wherein said truncating the partially sampled signal sequence according to the predetermined number of sample points to determine the set of samples comprises:
intercepting part of the sampling signal sequence according to the preset number of sample points;
and performing a mean value removing operation on the intercepted partial sampling signal sequence to determine a sample set.
3. The method of claim 1, wherein N and M are determined based on a maximum value, a minimum value, and a sampling frequency of the dc motor speed.
4. The method of claim 1, wherein said determining a sequence of zero crossings from said set of eigenvalues comprises:
and determining the position of the element with the value larger than zero in the feature value set as the element in the zero-crossing point sequence.
5. The method of claim 1, wherein the determining the rotational speed of the dc motor from the sequence of zero crossings comprises:
determining the number of sampling points in a sample period according to the zero-crossing sequence;
determining the rotation period of the direct current motor according to the number of sampling points in the sample period;
and determining the rotating speed of the direct current motor according to the rotating period and the sampling frequency.
6. The method of claim 5, wherein the determining the number of sample points during a sample period from the sequence of zero crossings comprises:
in response to only one element being included in the sequence of zero-crossings, determining the number of sample points during which the element is a sample.
7. The method of claim 5, wherein determining the number of sample points during a sample period from the sequence of zero crossings further comprises:
in response to the number of elements in the sequence of zero crossings being greater than 1, calculating a difference of each value in the sequence of zero crossings to an adjacent previous value to determine an approximate set of derivatives;
determining the average of all elements in the set of approximate derivatives as the number of sample points during one sample period in response to the difference between the maximum and minimum values in the set of approximate derivatives being less than a threshold.
8. The method of claim 7, wherein the first element in the sequence of zero crossings is further included in the set of approximate derivatives.
9. The method of claim 7, wherein after determining an approximate set of derivatives, the determining a number of sample points during a sample from the sequence of zero crossings further comprises:
determining the largest element in the sequence of zero crossings as the number of sample points during one sample period in response to a difference between a maximum value and a minimum value in the set of approximate derivatives being greater than a threshold.
10. A DC motor rotation speed detection device is characterized by comprising:
the sampling module is used for sampling a driving voltage signal of the direct current motor to determine a sampling signal sequence;
the first calculation module is used for intercepting a part of sampling signal sequences according to a preset sample point number to determine a sample set, wherein the sample point number is not less than the preset number of sampling points acquired in two sample periods, the sample period is the time between two commutations of the direct current motor, and the sampling point number is determined according to the rotating speed range of the direct current motor and a preset sampling frequency;
the second calculation module is used for determining a characteristic value set according to the sample set, wherein the characteristic value is used for representing the signal fluctuation condition of a corresponding sampling point;
the third calculation module is used for determining a zero-crossing point sequence according to the characteristic value set, wherein the zero-crossing point sequence is used for representing the position of a sampling point at the steering moment of the direct current motor;
the fourth calculation module is used for determining the rotating speed of the direct current motor according to the zero crossing point sequence;
said determining a set of eigenvalues from said set of samples comprises:
determining a first set of vectors { D } from the set of samplesN,DN+1,…,DMAnd a second vector DM+1Element D of the first vector setiFor the ith sampling point in the sample set as the M sampling points intercepted as the starting point, the second vector DM+1M sampling points are intercepted by taking the M +1 th sampling point in the sample set as a starting point, wherein N is a preset sliding window starting position, and M is a preset sliding window length;
according to the first vector set { DN,DN+1,…,DMEach element in the tree and a second vector DM+1Determining a quantity product set by the inner product;
calculating a difference of each value in the set of quantity products from an adjacent previous value to determine the set of eigenvalues.
11. A computer-readable storage medium on which computer program instructions are stored, which, when executed by a processor, implement the method of any one of claims 1-9.
12. An electronic device comprising a memory and a processor, wherein the memory is configured to store one or more computer program instructions, wherein the one or more computer program instructions are executed by the processor to perform the steps of:
sampling a driving voltage signal of a direct current motor to determine a sampling signal sequence;
intercepting a part of sampling signal sequences according to a preset sample point number to determine a sample set, wherein the sample point number is not less than the preset number of sampling points acquired in two sample periods, the sample periods are the time between two commutations of the direct current motor, and the sampling point number is determined according to the rotating speed range of the direct current motor and the preset sampling frequency;
determining a characteristic value set according to the sample set, wherein the characteristic value is used for representing the signal fluctuation condition of a corresponding sampling point;
determining a zero-crossing point sequence according to the characteristic value set, wherein the zero-crossing point sequence is used for representing the position of a sampling point at the steering moment of the direct current motor;
determining the rotating speed of the direct current motor according to the zero-crossing sequence;
said determining a set of eigenvalues from said set of samples comprises:
determining a first set of vectors { D } from the set of samplesN,DN+1,…,DMAnd a second vector DM+1Element D of the first vector setiFor the ith sampling point in the sample set as the M sampling points intercepted as the starting point, the second vector DM+1M sampling points are intercepted by taking the M +1 th sampling point in the sample set as a starting point, wherein N is a preset sliding window starting position, and M is a preset sliding window length;
according to the first vector set { DN,DN+1,…,DMEach element in the tree and a second vector DM+1Determining a quantity product set by the inner product;
calculating a difference of each value in the set of quantity products from an adjacent previous value to determine the set of eigenvalues.
13. The electronic device of claim 12, wherein said truncating the partially sampled signal sequence according to the predetermined number of sample points to determine a set of samples comprises:
intercepting part of the sampling signal sequence according to the preset number of sample points;
and performing a mean value removing operation on the intercepted partial sampling signal sequence to determine a sample set.
14. The electronic device of claim 12, wherein N and M are determined according to a maximum value, a minimum value, and a sampling frequency of the dc motor speed.
15. The electronic device of claim 12, wherein said determining a sequence of zero crossings from the set of eigenvalues comprises:
and determining the position of the element with the value larger than zero in the feature value set as the element in the zero-crossing point sequence.
16. The electronic device of claim 12, wherein the determining the rotational speed of the dc motor from the sequence of zero crossings comprises:
determining the number of sampling points in a sample period according to the zero-crossing sequence;
determining the rotation period of the direct current motor according to the number of sampling points in the sample period;
and determining the rotating speed of the direct current motor according to the rotating period and the sampling frequency.
17. The electronic device of claim 16, wherein the determining the number of sample points during a sample period from the sequence of zero crossings comprises:
in response to only one element being included in the sequence of zero-crossings, determining the number of sample points during which the element is a sample.
18. The electronic device of claim 16, wherein the determining a number of sample points during a sample period from the sequence of zero crossings further comprises:
in response to the number of elements in the sequence of zero crossings being greater than 1, calculating a difference of each value in the sequence of zero crossings to an adjacent previous value to determine an approximate set of derivatives;
determining the average of all elements in the set of approximate derivatives as the number of sample points during one sample period in response to the difference between the maximum and minimum values in the set of approximate derivatives being less than a threshold.
19. The electronic device of claim 18, wherein a first element in the sequence of zero crossings is further included in the set of approximate derivatives.
20. The electronic device of claim 18, wherein after determining an approximate set of derivatives, the determining a number of sample points during a sample from the sequence of zero crossings further comprises:
determining the largest element in the sequence of zero crossings as the number of sample points during one sample period in response to a difference between a maximum value and a minimum value in the set of approximate derivatives being greater than a threshold.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910544590.7A CN110275043B (en) | 2019-06-21 | 2019-06-21 | Method and device for detecting rotating speed of direct current motor, storage medium and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910544590.7A CN110275043B (en) | 2019-06-21 | 2019-06-21 | Method and device for detecting rotating speed of direct current motor, storage medium and electronic equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110275043A CN110275043A (en) | 2019-09-24 |
CN110275043B true CN110275043B (en) | 2020-12-15 |
Family
ID=67961601
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910544590.7A Active CN110275043B (en) | 2019-06-21 | 2019-06-21 | Method and device for detecting rotating speed of direct current motor, storage medium and electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110275043B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114660322B (en) * | 2022-03-18 | 2023-07-04 | 陕西工业职业技术学院 | Instantaneous rotation speed fluctuation monitoring device of hydraulic system and fluctuation information acquisition method |
Family Cites Families (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
DE4211982B4 (en) * | 1992-04-09 | 2006-09-21 | Robert Bosch Gmbh | DC motor with a device for rotor position and / or speed detection |
CN2733360Y (en) * | 2004-08-07 | 2005-10-12 | 周开勇 | Rotation speed measuring circuit for brush DC dynamo and rotation speed regulate and control device using the circuit |
EP2192413A1 (en) * | 2008-12-01 | 2010-06-02 | ABB Oy | Method and apparatus for estimating a rotation speed of an electric motor |
CN102004166B (en) * | 2010-09-17 | 2012-05-30 | 杭州正强电子技术有限公司 | Device and method for measuring rotating speed of brush motor |
CN201965144U (en) * | 2010-12-13 | 2011-09-07 | 宁波信泰机械有限公司 | Speed measuring device of small motor |
CN105675906A (en) * | 2016-03-08 | 2016-06-15 | 江苏仁源电气有限公司 | Direct current brushed motor speed measurement device and speed measurement method |
JP2018011434A (en) * | 2016-07-13 | 2018-01-18 | シャープ株式会社 | Motor control circuit and motor control method |
CN109861598B (en) * | 2017-11-30 | 2020-12-04 | 纬湃汽车电子(芜湖)有限公司 | System and method for detecting rotation speed of brushed direct current motor |
-
2019
- 2019-06-21 CN CN201910544590.7A patent/CN110275043B/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN110275043A (en) | 2019-09-24 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN105049707B (en) | Method for preventing camera from stalling and mobile terminal | |
JP5985372B2 (en) | Target detection apparatus and target detection method | |
CN105092966B (en) | Signal frequency detection method, device and equipment protection method and protection equipment | |
CN107566726B (en) | A method and device for correcting the rotation angle of a rotating camera | |
WO2019072044A1 (en) | Method and apparatus for detecting phase loss of motor, and electronic device | |
CN110275043B (en) | Method and device for detecting rotating speed of direct current motor, storage medium and electronic equipment | |
CN110208612B (en) | Compressor phase-failure operation detection method, device, equipment and readable storage medium | |
CN113504523A (en) | Adaptive constant false alarm method and device based on target characteristics and storage medium thereof | |
CN108111082A (en) | The IF control stall detection methods and system of permanent magnet synchronous motor | |
CN107367640B (en) | Nonuniform envelope unknown pulse edge estimation method and equipment based on phase information | |
JP2008261720A (en) | Ambiguity processing device | |
CN109150026B (en) | Phase changing method for brushless motor without position sensor | |
EP3852264B1 (en) | Method, system, and motor for measuring motor rotor logic level | |
CN110799807B (en) | Orthogonal encoder signal filtering method, device and system | |
CN113824377B (en) | Flywheel permanent magnet rotor position determining method and device and electronic equipment | |
KR20160098760A (en) | Target detection method and apparatus using RADAR | |
JP2004333279A (en) | System and method for discriminating motion of target | |
CN111478629B (en) | Position detection method and device of permanent magnet brushless direct current motor and electrical equipment | |
CN115455409A (en) | Method and device for detecting abnormal external connection behavior, storage medium and electronic equipment | |
JP5580185B2 (en) | Rotary encoder signal processing method | |
CN107302327B (en) | Method and device for adjusting rotating speed of motor and motor | |
CN118567284B (en) | A signal adjustment method, system and medium based on rotary encoder | |
CN116184191B (en) | Stepper motor stall detection method and device | |
CN116961502A (en) | Motor monitoring method, motor monitoring equipment, air conditioner and storage medium | |
CN107103916B (en) | Music starting and ending detection method and system applied to music fountain |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |