CN109343374B - LabVIEW-based pulse synchronization control two-dimensional scanning and signal acquisition method - Google Patents

LabVIEW-based pulse synchronization control two-dimensional scanning and signal acquisition method Download PDF

Info

Publication number
CN109343374B
CN109343374B CN201811063971.5A CN201811063971A CN109343374B CN 109343374 B CN109343374 B CN 109343374B CN 201811063971 A CN201811063971 A CN 201811063971A CN 109343374 B CN109343374 B CN 109343374B
Authority
CN
China
Prior art keywords
signal
axis
acquisition
module
motor
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201811063971.5A
Other languages
Chinese (zh)
Other versions
CN109343374A (en
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.)
Xiamen University
Original Assignee
Xiamen University
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 Xiamen University filed Critical Xiamen University
Priority to CN201811063971.5A priority Critical patent/CN109343374B/en
Publication of CN109343374A publication Critical patent/CN109343374A/en
Application granted granted Critical
Publication of CN109343374B publication Critical patent/CN109343374B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B19/00Programme-control systems
    • G05B19/02Programme-control systems electric
    • G05B19/04Programme control other than numerical control, i.e. in sequence controllers or logic controllers

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Automation & Control Theory (AREA)
  • Control Of Stepping Motors (AREA)
  • Sampling And Sample Adjustment (AREA)

Abstract

本发明公开一种基于LabVIEW的脉冲同步控制二维扫描和信号采集实现方法。所述方法包括硬件结构和软件模块;所述硬件结构由工作站、板载数据采集卡、信号放大器、工作站电源、运动控制模块、运动控制模块电源和超声传感器组成;所述软件模块基于LabVIEW平台开发,通过硬件控制两个电机进行二维栅扫描,同时实现电信号的采集;所述软件模块由控制面板和显示面板组成,控制面板包括位置调节模块、参数设置模块和信号采集模块,显示面板包括二维实时信号显示模块、实时信号显示模块和信号位置显示模块。所述方法能够实现X轴电机和Y轴电机的单独以及联合控制并设置信号高精度采集间距,快速准确定位信号采集点,有效提高了信号采集的效率和稳定性。

Figure 201811063971

The invention discloses a method for realizing pulse synchronization control two-dimensional scanning and signal acquisition based on LabVIEW. The method includes a hardware structure and a software module; the hardware structure is composed of a workstation, an onboard data acquisition card, a signal amplifier, a workstation power supply, a motion control module, a motion control module power supply and an ultrasonic sensor; the software module is developed based on the LabVIEW platform , through the hardware to control two motors to perform two-dimensional grid scanning, and realize the acquisition of electrical signals at the same time; the software module is composed of a control panel and a display panel, the control panel includes a position adjustment module, a parameter setting module and a signal acquisition module, and the display panel includes Two-dimensional real-time signal display module, real-time signal display module and signal position display module. The method can realize the independent and joint control of the X-axis motor and the Y-axis motor, set the signal acquisition distance with high precision, quickly and accurately locate the signal acquisition point, and effectively improve the efficiency and stability of the signal acquisition.

Figure 201811063971

Description

基于LabVIEW的脉冲同步控制二维扫描和信号采集方法LabVIEW-based pulse synchronization control two-dimensional scanning and signal acquisition method

技术领域technical field

本发明属于自动控制和信号采集存储技术领域,具体涉及一种基于LabVIEW的脉冲同步控制二维扫描和信号采集实现方法。The invention belongs to the technical field of automatic control and signal acquisition and storage, and in particular relates to a LabVIEW-based pulse synchronization control two-dimensional scanning and signal acquisition implementation method.

背景技术Background technique

在信号采集技术中,利用控制系统对时变信号进行实时采集和存储是极其重要的。基于LabVIEW(Laboratory Virtual Instrument Engineering Workbench)图形化编程语言进行操作平台设计,相比于其他编程语言编程界面直观易懂,用户界面友好。相对于其他控制电机的形式例如单片机等等需要有专门的编程知识,专业门槛较高, LabVIEW的操作界面更加简洁,可视化的编程语言便于理解和操控。已申请的专利中缺少电机的协同运动与运动过程中信号的收集的联合。例如在2015年12月大连理工大学贾振元等申请的专利“一种基于LabVIEW的多电机控制系统”中,该方法实现了对多台电机的快速稳定控制,但该方法实现过程较复杂且无法满足在运动过程中同时进行信号采集的要求。对运动过程中的信号分析是信号采集储存领域符合生产的实际需求。因此,需要一种新的方法解决多电机快速稳定控制协同信号采集的问题。In the signal acquisition technology, it is extremely important to use the control system to acquire and store time-varying signals in real time. The operation platform is designed based on the LabVIEW (Laboratory Virtual Instrument Engineering Workbench) graphical programming language. Compared with other programming languages, the programming interface is intuitive and easy to understand, and the user interface is friendly. Compared with other forms of motor control, such as single-chip microcomputer, special programming knowledge is required, and the professional threshold is higher. The operation interface of LabVIEW is more concise, and the visual programming language is easy to understand and control. The combination of the coordinated motion of the motors and the collection of signals during the motion is missing from the patent application. For example, in the patent "a multi-motor control system based on LabVIEW" applied by Jia Zhenyuan of Dalian University of Technology in December 2015, this method realizes fast and stable control of multiple motors, but the implementation process of this method is complicated and cannot satisfy The requirement for simultaneous signal acquisition during motion. The signal analysis in the movement process is in line with the actual needs of production in the field of signal acquisition and storage. Therefore, a new method is needed to solve the problem of multi-motor fast and stable control cooperative signal acquisition.

LabVIEW是一种程序开发环境,由美国国家仪器(NI)公司研制开发,类似于C和BASIC开发环境,但是LabVIEW与其他计算机语言的显著区别是:其他计算机语言都是采用基于文本的语言产生代码,而LabVIEW使用的是图形化编辑语言G编写程序,产生的程序是框图的形式。LabVIEW软件是NI设计平台的核心,也是开发测量或控制系统的理想选择。LabVIEW开发环境集成了工程师和科学家快速构建各种应用所需的所有工具,旨在帮助工程师和科学家解决问题、提高生产力和不断创新。LabVIEW is a program development environment developed by National Instruments (NI), similar to C and BASIC development environments, but the significant difference between LabVIEW and other computer languages is that other computer languages use text-based languages to generate code , and LabVIEW uses the graphical editing language G to write programs, and the resulting programs are in the form of block diagrams. LabVIEW software is at the heart of the NI design platform and is ideal for developing measurement or control systems. The LabVIEW development environment integrates all the tools engineers and scientists need to rapidly build a variety of applications designed to help engineers and scientists solve problems, increase productivity, and innovate.

与C和BASIC一样,LabVIEW也是通用的编程系统,有一个能用于完成任何编程任务的庞大函数库。LabVIEW的函数库包括数据采集、GPIB、串口控制、数据分析、数据显示及数据存储,等等。 LabVIEW也有传统的程序调试工具,如设置断点、以动画方式显示数据及其子程序(子VI(Virtual Instrument,虚拟仪器))的结果、单步执行等等,便于程序的调试。Like C and BASIC, LabVIEW is a general-purpose programming system with a large library of functions that can be used to accomplish any programming task. The function library of LabVIEW includes data acquisition, GPIB, serial port control, data analysis, data display and data storage, and so on. LabVIEW also has traditional program debugging tools, such as setting breakpoints, displaying data and its subprograms (subVI (Virtual Instrument, virtual instrument)) results in animation, single-step execution, etc., which is convenient for program debugging.

LabVIEW是一种用图标代替文本行创建应用程序的图形化编程语言。传统文本编程语言根据语句和指令的先后顺序决定程序执行顺序,而LabVIEW则采用数据流编程方式,程序框图中节点之间的数据流向决定了VI及函数的执行顺序。VI指虚拟仪器,是LabVIEW的程序模块。LabVIEW is a graphical programming language that uses icons instead of lines of text to create applications. Traditional text programming languages determine the program execution order according to the sequence of statements and instructions, while LabVIEW uses data flow programming. The data flow between nodes in the block diagram determines the execution order of VIs and functions. VI refers to a virtual instrument and is a program module of LabVIEW.

LabVIEW提供很多外观与传统仪器(如示波器、万用表)类似的控件,可用来方便地创建用户界面。用户界面在LabVIEW中被称为前面板。使用图标和连线,可以通过编程对前面板上的对象进行控制。这就是图形化源代码,又称G代码。LabVIEW的图形化源代码在某种程度上类似于流程图,因此又被称作程序框图代码。LabVIEW 的特点是:尽可能采用通用的硬件,各种仪器的差异主要是软件;可充分发挥计算机的能力,有强大的数据处理功能,可以创造出功能更强的仪器;用户可以根据自己的需要定义和制造各种仪器。LabVIEW provides many controls that look similar to traditional instruments (eg, oscilloscopes, multimeters) and can be used to easily create user interfaces. The user interface is called the front panel in LabVIEW. Objects on the front panel can be controlled programmatically using icons and wires. This is the graphical source code, also known as G-code. LabVIEW's graphical source code is somewhat similar to flowcharts and is therefore also referred to as block diagram code. The characteristics of LabVIEW are: use general hardware as much as possible, and the difference between various instruments is mainly software; it can give full play to the capabilities of the computer, has powerful data processing functions, and can create more powerful instruments; users can according to their own needs. Define and manufacture various instruments.

LabVIEW广泛地被工业界、学术界和研究实验室所接受,视为一个标准的数据采集和仪器控制软件。LabVIEW集成了与满足 GPIB、VXI、RS-232和RS-485协议的硬件及数据采集卡通讯的全部功能。它还内置了便于应用TCP/IP、ActiveX等软件标准的库函数。这是一个功能强大且灵活的软件。利用它可以方便地建立自己的虚拟仪器,其图形化的界面使得编程及使用过程都生动有趣。LabVIEW is widely accepted by industry, academia, and research laboratories as a standard data acquisition and instrument control software. LabVIEW integrates all functions for communicating with hardware and data acquisition cards that meet GPIB, VXI, RS-232 and RS-485 protocols. It also has built-in library functions that facilitate the application of software standards such as TCP/IP and ActiveX. This is a powerful and flexible software. Using it, you can easily build your own virtual instrument, and its graphical interface makes the programming and use process lively and interesting.

图形化的程序语言,又称为“G”语言。使用这种语言编程时,基本上不写程序代码,取而代之的是流程图或框图。它尽可能利用了技术人员、科学家、工程师所熟悉的术语、图标和概念,因此,LabVIEW 是一个面向最终用户的工具。它可以增强你构建自己的科学和工程系统的能力,提供了实现仪器编程和数据采集系统的便捷途径。使用它进行原理研究、设计、测试并实现仪器系统时,可以大大提高工作效率。利用LabVIEW,可产生独立运行的可执行文件,它是一个真正的32位/64位编译器。像许多重要的软件一样,LabVIEW提供了Windows、UNIX、Linux、Macintosh的多种版本。它主要的方便就是,在同一个硬件的情况下,通过改变软件,就可以实现不同的仪器仪表的功能。Graphical programming language, also known as "G" language. When programming in this language, program code is basically not written, but instead flowcharts or block diagrams. It utilizes as much as possible the terms, icons, and concepts familiar to technicians, scientists, and engineers, so LabVIEW is an end-user-facing tool. It enhances your ability to build your own scientific and engineering systems, providing a convenient way to implement instrument programming and data acquisition systems. When using it for principle research, design, test and realization of instrument system, work efficiency can be greatly improved. With LabVIEW, a stand-alone executable can be produced, which is a true 32-bit/64-bit compiler. Like many important software, LabVIEW provides Windows, UNIX, Linux, Macintosh versions. Its main convenience is that in the case of the same hardware, the functions of different instruments can be realized by changing the software.

发明内容SUMMARY OF THE INVENTION

为了解决现有的时变信号实时采集和存储方法中存在的实时性不强和准确性不高的问题,本发明提供一种基于LabVIEW的脉冲同步控制二维扫描和信号采集实现方法,所述方法构建一套通过单维电机组合实现二维扫描的控制系统与同时进行信号采集的信号存储系统,所述方法能够实现X轴电机和Y轴电机的单独以及联合控制并设置信号高精度采集间距,快速准确定位信号采集点,有效提高了信号采集的效率和稳定性。In order to solve the problems of weak real-time performance and low accuracy in the existing real-time acquisition and storage methods of time-varying signals, the present invention provides a LabVIEW-based pulse synchronization control two-dimensional scanning and signal acquisition implementation method. The method constructs a control system that realizes two-dimensional scanning through the combination of single-dimensional motors and a signal storage system that performs signal acquisition at the same time. The method can realize the separate and joint control of the X-axis motor and the Y-axis motor, and set the signal acquisition distance with high precision , quickly and accurately locate the signal acquisition point, effectively improving the efficiency and stability of signal acquisition.

为实现上述目标,本发明采用以下技术方案:To achieve the above-mentioned goals, the present invention adopts the following technical solutions:

一种基于LabVIEW的脉冲同步控制二维扫描和信号采集实现方法,所述方法包括硬件结构和软件模块。所述硬件结构由工作站、板载数据采集卡、信号放大器、工作站电源、运动控制模块、运动控制模块电源和超声传感器组成;所述板载数据采集卡、信号放大器和超声传感器三者顺次相连,所述超声传感器经信号放大器后与板载数据采集卡相连进行数据采集、模数转换以及数据储存;所述板载数据采集卡安装于所述工作站主板之中。所述软件模块基于 LabVIEW平台开发,通过硬件控制两个电机进行二维栅扫描,同时实现点源信号的采集;所述软件模块由控制面板和显示面板组成。控制面板包括位置调节模块、参数设置模块和信号采集模块,显示面板包括二维实时信号显示模块IV、实时信号显示模块V和信号位置显示模块VI。A LabVIEW-based pulse synchronization control two-dimensional scanning and signal acquisition implementation method, the method includes a hardware structure and a software module. The hardware structure consists of a workstation, an onboard data acquisition card, a signal amplifier, a workstation power supply, a motion control module, a motion control module power supply and an ultrasonic sensor; the onboard data acquisition card, the signal amplifier and the ultrasonic sensor are connected in sequence , the ultrasonic sensor is connected to the onboard data acquisition card after signal amplifier for data acquisition, analog-to-digital conversion and data storage; the onboard data acquisition card is installed in the workstation motherboard. The software module is developed based on the LabVIEW platform, and the hardware controls two motors to perform two-dimensional grid scanning, and simultaneously realizes the acquisition of point source signals; the software module is composed of a control panel and a display panel. The control panel includes a position adjustment module, a parameter setting module and a signal acquisition module, and the display panel includes a two-dimensional real-time signal display module IV, a real-time signal display module V and a signal position display module VI.

本发明所要解决的问题是构建一套单维电机组合实现二维扫描的控制系统与同时进行信号采集的信号存储系统。控制系统由软件模块和硬件部分组成,软件模块基于LabVIEW图形化编程平台编写的控制程序和系统操作界面,利用该控制程序实现2台步进电机进行X轴与Y轴的高精度二维栅扫描,使与之相结合的信号采集装置能够快速稳定的进行点对点采集信号,同时配合板载多通道数据采集卡进行数据获取、传输和储存。此外,该控制系统能够实现X轴和Y轴的电机的单独以及联合控制并设置信号高精度采集间距,快速准确定位信号采集点,有效提高了信号采集的效率和稳定性。The problem to be solved by the present invention is to construct a set of control system for combining single-dimensional motors to realize two-dimensional scanning and a signal storage system for simultaneous signal acquisition. The control system consists of software modules and hardware parts. The software module is based on the control program and system operation interface written by the LabVIEW graphical programming platform. Using this control program, two stepper motors are used to perform high-precision two-dimensional raster scanning on the X-axis and the Y-axis. , so that the combined signal acquisition device can quickly and stably acquire point-to-point signals, and at the same time cooperate with the onboard multi-channel data acquisition card for data acquisition, transmission and storage. In addition, the control system can realize the independent and joint control of the motors of the X-axis and the Y-axis, and set the signal acquisition distance with high precision, quickly and accurately locate the signal acquisition point, and effectively improve the efficiency and stability of the signal acquisition.

所述软件模块由控制面板和显示面板组成。控制面板包括位置调节模块I,参数设置模块II,信号采集模块III;显示面板包括二维实时信号显示模块IV,实时信号显示模块V,信号位置显示模块 VI。The software module consists of a control panel and a display panel. The control panel includes a position adjustment module I, a parameter setting module II, and a signal acquisition module III; the display panel includes a two-dimensional real-time signal display module IV, a real-time signal display module V, and a signal position display module VI.

所述位置调节模块I可对每个步进电机单独调节,包括X轴电机距离调节,Y轴电机距离调节以及二维电机同步调节;同时还可以设定初始位置点,便于两轴电机在未扫描期间复原。所述位置调节模块包含以下结构和操作步骤:串口序列选择窗口、X轴和Y轴电机位置调节输入和位置调节确定按钮;一般操作步骤:首先于串口序列选择窗口选择电机与工作站对应连接串口,以实现串口初始化、串口读写和关闭串口等串口通信功能,完成串口通信后在X轴和Y轴电机位置调节串口输入以毫米为单位的电机位移距离,勾选对应轴的选择方框后,点击位置调节确定按钮可实现一维或二维的空间位置调节。The position adjustment module I can adjust each stepping motor individually, including the distance adjustment of the X-axis motor, the distance adjustment of the Y-axis motor, and the synchronous adjustment of the two-dimensional motor; at the same time, the initial position point can also be set, which is convenient for the two-axis motor to be adjusted in the future. Restore during scanning. The position adjustment module includes the following structure and operation steps: a serial port sequence selection window, X-axis and Y-axis motor position adjustment input and position adjustment confirmation buttons; general operation steps: first, select the serial port corresponding to the motor and the workstation to connect the serial port in the serial port sequence selection window, In order to realize serial port communication functions such as serial port initialization, serial port reading and writing, and serial port closing, after completing serial port communication, adjust the serial port input motor displacement distance in millimeters in the X-axis and Y-axis motor positions, and check the selection box of the corresponding axis, Click the position adjustment button to realize one-dimensional or two-dimensional spatial position adjustment.

所述参数设置模块II用来设置电机二维运行X轴和Y轴区域大小,栅扫描间距和电机步进速度调节;内嵌急停控制,用于迅速切断所有信号,在意外发生前停止所有电机运转和数据采集卡采集,并使电机停止后自动回到设置的初始位置,采集卡数据清零。参数设置完成后,点击开始按钮,电机即按照给定参数进行运动。所述参数设置模块包含以下结构和操作步骤:X轴和Y轴扫描长度输入窗口,扫描间距输入窗口,数据存储位置选择窗口和文件命名窗口;一般操作步骤为:首先确定信号采集范围大小,先后输入以毫米为单位X轴和Y轴扫描长度,而后确定X轴扫描间距,其中,间距设置越小表示信号采集越精细,相应采集循环次数越多,完成一次采集时间越长,输入的扫描间距参数随实际情况进行设定。最后,对预采集数据文件命名和储存位置设置。The parameter setting module II is used to set the size of the X-axis and Y-axis area of the two-dimensional operation of the motor, the raster scan spacing and the adjustment of the motor stepping speed; the built-in emergency stop control is used to quickly cut off all signals and stop all signals before an accident occurs. The motor runs and the data acquisition card is collected, and after the motor stops, it automatically returns to the initial position set, and the data of the acquisition card is cleared. After the parameter setting is completed, click the start button, and the motor will move according to the given parameters. The parameter setting module includes the following structures and operation steps: X-axis and Y-axis scan length input windows, scan spacing input windows, data storage location selection windows and file naming windows; general operation steps are: first determine the size of the signal acquisition range, and then sequentially. Enter the X-axis and Y-axis scan lengths in millimeters, and then determine the X-axis scan spacing. The smaller the spacing setting, the finer the signal acquisition, the more the corresponding acquisition cycles, the longer the completion time for one acquisition, and the input scan spacing. The parameters are set according to the actual situation. Finally, set the name and storage location of the pre-collected data file.

所述信号采集模块III用于设置信号采集的参数。考虑到所采集信号自身的特点,该模块可以对数据采集卡进行调整,通过设定采样频率、采样长度、采样起始点等参数,高效准确采集所需要的信号段并加以存储。所述信号采集模块包含以下结构和操作步骤:采样率,采样长度,时钟模式,触发超时,采集模式,触发等待,采样深度,触发延时等输入或选择窗口;一般操作步骤为:由信号的频率出发,根据奈奎斯特定理选择合适采样率;依据不同信号的幅值、长度、周期和频率等特性选择采样长度、时钟模式、触发延时、采集模式、触发等待等参数,使最终信号采集准确性和效率达到最佳。内嵌急停控制,用于迅速切断所有信号,在意外发生前停止所有电机运转和数据采集卡采集,并使电机停止后自动回到设置的初始位置,采集卡的数据清零。The signal acquisition module III is used to set the parameters of signal acquisition. Taking into account the characteristics of the collected signal itself, this module can adjust the data acquisition card, and by setting the sampling frequency, sampling length, sampling starting point and other parameters, efficiently and accurately collect the required signal segments and store them. The signal acquisition module includes the following structures and operation steps: sampling rate, sampling length, clock mode, trigger timeout, acquisition mode, trigger wait, sampling depth, trigger delay and other input or selection windows; the general operation steps are: Starting from the frequency, select the appropriate sampling rate according to the Nyquist theorem; select the sampling length, clock mode, trigger delay, acquisition mode, trigger wait and other parameters according to the amplitude, length, period and frequency of different signals, so that the final signal The collection accuracy and efficiency are optimized. Built-in emergency stop control is used to quickly cut off all signals, stop all motor operation and data acquisition card acquisition before an accident occurs, and make the motor automatically return to the initial position after the motor stops, and the data of the acquisition card is cleared.

所述二维图像实时显示模块IV作为辅助模块,主要为实验者提供所采集信号的预览情况。通过展示信号波形以及对信号的组合和处理,实验者可以直观地观察所采集信号是否为感兴趣内容,以便及时对控制和采集过程进行调校。所述二维图像实时显示模块包含以下结构和操作步骤:X轴和Y轴坐标分别代表参数设置模块中的X 轴和Y轴扫描长度。通过两个坐标的定位,对所采集信号进行实时重建可得到二维图像实时显示;进一步地,通过调整坐标轴的最大和最小值,可以调节该模块中特别显示感兴趣的图像区域范围;此外,通过改变右侧色条颜色强度的大小值,可以根据信号强度调整获得二维图像的最佳显示对比度。The two-dimensional image real-time display module IV, as an auxiliary module, mainly provides the experimenter with a preview of the collected signals. By displaying the signal waveform and the combination and processing of the signal, the experimenter can intuitively observe whether the acquired signal is the content of interest, so as to adjust the control and acquisition process in time. The two-dimensional image real-time display module includes the following structures and operation steps: the X-axis and Y-axis coordinates respectively represent the X-axis and Y-axis scanning lengths in the parameter setting module. Through the positioning of the two coordinates, the real-time reconstruction of the acquired signal can obtain the real-time display of the two-dimensional image; further, by adjusting the maximum and minimum values of the coordinate axis, the range of the image area of interest can be adjusted in this module; in addition , by changing the value of the color intensity of the right color bar, the optimal display contrast of the two-dimensional image can be obtained by adjusting the signal intensity.

所述信号显示模块V可实时提供测得点源信号的波形、振幅和峰值位置等相关信息,包含以下结构和操作步骤:X、Y轴坐标分别代表时域信号的采样长度和信号幅值大小。X轴长度主要由信号采集模块中的采样长度决定,起始采样点由触发延时决定,即触发延时结束后,采集卡开始采集信号,实时信号显示模块显示采样长度大小的信号波形。The signal display module V can provide relevant information such as waveform, amplitude and peak position of the measured point source signal in real time, and includes the following structure and operation steps: the X and Y axis coordinates respectively represent the sampling length and signal amplitude of the time domain signal. The length of the X-axis is mainly determined by the sampling length in the signal acquisition module, and the starting sampling point is determined by the trigger delay, that is, after the trigger delay expires, the acquisition card starts to collect signals, and the real-time signal display module displays the signal waveform of the sampling length.

所述信号位置显示模块VI可实时显示完成一次X轴扫描后,该行信号在Z轴方向所处的信号位置,判定信号发生点源同样品表面的相对位置关系和该行不同信号发生点源的相对位置关系。所述信号位置显示模块包含以下结构和操作步骤:X、Y轴坐标分别代表X 轴长度和信号深度,分别由参数设置模块的X轴扫描长度和信号采集模块的采样长度决定。X轴长度可以调整以显示不同扫描范围内的信号深度;Y轴信号深度是由采样率、采样长度、信号传输速率反演得到,以此观察深层信号与表面信号的深度信息。The signal position display module VI can display in real time the signal position of the line of signals in the Z-axis direction after one X-axis scan is completed, and determine the relative positional relationship between the signal generating point source and the sample surface and the different signal generating point sources in the line. relative positional relationship. The signal position display module includes the following structure and operation steps: the X and Y axis coordinates respectively represent the X axis length and the signal depth, which are respectively determined by the X axis scanning length of the parameter setting module and the sampling length of the signal acquisition module. The length of the X-axis can be adjusted to display the signal depth in different scanning ranges; the signal depth of the Y-axis is obtained by inversion from the sampling rate, sampling length, and signal transmission rate, so as to observe the depth information of the deep signal and the surface signal.

所述控制软件的控制流程为:串口初始化,测试工作站与控制器、采集板卡通讯是否正常,若不正常则进行调试直至正常。当端口检测到高电平触发信号时,电机控制器发出指令控制X轴电机行进指定路程,同步地,采集卡受到触发信号触发数据采集过程。当 X轴电机行进完指定路程后停止运动,采集板卡停止数据采集,并将数据上传至工作站,写入存储文件。同时,Y轴电机行进指定路程直至停止。此时,X轴电机反向运动指定路程,同步地,采集卡受到触发信号触发数据采集过程。当X轴电机行进完指定路程后停止运动,采集板卡停止数据采集,并将数据上传至工作站,写入存储文件。同时,Y轴电机行进指定路程直至停止,X轴电机再次反向运动,同步发生数据采集保存过程,如此循环往复,直至完成指定区域面积的覆盖扫描。最后,所采集的数据被全部保存在一个文件内,软件控制过程结束。The control flow of the control software is: serial port initialization, testing whether the communication between the workstation and the controller and the acquisition board is normal, if not, debugging until normal. When the port detects a high-level trigger signal, the motor controller sends an instruction to control the X-axis motor to travel a specified distance. Simultaneously, the acquisition card is triggered by the trigger signal to trigger the data acquisition process. When the X-axis motor stops moving after the specified distance, the acquisition board stops data acquisition, uploads the data to the workstation, and writes the storage file. At the same time, the Y-axis motor travels the specified distance until it stops. At this time, the X-axis motor moves in the opposite direction for the specified distance, and synchronously, the acquisition card is triggered by the trigger signal to trigger the data acquisition process. When the X-axis motor stops moving after completing the specified distance, the acquisition board stops data acquisition, uploads the data to the workstation, and writes the storage file. At the same time, the Y-axis motor travels the specified distance until it stops, and the X-axis motor moves in the opposite direction again, and the data acquisition and storage process occurs synchronously. Finally, the collected data is all saved in one file, and the software control process ends.

本发明的优点和有益效果为:The advantages and beneficial effects of the present invention are:

1)基于LabVIEW设计开发了一个二维电机与信号采集的协同控制系统,程序简单,操作方便,与利用单片机、PLC等设备进行控制相比具有更好的便携性,可以高效地对二维电机和信号采集卡进行协同控制;1) Based on LabVIEW, a collaborative control system of two-dimensional motor and signal acquisition is designed and developed. The program is simple and the operation is convenient. Compared with the control of single-chip microcomputer, PLC and other equipment, it has better portability and can efficiently control the two-dimensional motor. Coordinate control with signal acquisition card;

2)实现了对X轴和Y轴二维空间位置的独立和协同控制以及时变脉冲信号的采集和储存,提高了信号采集的精准度和高效性。2) The independent and coordinated control of the two-dimensional spatial position of the X-axis and the Y-axis and the acquisition and storage of time-varying pulse signals are realized, which improves the accuracy and efficiency of signal acquisition.

附图说明Description of drawings

图1为本发明所构建的控制系统的硬件连接图,其中1为工作站,2为信号采集卡,3为信号放大器,4为工作站电源,5为运动控制模块电源,6为运动控制模块,7为超声传感器;1 is a hardware connection diagram of a control system constructed by the present invention, wherein 1 is a workstation, 2 is a signal acquisition card, 3 is a signal amplifier, 4 is a workstation power supply, 5 is a motion control module power supply, 6 is a motion control module, 7 is an ultrasonic sensor;

图2为本发明所述控制面板的软件界面;Fig. 2 is the software interface of the control panel of the present invention;

图3为本发明所述显示面板的软件界面;Fig. 3 is the software interface of the display panel of the present invention;

图4为本发明所述控制软件的控制流程图;Fig. 4 is the control flow chart of the control software of the present invention;

图5为本发明所述二维栅扫描方式示意图。FIG. 5 is a schematic diagram of the two-dimensional grid scanning method according to the present invention.

图6为本发明所述位置调节模块的结构和执行流程图;Fig. 6 is the structure and execution flow chart of the position adjustment module of the present invention;

图7为本发明所述参数设置模块的结构和执行流程图;Fig. 7 is the structure and execution flow chart of the parameter setting module of the present invention;

图8为本发明所述信号采集模块的结构和执行流程图;Fig. 8 is the structure and execution flow chart of the signal acquisition module of the present invention;

图9为本发明所述二维图像实时显示模块的结构和执行流程图;Fig. 9 is the structure and execution flow chart of the two-dimensional image real-time display module of the present invention;

图10为本发明所述信号显示模块的结构和执行流程图;Fig. 10 is the structure and execution flow chart of the signal display module of the present invention;

图11为本发明所述信号位置显示模块的结构和执行流程图;Fig. 11 is the structure and execution flow chart of the signal position display module of the present invention;

具体实施方式Detailed ways

下面结合实施例对本发明作进一步说明。The present invention will be further described below in conjunction with the examples.

在具体实施过程中,根据光声效应原理,使用聚焦脉冲激光激发样品产生脉冲超声源作为采集信号。二维机械扫描装置方案是将两个步进电机方向互相垂直放置,信号源与二维电机相对固定并随电机运动,构建成二维平面内的脉冲超声信号源。为了实现整个机械装置的灵活协调控制并同时采集脉冲超声信号,需要一种二维电机与信号采集卡协同控制的方法,完成二维平面内的电机扫描范围、速度、间距的单独和协同控制调节以及点对点的脉冲信号采集。In the specific implementation process, according to the principle of photoacoustic effect, a focused pulsed laser is used to excite the sample to generate a pulsed ultrasonic source as the acquisition signal. The two-dimensional mechanical scanning device scheme is to place two stepping motors perpendicular to each other, and the signal source and the two-dimensional motor are relatively fixed and move with the motor to construct a pulsed ultrasonic signal source in a two-dimensional plane. In order to realize the flexible and coordinated control of the entire mechanical device and simultaneously acquire the pulsed ultrasonic signals, a method of coordinated control of the two-dimensional motor and the signal acquisition card is required to complete the independent and coordinated control and adjustment of the scanning range, speed, and distance of the motor in the two-dimensional plane. And point-to-point pulse signal acquisition.

实施例1Example 1

参见附图1、2、3。一种基于LabVIEW的脉冲同步控制二维扫描和信号采集实现方法,所述方法包括硬件结构和软件模块。所述硬件结构由工作站1、板载数据采集卡2、信号放大器3、工作站电源4、运动控制模块电源5、运动控制模块6、超声传感器7组成;所述工作站电源4与工作站1相连并为其供电;所述数据采集卡2板载于所述工作站1同信号放大器3和超声传感器7相连,实现信号采集、放大与储存;所述电源5连接供电步进电机组合,带动超声传感器进行X轴和Y轴的运动扫描。See Figures 1, 2, and 3. A LabVIEW-based pulse synchronization control two-dimensional scanning and signal acquisition implementation method, the method includes a hardware structure and a software module. The hardware structure consists of a workstation 1, an onboard data acquisition card 2, a signal amplifier 3, a workstation power supply 4, a motion control module power supply 5, a motion control module 6, and an ultrasonic sensor 7; the workstation power supply 4 is connected to the workstation 1 and is It supplies power; the data acquisition card 2 is onboard on the workstation 1 and is connected with the signal amplifier 3 and the ultrasonic sensor 7 to realize signal acquisition, amplification and storage; the power supply 5 is connected to the power supply stepper motor combination to drive the ultrasonic sensor to perform X-ray operation. Axes and Y-axis motion sweep.

软件模块基于LabVIEW图形化编程平台编写开发,联同硬件部分一起实现对步进电机和数据采集卡的控制。软件模块由控制面板和显示面板中的位置调节模块I,参数设置模块II,信号采集模块III 以及二维实时信号显示模块IV,实时信号显示模块V,信号位置显示模块VI构成。The software module is written and developed based on the LabVIEW graphical programming platform, and together with the hardware part, it realizes the control of the stepping motor and the data acquisition card. The software module consists of a position adjustment module I, a parameter setting module II, a signal acquisition module III, a two-dimensional real-time signal display module IV, a real-time signal display module V, and a signal position display module VI in the control panel and the display panel.

附图2所示为位置调节模块I的控制界面,该模块包括X轴和Y 轴电机的单独和协同位置调节控制;参数设置模块II,该模块包括X 轴和Y轴扫描长度、扫描间距、储存位置和文件命名的相关参数设置;信号采集模块III,该模块针对不同信号特征实现采样频率、采样长度和采样起始点等参数的设置。Accompanying drawing 2 shows the control interface of the position adjustment module I, which includes the independent and coordinated position adjustment control of the X-axis and Y-axis motors; the parameter setting module II, which includes the X-axis and Y-axis scanning length, scanning distance, Related parameter settings of storage location and file naming; signal acquisition module III, this module implements the settings of parameters such as sampling frequency, sampling length and sampling starting point according to different signal characteristics.

附图3所示二维实时信号显示模块IV用于实时显示每完成一次 X轴扫描行的信号图像;实时信号显示模块V,该模块实时显示每个单点信号产生的波形和幅值大小,便于及时调整扫描位置;信号位置显示模块VI,该模块可用于明确信号点相对于探测表面深度,多点信号之间的位置关系。The two-dimensional real-time signal display module IV shown in accompanying drawing 3 is used to display the signal image of each X-axis scanning line in real time; It is convenient to adjust the scanning position in time; the signal position display module VI, this module can be used to clarify the positional relationship between the signal point relative to the detection surface depth and the multi-point signal.

系统运行时,在工作站1打开系统操作界面。软件的控制流程包含:首先在位置调节模块I设置X轴和Y轴的调节距离,例如设置X轴和Y轴调节距离分别为5毫米和3毫米将扫描初始位置定位至距离调节初始原点X轴5毫米、Y轴3毫米的预设位置。然后在参数设置模块II分别输入X轴与Y轴扫描长度、扫描间距,并设定数据储存与工作站中的数据盘符位置以及文件名称。接着在信号采集模块III中,以奈奎斯特定理为依据设定系统采样率,同时针对被测信号特点选择采样长度、时钟模式、触发延时、采集模式、触发等待等采集卡参数。点击开始按钮,布尔按钮判断为true后发出一条指令,内含位置调节、扫描距离和采集卡的相关参数,进入层叠式顺序结构首先将采集卡和电机初始化,获取工作站操作系统基本参数,然后将设置面板参数指令送入步进电机和采集卡驱动,开始数据采集。在顺序结构内嵌套while循环结构反复接收触发信号直至完成数据采集。若采集过程中需要对扫描采集进行调整,点击停止按钮,布尔按钮为ture后,系统当前行扫描结束后停止数据采集卡采集,传输储存当前完成的数据采集结果至预设工作站盘符内。若采集过程中出现紧急情况,按下急停按钮,布尔按钮为Ture后,系统全局变量转换为False,中断所有信号,系统停止工作。When the system is running, open the system operation interface on the workstation 1. The control process of the software includes: first, set the adjustment distance of X-axis and Y-axis in position adjustment module I, for example, set the adjustment distance of X-axis and Y-axis to 5 mm and 3 mm, respectively. Position the scanning initial position to the distance adjustment initial origin X-axis 5mm, Y-axis 3mm preset position. Then enter the X-axis and Y-axis scan length and scan interval in the parameter setting module II, and set the data drive letter position and file name in the data storage and workstation. Then in the signal acquisition module III, the system sampling rate is set based on the Nyquist theorem, and the acquisition card parameters such as sampling length, clock mode, trigger delay, acquisition mode, and trigger wait are selected according to the characteristics of the measured signal. Click the start button, the Boolean button judges to be true and then sends out a command, including the position adjustment, scanning distance and relevant parameters of the capture card, enter the stacked sequence structure, first initialize the capture card and motor, obtain the basic parameters of the workstation operating system, and then set the Set the panel parameter command and send it to the stepper motor and acquisition card driver to start data acquisition. The while loop structure is nested in the sequence structure to receive the trigger signal repeatedly until the data acquisition is completed. If you need to adjust the scan acquisition during the acquisition process, click the stop button, and the Boolean button is true, the system stops the data acquisition card acquisition after the current line scan ends, and transmits and stores the currently completed data acquisition results to the preset workstation drive letter. If there is an emergency during the acquisition process, press the emergency stop button, after the Boolean button is True, the system global variable will be converted to False, all signals will be interrupted, and the system will stop working.

附图5显示了信号采集的二维栅扫描运动方式:超声传感器在步进电机带动下进行XY轴的栅扫描运动;在运动控制模块可设置扫描范围x×y,扫描精度dx、dy,其中x控制扫描长度和数据储存。详细过程如下:超声传感器随着电机同步运动,在X轴扫描过程中按扫描精度每隔dxμm步进,每完成一个X轴扫描记录和存储全波形x扫描信号并存入程序文件中;完成x长度扫描后,探头做纵向步进dyμm,步进后再做负向的横向扫描并按上述方式记录数据缓存至程序文件中,完成x长度扫描后做纵向步进dyμm,如此反复。数据采集模块在每完成一个X轴扫描后采集超声扫描信号依次记录至程序文件的数据行,在完成所有X轴扫描后,一次将数据储存至工作站中,数据列数=x/dx、数据行=y/dy。Figure 5 shows the two-dimensional grid scanning motion mode of signal acquisition: the ultrasonic sensor is driven by the stepping motor to perform grid scanning motion of the XY axis; the scanning range x × y can be set in the motion control module, and the scanning accuracy is dx and dy, where x controls scan length and data storage. The detailed process is as follows: The ultrasonic sensor moves synchronously with the motor. During the X-axis scanning process, the scanning accuracy is every dxμm step. After each X-axis scanning is completed, the full-waveform x scanning signal is recorded and stored and stored in the program file; After the length scan, the probe makes a vertical step of dyμm, and then performs a negative horizontal scan after the step, and records the data and buffers it in the program file in the above-mentioned manner. The data acquisition module collects ultrasonic scan signals after each X-axis scan is completed and records them to the data lines of the program file in turn. After all X-axis scans are completed, the data is stored in the workstation at one time, the number of data columns=x/dx, data lines =y/dy.

参见附图6。所述位置调节模块I可对每个步进电机单独调节,包括X轴电机距离调节,Y轴电机距离调节以及二维电机同步调节;同时还可以设定初始位置点,便于两轴电机在未扫描期间复原。所述位置调节模块包含以下结构和操作步骤:串口序列,X轴电机调节参数输入窗口,Y轴电机调节参数输入窗口和位置调节按钮。首先选定电机串口序列,实现下位机(电机控制器)和上位机(工作站)的通讯,X轴和Y轴的调节参数输入后,勾选上对应轴参数输入行前端方框后,点击位置调节按钮可实现一维或者二维的位置调节功能。See Figure 6. The position adjustment module I can adjust each stepping motor individually, including the distance adjustment of the X-axis motor, the distance adjustment of the Y-axis motor, and the synchronous adjustment of the two-dimensional motor; at the same time, the initial position point can also be set, which is convenient for the two-axis motor to be adjusted in the future. Restore during scanning. The position adjustment module includes the following structure and operation steps: serial port sequence, X-axis motor adjustment parameter input window, Y-axis motor adjustment parameter input window and position adjustment button. First, select the serial port sequence of the motor to realize the communication between the lower computer (motor controller) and the upper computer (workstation). After the adjustment parameters of the X axis and the Y axis are input, check the box at the front of the corresponding axis parameter input line, and click the position The adjustment button can realize one-dimensional or two-dimensional position adjustment function.

所述参数设置模块II用来设置电机二维运行X轴和Y轴区域大小,栅扫描间距和电机步进速度调节;参数设置完成后,点击开始按钮,电机即按照给定参数进行运动。所述参数设置模块包含以下结构和操作步骤:X轴扫描长度参数输入窗口,Y轴扫描长度参数输入窗口,采集循环显示窗口,扫描间距参数输入窗口,数据储存位置选择窗口以及文件命名窗口;分别在X轴和Y轴扫描长度输入窗中输入对应毫米(mm)单位长度,可确定扫描面积的大小,即信号探测区域大小,通过选择储存位置和进行相应文件命名,可方便数据区分保存。The parameter setting module II is used to set the size of the X-axis and Y-axis area of the two-dimensional operation of the motor, the raster scan spacing and the adjustment of the motor stepping speed; after the parameter setting is completed, click the start button, and the motor will move according to the given parameters. Described parameter setting module comprises following structure and operation steps: X-axis scanning length parameter input window, Y-axis scanning length parameter input window, acquisition cycle display window, scanning interval parameter input window, data storage location selection window and file naming window; Enter the corresponding millimeter (mm) unit length in the X-axis and Y-axis scanning length input windows to determine the size of the scanning area, that is, the size of the signal detection area. By selecting the storage location and naming the corresponding file, it is convenient to distinguish and save the data.

所述信号采集模块III用于设置信号采集的参数。考虑到所采集信号自身的特点,该模块可以对数据采集卡进行调整,通过设定采样率、采样长度、时钟模式、触发延时、采样起始点等参数,高效准确采集所需要的信号段并加以存储。内嵌急停控制,用于迅速切断所有信号,在意外发生前停止所有电机运转和数据采集卡采集,并使电机停止后自动回到设置的初始位置,采集卡数据清零。所述信号采集模块包含以下结构和操作步骤:采样率,采样长度,时钟模式,触发超时,采集模式,触发等待,采样深度,触发延时等输入或选择窗口;一般操作步骤为:由信号的频率出发,根据奈奎斯特定理选择合适采样率;依据不同信号的幅值、长度、周期和频率等特性选择采样长度、时钟模式、触发延时、采集模式、触发等待等参数,使最终信号采集准确性和效率达到最佳。内嵌急停控制,用于迅速切断所有信号,在意外发生前停止所有电机运转和数据采集卡采集,并使电机停止后自动回到设置的初始位置,采集卡的数据清零。The signal acquisition module III is used to set the parameters of signal acquisition. Considering the characteristics of the collected signal itself, this module can adjust the data acquisition card, by setting the sampling rate, sampling length, clock mode, trigger delay, sampling starting point and other parameters, efficiently and accurately collect the required signal segments and be stored. Built-in emergency stop control is used to quickly cut off all signals, stop all motor operation and data acquisition card acquisition before an accident occurs, and make the motor automatically return to the initial position after the motor stops, and the acquisition card data is cleared. The signal acquisition module includes the following structures and operation steps: sampling rate, sampling length, clock mode, trigger timeout, acquisition mode, trigger wait, sampling depth, trigger delay and other input or selection windows; the general operation steps are: Starting from the frequency, select the appropriate sampling rate according to the Nyquist theorem; select the sampling length, clock mode, trigger delay, acquisition mode, trigger wait and other parameters according to the amplitude, length, period and frequency of different signals, so that the final signal The collection accuracy and efficiency are optimized. Built-in emergency stop control is used to quickly cut off all signals, stop all motor operation and data acquisition card acquisition before an accident occurs, and make the motor automatically return to the initial position after the motor stops, and the data of the acquisition card is cleared.

所述二维图像实时显示模块IV作为辅助模块,主要为实验者提供所采集信号的预览情况。通过展示信号波形以及对信号的组合和处理,实验者可以直观地观察所采集信号是否为感兴趣内容,以便及时对控制和采集过程进行调校。所述二维图像实时显示模块包含以下结构和操作步骤:X轴和Y轴坐标分别代表参数设置模块中的X 轴和Y轴扫描长度。通过两个坐标的定位,对所采集信号进行实时重建可得到二维图像实时显示;进一步地,通过调整坐标轴的最大和最小值,可以调节该模块中特别显示感兴趣的图像区域范围;此外,通过改变右侧色条颜色强度的大小值,可以根据信号强度调整获得二维图像的最佳显示对比度。The two-dimensional image real-time display module IV, as an auxiliary module, mainly provides the experimenter with a preview of the collected signals. By displaying the signal waveform and the combination and processing of the signal, the experimenter can intuitively observe whether the acquired signal is the content of interest, so as to adjust the control and acquisition process in time. The two-dimensional image real-time display module includes the following structures and operation steps: the X-axis and Y-axis coordinates respectively represent the X-axis and Y-axis scanning lengths in the parameter setting module. Through the positioning of the two coordinates, the real-time reconstruction of the acquired signal can obtain the real-time display of the two-dimensional image; further, by adjusting the maximum and minimum values of the coordinate axis, the range of the image area of interest can be adjusted in this module; in addition , by changing the value of the color intensity of the right color bar, the optimal display contrast of the two-dimensional image can be obtained by adjusting the signal intensity.

所述信号显示模块V可实时提供测得点源信号的波形、振幅和峰值位置等相关信息,包含以下结构和操作步骤:X、Y轴坐标分别代表时域信号的采样长度和信号幅值大小。X轴长度主要由信号采集模块中的采样长度决定,起始采样点由触发延时决定,即触发延时结束后,采集卡开始采集信号,实时信号显示模块显示采样长度大小的信号波形。The signal display module V can provide relevant information such as waveform, amplitude and peak position of the measured point source signal in real time, and includes the following structure and operation steps: the X and Y axis coordinates respectively represent the sampling length and signal amplitude of the time domain signal. The length of the X-axis is mainly determined by the sampling length in the signal acquisition module, and the starting sampling point is determined by the trigger delay, that is, after the trigger delay expires, the acquisition card starts to collect signals, and the real-time signal display module displays the signal waveform of the sampling length.

所述信号位置显示模块VI可实时显示完成一次X轴扫描后,该行信号在Z轴方向所处的信号位置,判定信号发生点源同样品表面的相对位置关系和该行不同信号发生点源的相对位置关系。所述信号位置显示模块包含以下结构和操作步骤:X、Y轴坐标分别代表X 轴长度和信号深度,分别由参数设置模块的X轴扫描长度和信号采集模块的采样长度决定。X轴长度可以调整以显示不同扫描范围内的信号深度;Y轴信号深度是由采样率、采样长度、信号传输速率反演得到,以此观察深层信号与表面信号的深度信息。The signal position display module VI can display in real time the signal position of the line of signals in the Z-axis direction after one X-axis scan is completed, and determine the relative positional relationship between the signal generating point source and the sample surface and the different signal generating point sources in the line. relative positional relationship. The signal position display module includes the following structure and operation steps: the X and Y axis coordinates respectively represent the X axis length and the signal depth, which are respectively determined by the X axis scanning length of the parameter setting module and the sampling length of the signal acquisition module. The length of the X-axis can be adjusted to display the signal depth in different scanning ranges; the signal depth of the Y-axis is obtained by inversion from the sampling rate, sampling length, and signal transmission rate, so as to observe the depth information of the deep signal and the surface signal.

所述控制软件的控制流程为:串口初始化,测试工作站与控制器、采集板卡通讯是否正常,若不正常则进行调试直至正常。当端口检测到高电平触发信号时,电机控制器发出指令控制X轴电机行进指定路程,同步地,采集卡受到触发信号触发数据采集过程。当 X轴电机行进完指定路程后停止运动,采集板卡停止数据采集,并将数据上传至工作站,写入存储文件。同时,Y轴电机行进指定路程直至停止。此时,X轴电机反向运动指定路程,同步地,采集卡受到触发信号触发数据采集过程。当X轴电机行进完指定路程后停止运动,采集板卡停止数据采集,并将数据上传至工作站,写入存储文件。同时,Y轴电机行进指定路程直至停止,X轴电机再次反向运动,同步发生数据采集保存过程,如此循环往复,直至完成指定区域面积的覆盖扫描。最后,所采集的数据被全部保存在一个文件内,软件控制过程结束。The control flow of the control software is: serial port initialization, testing whether the communication between the workstation and the controller and the acquisition board is normal, if not, debugging until normal. When the port detects a high-level trigger signal, the motor controller sends an instruction to control the X-axis motor to travel a specified distance. Simultaneously, the acquisition card is triggered by the trigger signal to trigger the data acquisition process. When the X-axis motor stops moving after the specified distance, the acquisition board stops data acquisition, uploads the data to the workstation, and writes the storage file. At the same time, the Y-axis motor travels the specified distance until it stops. At this time, the X-axis motor moves in the opposite direction for the specified distance, and synchronously, the acquisition card is triggered by the trigger signal to trigger the data acquisition process. When the X-axis motor stops moving after completing the specified distance, the acquisition board stops data acquisition, uploads the data to the workstation, and writes the storage file. At the same time, the Y-axis motor travels the specified distance until it stops, and the X-axis motor moves in the opposite direction again, and the data acquisition and storage process occurs synchronously. Finally, the collected data is all saved in one file, and the software control process ends.

最后应说明的是:显然,上述实施例仅仅是为清楚地说明本发明所作的举例,而并非对实施方式的限定。对于所属领域的普通技术人员来说,在上述说明的基础上还可以做出其它不同形式的变化或变动。这里无需也无法对所有的实施方式予以穷举。而由此所引伸出的显而易见的变化或变动仍处于本发明的保护范围之中。Finally, it should be noted that: obviously, the above-mentioned embodiments are only examples for clearly illustrating the present invention, and are not intended to limit the implementation manner. For those of ordinary skill in the art, changes or modifications in other different forms can also be made on the basis of the above description. There is no need and cannot be exhaustive of all implementations here. However, the obvious changes or changes derived therefrom still fall within the protection scope of the present invention.

Claims (1)

1.一种基于LabVIEW的脉冲同步控制二维扫描和信号采集实现方法,其特征在于:1. a pulse synchronization control two-dimensional scanning and signal acquisition implementation method based on LabVIEW, is characterized in that: 所述方法包括硬件结构和软件模块;The method includes a hardware structure and a software module; 所述硬件结构由工作站、板载数据采集卡、信号放大器、工作站电源、运动控制模块、运动控制模块电源和超声传感器组成;所述板载数据采集卡、信号放大器和超声传感器三者顺次相连,所述超声传感器经信号放大器后与所述板载数据采集卡相连进行数据采集、模数转换以及数据储存;所述板载数据采集卡安装于所述工作站主板之中;所述软件模块基于LabVIEW平台开发,通过硬件控制两个电机进行二维栅扫描,同时实现电信号的采集;The hardware structure consists of a workstation, an onboard data acquisition card, a signal amplifier, a workstation power supply, a motion control module, a motion control module power supply and an ultrasonic sensor; the onboard data acquisition card, the signal amplifier and the ultrasonic sensor are connected in sequence , the ultrasonic sensor is connected with the on-board data acquisition card through the signal amplifier for data acquisition, analog-to-digital conversion and data storage; the on-board data acquisition card is installed in the workstation motherboard; the software module is based on Developed on the LabVIEW platform, the hardware controls two motors to perform two-dimensional grid scanning, and at the same time realizes the acquisition of electrical signals; 所述软件模块由控制面板和显示面板组成,控制面板包括位置调节模块、参数设置模块和信号采集模块,显示面板包括二维图像实时显示模块、实时信号显示模块和信号位置显示模块;The software module is composed of a control panel and a display panel, the control panel includes a position adjustment module, a parameter setting module and a signal acquisition module, and the display panel includes a two-dimensional image real-time display module, a real-time signal display module and a signal position display module; 所述软件模块为基于LabVIEW图形化编程平台编写的控制程序和系统操作界面,利用该控制程序实现2台步进电机进行X轴与Y轴的高精度二维栅扫描,使与之相结合的信号采集装置能够快速稳定的进行点对点采集信号,同时配合板载多通道数据采集卡进行数据获取、传输和储存;The software module is a control program and a system operation interface written based on the LabVIEW graphical programming platform, and the control program is used to realize the high-precision two-dimensional grid scanning of the X-axis and the Y-axis by two stepping motors, so that the combined The signal acquisition device can quickly and stably collect signals from point to point, and at the same time cooperate with the onboard multi-channel data acquisition card for data acquisition, transmission and storage; 其中,所述控制面板中:Among them, in the control panel: 所述位置调节模块包含以下结构和操作步骤:串口序列选择窗口、X轴和Y轴电机位置调节输入和位置调节确定按钮;操作步骤为:首先于串口序列选择窗口选择电机与工作站对应连接串口,以实现串口初始化、串口读写和关闭串口串口通信功能,完成串口通信后在X轴和Y轴电机位置调节串口输入以毫米为单位的电机位移距离,勾选对应轴的选择方框后,点击位置调节确定按钮可实现一维或二维的空间位置调节;The position adjustment module includes the following structure and operation steps: a serial port sequence selection window, an X-axis and Y-axis motor position adjustment input and a position adjustment confirmation button; the operation steps are: first, in the serial port sequence selection window, select the corresponding connection port between the motor and the workstation, In order to realize serial port initialization, serial port reading and writing and close serial port serial port communication functions, after completing serial port communication, adjust the serial port input motor displacement distance in millimeters at the X-axis and Y-axis motor positions, check the selection box of the corresponding axis, and click The position adjustment confirmation button can realize one-dimensional or two-dimensional spatial position adjustment; 所述参数设置模块包含以下结构和操作步骤:X轴和Y轴扫描长度输入窗口,扫描间距输入窗口,数据存储位置选择窗口和文件命名窗口;操作步骤为:首先确定信号采集范围大小,先后输入以毫米为单位的X轴和Y轴扫描长度,而后确定X轴扫描间距,其中,间距设置越小表示信号采集越精细,相应采集循环次数越多,完成一次采集时间越长,输入的扫描间距参数随实际情况进行设定;最后,对预采集数据文件命名和储存位置进行设置;The parameter setting module includes the following structures and operation steps: X-axis and Y-axis scan length input windows, scan spacing input windows, data storage location selection windows and file naming windows; the operation steps are: first determine the size of the signal acquisition range, and input successively X-axis and Y-axis scanning length in millimeters, and then determine the X-axis scanning spacing. The smaller the spacing setting, the finer the signal acquisition, the more the corresponding acquisition cycles, the longer the completion time for one acquisition, and the input scanning spacing. The parameters are set according to the actual situation; finally, the naming and storage location of the pre-collected data files are set; 所述信号采集模块包含以下结构和操作步骤:采样率,采样长度,时钟模式,触发超时,采集模式,触发等待,采样深度,触发延时输入或选择窗口;操作步骤为:由信号的频率出发,根据奈奎斯特定理选择合适采样率;依据不同信号的幅值、长度、周期和频率特性选择采样长度、时钟模式、触发延时、采集模式、触发等待参数,使最终信号采集准确性和效率达到最佳;内嵌急停控制,用于迅速切断所有信号,在意外发生前停止所有电机运转和数据采集卡采集,并使电机停止后自动回到设置的初始位置,采集卡的数据清零;The signal acquisition module includes the following structures and operation steps: sampling rate, sampling length, clock mode, trigger timeout, acquisition mode, trigger wait, sampling depth, trigger delay input or selection window; the operation steps are: starting from the frequency of the signal , select the appropriate sampling rate according to the Nyquist theorem; select the sampling length, clock mode, trigger delay, acquisition mode, trigger waiting parameters according to the amplitude, length, period and frequency characteristics of different signals, so that the final signal acquisition accuracy and The efficiency is the best; the embedded emergency stop control is used to quickly cut off all signals, stop all motor operation and data acquisition card acquisition before an accident occurs, and make the motor automatically return to the initial position after the motor stops, and the data of the acquisition card is cleared. zero; 其中,所述显示面板中:Wherein, in the display panel: 所述二维图像实时显示模块包含以下结构和操作步骤:X轴和Y轴坐标分别代表参数设置模块中的X轴和Y轴扫描长度;通过两个坐标的定位,对所采集信号进行实时重建可得到二维图像实时显示;进一步地,通过调整坐标轴的最大和最小值,可以调节该模块中特别显示感兴趣的图像区域范围;此外,通过改变右侧色条颜色强度的大小值,可以根据信号强度调整获得二维图像的最佳显示对比度;The two-dimensional image real-time display module includes the following structures and operation steps: the X-axis and Y-axis coordinates represent the X-axis and Y-axis scanning lengths in the parameter setting module respectively; through the positioning of the two coordinates, the collected signals are reconstructed in real time Two-dimensional images can be displayed in real time; further, by adjusting the maximum and minimum values of the coordinate axis, the range of the image area of interest can be adjusted in this module; in addition, by changing the value of the color intensity of the right color bar, you can Adjust according to the signal strength to obtain the best display contrast of the two-dimensional image; 所述实时信号显示模块包含以下结构和操作步骤:坐标轴X轴代表信号采集模块中采样长度值,Y轴为信号幅值,该模块图像显示点源信号的位置和信号幅值,图像随扫描位置变化,实时反映信号位置和幅值的变化情况;The real-time signal display module includes the following structures and operation steps: the X axis of the coordinate axis represents the sampling length value in the signal acquisition module, the Y axis is the signal amplitude value, the image of the module displays the position and signal amplitude of the point source signal, and the image is scanned along with it. Position change, reflecting the change of signal position and amplitude in real time; 所述信号位置显示模块包含以下结构和操作步骤:坐标轴X轴代表参数设置中X扫描长度,Y轴为信号采集模块中采样长度值,可代表每个点源信号最大值出现的位置;完成一次X轴扫描后,该显示模块可呈现出该行点源信号最大值出现的位置,接着会进入下一个扫描循环,如此往复;The signal position display module includes the following structure and operation steps: the X axis of the coordinate axis represents the X scan length in the parameter setting, and the Y axis is the sampling length value in the signal acquisition module, which can represent the position where the maximum value of each point source signal appears; complete After one X-axis scan, the display module can present the position where the maximum value of the point source signal of the line appears, and then it will enter the next scan cycle, and so on; 其中,in, 所述软件模块的控制流程为:The control flow of the software module is: 1)串口初始化,测试工作站与控制器、采集板卡通讯是否正常,若不正常则进行调试直至正常;1) Initialize the serial port, test whether the communication between the workstation and the controller and the acquisition board is normal. If it is not normal, debug it until it is normal; 2)当端口检测到高电平触发信号时,电机控制器发出指令控制X轴电机行进指定路程,同步地,采集卡受到触发信号触发数据采集过程;当X轴电机行进完指定路程后停止运动,采集板卡停止数据采集,并将数据上传至工作站,写入存储文件;同时,Y轴电机行进指定路程直至停止;此时,X轴电机反向运动指定路程,同步地,采集卡受到触发信号触发数据采集过程;当X轴电机行进完指定路程后停止运动,采集板卡停止数据采集,并将数据上传至工作站,写入存储文件;同时,Y轴电机行进指定路程直至停止,X轴电机再次反向运动,同步发生数据采集保存过程,如此循环往复,直至完成指定区域面积的覆盖扫描;2) When the port detects a high-level trigger signal, the motor controller sends an instruction to control the X-axis motor to travel the specified distance. Simultaneously, the acquisition card is triggered by the trigger signal to trigger the data acquisition process; when the X-axis motor travels the specified distance, it stops moving , the acquisition board stops data acquisition, uploads the data to the workstation, and writes the data to the storage file; at the same time, the Y-axis motor travels the specified distance until it stops; at this time, the X-axis motor moves in the reverse direction for the specified distance, and the acquisition card is triggered synchronously. The signal triggers the data acquisition process; when the X-axis motor stops moving after the specified distance, the acquisition board stops data acquisition, uploads the data to the workstation, and writes the storage file; at the same time, the Y-axis motor travels the specified distance until it stops, and the X axis The motor moves in the reverse direction again, and the data acquisition and storage process occurs synchronously, and the cycle repeats until the coverage scanning of the designated area is completed; 3)最后,所采集的数据被全部保存在一个文件内,软件控制过程结束。3) Finally, the collected data are all stored in a file, and the software control process ends.
CN201811063971.5A 2018-09-12 2018-09-12 LabVIEW-based pulse synchronization control two-dimensional scanning and signal acquisition method Active CN109343374B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811063971.5A CN109343374B (en) 2018-09-12 2018-09-12 LabVIEW-based pulse synchronization control two-dimensional scanning and signal acquisition method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811063971.5A CN109343374B (en) 2018-09-12 2018-09-12 LabVIEW-based pulse synchronization control two-dimensional scanning and signal acquisition method

Publications (2)

Publication Number Publication Date
CN109343374A CN109343374A (en) 2019-02-15
CN109343374B true CN109343374B (en) 2020-01-07

Family

ID=65304837

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811063971.5A Active CN109343374B (en) 2018-09-12 2018-09-12 LabVIEW-based pulse synchronization control two-dimensional scanning and signal acquisition method

Country Status (1)

Country Link
CN (1) CN109343374B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113116511B (en) * 2021-04-16 2023-04-07 杭州维纳安可医疗科技有限责任公司 Electric signal output method, device, equipment, system and storage medium
CN115452484B (en) * 2022-09-13 2023-09-12 中国科学院地理科学与资源研究所 An automatic collection system for high-concentration runoff sediment samples
CN116088464A (en) * 2022-11-08 2023-05-09 北京理工大学 The linkage control test system and method of scanning galvanometer and displacement platform based on LabView

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6102965A (en) * 1996-09-23 2000-08-15 National Instruments Corporation System and method for providing client/server access to graphical programs
CN104237787A (en) * 2014-09-18 2014-12-24 国网河南禹州市供电公司 LabVIEW based motor speed test system and test method thereof
CN104297686A (en) * 2014-11-19 2015-01-21 芜湖杰诺瑞汽车电器系统有限公司 Electromobile motor data monitoring system based on LabVIEW
CN105141204A (en) * 2015-09-24 2015-12-09 大连理工大学 Multi-motor control system based on LabVIEW
CN107765182A (en) * 2017-12-07 2018-03-06 智灵飞(北京)科技有限公司 A kind of ground unmanned plane motor electricity commissioning test system and method based on LABVIEW

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN202776268U (en) * 2012-09-12 2013-03-13 无锡微奥科技有限公司 Real-time image displaying system based on swept source and optical coherence tomography (OCT)

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6102965A (en) * 1996-09-23 2000-08-15 National Instruments Corporation System and method for providing client/server access to graphical programs
CN104237787A (en) * 2014-09-18 2014-12-24 国网河南禹州市供电公司 LabVIEW based motor speed test system and test method thereof
CN104297686A (en) * 2014-11-19 2015-01-21 芜湖杰诺瑞汽车电器系统有限公司 Electromobile motor data monitoring system based on LabVIEW
CN105141204A (en) * 2015-09-24 2015-12-09 大连理工大学 Multi-motor control system based on LabVIEW
CN107765182A (en) * 2017-12-07 2018-03-06 智灵飞(北京)科技有限公司 A kind of ground unmanned plane motor electricity commissioning test system and method based on LABVIEW

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于LABVIEW的电机数据采集系统;胡文彪 等;《海军工程大学学报》;20050630;第17卷(第3期);第61-65页 *

Also Published As

Publication number Publication date
CN109343374A (en) 2019-02-15

Similar Documents

Publication Publication Date Title
CN109343374B (en) LabVIEW-based pulse synchronization control two-dimensional scanning and signal acquisition method
US20220196701A1 (en) Test and measurement devices, systems and methods associated with augmented reality
CN103376068B (en) The acquisition methods of laser three-D pattern proving installation and object plane three-dimensional information thereof
US7849416B2 (en) System and method for graphically creating a sequence of motion control, machine vision, and data acquisition (DAQ) operations
US20020149628A1 (en) Positioning an item in three dimensions via a graphical representation
JP6386540B2 (en) Machine vision system program editing environment including copy-and-paste functions with awareness of operating context
US7930643B2 (en) System and method for previewing a sequence of motion control operations
US20030139848A1 (en) System and method for invoking execution of a sequence of operations that includes motion control, machine vision, and data acquisition (DAQ) functionality
JPH0642210B2 (en) Electronic device control method
CN101750546A (en) Self-adaptive scanning device with electromagnetic compatibility for near-field test
Latif et al. Development of a feature-based open soft-CNC system
WO2012027969A1 (en) Method and system for four-dimensional electrocardio diagnosis instrument
CN104181467B (en) Portable linear motor multi-axis linkage measuring and controlling system
CN102680800A (en) Three-dimensional scanning system for magnetic fields
KR20140089049A (en) 3d ultrasound image analysis supporting apparatus and method
CN112097940B (en) Thermocouple two-dimensional temperature measurement platform and method based on computer automatic control
Wang et al. LabVIEW-based data acquisition system design
CN112067112A (en) Automatic underwater ultrasonic cavitation field characteristic measurement and visualization system and method
CN205654357U (en) An appearance detection device is assembled to section of jurisdiction
CN205608105U (en) PCB board level EMI testing arrangement based on framing
CN211426768U (en) Magnetic field intensity measuring device
CN103385735A (en) Ultrasonic diagnostic apparatus and control method thereof
CN115389002A (en) Pressure pulse measuring device and method of external shock wave lithotripter
CN113689398A (en) Robot tapping method and device
CN100337260C (en) Multifunctional virtual surgery equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant