Disclosure of Invention
In order to solve the problems in the prior art, the invention provides a box body calibration and bottom surface ranging compensation method and system, which solve the problem that the bottom surface of the box body on the existing clamp-free production line is not easy to correct.
In order to achieve the above purpose, the invention adopts the following technical scheme:
a box body calibration and bottom surface ranging compensation method comprises the following steps:
s1, selecting a placement position of a box body as a standard position, and determining a standard ranging value of a reference surface and a standard ranging value of a bottom surface of the box body at the standard position;
S2, collecting coordinate data of a reference surface of the box body to be detected, and recording the coordinate data as first coordinate data;
s3, calculating a normal vector on the reference plane, and calculating a theoretical ranging value of the bottom surface of the box to be measured by combining the first coordinate data and the second coordinate data;
and S4, calculating a deviation value of a corresponding measuring point according to the bottom surface theoretical distance measurement value, wherein the deviation value is used for calculating the contour degree and the plane degree of the box body to be measured.
In some embodiments of the present invention, the calculation formula of the bottom surface theoretical ranging value in the step S3 is:
;
The method comprises the steps of determining a bottom surface theoretical ranging value, wherein H i is the bottom surface theoretical ranging value, (X 1,Y1,Z1) is any acquisition point coordinate in first coordinate data, (X F,YF,ZF) is a normal vector on a reference surface, X i and Y i are data in the X direction and the Y direction in second coordinate data, H L is a bottom surface standard ranging value, H is a reference surface standard ranging value, and m is the bottom surface ranging number of a box body.
In some embodiments of the present invention,
The calculation formula of the deviation value in the step S4 is as follows:
;
Wherein D i is an offset value, H i is the bottom surface theoretical distance measurement value, and Z i is the data in the Z direction in the second coordinate data.
In some embodiments of the present invention, the step S2 further includes performing data filtering on the collected first coordinate data and second coordinate data, where the data filtering includes local outlier filtering and gaussian filtering.
In some embodiments of the present invention, the step S1 further includes establishing a workpiece coordinate system using coordinate data of the reference surface of the case, and measuring the reference surface standard ranging value and the bottom surface standard ranging value under the workpiece coordinate system.
In some embodiments of the present invention, there is provided a tank calibration and floor ranging compensation system comprising:
the coordinate acquisition module is used for acquiring reference plane coordinate data and bottom surface coordinate data of the box body;
A standard position confirmation module for determining a standard ranging value of a reference surface and a standard ranging value of a bottom surface of the case at the standard position;
the data processing module is used for calculating a bottom surface theoretical ranging value and an offset value of the box body to be measured according to the reference surface coordinate data and the bottom surface coordinate data, and calculating the contour degree and the flatness of the box body to be measured;
and the communication module is used for communicating with external equipment.
In some embodiments of the invention, the coordinate acquisition module comprises a robot and a ranging sensor fixed at the tail end of the arm of the robot, wherein the robot is used for acquiring coordinate data in the X direction and the Y direction, and the ranging sensor is used for acquiring coordinate data in the Z direction.
In some embodiments of the present invention, the data processing module is further configured to store reference plane coordinate data and bottom plane coordinate data of the case, and is further configured to perform zero removal filtering on the reference plane coordinate data and the bottom plane coordinate data.
In some embodiments of the present invention, there is provided an electronic device including:
a processor, and a memory and transceiver communicatively coupled to the processor;
the transceiver is used for receiving and transmitting data;
the processor executes the computer-executable instructions stored by the memory to implement the compensation approach described above.
In some embodiments of the present invention, there is provided a computer-readable storage medium, characterized in that,
The computer readable storage medium has stored therein computer executable instructions which when executed by a processor are adapted to implement the compensation method described above.
Compared with the prior art, the technical scheme of the invention has the following technical effects:
The calibration and compensation method provided by the invention realizes non-relative measurement, improves measurement accuracy, can be applied to online detection, combines non-contact measurement, has high efficiency, and does not influence production line production beats.
Detailed Description
The following description of the embodiments of the present application will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
In the description of the present application, it should be understood that the terms "center," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," "outer," and the like indicate orientations or positional relationships based on the orientation or positional relationships shown in the drawings, merely to facilitate describing the present application and simplify the description, and do not indicate or imply that the devices or elements referred to must have a specific orientation, be configured and operated in a specific orientation, and thus should not be construed as limiting the present application.
The terms "first," "second," and the like, are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include one or more such feature. In the description of the present application, unless otherwise indicated, the meaning of "a plurality" is two or more.
In the description of the present application, unless explicitly stated and limited otherwise, the terms "mounted," "connected," and "connected" are to be construed broadly, and may be, for example, fixedly connected, detachably connected, or integrally connected, mechanically connected, directly connected, or indirectly connected via an intermediary. The specific meaning of the above terms in the present application will be understood in specific cases by those of ordinary skill in the art.
In the present invention, unless expressly stated or limited otherwise, a first feature "above" or "below" a second feature may include both the first and second features being in direct contact, as well as the first and second features not being in direct contact but being in contact with each other through additional features therebetween. Moreover, a first feature being "above," "over" and "on" a second feature includes the first feature being directly above and obliquely above the second feature, or simply indicating that the first feature is higher in level than the second feature. The first feature being "under", "below" and "beneath" the second feature includes the first feature being directly under and obliquely below the second feature, or simply means that the first feature is less level than the second feature.
The following disclosure provides many different embodiments, or examples, for implementing different features of the invention. In order to simplify the present disclosure, components and arrangements of specific examples are described below. They are, of course, merely examples and are not intended to limit the invention. Furthermore, the present invention may repeat reference numerals and/or letters in the various examples, which are for the purpose of brevity and clarity, and which do not themselves indicate the relationship between the various embodiments and/or arrangements discussed.
Embodiment 1 referring to fig. 1, a method for calibrating a case and compensating for ranging from a bottom surface comprises the following steps:
s1, selecting a placement position of a box body as a standard position, and determining a standard ranging value of a reference surface and a standard ranging value of a bottom surface of the box body at the standard position;
S11, fixing the ranging sensor at the tail end of the robot, and preferentially leveling and supporting the tool during installation, so as to ensure that the laser rays emitted by the ranging sensor are perpendicular to the reference surface of the box body at the standard position as much as possible.
For the standard position, the placement position of the first box body on the production line is taken as the standard position for the box bodies in the same batch, and the position calibration of the subsequent box bodies refers to the relative position relation between the calibration and the standard position.
In the embodiment, three points are collected on the reference surface, the reference surface standard ranging values of the three points are adjusted to be H, and the positions of the three collected points are dispersed as much as possible, so that absolute positioning precision errors of the robot in the X direction and the Y direction can be reduced.
S13, the robot applies coordinates of three points in the step S12 to establish a workpiece coordinate system;
The robot teaches the measuring position of the bottom surface of the box body under the workpiece coordinate system, at the moment, the ranging sensor moves to the top surface position of the box body, and the measured bottom surface standard ranging value of the box body is H L, so that all the Z values of the measuring positions are theoretically the same and equal to the bottom surface standard ranging value H L.
And S14, storing the acquired box coordinate data in the standard position into an upper computer for subsequent calculation and retrieval.
S2, collecting coordinate data of a reference surface of the box body to be detected, and recording the coordinate data as first coordinate data;
s21, firstly, moving a ranging sensor to a reference plane, and collecting first coordinate data (X, Y, Z) of a box to be measured, wherein X and Y are coordinates of a robot in a sampling point, and Z is a measured value of the ranging sensor;
S22, moving the ranging sensor to the top surface position of the box body, and collecting second coordinate data (x, y, z) of the box body to be measured, wherein x and y are coordinates of a robot in the process of collecting points, and z is a measured value of the ranging sensor;
S23, the first coordinate data and the second coordinate data are transmitted to an upper computer by a PLC, then zero removal and filtration are carried out, wherein the different box sizes and the different precision requirements are different, the quantity of bottom surface measuring points is different, so that the PLC needs to reserve enough memory to store measurement data and robot coordinate values, and the data in the X/Y/Z directions in the first coordinate data and the second coordinate data are respectively located in 3 memory sections, and the values default to 0. During measurement, the PLC sequentially adds data from the head, so that the continuity of the measured data in the memory is ensured, and all default values 0 are at the tail. After the measurement is completed, the upper computer extracts all data from the PLC at one time and stores the data into 3 lists. Each list deletes a value of 0 from the end until the first non-0 value is encountered and the deletion is stopped. After zero removal filtering, the data in the 3 lists are the same.
S24, under the influence of the roughness of the bottom surface of the box body and the working principle of the ranging sensor, abnormal data possibly exist in the measured value, and the upper computer provides two abnormal value filtering methods:
and (3) local outlier filtering, namely, an algorithm for filtering the local outlier data is applied to the formula (1) and the formula (2), n is the local data quantity, and p is the coordinate value. If it is T is a threshold value,;The P i value is unchanged.
Gaussian filtering, namely removing abnormal point data according to the rule from measured data to enable all data values to be located inBetween the ranges. And then smoothing by Gaussian filtering to eliminate Gaussian noise, wherein a one-dimensional Gaussian filtering data model is shown in a formula (3). All outlier values are replaced with the average of the non-outliers.
S3, calculating a normal vector on the reference plane, and calculating a theoretical ranging value of the bottom surface of the box to be measured by combining the first coordinate data and the second coordinate data;
S31, establishing a coordinate system, wherein the ranging sensor collects three points on a reference surface of the box body, the coordinates are (X1,Y1,Z1)、(X2,Y2,Z2)、(X3,Y3,Z3), respectively, X and Y are coordinate values when the robot collects the points, and Z is a measured value of the ranging sensor. The vector consisting of the three points is ,The normal vector calculation of the box reference plane is shown in formula (4).
;
S32, moving the ranging sensor to the top surface of the box body to be detected to collect coordinates of the measuring pointM is the number of measurement points on the bottom surface of the box body, x and y are coordinate values when the robot picks up points, and z is the measured value of the ranging sensor, namely the bottom surface ranging value.
The calculation formula of the bottom surface theoretical distance measurement value is as follows:
;
Wherein, The theoretical ranging value of the bottom surface is (X 1,Y1,Z1) any acquisition point coordinate in the first coordinate data, in this embodiment, the origin position on the reference surface in the step S31, (X F,YF,ZF) the normal vector on the reference surface, X i and Y i are the data in the X direction and the Y direction in the second coordinate data, namely the position coordinate of the robot when the top surface of the box body is to be measured, H L is the standard ranging value of the bottom surface, H is the standard ranging value of the reference surface, and m is the number of the bottom surface of the box body.
And S4, calculating a deviation value of a corresponding measuring point according to the bottom surface theoretical distance measurement value, wherein the deviation value is used for calculating the contour degree and the plane degree of the box body to be measured.
S41, calculating a deviation value by using the bottom surface theoretical ranging value in the step:
;
Wherein D i is an offset value, H i is the bottom surface theoretical distance measurement value, and Z i is the data in the Z direction in the second coordinate data.
S42, calculating the profile degree, the flatness and other measured values under the ISO or ASME standard according to the deviation value D i.
The software can set and store the standard ranging value H of the reference surface and the standard ranging value H L of the bottom surface of different box parts so as to adapt to the optimal measuring distance of different sensors.
The ranging sensor must be calibrated periodically to ensure its measurement accuracy.
Compared with the prior art, the technical scheme of the invention has the following technical effects:
The calibration and compensation method provided by the invention realizes non-relative measurement, improves measurement accuracy, can be applied to online detection, combines non-contact measurement, has high efficiency, and does not influence production line production beats.
Example 2a case calibration and bottom ranging compensation system 100 and an electronic device 200.
For the compensation system 100, as shown with reference to fig. 2, comprising:
A coordinate acquisition module 110 for acquiring reference plane coordinate data and bottom plane coordinate data of the box body;
A standard position confirmation module 120 for determining a standard ranging value of a reference surface and a standard ranging value of a bottom surface of the case at the standard position;
The data processing module 130 is used for calculating a theoretical ranging value and an offset value of the bottom surface of the box to be measured according to the datum plane coordinate data and the bottom surface coordinate data, and also is used for calculating the contour degree and the flatness of the box to be measured;
and a communication module 140 for communicating with an external device.
The coordinate acquisition module 110 comprises a robot and a ranging sensor fixed at the tail end of an arm of the robot, wherein the robot is used for acquiring coordinate data in the X direction and the Y direction, and the ranging sensor is used for acquiring coordinate data in the Z direction.
In some embodiments of the present invention, the data processing module 130 is further configured to store the datum plane coordinate data and the bottom plane coordinate data of the box, and is further configured to perform zero removal filtering on the datum plane coordinate data and the bottom plane coordinate data.
It should be understood that the compensation system herein is embodied in the form of a functional module. The term module herein may refer to an Application Specific Integrated Circuit (ASIC), an electronic circuit, a processor (e.g., a shared, dedicated, or group processor, etc.) and memory that execute one or more software or firmware programs, a combinational logic circuit, and/or other suitable components that support the described functionality. In an alternative example, it will be understood by those skilled in the art that the compensation system may be specifically the electronic device 200 in the foregoing embodiment, or the functions of the electronic device 200 in the foregoing embodiment may be integrated in the compensation system, and the compensation system may be used to perform each flow and/or step corresponding to the electronic device 200 in the foregoing method embodiment, which is not described herein for avoiding repetition.
The compensation system has a function of implementing the corresponding steps executed by the electronic device 200 of the compensation method in embodiment 1, and the function may be implemented by hardware or may be implemented by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the functions described above. For example, the acquisition module may be a communication interface, such as a transceiver interface.
In an embodiment of the present application, the compensation system in FIG. 1 may also be a chip or a system-on-chip (SoC), for example.
Referring to fig. 3, in the present embodiment, there is provided an electronic apparatus 200 including:
a processor 210, and a memory 220 and a transceiver 230 communicatively coupled to the processor;
the memory 220 stores computer-executable instructions, the transceiver 230 for transceiving data;
the processor 210 executes computer-executable instructions stored in the memory 220 to implement the compensation approach of embodiment 1.
It should be understood that the electronic device 200 may be configured to perform the corresponding steps and/or flows of the method embodiments described above. Alternatively, the memory 220 may include read-only memory and random access memory, and provide instructions and data to the processor. A portion of memory 220 may also include non-volatile random access memory. For example, the memory 220 may also store information of the device type. The processor 210 may be configured to execute instructions stored in the memory 220, and when the processor 210 executes the instructions, the processor 210 may perform corresponding steps and/or flows in the above-described method embodiments.
It should be appreciated that in embodiments of the present application, the processor 210 may be a central processing unit (c e n t r a lprocessing unit, CPU), and the processor 210 may also be other general purpose processors, digital Signal Processors (DSPs), application Specific Integrated Circuits (ASICs), field Programmable Gate Arrays (FPGAs) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
In implementation, the steps of the above method may be performed by integrated logic circuitry in hardware or instructions in software in processor 210. The steps of a method disclosed in connection with an embodiment of the present application may be embodied directly in hardware processor execution or in a combination of hardware and software modules in the processor 210. The software modules may be located in a random access memory, flash memory, read only memory, programmable read only memory, or electrically erasable programmable memory, registers, etc. as well known in the art. The storage medium is located in a memory, and the processor executes instructions in the memory to perform the steps of the method described above in conjunction with its hardware. To avoid repetition, a detailed description is not provided herein.
Embodiment 3 in this embodiment, a computer-readable storage medium having stored therein computer-executable instructions that, when executed by a processor, are configured to implement the compensation approach of embodiment 1 is provided.
In the several embodiments provided by the present application, it should be understood that the disclosed systems, devices, and methods may be implemented in other manners. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of the units is merely a logical function division, and there may be additional divisions when actually implemented, e.g., multiple units or components may be combined or integrated into another system, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in the embodiments of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present application. The storage medium includes a U disk, a removable hard disk, a read-only memory (ROM), a random access memory (random access memory, RAM), a magnetic disk, an optical disk, or other various media capable of storing program codes.
Compared with the prior art, the technical scheme of the invention has the following technical effects:
The calibration and compensation method provided by the invention realizes non-relative measurement and has high precision, and the position calibration is carried out by the ranging sensor to eliminate the absolute positioning precision error of the robot;
The calibration and compensation method can be applied to online detection, combines non-contact measurement, has high efficiency, does not influence the production beat of a production line, does not need a positioning clamp, and has low cost and wide application range.
In the description of the above embodiments, particular features, structures, materials, or characteristics may be combined in any suitable manner in any one or more embodiments or examples.
The foregoing is merely illustrative of the present invention, and the present invention is not limited thereto, and any changes or substitutions easily contemplated by those skilled in the art within the scope of the present invention should be included in the scope of the present invention. Therefore, the protection scope of the invention is subject to the protection scope of the claims.