Brushless direct current motor speed measuring device based on single chip microcomputer and using method

文档序号:1542557 发布日期:2020-01-17 浏览:28次 中文

阅读说明:本技术 基于单片机的无刷直流电机测速装置及使用方法 (Brushless direct current motor speed measuring device based on single chip microcomputer and using method ) 是由 陆彦如 卜云 张懿 魏海峰 王浩陈 李垣江 刘维亭 于 2019-09-24 设计创作,主要内容包括:本发明公开了一种基于单片机的无刷直流电机测速装置,其中装置包括:电源转换模块、单片机、设置输入模块、显示模块、接口模块;电源转换模块用于给其他模块供电;设置输入模块与单片机连接,用于向单片机输入设置的参数;接口模块的输出端与单片机连接,接口模块的输入端分别与无刷直流电机中的霍尔传感器的正极、霍尔传感器的信号输出端、霍尔传感器的负极连接,接口模块用于将霍尔传感器的信号传递给单片机;单片机基于接口模块传递来的霍尔传感器信号以及设置输入模块输入的参数计算无刷直流电机转速;显示模块与单片机连接,用于显示设置输入模块输入的参数以及无刷直流电机的转速;本发明测速装置测速精度准、适应性强。(The invention discloses a brushless DC motor speed measuring device based on a singlechip, wherein the device comprises: the device comprises a power supply conversion module, a single chip microcomputer, a setting input module, a display module and an interface module; the power supply conversion module is used for supplying power to other modules; the setting input module is connected with the singlechip and is used for inputting set parameters to the singlechip; the output end of the interface module is connected with the single chip microcomputer, the input end of the interface module is respectively connected with the anode of a Hall sensor in the brushless direct current motor, the signal output end of the Hall sensor and the cathode of the Hall sensor, and the interface module is used for transmitting signals of the Hall sensor to the single chip microcomputer; the single chip microcomputer calculates the rotating speed of the brushless direct current motor based on Hall sensor signals transmitted by the interface module and parameters input by the setting input module; the display module is connected with the singlechip and is used for displaying parameters input by the input module and the rotating speed of the brushless direct current motor; the speed measuring device has accurate speed measuring precision and strong adaptability.)

1. The utility model provides a brushless DC motor speed sensor based on singlechip which characterized in that includes: the device comprises a power supply conversion module, a single chip microcomputer, a setting input module, a display module and an interface module;

the power supply conversion module is respectively connected with the single chip microcomputer, the setting input module, the display module and the interface module, and is used for supplying power to other modules; the setting input module is connected with the singlechip and is used for inputting set parameters to the singlechip; the output end of the interface module is connected with the single chip microcomputer, the input end of the interface module is respectively connected with the anode of a Hall sensor in the brushless direct current motor, the signal output end of the Hall sensor and the cathode of the Hall sensor, and the interface module is used for transmitting the signal of the Hall sensor to the single chip microcomputer; the single chip microcomputer calculates the rotating speed of the brushless direct current motor based on the Hall sensor signals transmitted by the interface module and the parameters input by the setting input module; and the display module is connected with the singlechip and is used for displaying the parameters input by the setting input module and the rotating speed of the brushless direct current motor.

2. The single-chip microcomputer-based brushless direct current motor speed measuring device according to claim 1, wherein the setting input module comprises: a start-stop key and a pole pair number setting key; the start-stop key is used for starting and stopping the device to run; the pole pair number setting key is used for setting the pole pair number of the brushless direct current motor.

3. The single-chip microcomputer-based brushless direct current motor speed measuring device according to claim 1 or 2, wherein the interface module comprises: the device comprises a power interface unit, a signal interface unit and an optical coupling isolation unit; the power supply interface unit is connected with the power supply conversion module and is accessed from the positive pole and the negative pole of the Hall sensor power supply; the output end of the signal interface unit is connected with the input end of the optical coupling isolation unit, and the input end of the signal interface unit is used for the signal output end of the Hall sensor to be connected; and the output end of the optical coupling isolation unit is connected with the singlechip and is used for isolating signals of the Hall sensor.

4. A use method of a brushless direct current motor speed measuring device based on a single chip microcomputer is characterized by comprising the following steps:

step 1: connecting the positive electrode and the negative electrode of a Hall sensor in a driver of the brushless direct current motor into a power interface unit, and connecting the signal output end of the Hall sensor into a signal interface unit;

step 2: setting a pole pair number value through a pole pair number setting key and starting through a start-stop key;

and step 3: the single chip microcomputer acquires the single-level single chip microcomputer timing number in the output signal of the Hall sensor;

and 4, step 4: selecting a method for calculating the rotating speed of the brushless direct current motor according to the relation between the single-chip microcomputer timing number of the single level and the single-chip microcomputer clock pulse frequency obtained in the step 3, wherein the method comprises the following specific steps:

when the ratio of the single-chip microcomputer timing number of a single level to the single-chip microcomputer clock pulse frequency is larger than

Figure FDA0002212515060000021

when a single levelThe ratio of the number of the single chip microcomputer in the timing process to the clock pulse frequency of the single chip microcomputer is not more than

Figure FDA0002212515060000022

and 5: and the rotating speed of the brushless direct current motor is displayed through the display module.

5. The method for using the speed measuring device of the brushless dc motor based on the single chip microcomputer according to claim 4, wherein the step 4 of calculating the rotation speed of the brushless dc motor by using the high and low level variation time of the output signal of the hall sensor specifically comprises the following steps:

and 3, calculating the rotating speed of the brushless direct current motor according to the single-chip microcomputer timing number of the single level, the single-chip microcomputer clock pulse frequency and the pole pair number input by the pole pair number setting key obtained in the step 3.

6. The method for using the speed measuring device of the brushless DC motor based on the single chip microcomputer according to claim 5, wherein the specific formula for calculating the rotation speed of the brushless DC motor is as follows:

wherein "v" is the brushless DC motor speed; "Tc"is the single-chip microcomputer timing number according to the single level obtained in the step 3; ' fc"is the clock pulse frequency of the single chip microcomputer; "p" is the number of pole pairs of the pole pair number setting key input.

7. The method for using the speed measuring device of the brushless dc motor based on the single chip microcomputer according to claim 4, wherein the step 4 of calculating the rotation speed of the brushless dc motor by using the number of high and low levels of the output signal of the hall sensor in the preset unit time comprises the following specific steps:

step 41B: setting a preset unit time, and recording the level jump times in the output signal of the Hall sensor in the preset unit time by the singlechip;

step 42B: and C, calculating the rotating speed of the brushless direct current motor according to the preset unit time, the level jump times acquired in the step 41B and the pole pair number input by the pole pair number setting key.

8. The method for using the speed measuring device of the brushless dc motor based on the single chip microcomputer according to claim 7, wherein the specific formula for calculating the rotation speed of the brushless dc motor in the step 42B is as follows:

Figure FDA0002212515060000031

wherein "T" is0"is a preset unit time; "N" is the number of level jumps acquired in step 41B; "p" is the number of pole pairs of the pole pair number setting key input.

9. The use method of the brushless dc motor speed measuring device based on the single chip microcomputer according to claim 7 or 8, wherein the preset unit time range is 300ms to 500 ms.

Technical Field

The invention belongs to the technical field of brushless direct current motors, relates to a brushless direct current motor speed measuring device, and particularly relates to a brushless direct current motor speed measuring device based on a single chip microcomputer and a using method.

Background

The brushless direct current motor is a permanent magnet synchronous motor and has the advantages of high efficiency, fast response, low noise and the like. Therefore, brushless dc motors have been widely used in more and more industries.

Most of drivers of brushless direct current motors on the market do not have rotating speed indicating devices, so that real-time rotating speed cannot be measured visually, the working state of the brushless direct current motors cannot be judged, and the difficulty that the brushless direct current motors are difficult to measure speed on site is formed.

In order to solve the problem, the conventional method is to add a sensor on a rotating shaft of a brushless direct current motor to realize speed measurement or paste reflective paper on the rotating shaft and then use a photoelectric speed meter to measure, but the former increases unnecessary hardware cost and construction difficulty, and the latter can bring larger rotating speed measurement errors. The Hall sensor in the brushless direct current motor has rotating speed information, and based on the rotating speed information, the Hall sensor information can be collected by the single chip microcomputer, and a high-precision rotating speed testing device is designed.

Disclosure of Invention

The invention provides a brushless direct current motor speed measuring device based on a single chip microcomputer and a using method thereof, and aims to solve the problem that the brushless direct current motor is difficult to measure speed on site in the prior art.

The invention provides a brushless DC motor speed measuring device based on a singlechip, comprising: the device comprises a power supply conversion module, a single chip microcomputer, a setting input module, a display module and an interface module;

the power supply conversion module is respectively connected with the single chip microcomputer, the setting input module, the display module and the interface module, and is used for supplying power to other modules; the setting input module is connected with the singlechip and is used for inputting set parameters to the singlechip; the output end of the interface module is connected with the single chip microcomputer, the input end of the interface module is respectively connected with the anode of a Hall sensor in the brushless direct current motor, the signal output end of the Hall sensor and the cathode of the Hall sensor, and the interface module is used for transmitting the signal of the Hall sensor to the single chip microcomputer; the single chip microcomputer calculates the rotating speed of the brushless direct current motor based on the Hall sensor signals transmitted by the interface module and the parameters input by the setting input module; and the display module is connected with the singlechip and is used for displaying the parameters input by the setting input module and the rotating speed of the brushless direct current motor.

Optionally, the setting input module includes: a start-stop key and a pole pair number setting key; the start-stop key is used for starting and stopping the device to run; the pole pair number setting key is used for setting the pole pair number of the brushless direct current motor.

Optionally, the interface module comprises: the device comprises a power interface unit, a signal interface unit and an optical coupling isolation unit; the power supply interface unit is connected with the power supply conversion module and is accessed from the positive pole and the negative pole of the Hall sensor power supply; the output end of the signal interface unit is connected with the input end of the optical coupling isolation unit, and the input end of the signal interface unit is used for the signal output end of the Hall sensor to be connected; and the output end of the optical coupling isolation unit is connected with the singlechip and is used for isolating signals of the Hall sensor.

The invention provides a method for using a brushless direct current motor speed measuring device based on a single chip microcomputer, which comprises the following steps:

step 1: connecting the positive electrode and the negative electrode of a Hall sensor in a driver of the brushless direct current motor into a power interface unit, and connecting the signal output end of the Hall sensor into a signal interface unit;

step 2: setting a pole pair number value through a pole pair number setting key and starting through a start-stop key;

and step 3: the single chip microcomputer acquires the single-level single chip microcomputer timing number in the output signal of the Hall sensor;

and 4, step 4: selecting a method for calculating the rotating speed of the brushless direct current motor according to the relation between the single-chip microcomputer timing number of the single level and the single-chip microcomputer clock pulse frequency obtained in the step 3, wherein the method comprises the following specific steps:

when the ratio of the single-chip microcomputer timing number of a single level to the single-chip microcomputer clock pulse frequency is larger thanCalculating the rotating speed of the brushless direct current motor by using the high and low level change time of the output signal of the Hall sensor;

when the ratio of the single-chip microcomputer timing number of a single level to the single-chip microcomputer clock pulse frequency is not more thanCalculating the rotating speed of the brushless direct current motor by using the number of high and low levels of output signals of the Hall sensor in preset unit time;

and 5: and the rotating speed of the brushless direct current motor is displayed through the display module.

Optionally, the specific steps of calculating the rotation speed of the brushless dc motor in step 4 by using the high-low level change time of the hall sensor output signal are as follows:

and 3, calculating the rotating speed of the brushless direct current motor according to the single-chip microcomputer timing number of the single level, the single-chip microcomputer clock pulse frequency and the pole pair number input by the pole pair number setting key obtained in the step 3.

Optionally, the method for using the speed measuring device of the brushless dc motor based on the single chip microcomputer is characterized in that a specific formula for calculating the rotation speed of the brushless dc motor is as follows:

wherein "v" is the brushless DC motor speed; "Tc"is the single-chip microcomputer timing number according to the single level obtained in the step 3; ' fc"is the clock pulse frequency of the single chip microcomputer; "p" is the number of pole pairs setThe number of poloidal key inputs.

Optionally, the specific step of calculating the rotation speed of the brushless dc motor by using the number of high and low levels of the output signal of the hall sensor in the preset unit time in step 4 is as follows:

step 41B: setting a preset unit time, and recording the level jump times in the output signal of the Hall sensor in the preset unit time by the singlechip;

step 42B: and C, calculating the rotating speed of the brushless direct current motor according to the preset unit time, the level jump times acquired in the step 41B and the pole pair number input by the pole pair number setting key.

Optionally, the specific formula for calculating the rotation speed of the brushless dc motor in step 42B is as follows:

wherein "T" is0"is a preset unit time; "N" is the number of level jumps acquired in step 41B; "p" is the number of pole pairs of the pole pair number setting key input.

Optionally, the preset unit time ranges from 300ms to 500 ms.

The invention at least comprises the following beneficial effects:

1. according to the invention, under the condition that an additional rotating speed sensor is not used, the square wave signals of the Hall sensor in the brushless direct current motor are collected by only utilizing the single chip microcomputer, the rotating speed is calculated based on the square wave signals, and the stability and the accuracy of the data measured by the rotating speed testing device are improved.

2. The brushless direct current motor speed measuring device based on the single chip microcomputer is convenient to use and does not need an internal power supply. The power supply and speed measurement of the brushless direct current motor speed measuring device can be realized only by connecting three wires to the driver of the brushless direct current motor to be measured, and the ready speed measurement requirement is met.

3. The two calculation methods are switched between high speed and low speed by using the relationship between the single-chip microcomputer timing number of a single level and the single-chip microcomputer clock pulse frequency as the switching of the calculation methods, and the precision of the measurement speed can be improved.

Drawings

The features and advantages of the present invention will be more clearly understood by reference to the accompanying drawings, which are illustrative and not to be construed as limiting the invention in any way, and in which:

fig. 1 is a schematic circuit structure diagram of a brushless dc motor speed measuring device based on a single chip microcomputer according to an embodiment of the present invention;

fig. 2 is a flowchart of a method for using a brushless dc motor speed measuring device based on a single chip microcomputer according to an embodiment of the present invention.

Detailed Description

The present invention is further described in detail below with reference to the attached drawings so that those skilled in the art can implement the invention by referring to the description text.

As shown in fig. 1, the present invention provides a speed measuring device of a brushless dc motor based on a single chip microcomputer, comprising: the device comprises a power supply conversion module 1, a singlechip 3, a display module 4, a setting input module 5 and an interface module;

wherein, set up input module 5 and include: a start-stop key and a pole pair number setting key; the interface module includes: the device comprises a power interface unit, a signal interface unit J2 and an optical coupling isolation unit 2; the power interface unit comprises a positive interface J1 and a negative interface J3.

The power supply conversion module 1 is respectively connected with the single chip microcomputer 3, the setting input module 5, the display module 4 and the optical coupling isolation unit 2, and the power supply conversion module 1 is used for supplying power to other modules; the input module 5 is connected with the singlechip 3, the start and stop of the control device are realized by sending start and stop signals to the singlechip 3 through a start and stop button in the input module 5, and the pole pair number is set in the singlechip 3 through a pole pair number setting button in the input module 5; the output end of the optical coupling isolation unit 2 is connected with the single chip microcomputer 3, the positive electrode interface J1 is connected with the positive electrode of a Hall sensor in the brushless direct current motor, the signal interface unit J2 is connected with the signal output end of the Hall sensor and the input end of the optical coupling isolation unit 2, the negative electrode interface J3 is connected with the negative electrode of the Hall sensor and the power supply conversion module 1, and the optical coupling isolation unit 2 is used for adjusting the voltage of the signal of the Hall sensor into the voltage suitable for the single chip microcomputer 3 and transmitting the voltage to the single chip microcomputer 3; the single chip microcomputer 3 calculates the rotating speed of the brushless direct current motor based on the Hall sensor signals transmitted by the optical coupling isolation unit 2 and the parameters input by the setting input module 5; the display module 4 is connected with the singlechip 3 and is used for displaying parameters input by the setting input module 5 and the rotating speed of the brushless direct current motor.

The power conversion module 1 can adopt AMS1117-3.3 to convert 5V voltage into 3.3V; the optical coupling isolation module 2 can adopt an EL813 chip; the singlechip 3 can adopt an STM32F103C8T6 singlechip; the display module 4 may employ a 0.96 inch OLED display screen.

As shown in fig. 2, the invention provides a method for using a brushless dc motor speed measuring device based on a single chip microcomputer, the method comprising the following steps:

step A1: connecting the positive electrode and the negative electrode of a Hall sensor in a driver of the brushless direct current motor into a power interface unit, and connecting the signal output end of the Hall sensor into a signal interface unit;

step A2: setting a pole pair number value through a pole pair number setting key and starting through a start-stop key;

step A3: when the single chip captures an edge signal in the output signal of the Hall sensor, timing is started; when the singlechip captures the edge signals in the output signals of the Hall sensors again, stopping timing, and recording the number of the single-level singlechip in the output signals of the Hall sensors as the number of the single-level singlechip in the output signals of the Hall sensors, wherein the single-level singlechip is used for timing according to the clock pulse frequency of the singlechip;

step A4: selecting a method for calculating the rotating speed of the brushless direct current motor according to the relation between the single-chip microcomputer timing number of the single level and the single-chip microcomputer clock pulse frequency obtained in the step A3, wherein the method comprises the following specific steps:

when the number of single-chip microcomputers in a single level is greater than the clock pulse frequency of the single-chip microcomputersWhen the voltage is doubled, calculating the rotating speed of the brushless direct current motor by using the high and low level change time of the output signal of the Hall sensor;

single chip computer for single levelWith time not greater than clock frequency of single-chip microcomputerWhen the current is doubled, calculating the rotating speed of the brushless direct current motor by using the level jump times of the output signals of the Hall sensor in preset unit time;

step A5: and the rotating speed of the brushless direct current motor is displayed through the display module.

In step a4, the specific method for calculating the rotation speed of the brushless dc motor by using the high-low level change time of the hall sensor output signal is as follows:

and B, calculating the rotating speed of the brushless direct current motor according to the single-level single-chip microcomputer timing number obtained in the step A3, the single-chip microcomputer clock pulse frequency and the pole pair number input by the pole pair number setting key, wherein the rotating speed is specifically represented by the following formula (1):

Figure BDA0002212515070000053

in the formula (1), "v" is the rotation speed of the brushless direct current motor; "Tc"is the single level single-chip timing number obtained in step A3; ' fc"is the clock pulse frequency of the single chip microcomputer; "p" is the number of pole pairs of the pole pair number setting key input. Wherein the molecular coefficient is 60, the unit of the rotating speed is converted from revolution/second to revolution/minute, namely rpm; a denominator coefficient 2, which converts the half-period level duration of the collected Hall signal into the whole-period level duration;

for example, when the single-chip microcomputer of a single level counts the number Tc600, single-chip clock pulse frequency fc=100×103And the number p of pole pairs of the brushless direct current motor is 4, and the calculated rotating speed v is specifically as follows:

Figure BDA0002212515070000061

in the step a4, the specific steps of calculating the rotation speed of the brushless dc motor by using the number of high and low levels of the hall sensor output signal in the preset unit time are as follows:

step A41: setting a preset unit time, and recording the level jump times in the output signal of the Hall sensor in the preset unit time by the singlechip;

step A42: calculating the rotating speed of the brushless direct current motor according to the preset unit time, the level jump times obtained in the step A41 and the pole pair number input by the pole pair number setting key, wherein the rotating speed is specifically represented by the following formula (2):

Figure BDA0002212515070000062

in the formula (2), "T0"is a preset unit time; "N" is the number of level jumps obtained in step a 41; "p" is the number of pole pairs of the pole pair number setting key input. In the formula, the molecular weight of 60 is the unit of rotation speed converted from rpm to rpm, i.e., rpm.

For example, when the unit time T is preset0The number of level jumps N in the recorded preset unit time is 50 when 500ms is 0.5s, and the number of pole pairs p of the brushless dc motor is 2, the rotating speed v is calculated:

Figure BDA0002212515070000063

the preset unit time range is 300 ms-500 ms. The preset time is to satisfy T0X p is not less than 1, if T0When x p is less than 1, the denominator of the formula for calculating the speed of the rotor is too small, and the rotating speed calculation precision is influenced.

Whether the brushless direct current motor is in a high-rotation-speed running state or not is distinguished, whether the actual electric rotation speed of the brushless direct current motor is higher than 15000rpm or not is generally judged, at the moment, when the electric rotation speed of the brushless direct current motor is 15000rpm, the ratio of the single-chip microcomputer timing number of a single level to the single-chip microcomputer clock pulse frequency is 1/500, and because the electric rotation speed of the brushless direct current motor does not influence the ratio of the single-chip microcomputer timing number of the single level to the single-chip microcomputer clock pulse frequency when being converted to the actual rotation speed according to the pole pair number, the rotation speed condition of the brushless direct current motor can be judged directly through the ratio of the single-chip microcomputer timing number of the single level to the single-chip microcomputer clock pulse frequency, and. When there is noWhen the brush DC motor is in high-speed operation, the number of single-chip microcomputers for timing at single level is not more than the clock pulse frequency of the single-chip microcomputers

Figure BDA0002212515070000071

The obtained single-level single-chip microcomputer timing number is short, if the formula (1) is used as a method for calculating the rotating speed, the single-level single-chip microcomputer timing number T in the formula (1) isc"an operator as the denominator of the formula, if too small, will result in computational accuracy, so at the time" TcThe value is slightly fluctuated to bring a large error of rotating speed calculation, so that the rotating speed of the brushless direct current motor is calculated without using the high and low level change time of the output signal of the Hall sensor under the high-speed condition; when the brushless DC motor is in low-speed operation, the brushless DC motor can be regarded as being in low-speed operation when the actual rotating speed is lower than half of the rated rotating speed, and the timing number of the single-chip microcomputer of a single level is larger than the clock pulse frequency of the single-chip microcomputer

Figure BDA0002212515070000072

And at the moment, the level jump times in unit time are small, if the formula (2) is used as a method for calculating the rotating speed, if the level jump times 'N' serving as the numerator in the formula are too small, the calculation precision is influenced, so that the rotating speed of the brushless direct current motor is calculated at low speed without using the high and low level numbers of the Hall sensor output signals in the preset unit time.

For example: aiming at a brushless direct current motor with the rated rotating speed of 2500rpm and the number of pole pairs of 6, the clock pulse frequency f of a singlechipc=50×103In the case of (3), the number of single-chip microcomputers counting within 1250rpm of the actual rotating speed of the brushless direct current motor, namely, the single-chip microcomputers counting is larger than the clock pulse frequency of the single-chip microcomputers

Figure BDA0002212515070000073

When the voltage is doubled, calculating the rotating speed of the brushless direct current motor by using the high and low level change time of the output signal of the Hall sensor; when the rotating speed of the brushless DC motor is more than 1250rpm, namely the number of the single-chip microcomputers for timing at a single level is not more than the clock pulse of the single-chip microcomputersOf the impulse frequency

Figure BDA0002212515070000074

And (4) calculating the rotating speed of the brushless direct current motor by using the level jump times of the output signals of the Hall sensor in preset unit time. Therefore, the switching of the rotating speed calculation method at 1/2 of the rated rotating speed is realized, higher calculation accuracy can be obtained, the rotating speed calculation accuracy can be controlled within +/-5 rpm error, and higher calculation accuracy is obtained. If the rotating speed of the brushless DC motor is larger than 1250rpm, the rotating speed of the brushless DC motor is still calculated by using the high-low level change time of the output signal of the Hall sensor, which at least causes the rotating speed calculation error of +/-6 rpm and reduces the calculation precision.

10页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种楔形光幕阵列测量阵列炮管弹丸初速的装置及方法

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!