CN116819113A - Motor rotation speed measuring method and device, electronic equipment and storage medium - Google Patents

Motor rotation speed measuring method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN116819113A
CN116819113A CN202310869397.7A CN202310869397A CN116819113A CN 116819113 A CN116819113 A CN 116819113A CN 202310869397 A CN202310869397 A CN 202310869397A CN 116819113 A CN116819113 A CN 116819113A
Authority
CN
China
Prior art keywords
motor
preset
image
distance
light source
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.)
Pending
Application number
CN202310869397.7A
Other languages
Chinese (zh)
Inventor
三梅英
刘云平
陈珏良
林全
高涛
权统
贾永红
蒋维
刘靖
万慧明
段娟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huanghe Hydropower Development Co Ltd
Dongfang Electric Machinery Co Ltd DEC
Original Assignee
Huanghe Hydropower Development Co Ltd
Dongfang Electric Machinery Co Ltd DEC
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Huanghe Hydropower Development Co Ltd, Dongfang Electric Machinery Co Ltd DEC filed Critical Huanghe Hydropower Development Co Ltd
Priority to CN202310869397.7A priority Critical patent/CN116819113A/en
Publication of CN116819113A publication Critical patent/CN116819113A/en
Priority to PCT/CN2024/098716 priority patent/WO2025016113A1/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01PMEASURING LINEAR OR ANGULAR SPEED, ACCELERATION, DECELERATION, OR SHOCK; INDICATING PRESENCE, ABSENCE, OR DIRECTION, OF MOVEMENT
    • G01P3/00Measuring linear or angular speed; Measuring differences of linear or angular speeds
    • G01P3/36Devices characterised by the use of optical means, e.g. using infrared, visible, or ultraviolet light
    • G01P3/38Devices characterised by the use of optical means, e.g. using infrared, visible, or ultraviolet light using photographic means

Landscapes

  • Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Electromagnetism (AREA)
  • Power Engineering (AREA)
  • General Physics & Mathematics (AREA)
  • Length Measuring Devices By Optical Means (AREA)

Abstract

The embodiment of the invention discloses a motor rotating speed measuring method, a device, electronic equipment and a storage medium, which relate to the technical field of online monitoring of generators, wherein a preset mark is arranged on the surface of a motor rotating shaft to be detected, a stroboscopic light source is controlled to project a light source to a motor to be detected according to a preset pulse period, and a camera is controlled to acquire a motor image in the process of projecting the light source to the motor to be detected; performing target detection on the motor image, determining the moving distance of a preset mark in the motor image, and determining the rotating speed of the motor to be detected based on the moving distance and a preset pulse period; according to the invention, the stroboscopic light source is controlled to stroboscopic by the pulse signal, the imaging picture acquired by the camera in the stroboscopic process is analyzed, and the measurement of the rotating speed of the generator is realized by utilizing the pixel moving range of the preset mark in the analysis picture and the preset pulse period, so that the problem of inaccurate rotating speed measurement caused by inconsistent tooth pitch of the fluted disc is avoided.

Description

电机转速测量方法、装置、电子设备和存储介质Motor speed measurement method, device, electronic equipment and storage medium

技术领域Technical field

本发明涉及发电机在线监测技术领域,具体涉及一种电机转速测量方法、装置、电子设备和存储介质。The invention relates to the technical field of generator online monitoring, and in particular to a motor speed measurement method, device, electronic equipment and storage medium.

背景技术Background technique

在发电机组运行中,需要检测发电机组中电机的转动速度,确定发电机组的运行状态。When the generator set is running, it is necessary to detect the rotation speed of the motor in the generator set and determine the operating status of the generator set.

现有的发电机组的转速测量方法主要是通过齿盘进行测速,通过在发电机的转轴端部安装环形齿状设备,并在固定部件上安装齿盘测速传感器和相应的转速信号处理器,当机组旋转时通过接近式或光电式传感器感应产生反应机组转速的脉冲信号,由上位机对脉冲信号进行处理,测量脉冲宽度,并计算获取机组转速。The existing speed measurement method of the generator set is mainly to measure the speed through a toothed disc. By installing an annular toothed device at the end of the rotating shaft of the generator, and installing a toothed disc speed sensor and a corresponding speed signal processor on the fixed component, when When the unit rotates, a proximity or photoelectric sensor senses a pulse signal that reflects the unit's rotational speed. The host computer processes the pulse signal, measures the pulse width, and calculates the unit's rotational speed.

然而由于加工精度的限制,齿盘上齿与齿之间的距离(即齿距)不可能完全相等,而高灵敏度的传感器是通过扫描齿与齿之间的时间来计算速度的。即可能造成机组的转速没变,而因齿距变化导致计算的速度发生变化,产生干扰信号,从而降低测量结果的准确度。However, due to limitations in machining accuracy, the distance between the teeth on the gear disc (i.e., the tooth pitch) cannot be completely equal, and a highly sensitive sensor calculates the speed by scanning the time between teeth. That is to say, the speed of the unit may not change, but the calculated speed changes due to the change in tooth pitch, resulting in interference signals, thereby reducing the accuracy of the measurement results.

发明内容Contents of the invention

本发明实施例提供一种电机转速测量方法、装置、电子设备和存储介质,以提高发电机转速测速的准确度。Embodiments of the present invention provide a motor speed measurement method, device, electronic equipment and storage medium to improve the accuracy of generator speed measurement.

一方面,本发明实施例提供一种电机转速测量方法,所述方法包括:On the one hand, embodiments of the present invention provide a method for measuring motor speed, which method includes:

控制频闪光源按照预设的脉冲周期向待测电机投射光源,控制相机采集向所述待测电机投射光源过程中的电机图像;所述待检测电机转轴的表面设置有预设标记;Control the stroboscopic light source to project the light source to the motor to be tested according to a preset pulse period, and control the camera to collect the motor image during the process of projecting the light source to the motor to be tested; the surface of the rotating shaft of the motor to be detected is provided with a preset mark;

对所述电机图像进行目标检测,确定所述电机图像中预设标记的移动距离;Perform target detection on the motor image and determine the movement distance of the preset mark in the motor image;

基于所述移动距离以及所述预设的脉冲周期,确定所述待测电机的转速。Based on the movement distance and the preset pulse period, the rotation speed of the motor under test is determined.

另一方面,本发明实施例提供一种电机转速测量装置,所述装置包括:On the other hand, an embodiment of the present invention provides a motor speed measuring device, which includes:

图像采集模块,用于控制频闪光源按照预设的脉冲周期向待测电机投射光源,控制相机采集向所述待测电机投射光源过程中的电机图像;所述待检测电机转轴的表面设置有预设标记;The image acquisition module is used to control the stroboscopic light source to project the light source to the motor to be tested according to a preset pulse period, and to control the camera to collect the motor image during the process of projecting the light source to the motor to be tested; the surface of the rotating shaft of the motor to be detected is provided with default mark;

距离检测模块,用于对所述电机图像进行目标检测,确定所述电机图像中预设标记的移动距离;A distance detection module, used to perform target detection on the motor image and determine the movement distance of the preset mark in the motor image;

转速测量模块,用于基于所述移动距离以及所述预设的脉冲周期,确定所述待测电机的转速。A rotational speed measurement module, configured to determine the rotational speed of the motor to be tested based on the movement distance and the preset pulse period.

另一方面,本发明实施例提供一种电子设备,包括存储器和处理器;所述存储器存储有应用程序,所述处理器用于运行所述存储器内的应用程序,以执行上述电机转速测量方法中的操作。On the other hand, an embodiment of the present invention provides an electronic device, including a memory and a processor; the memory stores an application program, and the processor is used to run the application program in the memory to perform the above motor speed measurement method. operation.

另一方面,本发明实施例提供一种存储介质,所述存储介质存储有多条指令,所述指令适于处理器进行加载,以执行上述电机转速测量方法中的步骤。On the other hand, embodiments of the present invention provide a storage medium that stores a plurality of instructions, and the instructions are suitable for loading by a processor to execute the steps in the above motor speed measurement method.

本发明实施例提供一种电机转速测量方法、装置、电子设备和存储介质,涉及发电机在线监测技术领域,通过控制频闪光源按照预设的脉冲周期向待测电机投射光源,控制相机采集向待测电机投射光源过程中的电机图像;待检测电机转轴的表面设置有预设标记,对电机图像进行目标检测,确定电机图像中预设标记的移动距离,基于移动距离以及预设的脉冲周期,确定待测电机的转速;本发明通过脉冲信号控制频闪光源频闪,分析相机在频闪过程中采集到的成像图片,利用分析图片中预设标记的像素移动范围以及预设的脉冲周期,实现发电机转速的测量,避免由于齿盘的齿距不一致造成的转速测量不准确的问题。Embodiments of the present invention provide a motor speed measurement method, device, electronic equipment and storage medium, which relate to the technical field of generator online monitoring. By controlling the stroboscopic light source to project the light source to the motor to be measured according to a preset pulse period, the camera is controlled to collect the direction. The motor image during the process of projecting a light source on the motor to be tested; a preset mark is set on the surface of the motor shaft to be detected, target detection is performed on the motor image, and the movement distance of the preset mark in the motor image is determined based on the movement distance and the preset pulse period. , determine the rotation speed of the motor to be tested; the present invention controls the strobe light source to strobe through pulse signals, analyzes the imaging pictures collected by the camera during the strobe process, and uses the pixel movement range of the preset markers in the analyzed pictures and the preset pulse period , realize the measurement of generator speed, and avoid the problem of inaccurate speed measurement caused by inconsistent tooth pitch of the tooth plate.

附图说明Description of the drawings

为了更清楚地说明本发明实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present invention. For those skilled in the art, other drawings can also be obtained based on these drawings without exerting creative efforts.

图1是本发明实施例提供的电机转速测量系统的结构示意图;Figure 1 is a schematic structural diagram of a motor speed measurement system provided by an embodiment of the present invention;

图2是本发明实施例提供的电机转速测量方法的流程示意图;Figure 2 is a schematic flow chart of a motor speed measurement method provided by an embodiment of the present invention;

图3是本发明实施例提供的相机的快门曝光时间与频闪光源的脉冲周期的示意图;Figure 3 is a schematic diagram of the shutter exposure time of the camera and the pulse period of the stroboscopic light source provided by the embodiment of the present invention;

图4是本发明实施例提供的预设标记的移动距离的检测方法的流程示意图;Figure 4 is a schematic flowchart of a method for detecting the movement distance of a preset mark provided by an embodiment of the present invention;

图5是本发明实施例提供的另一种电机转速测量方法的流程示意图;Figure 5 is a schematic flow chart of another motor speed measurement method provided by an embodiment of the present invention;

图6是本发明实施例提供的种电机转速测量装置的结构示意图;Figure 6 is a schematic structural diagram of a motor speed measuring device provided by an embodiment of the present invention;

图7是本发明实施例提供的电子设备的结构示意图。Figure 7 is a schematic structural diagram of an electronic device provided by an embodiment of the present invention.

具体实施方式Detailed ways

现在将参考附图更全面地描述示例实施方式。然而,示例实施方式能够以多种形式实施,且不应被理解为限于在此阐述的范例;相反,提供这些实施方式使得本发明将更加全面和完整,并将示例实施方式的构思全面地传达给本领域的技术人员。Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments may, however, be embodied in various forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concepts of the example embodiments. To those skilled in the art.

此外,所描述的特征、结构或特性可以以任何合适的方式结合在一个或更多实施例中。在下面的描述中,提供许多具体细节从而给出对本发明的实施例的充分理解。然而,本领域技术人员将意识到,可以实践本发明的技术方案而没有特定细节中的一个或更多,或者可以采用其它的方法、组元、装置、步骤等。在其它情况下,不详细示出或描述公知方法、装置、实现或者操作以避免模糊本发明的各方面。Furthermore, the described features, structures or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to provide a thorough understanding of embodiments of the invention. However, those skilled in the art will appreciate that the technical solutions of the present invention may be practiced without one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other instances, well-known methods, apparatus, implementations, or operations have not been shown or described in detail to avoid obscuring aspects of the present invention.

附图中所示的方框图仅仅是功能实体,不一定必须与物理上独立的实体相对应。即,可以采用软件形式来实现这些功能实体,或在一个或多个硬件模块或集成电路中实现这些功能实体,或在不同网络和/或处理器装置和/或微控制器装置中实现这些功能实体。The block diagrams shown in the figures are functional entities only and do not necessarily correspond to physically separate entities. That is, these functional entities may be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and/or processor devices and/or microcontroller devices. entity.

附图中所示的流程图仅是示例性说明,不是必须包括所有的内容和操作/步骤,也不是必须按所描述的顺序执行。例如,有的操作/步骤还可以分解,而有的操作/步骤可以合并或部分合并,因此实际执行的顺序有可能根据实际情况改变。The flowcharts shown in the drawings are only illustrative, and do not necessarily include all contents and operations/steps, nor must they be performed in the order described. For example, some operations/steps can be decomposed, and some operations/steps can be merged or partially merged, so the actual order of execution may change according to the actual situation.

需要说明的是:在本文中提及的“多个”是指两个或两个以上。“和/或”描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。字符“/”一般表示前后关联对象是一种“或”的关系。It should be noted that the "multiple" mentioned in this article refers to two or more. "And/or" describes the relationship between related objects, indicating that there can be three relationships. For example, A and/or B can mean: A exists alone, A and B exist simultaneously, and B exists alone. The character "/" generally indicates that the related objects are in an "or" relationship.

如背景技术所述,由于加工精度的限制,齿盘上齿与齿之间的距离(即齿距)不可能完全相等,而高灵敏度的传感器是通过扫描齿与齿之间的时间来计算速度的。即可能造成机组的转速没变,而因齿距变化导致计算的速度发生变化,产生干扰信号,这将降低基于齿盘的测速方法的测量结果;并且由于齿盘测速传感器存在“感知灵界点”,而发电机在停机状态下有可能恰好处于传感器“感知临界点”,由于发电机组及厂房存在振动,测速传感器就有可能会感知到齿盘,造成误报,这将进一步降低转速测量结果的准确度;而且基于齿盘的测速方法需要在转动部件上增加齿盘设备,增加了系统的复杂性,同时在转动部件上增加设备带来了一定的安全风险;此外,最后由于传感器的测温范围限制,安装在固定部件上的传感器通常距离齿盘仅有1-2mm,容易出现动静部件的碰磨导致设备损坏,需要更换设备,增加硬件成本。可见现有的基于齿盘的测速方法存在测量结果不准确、测量复杂、硬件成本高,且存在安全隐患的问题。As mentioned in the background art, due to the limitation of machining accuracy, the distance between the teeth on the gear disc (i.e., the tooth pitch) cannot be completely equal, and a highly sensitive sensor calculates the speed by scanning the time between teeth. of. That is to say, the speed of the unit may not change, but the calculated speed changes due to the change in tooth pitch, resulting in an interference signal, which will reduce the measurement results of the speed measurement method based on the gear disc; and because the gear disc speed measurement sensor has a "perception boundary point" ", and the generator may happen to be at the sensor's "critical point of sensing" when it is stopped. Due to the vibration of the generator set and the factory building, the speed sensor may sense the toothed disc, causing a false alarm, which will further reduce the speed measurement results. The accuracy; and the speed measurement method based on the gear disc requires adding gear disc equipment to the rotating parts, which increases the complexity of the system. At the same time, adding equipment to the rotating parts brings certain safety risks; in addition, in the end, due to the sensor's measurement The temperature range is limited, and the sensor installed on the fixed component is usually only 1-2mm away from the toothed disc. It is easy for dynamic and static components to rub against each other, causing damage to the equipment. The equipment needs to be replaced, which increases hardware costs. It can be seen that the existing speed measurement method based on the toothed disc has problems such as inaccurate measurement results, complex measurement, high hardware cost, and potential safety hazards.

基于此,为了提升发电机的转速测量结果的准确度,降低测量硬件成本以及提供测量便捷且安全性高的转速测量方法,本发明实施例提供一种电机转速测量方法、装置、电子设备和存储介质,通过脉冲信号控制频闪光源频闪,分析相机在频闪过程中采集到的成像图片,利用分析图片中预设标记的像素移动范围以及预设的脉冲周期,实现发电机转速的测量,避免由于齿盘的齿距不一致造成的转速测量不准确的问题;并且不需要在发电机转动部件上增加结构件,降低了系统的复杂性,消除了在转动部件增加结构件带来的安全风险,此外相机和转轴可保持较大距离,消除了测量方法中动静部件碰磨的风险。Based on this, in order to improve the accuracy of the generator's rotational speed measurement results, reduce the cost of measurement hardware, and provide a convenient and safe rotational speed measurement method, embodiments of the present invention provide a motor rotational speed measurement method, device, electronic equipment and storage The medium controls the strobe light source to strobe through pulse signals, analyzes the imaging pictures collected by the camera during the strobe process, and uses the pixel movement range of the preset markers in the analyzed pictures and the preset pulse period to measure the generator speed. It avoids the problem of inaccurate rotation speed measurement caused by inconsistent tooth pitch of the tooth plate; and does not need to add structural parts to the rotating parts of the generator, reducing the complexity of the system and eliminating the safety risks caused by adding structural parts to the rotating parts. , In addition, the camera and the rotating shaft can be kept at a large distance, eliminating the risk of collision of dynamic and static components in the measurement method.

为了便于理解本发明实施例提供的技术方案,下面将结合具体应用场景对本发明实施例提供的电机转速测量方法、装置、电子设备和存储介质进介绍。In order to facilitate understanding of the technical solutions provided by the embodiments of the present invention, the motor speed measurement method, device, electronic device and storage medium provided by the embodiments of the present invention will be introduced below in conjunction with specific application scenarios.

如图1所示,图1是本发明实施例提供的电机转速测量系统的结构示意图,所示的电机转速测量系统包括待测电机、相机、上位机、脉冲发生器以及频散光源。其中,相机可以是面阵相机,例如工业相机。As shown in Figure 1, Figure 1 is a schematic structural diagram of a motor speed measurement system provided by an embodiment of the present invention. The motor speed measurement system shown includes a motor to be measured, a camera, a host computer, a pulse generator and a dispersive light source. The camera may be an area scan camera, such as an industrial camera.

其中,上位机分别与相机和脉冲发生连接,用于向相机发送指令,以使相机采集待测电机的电机图像,以及向脉冲发生器发送指令,控制脉冲发生器向频闪光源发送脉冲,控制频闪光源按照预设的脉冲周期向待测电机投射光源,以及用于接收相机采集到的电机图像,对电机图像进行目标检测,确定电机图像中预设标记的移动距离,基于移动距离以及预设的脉冲周期,确定待测电机的转速。Among them, the host computer is connected to the camera and the pulse generator respectively, and is used to send instructions to the camera so that the camera collects the motor image of the motor to be tested, and sends instructions to the pulse generator to control the pulse generator to send pulses to the stroboscopic light source. The stroboscopic light source projects the light source to the motor under test according to the preset pulse period, and is used to receive the motor image collected by the camera, perform target detection on the motor image, and determine the moving distance of the preset mark in the motor image. Based on the moving distance and the preset Set the pulse period to determine the speed of the motor under test.

在一些实施方式中,待测电机的转轴表面设置有预设标记,如图1所示,在待测电机的转轴表面设置有斜条纹。需要说明的是,图1所示的预设标记仅为示例性说明,不构成对本发明实施例的限定,预设标记还可以是竖条纹、圆形、三角形等形状。In some embodiments, preset marks are provided on the surface of the rotating shaft of the motor to be tested. As shown in FIG. 1 , diagonal stripes are provided on the surface of the rotating shaft of the motor to be tested. It should be noted that the preset marks shown in FIG. 1 are only illustrative and do not limit the embodiments of the present invention. The preset marks may also be in shapes such as vertical stripes, circles, triangles, etc.

可选的,可以通过喷涂,印制,粘贴等多种形式在待测电机的转轴表面设置预设标记。Optionally, preset marks can be set on the surface of the rotating shaft of the motor to be tested by spraying, printing, pasting, etc.

可理解的,脉冲发生器基于预设的脉冲周期向频闪光源发送脉冲信号,频闪光源按照脉冲信号向待测电机投射光源,由于频闪光源是间歇性的向待测电机投影光源,在频闪光源未向待测电机投射光源的时间段内,待测电机所处环境中无光源,相机不能捕捉到转轴表面的预设标记,当频闪光源向待测电机投射光源的时间段,相机捕捉到转轴表面的预设标记,如此通过频闪光源按照脉冲信号向待测电机投射光源过程中,转轴运动引起转轴表面的预设标记的转动,由于相机存在快门曝光时间,当在预设的脉冲周期内向待测电机投射频闪光源时,相机捕捉到转轴表面的预设标记在预设的脉冲周期内的移动距离,进而可以基于转轴表面的预设标记在预设的脉冲周期内的移动距离得到待测电机的转速。例如,频闪光源在预设的脉冲周期内向待测电机投射两次光源时,由于两次光源的投射时间之间存在时间差,在这个时间差内转轴运动引起转轴表面的预设标记的转动,因此在相机捕捉到的电机图像中,存在两个预设标记,通过计算两个预设标记之间的距离,可以确定电机图像中预设标记的移动距离,进而确定待测电机的转速。It can be understood that the pulse generator sends a pulse signal to the stroboscopic light source based on the preset pulse period, and the stroboscopic light source projects the light source to the motor under test according to the pulse signal. Since the stroboscopic light source intermittently projects the light source to the motor under test, in During the period when the stroboscopic light source does not project light onto the motor under test, there is no light source in the environment where the motor under test is located, and the camera cannot capture the preset mark on the surface of the rotating shaft. When the stroboscopic light source projects light onto the motor under test, The camera captures the preset mark on the surface of the rotating shaft. In the process of projecting the light source to the motor under test through the stroboscopic light source according to the pulse signal, the movement of the rotating shaft causes the preset mark on the surface of the rotating shaft to rotate. Since the camera has a shutter exposure time, when the preset When the stroboscopic light source is projected to the motor under test during the pulse period, the camera captures the moving distance of the preset mark on the surface of the rotating shaft within the preset pulse period, and then can based on the movement distance of the preset mark on the surface of the rotating shaft within the preset pulse period. The moving distance is the speed of the motor under test. For example, when a stroboscopic light source projects two light sources to the motor under test within a preset pulse period, due to the time difference between the projection times of the two light sources, the movement of the rotating shaft within this time difference causes the rotation of the preset mark on the surface of the rotating shaft. In the motor image captured by the camera, there are two preset marks. By calculating the distance between the two preset marks, the moving distance of the preset marks in the motor image can be determined, and then the rotation speed of the motor to be measured can be determined.

在一些实施方式中,如图1所示,上位机包括数据库、转轴转速计算单元以及相机和光源控制单元,其中,转轴转速计算单元与数据连接,转轴转速计算单元用于接收相机采集到的电机图像,对电机图像进行目标检测,确定电机图像中预设标记的移动距离,基于移动距离以及预设的脉冲周期,确定待测电机的转速,将待测电机的转速写入数据库;相机和光源控制单元用于向面阵相机发送控制指令、以及向脉冲发生器发送控制指令。In some embodiments, as shown in Figure 1, the host computer includes a database, a rotation speed calculation unit, and a camera and light source control unit. The rotation speed calculation unit is connected to the data, and the rotation speed calculation unit is used to receive the motor data collected by the camera. Image, perform target detection on the motor image, determine the moving distance of the preset mark in the motor image, determine the rotational speed of the motor to be tested based on the moving distance and the preset pulse period, and write the rotational speed of the motor to be tested into the database; camera and light source The control unit is used to send control instructions to the area scan camera and to the pulse generator.

本发明实施例提供的电机转速测量系统,通过脉冲信号控制频闪光源频闪,分析相机在频闪过程中采集到的成像图片,利用分析图片中预设标记的像素移动范围以及预设的脉冲周期,实现发电机转速的测量,避免由于齿盘的齿距不一致造成的转速测量不准确的问题;并且不需要在发电机转动部件上增加结构件,降低了系统的复杂性,消除了在转动部件增加结构件带来的安全风险,此外相机和转轴可保持较大距离,消除了测量方法中动静部件碰磨的风险。The motor speed measurement system provided by the embodiment of the present invention uses pulse signals to control the strobe light source to strobe, analyzes the imaging pictures collected by the camera during the strobe process, and analyzes the pixel movement range of the preset markers in the pictures and the preset pulses. period, to achieve the measurement of generator speed, avoiding the problem of inaccurate speed measurement caused by inconsistent tooth pitch of the tooth plate; and there is no need to add structural parts to the rotating parts of the generator, which reduces the complexity of the system and eliminates the need to Components increase the safety risks caused by structural parts. In addition, the camera and the rotating shaft can be kept at a large distance, eliminating the risk of collision of dynamic and static components in the measurement method.

基于图1所示的电机转速测量系统,本发明实施例提供一种电机转速测量方法,如图2所示,图2是本发明实施例提供的电机转速测量方法的流程示意图,所示的电机转速测量方法可应用于图1所示的电机转速测量系统中的上位机,也可以应用于具备数据处理能力的计算机设备,例如工业计算机、服务器等,本发明实施例对此不进行具体限定。具体地,所示的电机转速测量方法至少包括步骤210至步骤230,详细描述如下:Based on the motor speed measurement system shown in Figure 1, an embodiment of the present invention provides a motor speed measurement method, as shown in Figure 2. Figure 2 is a schematic flow chart of the motor speed measurement method provided by an embodiment of the present invention. The motor shown The rotation speed measurement method can be applied to the host computer in the motor rotation speed measurement system shown in Figure 1, or to computer equipment with data processing capabilities, such as industrial computers, servers, etc. This is not specifically limited in the embodiment of the present invention. Specifically, the motor speed measurement method shown at least includes steps 210 to 230, which are described in detail as follows:

步骤210,控制频闪光源按照预设的脉冲周期向待测电机投射光源,控制相机采集向待测电机投射光源过程中的电机图像。Step 210: Control the stroboscopic light source to project the light source to the motor to be tested according to a preset pulse period, and control the camera to collect images of the motor during the process of projecting the light source to the motor to be tested.

其中,待检测电机转轴的表面设置有预设标记。Among them, preset marks are provided on the surface of the motor shaft to be detected.

在一些实施方式中,预设的脉冲周期可以工作人员预先设置的。In some embodiments, the preset pulse period can be preset by the operator.

在一些实施方式中,相机存在快门曝光时间,为了确保在快门曝光时间内相机可以捕捉到待测电机转轴的表面设置的预设标记在不同时间的位置信息,需要保证在快门曝光时间内,频闪光源可以向待测电机投射至少两次光源,基于此,可以根据相机的快门曝光时间确定预设的脉冲周期。In some embodiments, the camera has a shutter exposure time. In order to ensure that the camera can capture the position information of the preset marks set on the surface of the motor shaft to be tested at different times during the shutter exposure time, it is necessary to ensure that within the shutter exposure time, the frequency The flash source can project the light source to the motor under test at least twice. Based on this, the preset pulse period can be determined according to the shutter exposure time of the camera.

可选的,向相机发送拍摄指令,并基于相机的快门曝光时间确定预设的脉冲周期,基于预设的脉冲周期生成脉冲信号,发送脉冲信号至频闪光源,频闪光源基于脉冲信号触发光源的启闭,向待测电机投射光源,相机响应拍摄指令采集向待测电机投射光源过程中的电机图像。Optionally, send a shooting instruction to the camera, determine a preset pulse period based on the camera's shutter exposure time, generate a pulse signal based on the preset pulse period, send the pulse signal to the stroboscopic light source, and the stroboscopic light source triggers the light source based on the pulse signal. The camera opens and closes to project a light source to the motor to be tested, and the camera responds to the shooting instructions to collect images of the motor during the process of projecting the light source to the motor to be tested.

在一些实施方式中,为了确保采集到的电机图像可以记录有预设标记在不同时间的位置信息,可以控制相机按照预设的帧率和快门曝光时间进行连续拍摄,并在控制相机连续拍摄过程中,控制频闪光源按照预设的脉冲周期向待测电机投射光源,如此可以确保相机采集的多张电机图像中至少存在一张记录有预设标记在不同时间的位置信息的电机图像。In some embodiments, in order to ensure that the collected motor images can record the position information of the preset markers at different times, the camera can be controlled to continuously shoot according to the preset frame rate and shutter exposure time, and the camera can be controlled during the continuous shooting process. In the method, the stroboscopic light source is controlled to project the light source to the motor under test according to a preset pulse period. This can ensure that among the multiple motor images collected by the camera, there is at least one motor image that records the position information of the preset mark at different times.

可选的,可以每间隔预设时长向相机发送拍摄指令,同时基于相机的快门曝光时间确定预设的脉冲周期,基于预设的脉冲周期生成脉冲信号,发送脉冲信号至频闪光源,频闪光源基于脉冲信号触发光源的启闭,向待测电机投射光源,相机响应拍摄指令,确定相机的相机帧率、快门曝光时间以及拍摄时长,相机在拍摄时长内按照相机帧率、快门曝光时间进行连续拍摄,得到多张电机图像。Optionally, shooting instructions can be sent to the camera at preset intervals. At the same time, the preset pulse period is determined based on the shutter exposure time of the camera, a pulse signal is generated based on the preset pulse period, and the pulse signal is sent to the stroboscopic light source. The source triggers the opening and closing of the light source based on the pulse signal, and projects the light source to the motor to be tested. The camera responds to the shooting instructions and determines the camera frame rate, shutter exposure time and shooting duration. The camera performs operations according to the camera frame rate and shutter exposure time within the shooting duration. Shoot continuously to obtain multiple motor images.

步骤220,对电机图像进行目标检测,确定电机图像中预设标记的移动距离。Step 220: Perform target detection on the motor image to determine the movement distance of the preset mark in the motor image.

在一些实施方式中,可以通过预设的检测模型对电机图像进行目标检测,得到电机图像中预设标记的移动距离。其中,检测模型可以是基于机器学习的检测模型,例如基于字典学习的检测模型,也可以是基于神经网络的检测模型,例如基于CNN的检测模型、基于Fast-cnn的检测模型、基于Faster-cnn的检测模型、或者基于YOLO的检测模型。In some implementations, target detection can be performed on the motor image through a preset detection model to obtain the movement distance of the preset mark in the motor image. Among them, the detection model can be a detection model based on machine learning, such as a detection model based on dictionary learning, or a detection model based on a neural network, such as a detection model based on CNN, a detection model based on Fast-cnn, or a detection model based on Faster-cnn. detection model, or a detection model based on YOLO.

在一些实施方式中,可以对电机图像进行目标检测,确定电机图像中不同位置上的预设标记,根据各预设标记之间的像素距离,得到电机图像中预设标记的移动距离。其中,像素距离可以是在电机图像所在的图像坐标系下各预设标记之间的距离,像素距离也可以是在电机图像中各预设标记之间的像素数量。In some implementations, target detection can be performed on the motor image, preset marks at different positions in the motor image are determined, and the movement distance of the preset mark in the motor image is obtained based on the pixel distance between the preset marks. The pixel distance may be the distance between the preset marks in the image coordinate system where the motor image is located, and the pixel distance may also be the number of pixels between the preset marks in the motor image.

可选的,可以通过预设的检测模型对电机图像进行目标检测;可选的,也可以是通过边缘检测算子对电机图像进行目标检测。Optionally, target detection can be performed on the motor image through a preset detection model; optionally, target detection can also be performed on the motor image through an edge detection operator.

在一些实施方式中,可以对电机图像进行目标检测,确定电机图像中是否存在至少两个预设标记,若存在至少两个预设标记,则确定电机图像中每个预设标记所在的图像区域,基于各预设标记所在的图像区域的位置信息,得到电机图像中预设标记的移动距离;若不存在至少两个预设标记,则舍弃该电机图像,对下一张电机图像进行目标检测,或者重新采集电机图像。In some embodiments, target detection can be performed on the motor image to determine whether there are at least two preset marks in the motor image. If there are at least two preset marks, determine the image area where each preset mark in the motor image is located. , based on the position information of the image area where each preset mark is located, the moving distance of the preset mark in the motor image is obtained; if there are not at least two preset marks, the motor image is discarded and the next motor image is targeted. , or re-acquire motor images.

在一些实施方式中,可以将电机图像与预存的基准图像进行差分,得到电机图像与预存的基准图像之间的差分图像,基于差分图像进行目标检测,确定差分图像中预设标记所在的图像区域,基于各预设标记所在的图像区域的位置信息,得到电机图像中预设标记的移动距离。其中,预设的基准图像可以是不存在预设标记的图像。In some embodiments, the motor image and the pre-stored reference image can be differentiated to obtain a difference image between the motor image and the pre-stored reference image, target detection is performed based on the difference image, and the image area where the preset mark is located in the difference image is determined. , based on the position information of the image area where each preset mark is located, the movement distance of the preset mark in the motor image is obtained. The preset reference image may be an image without a preset mark.

步骤230,基于移动距离以及预设的脉冲周期,确定待测电机的转速。Step 230: Determine the rotation speed of the motor to be tested based on the movement distance and the preset pulse period.

在一些实施方式中,在确定移动距离之后,可以根据移动距离以及预设的脉冲周期,通过移动距离/预设的脉冲周期,得到待测电机的转速。In some embodiments, after the moving distance is determined, the rotational speed of the motor to be measured can be obtained based on the moving distance and the preset pulse period, using the moving distance/preset pulse period.

在一些实施方式中,在确定移动距离之后,可以根据移动距离以及预设的脉冲周期,通过移动距离/预设的脉冲周期,得到待测电机的线速度,根据待检测电机转轴的转轴半径以及线速度,通过120*π*转轴半径*线速度得到待测电机的转速。In some embodiments, after determining the moving distance, the linear speed of the motor to be tested can be obtained based on the moving distance and the preset pulse period. According to the moving distance/preset pulse period, the linear speed of the motor to be tested can be obtained. According to the radius of the rotating shaft of the motor to be detected and Linear speed, the speed of the motor under test is obtained through 120*π*shaft radius*linear speed.

在一些实施方式中,可以在确定移动距离之后,可以根据移动距离以及预设的脉冲周期,通过移动距离/预设的脉冲周期,得到待测电机的线速度,基于预设的待检测电机的线速度与转速之间的映射关系,得到待测电机的转速。其中,预设的待检测电机的线速度与转速之间的映射关系用于指示待检测电机的线速度与对应的转速之间的映射关系。In some embodiments, after the moving distance is determined, the linear speed of the motor to be tested can be obtained based on the moving distance and the preset pulse period, by moving distance/preset pulse period, based on the preset speed of the motor to be tested. The mapping relationship between linear speed and rotational speed is used to obtain the rotational speed of the motor under test. The preset mapping relationship between the linear speed and the rotation speed of the motor to be detected is used to indicate the mapping relationship between the linear speed and the corresponding rotation speed of the motor to be detected.

在一些实施方式中,若存在多张电机图像,可以根据每张电机图像中预设标记的移动距离,得到该电机图像对应的初始转速,将各电机图像对应的初始转速进行平均处理,得到待测电机的转速;若存在一张电机图像,则将该电机图像对应的初始转速确定为待测电机的转速。In some implementations, if there are multiple motor images, the initial rotation speed corresponding to the motor image can be obtained based on the movement distance of the preset mark in each motor image, and the initial rotation speed corresponding to each motor image can be averaged to obtain the target value. Measure the rotation speed of the motor; if there is a motor image, determine the initial rotation speed corresponding to the motor image as the rotation speed of the motor to be measured.

在一些实施方式中,可以在一段时间内每间隔预设时长,执行上述步骤210~230,得到待测电机的转速序列,基于待测电机的转速序列对待测电机进行转动状态检测,确定待测电机的转动状态是否存在异常,并在待测电机的转动状态存在异常时,发出示警信息,提示工作人员对待测电机进行维护。其中,转动状态包括转动异常、转动正常。In some embodiments, the above-mentioned steps 210 to 230 can be performed at preset intervals within a period of time to obtain the rotation speed sequence of the motor to be tested. Based on the rotation speed sequence of the motor to be tested, the rotation state of the motor to be tested is detected, and the rotation status of the motor to be tested is determined. Whether there is any abnormality in the rotation state of the motor, and when there is any abnormality in the rotation state of the motor to be tested, a warning message will be issued to prompt the staff to perform maintenance on the motor to be tested. Among them, the rotation state includes abnormal rotation and normal rotation.

示例性的,当待测电机的转速序列中存在连续大于预设转速阈值的转速时,确定待测电机转动异常,当待测电机的转速序列中转速都小于或等于预设转速阈值时,确定待测电机转动正常。For example, when there are rotation speeds in the rotation speed sequence of the motor under test that are continuously greater than the preset rotation speed threshold, it is determined that the rotation of the motor under test is abnormal. When the rotation speeds in the rotation speed sequence of the motor under test are all less than or equal to the preset rotation speed threshold, it is determined that the rotation speed of the motor under test is abnormal. The motor under test rotates normally.

本发明实施例提供的电机转速测量方法,通过脉冲信号控制频闪光源频闪,分析相机在频闪过程中采集到的成像图片,利用分析图片中预设标记的像素移动范围以及预设的脉冲周期,实现发电机转速的测量,避免由于齿盘的齿距不一致造成的转速测量不准确的问题;并且不需要在发电机转动部件上增加结构件,降低了系统的复杂性,消除了在转动部件增加结构件带来的安全风险,此外相机和转轴可保持较大距离,消除了测量方法中动静部件碰磨的风险。The motor speed measurement method provided by the embodiment of the present invention uses pulse signals to control the strobe light source to strobe, analyzes the imaging pictures collected by the camera during the strobe process, and uses the pixel movement range of the preset markers in the analyzed pictures and the preset pulses to period, to achieve the measurement of generator speed, avoiding the problem of inaccurate speed measurement caused by inconsistent tooth pitch of the tooth plate; and there is no need to add structural parts to the rotating parts of the generator, which reduces the complexity of the system and eliminates the need to Components increase the safety risks caused by structural parts. In addition, the camera and the rotating shaft can be kept at a large distance, eliminating the risk of collision of dynamic and static components in the measurement method.

考虑到相机存在快门曝光时间,为了确保在相机将不同时间的预设标记的位置捕捉到同一张电机图像中,需要确保在快门曝光时间内频闪光源向电机投射至少两次光源,基于此,在一些实施方式中,可以根据相机的快门曝光时间以及频闪光源的频闪次数设置脉冲周期。具体地,脉冲周期的确定方法包括步骤a1~a2:Considering that the camera has a shutter exposure time, in order to ensure that the camera captures the same motor image at the positions of preset marks at different times, it is necessary to ensure that the stroboscopic light source projects the light source to the motor at least twice during the shutter exposure time. Based on this, In some embodiments, the pulse period can be set according to the shutter exposure time of the camera and the number of strobes of the strobe light source. Specifically, the method for determining the pulse period includes steps a1 to a2:

步骤a1,获取相机的快门曝光时间、以及在快门曝光时间内频闪光源的频闪次数。Step a1: Obtain the shutter exposure time of the camera and the number of stroboscopic flashes of the stroboscopic light source within the shutter exposure time.

步骤a2,根据快门曝光时间和频闪次数,确定频闪光源的预设的脉冲周期。Step a2: Determine the preset pulse period of the stroboscopic light source based on the shutter exposure time and the number of stroboscopic flashes.

在一些实施方式中,可以获取工作人员基于配置页面视图输入的相机的快门曝光时间、以及频闪光源的频闪次数。In some embodiments, the shutter exposure time of the camera and the number of stroboscopic flashes of the stroboscopic light source input by the staff based on the configuration page view can be obtained.

在一些实施方式中,可以获取后台服务器发送的相机的快门曝光时间以及频闪光源的频闪次数。In some implementations, the shutter exposure time of the camera and the number of stroboscopic flashes of the stroboscopic light source sent by the background server can be obtained.

在一些实施方式中,可以根据快门曝光时间和频闪次数,通过快门曝光时间/频闪次数,得到频闪光源的预设的脉冲周期。In some embodiments, the preset pulse period of the stroboscopic light source can be obtained based on the shutter exposure time and the number of stroboscopic flashes, by using the shutter exposure time/number of stroboscopic flashes.

示例性的,以快门曝光时间内频闪光源的频闪次数为2为例进行说明,如图3所示,图3是本发明实施例提供的相机的快门曝光时间与频闪光源的脉冲周期的示意图,在一个快门曝光时间t内触发两个脉冲信号,脉冲信号之间的脉冲中周期为T=t/2,每个脉冲持续T1时刻,其中,K为相机的帧率,1/K为相机的拍摄频率。For example, the number of stroboscopic flashes of the stroboscopic light source within the shutter exposure time is 2. As shown in Figure 3, Figure 3 shows the shutter exposure time of the camera and the pulse period of the stroboscopic light source provided by the embodiment of the present invention. The schematic diagram of Triggering two pulse signals within a shutter exposure time t, the pulse mid-cycle between pulse signals is T=t/2, each pulse lasts for T1 time, where K is the frame rate of the camera, 1/K is the shooting frequency of the camera.

本发明实施例通过快门曝光时间和频闪次数,确定频闪光源的预设的脉冲周期,确保在快门曝光时间内频闪光源可以向待测电机投射频闪次数的光源,由于频闪光源每次向待测电机投射光源之间存在时间差,而待检测电机值序运转,因此电机可以捕捉到在时间差内待检测电机转轴表面设置的预设标记的位置变化情况,从而确定电机图像中预设标记的移动距离。The embodiment of the present invention determines the preset pulse period of the stroboscopic light source through the shutter exposure time and the number of stroboscopic flashes, ensuring that the stroboscopic light source can project the number of stroboscopic light sources to the motor under test within the shutter exposure time. Since the stroboscopic light source each There is a time difference between the light sources projected onto the motor to be tested, and the motor to be detected operates sequentially. Therefore, the motor can capture the position changes of the preset mark set on the surface of the motor shaft to be detected within the time difference, thereby determining the preset value in the motor image. The distance the marker moves.

考虑到电机在快门曝光时间内继续转动,因此相机采集到的电机图像中可能存在多个预设标记,而每个预设标记在电机图像中位置不同,可以通过检测多个预设标记的轮廓之间的距离,得到预设标记的移动距离。基于此,在一些实施方式中,可以对电机图像进行边缘检测,确定电机图像中每个预设标记的轮廓,基于电机图像中每个预设标记的轮廓之间的距离确定电机图像中预设标记的移动距离。Considering that the motor continues to rotate during the shutter exposure time, there may be multiple preset marks in the motor image collected by the camera, and each preset mark has a different position in the motor image. By detecting the outlines of multiple preset marks The distance between them is the moving distance of the preset mark. Based on this, in some embodiments, edge detection can be performed on the motor image, the outline of each preset mark in the motor image is determined, and the preset mark in the motor image is determined based on the distance between the outlines of each preset mark in the motor image. The distance the marker moves.

可选的,可以通过边缘检测算子对电机图像进行边缘检测,确定电机图像中每个预设标记的轮廓。其中,边缘检测算子包括但不限于梯度算子、Sobel(中文:离散微分算子)、Roberts(中文:斜向偏差分的梯度计算方法、Prewitt(微分算子的边缘检测算子)、Canny(中文:最优的阶梯型边缘检测算子)和Laplacian(中文:二阶微分算子)边缘识别算子。Optionally, edge detection can be performed on the motor image through an edge detection operator to determine the outline of each preset mark in the motor image. Among them, edge detection operators include but are not limited to gradient operators, Sobel (Chinese: discrete differential operator), Roberts (Chinese: oblique deviation gradient calculation method, Prewitt (edge detection operator of differential operators), Canny (Chinese: optimal ladder-type edge detection operator) and Laplacian (Chinese: second-order differential operator) edge identification operator.

其中,电机图像中每个预设标记的轮廓之间的距离可以是电机图像中每个预设标记的轮廓的外边缘之间的距离;也可以是电机图像中每个预设标记的轮廓的内边缘之间的距离;还可以是电机图像中每个预设标记的轮廓的中心点之间的距离。Wherein, the distance between the outlines of each preset mark in the motor image may be the distance between the outer edges of the outlines of each preset mark in the motor image; it may also be the distance between the outer edges of the outlines of each preset mark in the motor image. The distance between inner edges; can also be the distance between the center points of each preset marked outline in the motor image.

在一些实施方式中,可以将电机图像中每个预设标记的轮廓之间的距离确定为电机图像中预设标记的移动距离。In some implementations, the distance between the outlines of each preset mark in the motor image may be determined as the movement distance of the preset mark in the motor image.

在一些实施方式中,可以根据电机图像中每个预设标记的轮廓之间的距离以及预设的图像距离与实际距离之间的映射关系,得到电机图像中预设标记的移动距离。In some embodiments, the movement distance of the preset mark in the motor image can be obtained based on the distance between the outlines of each preset mark in the motor image and the mapping relationship between the preset image distance and the actual distance.

其中,预设的图像距离与实际距离之间的映射关系用于指示图像距离与对应的实际坐标系下的实际距离之间的映射关系。在一些实施方式中,预设的图像距离与实际距离之间的映射关系可以是图像距离与实际距离之间的映射函数,例如图像坐标系与世界坐标系之间的转换函数。The preset mapping relationship between the image distance and the actual distance is used to indicate the mapping relationship between the image distance and the actual distance in the corresponding actual coordinate system. In some implementations, the preset mapping relationship between the image distance and the actual distance may be a mapping function between the image distance and the actual distance, such as a conversion function between the image coordinate system and the world coordinate system.

可选的,当电机图像中存在两个预设标记时,可以根据预设标记的轮廓之间的距离,得到电机图像中预设标记的移动距离。Optionally, when there are two preset marks in the motor image, the movement distance of the preset marks in the motor image can be obtained based on the distance between the outlines of the preset marks.

可选的,当电机图像中存在两个以上预设标记时,可以将电机图像中每个预设标记的轮廓之间的距离中最大距离确定为目标轮廓距离,根据目标轮廓距离得到电机图像中预设标记的移动距离,例如,将目标轮廓距离确定为电机图像中预设标记的移动距离;例如,根据目标轮廓距离以及预设的图像距离与实际距离之间的映射关系,得到电机图像中预设标记的移动距离。Optionally, when there are more than two preset marks in the motor image, the maximum distance between the outlines of each preset mark in the motor image can be determined as the target outline distance, and the target outline distance in the motor image can be obtained based on the target outline distance. The moving distance of the preset mark, for example, determine the target contour distance as the moving distance of the preset mark in the motor image; for example, according to the target contour distance and the mapping relationship between the preset image distance and the actual distance, obtain the moving distance of the preset mark in the motor image. Default marker movement distance.

为了提高边缘检测的准确度,进而提高电机图像中预设标记的移动距离的精准度,从而确保转速测量结果的可信度,在一些实施方式中,可以对电机图像进行预处理,基于预处理后的电机图像进行边缘检测,如此,通过提升电机图像的图像质量,提高边缘检测的准确度,进而提高电机图像中预设标记的移动距离的精准度,从而确保转速测量结果的可信度。其中,预处理包括但不限于图像锐化、灰度拉伸、图像降噪、图像边缘增强等。In order to improve the accuracy of edge detection and thereby improve the accuracy of the movement distance of the preset mark in the motor image, thereby ensuring the credibility of the rotation speed measurement results, in some implementations, the motor image can be preprocessed. Based on the preprocessing Edge detection is performed on the final motor image. In this way, by improving the image quality of the motor image, the accuracy of edge detection is improved, thereby improving the accuracy of the movement distance of the preset mark in the motor image, thereby ensuring the credibility of the speed measurement results. Among them, preprocessing includes but is not limited to image sharpening, grayscale stretching, image noise reduction, image edge enhancement, etc.

具体地,如图4所示,图4是本发明实施例提供的预设标记的移动距离的检测方法的流程示意图,所示的预设标记的移动距离的检测方法包括步骤221~223:Specifically, as shown in Figure 4, Figure 4 is a schematic flowchart of a method for detecting the movement distance of a preset mark provided by an embodiment of the present invention. The method shown for detecting the movement distance of a preset mark includes steps 221 to 223:

步骤221,对电机图像进行预处理,得到预处理后的电机图像。Step 221: Preprocess the motor image to obtain a preprocessed motor image.

步骤222,对预处理后的电机图像进行边缘检测,确定预处理后的电机图像中每个预设标记的轮廓。Step 222: Perform edge detection on the preprocessed motor image to determine the outline of each preset mark in the preprocessed motor image.

步骤223,确定各轮廓之间的像素距离,基于各轮廓之间的像素距离,确定预处理后的电机图像中预设标记的移动距离。Step 223: Determine the pixel distance between each contour, and determine the movement distance of the preset mark in the preprocessed motor image based on the pixel distance between each contour.

在一些实施方式中,可以根据每个预设标记的轮廓,确定每个预设标记的轮廓的中心点在电机图像所在的图像坐标系下的图像坐标,基于各预设标记的轮廓的中心点的图像坐标之间的距离,得到各轮廓之间的像素距离。例如,可以基于各预设标记的轮廓的中心点的图像坐标,将各预设标记的轮廓的中心点的图像坐标之间的欧式距离或马氏距离确定为各轮廓之间的像素距离。其中,中心点可以是几何中心点,也可以是重心点。In some embodiments, based on the outline of each preset mark, the image coordinates of the center point of the outline of each preset mark in the image coordinate system where the motor image is located can be determined, based on the center point of the outline of each preset mark The distance between the image coordinates is used to obtain the pixel distance between each contour. For example, based on the image coordinates of the center points of the contours of each preset mark, the Euclidean distance or the Mahalanobis distance between the image coordinates of the center points of the contours of each preset mark may be determined as the pixel distance between the contours. Among them, the center point can be the geometric center point or the center of gravity point.

在一些实施方式中,可以根据每个预设标记的轮廓,确定每个预设标记的轮廓的边缘在电机图像所在的图像坐标系下的图像坐标,基于各预设标记的轮廓的边缘在电机图像所在的图像坐标系下的图像坐标,确定各预设标记的轮廓之间的像素距离。其中,边缘可以是外边缘,也可以是内边缘。In some embodiments, based on the outline of each preset mark, the image coordinates of the edge of the outline of each preset mark in the image coordinate system where the motor image is located can be determined, and based on the edge of the outline of each preset mark in the motor The image coordinates in the image coordinate system where the image is located determine the pixel distance between the outlines of each preset mark. The edge can be an outer edge or an inner edge.

在一些实施方式中,还可以基于各轮廓中预设关键点在电机图像所在的图像坐标系下的图像坐标,得到各预设标记的轮廓之间的像素距离。其中,预设关键点可以是轮廓的中心点,也可以是轮廓中边缘的中心点,还可以是轮廓中任意一点。In some implementations, the pixel distance between the contours of each preset mark can also be obtained based on the image coordinates of the preset key points in each contour in the image coordinate system where the motor image is located. Among them, the preset key point can be the center point of the contour, the center point of the edge in the contour, or any point in the contour.

在一些实施方式中,还可以基于各轮廓中预设关键点之间的像素数量,确定各预设标记的轮廓之间的像素距离。具体地,像素距离的确定方法包括:In some implementations, the pixel distance between the contours of each preset mark can also be determined based on the number of pixels between the preset key points in each contour. Specifically, the method for determining the pixel distance includes:

(1)根据各轮廓中的预设关键点的位置信息,确定各轮廓中的预设关键点之间的像素数量。(1) According to the position information of the preset key points in each outline, determine the number of pixels between the preset key points in each outline.

(2)将各轮廓中的预设关键点之间的像素数量确定为各轮廓之间的像素距离。(2) Determine the number of pixels between the preset key points in each contour as the pixel distance between each contour.

可选的,可以将各轮廓中预设关键点在电机图像中的位置信息进行比对,得到各轮廓中预设关键点之间的图像长度,基于各轮廓中预设关键点之间的图像长度以及该电机图像的分辨率,得到各轮廓中预设关键点之间的像素数量。Optionally, the position information of the preset key points in each outline in the motor image can be compared to obtain the image length between the preset key points in each outline, based on the image between the preset key points in each outline. The length and the resolution of the motor image are used to obtain the number of pixels between preset key points in each contour.

可选的,可以统计各轮廓中预设关键点在电机图像中的位置信息与其他轮廓中预设关键点在电机图像中的位置信息之间的像素点的数量,得到各轮廓中预设关键点之间的像素数量。Optionally, the number of pixels between the position information of the preset key points in the motor image in each contour and the position information of the preset key points in the motor image in other contours can be counted to obtain the preset key points in each contour. The number of pixels between points.

在一些实施方式中,在确定像素距离之后,可以基于图像坐标系与世界坐标系之间的映射关系,将像素距离映射到世界坐标系下,得到预处理后的电机图像中预设标记的移动距离。其中,图像坐标系与世界坐标系之间的映射关系用于指示图像坐标系下的坐标值与世界坐标下的坐标值下的映射关系。In some embodiments, after determining the pixel distance, the pixel distance can be mapped to the world coordinate system based on the mapping relationship between the image coordinate system and the world coordinate system to obtain the movement of the preset mark in the preprocessed motor image. distance. The mapping relationship between the image coordinate system and the world coordinate system is used to indicate the mapping relationship between the coordinate values in the image coordinate system and the coordinate values in the world coordinate system.

在一些实施方式中,还在确定像素距离之后,为确保移动距离计算准确度,还需要考虑电机图像中每个像素所代表的实际物理尺寸,进而确定预处理后的电机图像中预设标记的移动距离,即需要相机的预设像素精度以及像素距离,确定预处理后的电机图像中预设标记的移动距离,其中,相机的预设像素精度用于表征相机拍摄的图像中每个像素代表的实际物理尺寸。具体地,基于像素距离的移动距离确定方法包括:In some embodiments, after determining the pixel distance, in order to ensure the accuracy of the movement distance calculation, it is also necessary to consider the actual physical size represented by each pixel in the motor image, and then determine the preprocessed mark in the motor image. The moving distance requires the camera's preset pixel accuracy and pixel distance to determine the moving distance of the preset mark in the preprocessed motor image. The camera's preset pixel accuracy is used to characterize each pixel in the image captured by the camera. actual physical size. Specifically, the moving distance determination method based on pixel distance includes:

(1)基于各轮廓之间的像素距离以及相机的预设像素精度,得到预处理后的电机图像中预设标记的初始移动距离。(1) Based on the pixel distance between each contour and the preset pixel accuracy of the camera, the initial movement distance of the preset mark in the preprocessed motor image is obtained.

(2)根据预处理后的电机图像中预设标记的图像高度以及预设标记的预设实际高度,得到像素长度与实际距离之间的修正系数。(2) According to the image height of the preset mark in the preprocessed motor image and the preset actual height of the preset mark, the correction coefficient between the pixel length and the actual distance is obtained.

(3)基于修正系数对初始移动距离进行修正,得到预处理后的电机图像中预设标记的移动距离。(3) Correct the initial movement distance based on the correction coefficient to obtain the movement distance of the preset mark in the preprocessed motor image.

在一些实施方式中,可以根据各轮廓之间的像素距离以及相机的预设像素精度,通过像素距离*预设像素精度,得到预处理后的电机图像中预设标记的初始移动距离。In some implementations, the initial movement distance of the preset mark in the preprocessed motor image can be obtained based on the pixel distance between the contours and the preset pixel accuracy of the camera, using the pixel distance * the preset pixel accuracy.

在一些实施方式中,可以根据各轮廓之间的像素距离以及相机的预设像素精度,通过像素距离*预设像素精度,得到各轮廓之间的物理距离,将各轮廓之间的物理距离中的最远距离确定为预处理后的电机图像中预设标记的初始移动距离。In some implementations, the physical distance between the contours can be obtained based on the pixel distance between the contours and the preset pixel precision of the camera, and the physical distance between the contours is calculated by pixel distance * preset pixel precision. The farthest distance is determined as the initial movement distance of the preset mark in the preprocessed motor image.

其中,修正系数用于指示图像坐标系中长度与世界坐标系下的长度之间的映射系数。在一些实施方式中,可以预处理后的电机图像中预设标记的图像高度以及预设标记的预设实际高度,通过图像高度/预设实际高度,得到修正系数。其中,图像高度表征在电机图像所在的图像坐标系下预设标记的高度。Among them, the correction coefficient is used to indicate the mapping coefficient between the length in the image coordinate system and the length in the world coordinate system. In some embodiments, the image height of the preset mark and the preset actual height of the preset mark in the preprocessed motor image can be used to obtain the correction coefficient through the image height/preset actual height. Among them, the image height represents the height of the preset mark in the image coordinate system where the motor image is located.

在一些实施方式中,可以基于修正系数,通过修正系数*初始移动距离,得到预处理后的电机图像中预设标记的移动距离。In some implementations, based on the correction coefficient, the movement distance of the preset mark in the preprocessed motor image can be obtained by the correction coefficient*initial movement distance.

在一些实施方式中,在得到预处理后的电机图像中预设标记的移动距离之后,可以根据步骤230中待测电机的转速的确定方法,确定待测电机的转速。In some embodiments, after obtaining the movement distance of the preset mark in the preprocessed motor image, the rotation speed of the motor to be tested may be determined according to the method for determining the rotation speed of the motor to be tested in step 230.

考虑到由于厂房振动或电机关停后惯性运动,或者在电机低速运行时,电机转轴会出现低速运动,可能在相机的快门曝光时间内难以捕捉到预设标记的位置变化,或者预设标记的位置变化较小,因此,相机如果采用相同的快门曝光时间进行图像采集,就可能存在移动距离计算准确度不高的问题,进而降低转速测量结果的精准。基于此,为确保转速测量结果的精准,在一些实施方式中,在得到移动距离之后,将移动距离与预设距离阈值进行比较,在移动距离小于或等于预设距离阈值时,对相机的快门曝光时间进行调整,从而确保在相机的快门曝光时间内可以捕捉到预设标记的位置变化。具体地,如图5所示,图5是本发明实施例提供的另一种电机转速测量方法的流程示意图,所示的电机转速测量方法至少包括步骤510~580:Considering that due to factory vibration or inertial movement after the motor is shut down, or when the motor is running at low speed, the motor shaft will move at a low speed, it may be difficult to capture the position change of the preset mark during the shutter exposure time of the camera, or the position of the preset mark. The position change is small. Therefore, if the camera uses the same shutter exposure time for image acquisition, there may be a problem of inaccurate calculation of the moving distance, thereby reducing the accuracy of the rotational speed measurement results. Based on this, in order to ensure the accuracy of the rotation speed measurement results, in some embodiments, after obtaining the moving distance, the moving distance is compared with a preset distance threshold. When the moving distance is less than or equal to the preset distance threshold, the camera shutter is The exposure time is adjusted to ensure that the position changes of the preset mark can be captured within the camera's shutter exposure time. Specifically, as shown in Figure 5, Figure 5 is a schematic flow chart of another motor speed measurement method provided by an embodiment of the present invention. The motor speed measurement method shown at least includes steps 510 to 580:

步骤510,控制频闪光源按照预设的脉冲周期向待测电机投射光源,控制相机采集向待测电机投射光源过程中的电机图像。Step 510: Control the stroboscopic light source to project the light source to the motor to be tested according to a preset pulse period, and control the camera to collect images of the motor during the process of projecting the light source to the motor to be tested.

在一些实施方式中,可以参考图2提供的电机转速测量方法中步骤210,控制频闪光源按照预设的脉冲周期向待测电机投射光源,控制相机采集向待测电机投射光源过程中的电机图像,本发明实施例在此不进行赘述。In some embodiments, step 210 of the motor speed measurement method provided in Figure 2 can be referred to, the stroboscopic light source is controlled to project the light source to the motor to be tested according to the preset pulse period, and the camera is controlled to collect the motor during the process of projecting the light source to the motor to be tested. Image, the embodiment of the present invention will not be described in detail here.

在一些实施方式中,可以按照步骤a1~a2提供的脉冲周期的确定方法,确定预设的脉冲周期,参考图2提供的电机转速测量方法中步骤210,控制频闪光源按照预设的脉冲周期向待测电机投射光源,控制相机采集向待测电机投射光源过程中的电机图像,本发明实施例在此不进行赘述。In some embodiments, the preset pulse period can be determined according to the pulse period determination method provided in steps a1 to a2. Refer to step 210 in the motor speed measurement method provided in Figure 2 to control the stroboscopic light source according to the preset pulse period. Project a light source to the motor to be tested, and control the camera to collect the image of the motor during the process of projecting the light source to the motor to be tested. The embodiments of the present invention will not be described in detail here.

步骤520,对电机图像进行目标检测,确定电机图像中预设标记的移动距离。Step 520: Perform target detection on the motor image to determine the movement distance of the preset mark in the motor image.

在一些实施方式中,可以参考图4提供的预设标记的移动距离的检测方法,确定电机图像中预设标记的移动距离,本发明实施例在此不进行赘述。In some embodiments, the movement distance of the preset mark in the motor image can be determined with reference to the detection method of the movement distance of the preset mark provided in FIG. 4 , which will not be described in detail here in the embodiment of the present invention.

步骤530,若移动距离大于预设距离阈值,则基于移动距离以及预设的脉冲周期,确定待测电机的转速。Step 530: If the moving distance is greater than the preset distance threshold, determine the rotational speed of the motor to be tested based on the moving distance and the preset pulse period.

在一些实施方式中,可以将移动距离与预设距离阈值进行比较,若移动距离大于预设距离阈值,则按照图2提供的电机转速测量方法中步骤230确定待测电机的转速,本发明实施例在此不进行赘述。In some embodiments, the movement distance can be compared with the preset distance threshold. If the movement distance is greater than the preset distance threshold, the speed of the motor to be measured is determined according to step 230 of the motor speed measurement method provided in Figure 2. The present invention implements The example will not be repeated here.

步骤540,若移动距离小于或等于预设距离阈值,则调整相机的快门曝光时间、以及调整脉冲周期。Step 540: If the movement distance is less than or equal to the preset distance threshold, adjust the shutter exposure time of the camera and adjust the pulse period.

在一些实施方式中,若移动距离小于或等于预设距离阈值,则获取调整系数,基于调整系数对相机的快门曝光时间进行调整,基于调整后的快门曝光时间以及频闪光源的频闪次数,通过调整后的快门曝光时间/频闪光源的频闪次数,得到调整后的脉冲周期。其中,调整系数是大于1的整数。In some embodiments, if the movement distance is less than or equal to the preset distance threshold, the adjustment coefficient is obtained, and the shutter exposure time of the camera is adjusted based on the adjustment coefficient. Based on the adjusted shutter exposure time and the number of stroboscopic flashes of the stroboscopic light source, The adjusted pulse period is obtained through the adjusted shutter exposure time/number of stroboscopic flashes of the strobe light source. Among them, the adjustment coefficient is an integer greater than 1.

可选的,可以通过调整系数*相机的快门曝光时间,得到调整后的快门曝光时间。Optionally, you can obtain the adjusted shutter exposure time by adjusting the coefficient * the shutter exposure time of the camera.

可选的,可以通过相机的快门曝光时间*2^(调整系数),得到调整后的快门曝光时间。Optionally, you can get the adjusted shutter exposure time by using the camera's shutter exposure time*2^ (adjustment coefficient).

可选的,可以从预设的调整系数序列中获取调整系数;可选的,可以获取工作人员输入的调整系数;可选的,可以获取快门曝光时间的调整次数,将调整次数确定为调整系数,或者将2^(调整次数)确定为调整系数。Optionally, the adjustment coefficient can be obtained from a preset adjustment coefficient sequence; optionally, the adjustment coefficient input by the staff can be obtained; optionally, the number of adjustments to the shutter exposure time can be obtained, and the number of adjustments can be determined as the adjustment coefficient. , or determine 2^ (number of adjustments) as the adjustment coefficient.

步骤550,基于调整后的脉冲周期向待测电机投射光源,控制相机按照调整后的快门曝光时间,采集待测电机投射光源过程中的新的电机图像。Step 550: Project a light source to the motor under test based on the adjusted pulse period, and control the camera to collect a new motor image during the process of projecting the light source onto the motor under test according to the adjusted shutter exposure time.

在一些实施方式中,可以图2提供的电机转速测量方法中步骤210,基于调整后的脉冲周期向待测电机投射光源,控制相机按照调整后的快门曝光时间,采集待测电机投射光源过程中的新的电机图像,本发明实施例在此不进行赘述。In some embodiments, step 210 of the motor speed measurement method provided in Figure 2 can be used to project a light source to the motor under test based on the adjusted pulse period, and control the camera to collect the light source projected from the motor under test according to the adjusted shutter exposure time. The new motor image will not be described again in the embodiment of the present invention.

步骤560,对新的电机图像进行目标检测,确定电机图像中预设标记的新的移动距离。Step 560: Perform target detection on the new motor image to determine the new moving distance of the preset mark in the motor image.

在一些实施方式中,可以参考图4提供的预设标记的移动距离的检测方法,确定电机图像中预设标记的新的移动距离,本发明实施例在此不进行赘述。In some embodiments, the new movement distance of the preset mark in the motor image can be determined with reference to the detection method of the movement distance of the preset mark provided in FIG. 4 , which will not be described in detail here in the embodiment of the present invention.

步骤570,若新的移动距离小于或等于预设距离阈值,则将预设转速确定为待测电机的转速。Step 570: If the new movement distance is less than or equal to the preset distance threshold, the preset rotation speed is determined as the rotation speed of the motor to be tested.

在一些实施方式中,若新的移动距离小于或等于预设距离阈值,则重复步骤540~560,得到新的移动距离,若新的移动距离小于或等于预设距离阈值,说明待测电机转轴无转速,或转速过低,则将设转速确定为待测电机的转速。其中,预设转速可以是0/s。In some embodiments, if the new movement distance is less than or equal to the preset distance threshold, then steps 540 to 560 are repeated to obtain the new movement distance. If the new movement distance is less than or equal to the preset distance threshold, the motor shaft to be tested is If there is no speed or the speed is too low, the set speed will be determined as the speed of the motor under test. Among them, the preset rotation speed can be 0/s.

在一些实施方式中,若新的移动距离小于或等于预设距离阈值,则快门曝光时间调整次数大于预设次数阈值,则将设转速确定为待测电机的转速;若快门曝光时间调整次数小于或等于预设次数阈值,则重复步骤540~560,得到新的移动距离。In some embodiments, if the new movement distance is less than or equal to the preset distance threshold, and the number of shutter exposure time adjustments is greater than the preset number threshold, then the set rotation speed is determined as the rotation speed of the motor to be tested; if the number of shutter exposure time adjustments is less than or equal to the preset times threshold, then steps 540 to 560 are repeated to obtain a new moving distance.

步骤580,步骤560之后,若新的移动距离大于预设距离阈值,则基于新的移动距离以及调整后的脉冲周期,确定待测电机的转速。Step 580. After step 560, if the new moving distance is greater than the preset distance threshold, the rotation speed of the motor to be tested is determined based on the new moving distance and the adjusted pulse period.

在一些实施方式中,新的移动距离大于预设距离阈值,则按照图2提供的电机转速测量方法中步骤230确定待测电机的转速,本发明实施例在此不进行赘述。In some embodiments, if the new movement distance is greater than the preset distance threshold, the rotation speed of the motor to be measured is determined according to step 230 of the motor rotation speed measurement method provided in Figure 2. This embodiment of the present invention will not be repeated here.

本发明实施例提供的电机转速测量方法,通过增加移动距离的检测,当转速过低或无转速,导致像素精度不够不能准确获取移动距离时,自动控制相机快门曝光时间,通过增大快门曝光时间,来获取有效的移动距离,使得相机、脉冲发生器等设备的参数与待测电机的当前转速匹配,进行更加精确的测量,避免由于转速过低或者厂房振动造成的转速测量结果不准的问题。The motor speed measurement method provided by the embodiment of the present invention automatically controls the camera shutter exposure time by increasing the detection of the moving distance. When the rotation speed is too low or has no rotation speed, resulting in insufficient pixel accuracy and the moving distance cannot be accurately obtained, the camera shutter exposure time is increased. , to obtain the effective moving distance, so that the parameters of the camera, pulse generator and other equipment can match the current speed of the motor to be measured, to perform more accurate measurements and avoid inaccurate speed measurement results due to too low speed or factory vibration. .

为了更好实施本发明实施例提供的电机转速测量方法,在电机转速测量方法实施例基础上,本发明实施例提供一种电机转速测量装置,如图6所示,图6是本发明实施例提供的电机转速测量装置的结构示意图,所示的电机转速测量装置包括:In order to better implement the motor speed measurement method provided by the embodiment of the present invention, based on the embodiment of the motor speed measurement method, the embodiment of the present invention provides a motor speed measurement device, as shown in Figure 6. Figure 6 is an embodiment of the present invention The structural schematic diagram of the motor speed measurement device is provided. The motor speed measurement device shown includes:

图像采集模块601,用于控制频闪光源按照预设的脉冲周期向待测电机投射光源,控制相机采集向待测电机投射光源过程中的电机图像;待检测电机转轴的表面设置有预设标记;The image acquisition module 601 is used to control the stroboscopic light source to project the light source to the motor to be tested according to a preset pulse period, and to control the camera to collect the motor image during the process of projecting the light source to the motor to be tested; the surface of the motor shaft to be detected is provided with preset marks. ;

距离检测模块602,用于对电机图像进行目标检测,确定电机图像中预设标记的移动距离;The distance detection module 602 is used to perform target detection on the motor image and determine the movement distance of the preset mark in the motor image;

转速测量模块603,用于基于移动距离以及预设的脉冲周期,确定待测电机的转速。The rotation speed measurement module 603 is used to determine the rotation speed of the motor to be tested based on the movement distance and the preset pulse period.

在一些实施方式中,距离检测模块602,包括:In some implementations, the distance detection module 602 includes:

图像预处理单元,用于对电机图像进行预处理,得到预处理后的电机图像;The image preprocessing unit is used to preprocess the motor image to obtain the preprocessed motor image;

边缘检测单元,用于对预处理后的电机图像进行边缘检测,确定预处理后的电机图像中每个预设标记的轮廓;An edge detection unit, used to perform edge detection on the preprocessed motor image and determine the outline of each preset mark in the preprocessed motor image;

距离检测单元,用于确定各轮廓之间的像素距离,基于各轮廓之间的像素距离,确定预处理后的电机图像中预设标记的移动距离。The distance detection unit is used to determine the pixel distance between each contour, and determine the movement distance of the preset mark in the preprocessed motor image based on the pixel distance between each contour.

在一些实施方式中,距离检测单元,用于:In some embodiments, the distance detection unit is used for:

基于各轮廓之间的像素距离以及相机的预设像素精度,得到预处理后的电机图像中预设标记的初始移动距离;Based on the pixel distance between each contour and the preset pixel accuracy of the camera, the initial movement distance of the preset mark in the preprocessed motor image is obtained;

根据预处理后的电机图像中预设标记的像素高度以及预设标记的预设实际高度,得到像素长度与实际距离之间的修正系数;According to the pixel height of the preset mark in the preprocessed motor image and the preset actual height of the preset mark, the correction coefficient between the pixel length and the actual distance is obtained;

基于修正系数对初始移动距离进行修正,得到预处理后的电机图像中预设标记的移动距离。The initial movement distance is corrected based on the correction coefficient to obtain the movement distance of the preset mark in the preprocessed motor image.

在一些实施方式中,距离检测单元,用于:In some embodiments, the distance detection unit is used for:

根据各轮廓中的预设关键点的位置信息,确定各轮廓中的预设关键点之间的像素数量;Determine the number of pixels between the preset key points in each contour based on the position information of the preset key points in each contour;

将各轮廓中的预设关键点之间的像素数量确定为各轮廓之间的像素距离。The number of pixels between preset keypoints in each contour is determined as the pixel distance between each contour.

在一些实施方式中,转速测量模块603,用于:In some embodiments, the rotation speed measurement module 603 is used for:

根据移动距离以及预设的脉冲周期,得到待测电机的线速度;According to the moving distance and the preset pulse period, the linear speed of the motor under test is obtained;

获取待检测电机转轴的转轴半径;Get the shaft radius of the motor shaft to be detected;

根据转轴半径以及线速度,得到待测电机的转速。According to the radius of the rotating shaft and the linear speed, the rotation speed of the motor under test is obtained.

在一些实施方式中,电机转速测量装置还包括:In some embodiments, the motor speed measuring device further includes:

反馈调节模块604,用于若移动距离小于或等于预设距离阈值,则调整相机的快门曝光时间、以及调整脉冲周期;The feedback adjustment module 604 is used to adjust the shutter exposure time of the camera and adjust the pulse period if the movement distance is less than or equal to the preset distance threshold;

图像采集模块601,用于基于调整后的脉冲周期向待测电机投射光源,控制相机按照调整后的快门曝光时间,采集待测电机投射光源过程中的新的电机图像;The image acquisition module 601 is used to project a light source to the motor to be tested based on the adjusted pulse period, and control the camera to collect a new motor image during the process of projecting the light source of the motor to be tested according to the adjusted shutter exposure time;

距离检测模块602,用于对新的电机图像进行目标检测,确定电机图像中预设标记的新的移动距离;The distance detection module 602 is used to perform target detection on the new motor image and determine the new movement distance of the preset mark in the motor image;

转速测量模块603,用于,若新的移动距离小于或等于预设距离阈值,则将预设转速确定为待测电机的转速;若新的移动距离大于预设距离阈值,则基于新的移动距离以及调整后的脉冲周期,确定待测电机的转速。The rotation speed measurement module 603 is used to determine the preset rotation speed as the rotation speed of the motor to be measured if the new movement distance is less than or equal to the preset distance threshold; if the new movement distance is greater than the preset distance threshold, determine the preset rotation speed based on the new movement distance. The distance and the adjusted pulse period determine the speed of the motor under test.

在一些实施方式中,电机转速测量装置还包括:In some embodiments, the motor speed measuring device further includes:

控制模块605,用于获取相机的快门曝光时间、以及在快门曝光时间内频闪光源的频闪次数;根据快门曝光时间和频闪次数,确定频闪光源的预设的脉冲周期。The control module 605 is used to obtain the shutter exposure time of the camera and the number of stroboscopic flashes of the stroboscopic light source within the shutter exposure time; and determine the preset pulse period of the stroboscopic light source based on the shutter exposure time and the number of stroboscopic flashes.

本发明实施例提供的电机转速测量装置,通过脉冲信号控制频闪光源频闪,分析相机在频闪过程中采集到的成像图片,利用分析图片中预设标记的像素移动范围以及预设的脉冲周期,实现发电机转速的测量,避免由于齿盘的齿距不一致造成的转速测量不准确的问题;并且不需要在发电机转动部件上增加结构件,降低了系统的复杂性,消除了在转动部件增加结构件带来的安全风险,此外相机和转轴可保持较大距离,消除了测量方法中动静部件碰磨的风险。The motor speed measuring device provided by the embodiment of the present invention controls the strobe light source to strobe through pulse signals, analyzes the imaging pictures collected by the camera during the strobe process, and analyzes the pixel movement range of the preset markers in the pictures and the preset pulses. period, to achieve the measurement of generator speed, avoiding the problem of inaccurate speed measurement caused by inconsistent tooth pitch of the tooth plate; and there is no need to add structural parts to the rotating parts of the generator, which reduces the complexity of the system and eliminates the need to Components increase the safety risks caused by structural parts. In addition, the camera and the rotating shaft can be kept at a large distance, eliminating the risk of collision of dynamic and static components in the measurement method.

本发明实施例还提供一种电子设备,如图7所示,其示出了本发明实施例所涉及的电子设备的结构示意图,具体来讲:An embodiment of the present invention also provides an electronic device, as shown in Figure 7, which shows a schematic structural diagram of the electronic device involved in the embodiment of the present invention. Specifically:

该电子设备可以包括一个或者一个以上处理核心的处理器701、一个或一个以上计算机可读存储介质的存储器702、电源703和输入单元704等部件。本领域技术人员可以理解,图7中示出的电子设备结构并不构成对电子设备的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。其中:The electronic device may include components such as a processor 701 of one or more processing cores, a memory 702 of one or more computer-readable storage media, a power supply 703, and an input unit 704. Those skilled in the art can understand that the structure of the electronic device shown in FIG. 7 does not constitute a limitation of the electronic device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange different components. in:

处理器701是该电子设备的控制中心,利用各种接口和线路连接整个电子设备的各个部分,通过运行或执行存储在存储器702内的软件程序和/或模块,以及调用存储在存储器702内的数据,执行电子设备的各种功能和处理数据,从而对电子设备进行整体监控。可选的,处理器701可包括一个或多个处理核心;优选的,处理器701可集成应用处理器和调制解调处理器,其中,应用处理器主要处理操作系统、用户界面和应用程序等,调制解调处理器主要处理无线通信。可以理解的是,上述调制解调处理器也可以不集成到处理器701中。The processor 701 is the control center of the electronic device, using various interfaces and lines to connect various parts of the entire electronic device, by running or executing software programs and/or modules stored in the memory 702, and calling software programs stored in the memory 702. Data, perform various functions of the electronic device and process the data to conduct overall monitoring of the electronic device. Optionally, the processor 701 may include one or more processing cores; preferably, the processor 701 may integrate an application processor and a modem processor, where the application processor mainly processes operating systems, user interfaces, application programs, etc. , the modem processor mainly handles wireless communications. It can be understood that the above-mentioned modem processor may not be integrated into the processor 701.

存储器702可用于存储软件程序以及模块,处理器701通过运行存储在存储器702的软件程序以及模块,从而执行各种功能应用以及数据处理。存储器702可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序(比如声音播放功能、图像播放功能等)等;存储数据区可存储根据电子设备的使用所创建的数据等。此外,存储器702可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。相应地,存储器702还可以包括存储器控制器,以提供处理器701对存储器702的访问。The memory 702 can be used to store software programs and modules. The processor 701 executes various functional applications and data processing by running the software programs and modules stored in the memory 702 . The memory 702 may mainly 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 (such as a sound playback function, an image playback function, etc.), etc.; the storage data area may store a program based on Data created by the use of electronic devices, etc. In addition, memory 702 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 volatile solid-state storage device. Accordingly, the memory 702 may also include a memory controller to provide the processor 701 with access to the memory 702 .

电子设备还包括给各个部件供电的电源703,优选的,电源703可以通过电源管理系统与处理器701逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗管理等功能。电源703还可以包括一个或一个以上的直流或交流电源、再充电系统、电源故障检测电路、电源转换器或者逆变器、电源状态指示器等任意组件。The electronic device also includes a power supply 703 that supplies power to various components. Preferably, the power supply 703 can be logically connected to the processor 701 through a power management system, so that functions such as charging, discharging, and power consumption management can be implemented through the power management system. Power supply 703 may also include one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, power status indicators, and other arbitrary components.

该电子设备还可包括输入单元704,该输入单元704可用于接收输入的数字或字符信息,以及产生与用户设置以及功能控制有关的键盘、鼠标、操作杆、光学或者轨迹球信号输入。The electronic device may also include an input unit 704 that may be used to receive input numeric or character information and generate keyboard, mouse, joystick, optical, or trackball signal input related to user settings and function control.

尽管未示出,电子设备还可以包括显示单元等,在此不再赘述。具体在本实施例中,电子设备中的处理器701会按照如下的指令,将一个或一个以上的应用程序的进程对应的可执行文件加载到存储器702中,并由处理器701来运行存储在存储器702中的应用程序,从而实现各种功能,如下:Although not shown, the electronic device may also include a display unit and the like, which will not be described again here. Specifically, in this embodiment, the processor 701 in the electronic device will load the executable files corresponding to the processes of one or more application programs into the memory 702 according to the following instructions, and the processor 701 will run the executable files stored in The application program in the memory 702 implements various functions, as follows:

控制频闪光源按照预设的脉冲周期向待测电机投射光源,控制相机采集向待测电机投射光源过程中的电机图像;待检测电机转轴的表面设置有预设标记;The stroboscopic light source is controlled to project the light source to the motor to be tested according to a preset pulse period, and the camera is controlled to collect the motor image during the process of projecting the light source to the motor to be tested; a preset mark is set on the surface of the motor shaft to be detected;

对电机图像进行目标检测,确定电机图像中预设标记的移动距离;Perform target detection on the motor image and determine the moving distance of the preset mark in the motor image;

基于移动距离以及预设的脉冲周期,确定待测电机的转速。Based on the moving distance and the preset pulse period, the rotation speed of the motor under test is determined.

本领域普通技术人员可以理解,上述实施例的各种方法中的全部或部分步骤可以通过指令来完成,或通过指令控制相关的硬件来完成,该指令可以存储于一计算机可读存储介质中,并由处理器进行加载和执行。Those of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructions, or by controlling relevant hardware through instructions. The instructions can be stored in a computer-readable storage medium, and loaded and executed by the processor.

为此,本发明实施例提供一种存储介质,其中存储有多条指令,该指令能够被处理器进行加载,以执行本发明实施例所提供的任一种电机转速测量方法中的步骤。例如,该指令可以执行如下步骤:To this end, embodiments of the present invention provide a storage medium in which a plurality of instructions are stored, and the instructions can be loaded by a processor to execute the steps in any motor speed measurement method provided by embodiments of the present invention. For example, this command can perform the following steps:

控制频闪光源按照预设的脉冲周期向待测电机投射光源,控制相机采集向待测电机投射光源过程中的电机图像;待检测电机转轴的表面设置有预设标记;The stroboscopic light source is controlled to project the light source to the motor to be tested according to a preset pulse period, and the camera is controlled to collect the motor image during the process of projecting the light source to the motor to be tested; a preset mark is set on the surface of the motor shaft to be detected;

对电机图像进行目标检测,确定电机图像中预设标记的移动距离;Perform target detection on the motor image and determine the moving distance of the preset mark in the motor image;

基于移动距离以及预设的脉冲周期,确定待测电机的转速。Based on the moving distance and the preset pulse period, the rotation speed of the motor under test is determined.

以上各个操作的具体实施可参见前面的实施例,在此不再赘述。For the specific implementation of each of the above operations, please refer to the previous embodiments and will not be described again here.

其中,该存储介质可以包括:只读存储器(ROM,Read Only Memory)、随机存取记忆体(RAM,Random Access Memory)、磁盘或光盘等。The storage medium may include: read only memory (ROM, Read Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disk, etc.

由于该存储介质中所存储的指令,可以执行本发明实施例所提供的任一种电机转速测量方法中的步骤,因此,可以实现本发明实施例所提供的任一种电机转速测量方法所能实现的有益效果,详见前面的实施例,在此不再赘述。Since the instructions stored in the storage medium can execute the steps in any motor speed measurement method provided by the embodiment of the present invention, therefore, any of the motor speed measurement methods provided by the embodiment of the present invention can be realized. The beneficial effects achieved are detailed in the previous embodiments and will not be described again here.

以上对本发明实施例所提供的一种电机转速测量方法、装置、电子设备和存储介质进行了详细介绍,本文中应用了具体个例对本发明的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本发明的方法及其核心思想;同时,对于本领域的技术人员,依据本发明的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本发明的限制。The above is a detailed introduction to a motor speed measurement method, device, electronic equipment and storage medium provided by the embodiments of the present invention. This article uses specific examples to illustrate the principles and implementation methods of the present invention. The description of the above embodiments It is only used to help understand the method and its core idea of the present invention; at the same time, for those skilled in the art, there will be changes in the specific implementation and application scope according to the idea of the present invention. In summary, this The content of the description should not be construed as limiting the invention.

Claims (10)

1. A method of measuring rotational speed of an electric motor, the method comprising:
the method comprises the steps of controlling a stroboscopic light source to project a light source to a motor to be tested according to a preset pulse period, and controlling a camera to acquire a motor image in the process of projecting the light source to the motor to be tested; the surface of the motor rotating shaft to be detected is provided with a preset mark;
performing target detection on the motor image, and determining the moving distance of a preset mark in the motor image;
and determining the rotating speed of the motor to be tested based on the moving distance and the preset pulse period.
2. The method for measuring a rotational speed of a motor according to claim 1, wherein the performing object detection on the motor image to determine a moving distance of a preset mark in the motor image includes:
Preprocessing the motor image to obtain a preprocessed motor image;
performing edge detection on the preprocessed motor image, and determining the outline of each preset mark in the preprocessed motor image;
and determining the pixel distance between the outlines, and determining the moving distance of a preset mark in the preprocessed motor image based on the pixel distance between the outlines.
3. The motor rotation speed measurement method according to claim 2, wherein the determining a movement distance of a preset mark in the preprocessed motor image based on a pixel distance between the contours includes:
obtaining an initial moving distance of a preset mark in the preprocessed motor image based on a pixel distance between the outlines and a preset pixel precision of the camera;
obtaining a correction coefficient between the pixel length and the actual distance according to the pixel height of a preset mark in the preprocessed motor image and the preset actual height of the preset mark;
and correcting the initial moving distance based on the correction coefficient to obtain the moving distance of the preset mark in the preprocessed motor image.
4. The motor speed measurement method according to claim 2, wherein the determining the pixel distance between the profiles includes:
determining the number of pixels between preset key points in each contour according to the position information of the preset key points in each contour;
and determining the number of pixels between preset key points in each contour as the pixel distance between the contours.
5. The motor rotation speed measurement method according to claim 1, wherein the determining the rotation speed of the motor to be measured based on the moving distance and the preset pulse period includes:
obtaining the linear speed of the motor to be tested according to the moving distance and the preset pulse period;
acquiring the radius of a rotating shaft of the motor to be detected;
and obtaining the rotating speed of the motor to be tested according to the radius of the rotating shaft and the linear speed.
6. The motor speed measurement method according to claim 1, wherein after the target detection is performed on the motor image and the moving distance of the preset mark in the motor image is determined, the method further comprises:
if the moving distance is smaller than or equal to a preset distance threshold value, adjusting shutter exposure time of the camera and adjusting the pulse period;
Based on the adjusted pulse period, projecting a light source to the motor to be detected, controlling the camera to acquire a new motor image in the process of projecting the light source to the motor to be detected according to the adjusted shutter exposure time;
performing target detection on the new motor image, and determining a new moving distance of a preset mark in the motor image;
if the new moving distance is smaller than or equal to the preset distance threshold value, determining a preset rotating speed as the rotating speed of the motor to be detected;
and if the new moving distance is larger than the preset distance threshold, determining the rotating speed of the motor to be detected based on the new moving distance and the adjusted pulse period.
7. The method for measuring the rotational speed of a motor according to any one of claims 1 to 6, wherein the controlling the strobe light source projects a light source to the motor to be measured according to a preset pulse period, and the method comprises, before the controlling the camera to collect an image of the motor during the projection of the light source to the motor to be measured:
acquiring shutter exposure time of a camera and strobe times of a strobe light source in the shutter exposure time;
and determining a preset pulse period of the stroboscopic light source according to the shutter exposure time and the stroboscopic frequency.
8. A motor speed measurement device, the device comprising:
the image acquisition module is used for controlling the stroboscopic light source to project a light source to the motor to be detected according to a preset pulse period and controlling the camera to acquire a motor image in the process of projecting the light source to the motor to be detected; the surface of the motor rotating shaft to be detected is provided with a preset mark;
the distance detection module is used for carrying out target detection on the motor image and determining the moving distance of a preset mark in the motor image;
and the rotating speed measuring module is used for determining the rotating speed of the motor to be measured based on the moving distance and the preset pulse period.
9. An electronic device comprising a memory and a processor; the memory stores an application program, and the processor is configured to execute the application program in the memory to perform the operations in the motor rotation speed measurement method according to any one of claims 1 to 7.
10. A storage medium storing a plurality of instructions adapted to be loaded by a processor to perform the steps of the motor speed measurement method of any one of claims 1 to 7.
CN202310869397.7A 2023-07-14 2023-07-14 Motor rotation speed measuring method and device, electronic equipment and storage medium Pending CN116819113A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202310869397.7A CN116819113A (en) 2023-07-14 2023-07-14 Motor rotation speed measuring method and device, electronic equipment and storage medium
PCT/CN2024/098716 WO2025016113A1 (en) 2023-07-14 2024-06-12 Motor speed measurement method and apparatus, electronic device, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310869397.7A CN116819113A (en) 2023-07-14 2023-07-14 Motor rotation speed measuring method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116819113A true CN116819113A (en) 2023-09-29

Family

ID=88120252

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310869397.7A Pending CN116819113A (en) 2023-07-14 2023-07-14 Motor rotation speed measuring method and device, electronic equipment and storage medium

Country Status (2)

Country Link
CN (1) CN116819113A (en)
WO (1) WO2025016113A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2025016113A1 (en) * 2023-07-14 2025-01-23 国家电投集团黄河上游水电开发有限责任公司 Motor speed measurement method and apparatus, electronic device, and storage medium

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102944689A (en) * 2012-11-13 2013-02-27 江苏科技大学 Brushless direct-current motor rotation speed detection device adopting charge coupled device (CCD) camera and method
JP6716375B2 (en) * 2016-07-12 2020-07-01 株式会社小野測器 Rotation speed measuring device
CN206832833U (en) * 2016-10-24 2018-01-02 杭州品拓电子技术有限公司 Motor speed self-operated measuring unit
CN106370880B (en) * 2016-10-24 2023-05-05 杭州品拓电子技术有限公司 Automatic measuring method and device for motor rotation speed
CN110702936A (en) * 2019-10-14 2020-01-17 深圳东方锅炉控制有限公司 Device and method for measuring rotating speed of air preheater based on laser image recognition
CN114979427A (en) * 2022-03-30 2022-08-30 天津大学 High-speed synchronous stroboscopic rotor blade tip image acquisition device and method
CN116819113A (en) * 2023-07-14 2023-09-29 青海黄河上游水电开发有限责任公司 Motor rotation speed measuring method and device, electronic equipment and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2025016113A1 (en) * 2023-07-14 2025-01-23 国家电投集团黄河上游水电开发有限责任公司 Motor speed measurement method and apparatus, electronic device, and storage medium

Also Published As

Publication number Publication date
WO2025016113A1 (en) 2025-01-23

Similar Documents

Publication Publication Date Title
EP2416113A2 (en) Position and orientation measurement apparatus and position and orientation measurement method
CN109000559B (en) A method, device, system and readable storage medium for measuring the volume of an object
CN109941274A (en) Parking method and system, server and medium based on radar range finding identification gantry crane
WO2025016113A1 (en) Motor speed measurement method and apparatus, electronic device, and storage medium
EP2985566A1 (en) Data generation method and data generation device
CN113804418B (en) Laser position adjusting method and device
CN108322737B (en) Method and device for measuring camera shooting frame rate
CN117246720A (en) A coal conveyor belt failure early warning method and system based on computer vision algorithm
CN101458119B (en) Method for real-time detecting bearing shell vibration by image analysis
CN113358351A (en) Rotating shaft end face torsional vibration extraction method and device based on photogrammetry
CN117928401A (en) Polymer monofilament wire diameter detection device and detection method based on machine vision
TW201642180A (en) Image processing method and image processing device
CN113902652B (en) Speckle image correction method, depth calculation method, device, medium, and apparatus
JP2024544327A (en) Method for operating a CT imaging system - Patent application
CN108965525B (en) Detection method and device, terminal, computer equipment and readable storage medium
US20210307619A1 (en) Fever detection
US11493453B2 (en) Belt inspection system, belt inspection method, and recording medium for belt inspection program
CN117853445A (en) Target tracking analysis method and system based on machine vision
CN104704532A (en) A Hough transform approach to gap measurement in blade inspection
CN116203532A (en) Method, device, equipment and storage medium for adjusting radar levelness consistency
CN113766175B (en) Target monitoring method, device, equipment and storage medium
KR102368031B1 (en) Method and apparatus for recognizing the length of a slab using an artificial neural network
CN215114844U (en) Noise detection device applied to active medical equipment
WO2023108498A1 (en) Zero-speed interval detection method, pedestrian navigation system and storage medium
CN115104113A (en) Work rate measuring apparatus and work rate measuring method

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