Disclosure of Invention
The embodiment of the invention aims to provide a method and a device for driving a brush motor and a computer readable storage medium, which can reduce electromagnetic radiation peak and noise interference generated in the running process of the brush motor.
In order to solve the above technical problem, an embodiment of the present invention provides a method for driving a brush motor, including: randomly generating an initial driving frequency within a first preset frequency range; controlling the brush motor to operate at the initial driving frequency; and generating a new driving frequency in a second preset frequency range at preset intervals, and controlling the brush motor to operate at the new driving frequency.
An embodiment of the present invention also provides a brush motor driving device, including: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the aforementioned brushed motor driving method.
Embodiments of the present invention also provide a computer-readable storage medium storing a computer program which, when executed by a processor, implements the foregoing brushed motor driving method.
Compared with the prior art, the method and the device have the advantages that after the initial driving frequency is generated and the brush motor is controlled to operate at the initial driving frequency, new driving frequency is generated at intervals of preset duration, and then the brush motor is controlled to operate at the new driving frequency. The driving frequency of the brush motor is changed every preset time interval, so that the energy of the electromagnetic radiation generated when the brush motor operates can be dispersed at different frequencies, the brush motor is prevented from operating at the same driving frequency for a long time, the energy of the generated electromagnetic radiation is prevented from being superposed at the frequency, the peak energy of the electromagnetic radiation is avoided being overlarge, and the electromagnetic radiation peak value generated when the brush motor operates is effectively reduced. In addition, the driving frequency of the brush motor is changed when preset time is set at intervals, resonance of the operating frequency of the brush motor and structures such as a shell of the brush motor can be prevented, and the occurrence of large noise is avoided, so that noise interference generated in the operating process of the brush motor is effectively reduced.
In addition, before generating a new driving frequency in a second preset frequency range every the preset time interval, the method further includes: acquiring the product of the initial driving frequency and a preset upper limit proportion as a theoretical upper limit value of the second preset frequency range; setting an upper limit value of the second preset frequency range as the theoretical upper limit value; acquiring the product of the initial driving frequency and a preset lower limit proportion as a theoretical lower limit value of the second preset frequency range; judging whether the theoretical lower limit value is greater than or equal to 20000 Hz; if so, setting the lower limit value of the second preset frequency range as the theoretical lower limit value, and if not, setting the lower limit value of the second preset frequency range as 20000 hertz. Through initial drive frequency, preset default upper limit proportion and preset default lower limit proportion that set up in advance, calculate respectively and obtain the theoretical upper limit value and the theoretical lower limit value of the second default frequency range, when theoretical lower limit value is less than 20000 hertz, the lower limit value that sets up the second default frequency range is 20000 hertz, because the vibration that is less than 20000 hertz can produce the sound that the human ear can hear, consequently, the lower limit value that sets up the second default frequency range is not less than 20000 hertz, can effectually prevent that there is the brush motor to produce strong noise interference to the human ear.
In addition, the preset upper limit proportion is not less than 110% and not more than 120%, and the preset lower limit proportion is not less than 80% and not more than 90%.
In addition, the preset upper limit proportion and the preset lower limit proportion are generated by a random function.
In addition, before the controlling the brushed motor to operate at the new driving frequency, the method further includes: judging whether the new driving frequency is the same as the current driving frequency of the brush motor or not; if so, regenerating the new driving frequency, and controlling the brush motor to operate at the new driving frequency; and if not, directly controlling the brushed motor to operate at the new driving frequency. Before the brushed motor is controlled to run under the new driving frequency, the step of judging whether the new driving frequency is the same as the current driving frequency of the brushed motor is added, and the new driving frequency is generated again when the new driving frequency is judged to be the same, so that the situation that the driving frequency of the brushed motor continuously takes the same value twice or for many times without change is prevented, and the electromagnetic radiation peak value and the noise interference generated in the running process of the brushed motor are effectively reduced.
In addition, the first predetermined frequency range is greater than or equal to 20000 hz. The first preset frequency range is set to be more than or equal to 20000 Hz, and noise interference caused by the fact that the brush motor runs due to the fact that the initial driving frequency is less than 20000 Hz is prevented.
In addition, the initial driving frequency is generated by a random function, and the new driving frequency is generated by the random function.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention more apparent, embodiments of the present invention will be described in detail below with reference to the accompanying drawings. However, it will be appreciated by those of ordinary skill in the art that numerous technical details are set forth in order to provide a better understanding of the present invention in its various embodiments. However, the technical solution claimed in the present invention can be implemented without these technical details and various changes and modifications based on the following embodiments.
A first embodiment of the present invention relates to a brush motor driving method. The specific process is shown in fig. 1, and comprises the following steps:
step S101: the initial driving frequency is randomly generated within a first preset frequency range.
Specifically, in this step, the first preset frequency range is a preset value range of the initial driving frequency, and the first preset frequency range can be flexibly set according to the actual situation of the brushed motor, such as according to model parameters, use scenes, and the like of the brushed motor.
Further, in this step, the initial driving frequency is generated by a random function within a first predetermined frequency range. It is to be understood that the method for randomly generating the initial driving frequency within the first predetermined frequency range is not limited to the random function generation, and may also be generated by other methods, such as a random number table method, and may be specifically selected according to actual needs.
In addition, in this step, the first predetermined frequency range is greater than or equal to 20000 hz. Because 20000 hertz is the highest frequency of the sound that the human ear can hear, sets up first preset frequency range and is more than or equal to 20000 hertz, prevents to have the brush motor to produce the sound that the human ear can hear, the effectual noise that produces when having the brush motor operation that has reduced. It should be noted that the first preset frequency range is only one preferred embodiment, and the first preset frequency range is not limited to this value range, and may be flexibly set according to actual needs, for example, if the brush motor is installed in a region far from the crowd, the driving frequency may be less than 20000 hz.
Step S102: and controlling the brush motor to run at the initial driving frequency.
Specifically, in this step, after the initial driving frequency is generated in step S101, the initial driving frequency is input to the micro control unit of the brush motor; the micro control unit controls the brush motor to operate at the initial driving frequency through a field effect transistor driving circuit controlling the brush motor.
Step S103: and generating a new driving frequency within a second preset frequency range at intervals of a preset time length.
Specifically, in this embodiment, the preset duration is a duration of a device in advance, and the duration may be flexibly set according to actual needs. The interval preset duration is to generate a new driving frequency within a second preset frequency range, that is, after the brushed motor runs for the preset duration under the initial driving frequency, the new driving frequency is generated within the second preset frequency range.
Further, in the present embodiment, the method for generating the new driving frequency in the second predetermined frequency range is the same as the method for generating the initial driving frequency in the first predetermined frequency range, that is, the new driving frequency is randomly generated in the second predetermined frequency range by the random function. It will be appreciated that the method of generating the new drive frequency in the second predetermined frequency range may be different from the method of generating the initial drive frequency in the first predetermined frequency range, and other methods may be used to randomly generate the new drive frequency. The method can be flexibly selected according to actual needs.
In addition, it should be noted that the second preset value range may be the same as or different from the first preset value range, and may be specifically selected according to an actual situation. In this embodiment, the second preset value range is a value range selected in advance according to actual needs.
Step S104: the brush motor is controlled to operate at the new driving frequency, and the process returns to step S103.
Specifically, in this step, after the new driving frequency is generated in step S103, the brush motor is controlled to operate at the new driving frequency. It is understood that the method for controlling the operation of the brushed motor at the new driving frequency is substantially the same as that in step S102, and will not be described herein again. It should be noted that, after the brushed motor is controlled to operate at the new driving frequency for the preset time period in this step, the process returns to step S103, where the converted driving frequency is generated.
Compared with the prior art, the method for driving the brush motor provided by the first embodiment of the invention controls the brush motor to operate at a new driving frequency by presetting time intervals, so that electromagnetic radiation energy generated in the operation process of the brush motor is dispersed into different frequencies, and the electromagnetic radiation peak value caused by accumulation of the electromagnetic radiation energy at the same frequency is prevented from generating adverse effects on the surrounding environment. In addition, every preset interval is long, the brush motor is controlled to run at a new driving frequency, other parts of the brush motor, such as a shell and the like, are prevented from resonating with the rotor, and noise of the brush motor in the running process is effectively reduced.
A second embodiment of the present invention relates to a brush motor driving method. As shown in fig. 2, the method comprises the following steps:
step S201: the initial driving frequency is randomly generated within a first preset frequency range.
Step S202: and controlling the brush motor to run at the initial driving frequency.
Step S203: and calculating according to the initial driving frequency to obtain a second preset value range.
Specifically, in this step, a preset upper limit ratio and a preset lower limit ratio are preset, and after the initial driving frequency is obtained in step S201. Firstly, calculating to obtain a theoretical upper limit value of a second preset value range according to the initial driving frequency and a preset upper limit ratio, and setting the upper limit value of the second preset frequency range as the calculated theoretical upper limit value; and then, calculating to obtain a theoretical lower limit value of a second preset value range according to the initial driving frequency and the preset lower limit proportion. The lower limit value of the second preset frequency range is set as the calculated theoretical lower limit value if the calculated theoretical lower limit value is greater than or equal to 20000 hertz; if the calculated theoretical lower limit value is less than 20000 hz, the lower limit value of the second preset frequency range is set to 20000 hz.
Preferably, in this step, the preset upper limit proportion is not less than 110% and not more than 120%, and the preset lower limit proportion is not less than 80% and not more than 90%.
In addition, in this step, both the preset upper limit ratio and the preset lower limit ratio are obtained by a random function. It is understood that, an example of a method for randomly generating the preset upper limit ratio and the preset lower limit ratio provided for the present embodiment is obtained by a random function, and in an actual application process, other methods may also be used, and are not listed here.
Step S204: and generating a new driving frequency within a second preset frequency range at intervals of a preset time length.
Step S205: and controlling the brush motor to run at the new driving frequency, and returning to the step S204.
Since steps S201, S202, S204, and S205 in this embodiment are substantially the same as steps S101 to S104 in the first embodiment, detailed description thereof is omitted.
Compared with the prior art, the method for driving the brush motor provided by the second embodiment of the invention controls the brush motor to operate at a new driving frequency at intervals of a preset duration, so that the electromagnetic radiation energy generated in the operation process of the brush motor is dispersed into different frequencies, and the electromagnetic radiation peak value caused by the accumulation of the electromagnetic radiation energy at the same frequency is prevented from generating adverse effects on the surrounding environment. In addition, every preset interval is long, the brush motor is controlled to run at a new driving frequency, other parts of the brush motor, such as a shell and the like, are prevented from resonating with the rotor, and noise of the brush motor in the running process is effectively reduced. In addition, a second preset frequency range is obtained through calculation of the initial driving frequency, the preset upper limit proportion and the preset lower limit proportion, and the situation that the brush motor is damaged in the process of rapidly converting the driving frequency due to the fact that the difference value between the driving frequencies obtained at random twice continuously is too large is avoided.
A third embodiment of the present invention relates to a brush motor driving method. As shown in fig. 3, the method comprises the following steps:
step S301: the initial driving frequency is randomly generated within a first preset frequency range.
Step S302: and controlling the brush motor to run at the initial driving frequency.
Step S303: and generating a new driving frequency within a second preset frequency range at intervals of a preset time length.
Step S304: judging whether the new driving frequency is the same as the current driving frequency of the brush motor, if so, executing step S305; if not, go to step S306.
Specifically, in this step, after a new driving frequency is generated within a second preset frequency range, it is first determined whether the new driving frequency is the same as the current driving frequency of the brush motor, if so, step S305 is executed, and if not, step S306 is executed.
Step S305: and regenerating a new driving frequency in the second preset frequency range, and returning to execute the step S304.
Specifically, in this step, since it is determined in step S304 that the new driving frequency is the same as the current driving frequency of the brush motor, in order to change the driving frequency of the brush motor, in this step, the new driving frequency is newly generated within the second preset frequency range, and the process returns to step S304 to perform the determination again.
Step S306: the brush motor is controlled to operate at the new driving frequency, and the process returns to step S303.
Since steps S301, S302, S303, and S306 in this embodiment are substantially the same as steps S101 to S104 in the first embodiment, detailed description thereof is omitted.
Compared with the prior art, the method for driving the brush motor provided by the second embodiment of the invention controls the brush motor to operate at a new driving frequency at intervals of a preset duration, so that the electromagnetic radiation energy generated in the operation process of the brush motor is dispersed into different frequencies, and the electromagnetic radiation peak value caused by the accumulation of the electromagnetic radiation energy at the same frequency is prevented from generating adverse effects on the surrounding environment. In addition, every preset interval is long, the brush motor is controlled to run at a new driving frequency, other parts of the brush motor, such as a shell and the like, are prevented from resonating with the rotor, and noise of the brush motor in the running process is effectively reduced. In addition, before the brushed motor is controlled to operate at a new driving frequency, step S304 is added to judge whether the new driving frequency is the same as the current driving frequency of the brushed motor, step S305 is executed when the new driving frequency is judged to be the same as the current driving frequency of the brushed motor to regenerate the new driving frequency, the step S306 is executed until the new driving frequency is different from the current driving frequency of the brushed motor, the brushed motor is controlled to operate at the new driving frequency, the driving frequency of the brushed motor is prevented from being changed due to the fact that the same value is continuously obtained twice or for multiple times, and therefore electromagnetic radiation peak values and noise interference generated in the operation process of the brushed motor are effectively reduced.
A fourth embodiment of the present invention relates to a brush motor drive device, as shown in fig. 4, including: at least one processor 401; and a memory 402 communicatively coupled to the at least one processor 401; the memory 402 stores instructions executable by the at least one processor 401, and the instructions are executed by the at least one processor 401 to enable the at least one processor 401 to perform the brush motor driving method as described above.
Where the memory 402 and the processor 401 are coupled by a bus, which may include any number of interconnected buses and bridges that couple one or more of the various circuits of the processor 401 and the memory 402 together. The bus may also connect various other circuits such as peripherals, voltage regulators, power management circuits, and the like, which are well known in the art, and therefore, will not be described any further herein. A bus interface provides an interface between the bus and the transceiver. The transceiver may be one element or a plurality of elements, such as a plurality of receivers and transmitters, providing a means for communicating with various other apparatus over a transmission medium. The data processed by the processor 401 may be transmitted over a wireless medium via an antenna, which may receive the data and transmit the data to the processor 401.
The processor 401 is responsible for managing the bus and general processing and may provide various functions including timing, peripheral interfaces, voltage regulation, power management, and other control functions. And memory 402 may be used to store data used by processor 401 in performing operations.
A fifth embodiment of the present invention relates to a computer-readable storage medium storing a computer program. The computer program realizes the above-described method embodiments when executed by a processor.
That is, as can be understood by those skilled in the art, all or part of the steps in the method for implementing the embodiments described above may be implemented by a program instructing related hardware, where the program is stored in a storage medium and includes several instructions to enable a device (which may be a single chip, a chip, or the like) or a processor (processor) to execute all or part of the steps of the method described in the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
It will be understood by those of ordinary skill in the art that the foregoing embodiments are specific examples for carrying out the invention, and that various changes in form and details may be made therein without departing from the spirit and scope of the invention in practice.