introduction
In mechanical processing, it is often necessary to measure some simple geometric dimensions, such as diameter and margin. This type of work is highly repetitive and labor-intensive. Traditional manual measurement not only increases the workload of on-site workers, but also has low precision, and the data of manual measurement is also inconvenient for statistical processing. If this type of work is measured using high-precision and versatile instruments such as coordinate measuring machines, it is difficult to meet the requirements in terms of economy and efficiency. There is also a special laser scanning sensor that can be used for this type of measurement, but its measurement accuracy is based on the precise control of the speed of the independent motion system, which undoubtedly increases the cost. In order to facilitate the measurement of this type of simple, one-dimensional size, high efficiency, high precision, and easy data management, a system that can implement laser scanning measurement on a common motion platform controlled by a PMAC control card is proposed. It combines the above two measurement methods, that is, the edge signal of the object to be measured is obtained by detecting the laser signal, and the grating ruler reading is latched according to this signal to obtain the edge position of the object to be measured, thereby further obtaining the size value.
This method has the advantages of high speed and non-contact photoelectric measurement, and can make full use of the mature and widely used grating ruler resources. Since the accuracy of grating rulers is usually high, this measurement system can achieve higher accuracy within a certain range.
1. Measurement principle and overall structure
The measurement system consists of an industrial computer, a PMAC control card, a motion measurement and control system (including grating ruler, servo motor, lead screw, etc.), a laser emitting device and a photoelectric detection device. The main principle of the system is shown in Figure 1. The object to be measured is installed on the experimental table and moves with the experimental table. The motion control is completed by the PMAC control card, which reads the reading of the grating ruler and outputs the control quantity to the motor. On both sides of the object to be measured are the laser emitting device and the photoelectric detection element. When the object to be measured is in the optical path, the detection element is in the disconnected state; when the object to be measured leaves, the element is turned on. As the object to be measured moves, when its edge passes through the laser beam, the detection element will jump from on to off or from off to on. Through certain settings, PMAC can detect these jump signals and latch the grating ruler reading at that time, so as to obtain the edge position of the object to be measured, and by measuring the front and rear edge positions, the required size value can be obtained.
The laser uses a low-power semiconductor laser with a wavelength of 640nm. Its small size and low price make it very suitable for such applications. The photoelectric detection element uses an ordinary metal-packaged phototransistor.
PMAC is inserted into the PCI slot of the industrial computer and communicates through the PCI bus. The main contents of communication are two-fold: sending motion control instructions to PMAC so that it can complete the motion control of the platform; reading the edge position readings of the measured object latched in PMAC, so as to complete the output, storage and analysis of the results. In order to facilitate the processing and analysis of the collected data and to facilitate the study of system performance, the system adopts the organizational scheme of industrial computer plus PMAC. After the system is finalized, a more economical solution can be used, such as ARM-Linux plus PMAC.
The use of PMAC control card is very flexible. To form the system described above, some settings are required. The following will introduce in detail the setting method of PMAC card and the implementation method of communication between upper and lower computers in this application.
2PMAC card settings
2.1 Introduction to PMAC Card
The PMAC motion control card is a series of control cards launched by Delta-Tau that can interface with a microcomputer in a variety of ways. This example uses a PCI interface control card: PMAC-PC.
PMAC is essentially a multi-function system on board based on DSP chip. The PMAC in this example has two main interfaces, each of which can control the movement of four motors at the same time. For each motor, the main interface has a set of corresponding pins (as shown in Figure 2). They are responsible for the grating scale signal input, motor control output and flag signal input respectively. In this example, the main interface is set to opto-isolation mode through jumpers.
In addition to the main interface, PMAC also has a series of general analog and digital input/output ports. These ports are uniformly addressed with its DSP memory and can be accessed in a unified manner. The functions of the PMAC address space are preset and fixed. For example, the data stored in a certain part of the address represents the settings of a certain motor, and the other part is the data stored by the user application. In order to facilitate the operation of the PMAC memory by the host computer and the writing of application programs, its memory is divided into various variables according to its function, such as I variables, M variables, and P variables. The value of the I variable sets the working environment of the PMAC card, which in turn allows the I variable to be divided into many types, such as the motor setting I variable, the communication setting I variable, the encoder I variable, and the P variable (global variables for user programs, M variables (pointer variables), that is, the memory address represented by it stores the address of another storage unit). M variables can point to any storage location as needed, including memory and port registers. However, when the PMAC is powered on, some M variables will be pre-initialized to point to special locations. For example, the default value of M203 points to the position capture register of encoder No. 2.
2.2 Setting of position capture function
The position capture function is to latch the corresponding current encoder position when an external event enters a register. This is a task that is completely completed by the hardware circuit related to the encoder, so its only delay is the delay of the hardware gate, which makes it have very high position capture accuracy.
The working mode of the circuit can be selected by software, such as setting the position of reading external events. The setting is completed through the relevant encoder I variable. Each encoder can be set through 5 I variables. The variables related to the position capture function are encoder I variable 2 and encoder I variable 3. Variable 3 sets the position of event capture, such as it can be set to capture through the HOME mark. Variable 2 sets the capture mode of external events, such as rising edge or falling edge. PMAC can set a total of 16 encoders, and the I variable of each encoder is arranged in groups of 5 in sequence, namely I900~I979. For encoder 2 (numbered starting from 1), if it is set to capture the rising edge signal of the HOME mark for position capture, it can be achieved by sending commands "I907=2" and "I908=0" to PMAC. Each encoder corresponds to a group of registers, through which the working mode of the encoder can be set. For example, the setting of the encoder I variable above is actually writing certain values to certain bits of these registers. The encoder information can also be read through these registers. For example, when the encoder completes a position capture, the latched position is saved in these registers. For encoder 2, the position of this register is X: all 24 bits of MYMC007. The encoder also automatically sets certain flags according to the position capture situation, that is, the flag is set to 1 when a capture is completed. At this time, no matter what changes the external signal has, it will not be captured again. When the capture result is taken away (that is, there is a read operation on the corresponding register), the encoder automatically sets the flag to 0 and restarts to respond to external events for a new position capture. For encoder 2, the position of this flag is X: MYMC004, bit 17 (starting from 0, a total of 24 bits). [page]
2.3PLC program settings
PMAC is a multi-tasking computer application system. In addition to completing high-precision positioning and complex motion control tasks through various settings and motion programs, it can also perform multiple other tasks in time-sharing, and assign task priorities according to the real-time requirements of the tasks. High-priority tasks will interrupt low-priority tasks. The PLC program is one of the user programs supported by PMAC, and is at the last background processing level in terms of task priority. It can be written on the user's host and then downloaded to PMAC for execution. Compared with another higher-priority user program supported by PMAC - the motion program. The PLC program has no motion statements and is very similar to the programmable logic controller in function.
In this application, the task of the PLC program is to determine whether position capture occurs. If so, read it into an array and count the captured positions. The reason why the value is read into the array is that when the laser scans the edge of the object being measured, it will generate jitter due to the reflection of the edge, so that more than one data is collected. In order to prevent the later data from overwriting the previous data, the data generated by scanning one edge is put into the array.
Available PLC programs are as follows:
In the program, m203 points to the position capture register of encoder 2; m217 points to the position capture status flag of encoder 2; m33 points to P variable 220, which is the position of the first element of the array; m34 points to the lower 12 bits of m33, so that m33 can be operated to point to the next P variable after reading the capture position.
3. Preliminary Study on Measurement System Characteristics
In order to study the measurement performance of the system, a series of measurement experiments were carried out on the above system with a 20mm standard block as the object to be measured. The experimental results were collected, stored and analyzed by a program written in Vc++ on the host computer. The communication with PMAC was completed using the dynamic link library PComm32.dll provided by Delta-tau. Since C++ language has little support for numerical calculations and chart output, the program uses a mixed programming method with Matlab to complete the analysis work, that is, it uses the method of calling Mat-labCOM server to realize the call of Matlab function. This programming method can also be implemented in other languages.
During the measurement process, the two edges of the object under test are located in two ways, namely, from light to dark and from dark to light, and the number of samples for each experiment is not less than 300. In other words, each experimental result contains 4 data groups, which are recorded as Q_L (representing the front edge, from light to dark), Q_A (representing the front edge, from dark to light), H_L (representing the back edge, from light to dark), H_A (representing the back edge, from dark to light), and the number of data in each group is not less than 300. Since the measurement system essentially completes the dimensional measurement by locating the edge, only a brief description of the system characteristics of edge positioning is given in the following analysis.
FIG3 shows the result of an experiment in which each count of the grating ruler represents 0.1 μm.
The numerical characteristics of the data shown in Figure 3 are shown in Table 1.
As can be seen from Figure 3, the front edge measurement data has an obvious linear relationship with time, and this feature is also clearly reflected in other experiments. According to the method of distinguishing the variable value system error, this feature can be regarded as a variable value system error. There are many ways to eliminate the variable value system error. The idea adopted here is to first find a certain empirical function through a large number of experiments to characterize this error, and then eliminate the error through compensation based on this function, thereby improving the system accuracy. The numbers in the brackets in the last row of Table 1 are the values obtained after eliminating the influence of time through univariate regression analysis in the measurement sequence. It is worth noting that this correlation between the measurement data and time is not very stable. It is affected by other experimental environmental factors, that is, the compensation function applicable to a certain system. Usually when the system parameters change, the compensation function is no longer applicable. To improve the accuracy through this method in actual measurement, it is necessary to conduct experiments for specific situations. In addition, it can be seen that for the two sets of data on the same side, the standard deviation is somewhat different, which is also a common phenomenon in other experimental data sets. It can be considered to use a data set with higher accuracy to calculate the size value, that is, to use H_L and Q_A to calculate.
4 Conclusion
On the motion platform controlled by PMAC, the position capture function of PMAC and the PLC program running on it can be used to conveniently build a laser scanning dimension measurement system. By cooperating with the software of the host computer, the system can achieve fast, efficient, non-contact measurement of the dimensions of general workpieces, and its accuracy can meet the vast majority of applications. By conducting multiple measurement experiments, the empirical function of the time-related variable system error can be obtained, thereby further improving the accuracy.
Previous article:A solution for multi-band mixed signal test system based on DSP
Next article:Research on Error Diagnosis Method in Circuit Based on Symbolic Simulation
- Keysight Technologies Helps Samsung Electronics Successfully Validate FiRa® 2.0 Safe Distance Measurement Test Case
- From probes to power supplies, Tektronix is leading the way in comprehensive innovation in power electronics testing
- Seizing the Opportunities in the Chinese Application Market: NI's Challenges and Answers
- Tektronix Launches Breakthrough Power Measurement Tools to Accelerate Innovation as Global Electrification Accelerates
- Not all oscilloscopes are created equal: Why ADCs and low noise floor matter
- Enable TekHSI high-speed interface function to accelerate the remote transmission of waveform data
- How to measure the quality of soft start thyristor
- How to use a multimeter to judge whether a soft starter is good or bad
- What are the advantages and disadvantages of non-contact temperature sensors?
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- 10 Tips for Writing Better Embedded Software Code
- FPGA Timing Constraints Practice: Multi-Cycle Path Constraints
- Didn’t Vicor apply for a Chinese patent?
- Engineers tell you how to do PCB design——[Worthy of collection]
- Big disaster! HP Japan accidentally deleted 77TB of important data from Kyoto University's supercomputer system
- Configuration and use of TI C2000 TMS320F28379D SCID SCIB
- How many filters does IMX283 CAN support at most?
- Prize discussion: Reply to the "live" DAC application you have encountered and receive 10-30 core points!
- CMD file allocation method
- LSM6DS3 3D Accelerometer and 3D Gyroscope PCB Package and Code