A kind of anchor chain flash welding quality online evaluation method based on DTW and MDS
Technical field
The invention belongs to welding field, in particular to a kind of anchor chain flash welding quality online evaluation side based on DTW and MDS
Method.
Background technique
With the development of world shipping, more stringent requirements are proposed for safety of the people to shipping.And anchor chain is as guarantee boat
The important link of safety is transported, quality problems have caused more and more concerns.Flash welding method due to the thermal efficiency is high,
The advantages that welding quality is good, quality of weld joint is stablized is the mainstream in high quality anchor chain market at this stage.
Flash welding process is the process of a multi-parameter comprehensive influence, electric circumstance rather harsh, the height of welding process
Spend non-linear and group flashing light process randomness to establish accurate model to flash welding process it is extremely difficult, so building
Vertical flash welding quality evaluation system acquires a certain degree of difficulty.The study found that notification number is after being retrieved to existing patent and document
The patent of CN106271036A discloses " ultrasonic wave metal welding quality appraisal procedure, device and ultrasonic metal bonding machine ",
The invention by extract actual production process in welding process information characteristic parameter, and by input metal to be welded it is corresponding surpass
Sound wave welding Evaluation Model on Quality simultaneously exports assessed value, to realize the assessment of welding quality.The disadvantage is that, the welding matter of this method
Amount assessment models are built by artificial neural network, need to carry out experiment of a large amount of varying environment under the conditions of, to obtain foot
Enough sample datas.And Artificial Neural Network needs to carry out largely in line computation, and the calculating time is long, to the property of computer
Height can be required, is not suitable for industry spot mostly.In addition, the welding quality assessment models of this method need before actual production
It is established by carrying out the soldering test of large sample size to each welding object, this is a kind of static state modeling method, is not accounted for
To the timing dependence of observation data and the observation data (sample data) of last time, the dynamic characteristic of system is not accounted for.
Summary of the invention
Goal of the invention: aiming at the problems existing in the prior art, the present invention, which provides one kind, can quickly and effectively identify event
Hinder welding product, improve production efficiency and ensures the anchor chain flash welding quality online evaluation based on DTW and MDS of welding quality
Method.
Technical solution: in order to solve the above technical problems, the present invention provides a kind of anchor chain flash welding matter based on DTW and MDS
Online evaluation method is measured, is included the following steps:
(1) database E1 is established;
(2) judge whether system monitors new measured signal, be judged as YES, then follow the steps (3);It is judged as NO, then
Indicate that welding stops, system finishing process.
(3) measured signal S is acquired1;
(4) to S1Carry out data prediction;
(5) it is calculated separately between measured signal and 2L historical data of selection with dynamic time warping, that is, DTW algorithm
Dissmilarity distance dI, s, i=1,2 ..., 2L;
(6) the dissimilar distance matrix E2 of size 2L*1 is established;
(7) last line for matrix E2 obtained in step (6) being added to the database E1 established in step (1) is last
One column, the dissimilar distance matrix F that composition size is (2L+1) * (2L+1);
(8) the distance matrix G for being (2L+1) * P by dissimilar distance matrix F dimensionality reduction with Multidimensional Scaling method, that is, MDS,
Middle P represents dimension, and keeps distance relation original between data;
(9) clustering is carried out to 2L+1 P dimension data in matrix G with Di Li Cray process mixed model, that is, DPMM;
(10) judge whether measured signal clusters as normal signal class, be judged as NO, then measured signal belongs to fault-signal
And then follow the steps (11);It is judged as YES, then measured signal belongs to normal signal and thens follow the steps (12);
(11) judge that measured signal for fault-signal, is handled fault-signal according to step (10);
(12) judge that measured signal for normal signal, is handled normal signal according to step (10).
Further, database E1 is established in the step (1) specific step is as follows:
(1.1) it is welded in record data according to actual welding experience from history and chooses L normal weld signal Q1, Q2...,
QLWith L failure welding signal QL+1, QL+2..., Q2L;
(1.2) data prediction;
(1.3) the dissimilar distance of 2L 2D signal between any two is calculated with dynamic time warping, that is, DTW algorithm;
(1.4) the dissimilar distance by the 2L 2D signal obtained in step (1.3) between any two, composition size are
The dissimilar distance matrix database E1 of 2L*2L.
Further, in the step (1.1) L normal weld signal and L failure welding signal by electrode position
The 2D signal of signal and current signal composition, such as Q1=[A B], A=[a1, a2..., ai, an]TFor electrode position
Confidence number, B=[b1, b2..., bi..., bn]TFor current signal.
Further, specific step is as follows for data prediction in the step (1.2): according to z-score algorithm to electricity
Pole position and electric current 2D signal Q1It is normalized:
Wherein μ1For the mean value of sample data A, σ1For the standard deviation of sample data A, A*For electrode position signal A normalization
Result that treated.μ2For the mean value of sample data B, σ2For the standard deviation of sample data B, B*For current signal B normalized
Result afterwards;2D signal after obtaining normalized According to above-mentioned formula to 2L signal respectively into
Row normalized, the signal after being normalized
Further, in the step (1.3) with dynamic time warping, that is, DTW algorithm calculate 2L 2D signal two-by-two it
Between dissimilar distance specific step is as follows:
(1.3.1) is for the signal after normalizationWithDistance matrix Δ=[D is constructed firstI, j], wherein element
DI, jIt indicatesWithBetween Euclidean distance:
N and M are respectivelyWithLength;
(1.3.2) searches for the regular path W={ w of a connection (1,1) and (N, M) in a two-dimensional matrix1, w2...,
wK, that is, w1=(1,1) and wK=(N, M), while meeting monotonicity and step-length less than the two constraint conditions of r;
(1.3.3) finds optimal regular path, from primary condition Start, step-length is less than r, and searching algorithm is as follows:
| i-j |≤r, i=2,3 ..., N, j=2,3 ..., M
Wherein θ (i-1, j-1), θ (i-1, j) and θ (i, j-1) indicate three lattice points (i-1, j-1) that may advance, (i-
1, j) it is indicated in current Cumulative Distance with the Cumulative Distance of (i, j-1), min (θ (i-1, j-1), θ (i-1, j), θ (i, j-1))
Minimum value.θ (i, j) is minimum Cumulative Distance and current lattice point distance DI, jThe sum of, total Cumulative Distance as current lattice point;
(1.3.4) finally calculates regular distance are as follows:
d1,2 indicate two 2D signalsWithDissimilar distance.
(1.3.5) calculates the dissimilar distance d of 2L 2D signal between any two according to step 1.3.1~1.3.4I, j, i
=1,2 ..., 2L, j=1,2 ..., 2L.
Further, dissimilar distance matrix F dimensionality reduction is (2L by the middle use Multidimensional Scaling method, that is, MDS of the step (8)
+ 1) the distance matrix G of * P, wherein P represents dimension, and keeps distance relation original between data specific step is as follows:
It (8.1) is to reconstruct gram in the dissimilar distance matrix F of (2L+1) * (2L+1) from the size that step (7) obtains
Matrix B:
Wherein H=I-11T/ L is matrix centralization, and I is the unit matrix that size is L, and 1 is the column vector of L 1 composition,
And F(2)In each element be dI, j 2;
(8.2) the element b in matrix BijIt can indicate are as follows:
(8.3) gram matrix B is defined as vector product B=XX known toT, it is further broken into: Wherein V is eigenvectors matrix, and Λ is the diagonal matrix of characteristic value.Institute is in the hope of vector matrix
Are as follows:X=[x1, x2..., xi..., xj..., xL]T, matrix G=X after finally acquiring dimensionality reduction.
Further, 2L+1 P in matrix G is tieed up with Di Li Cray process mixed model, that is, DPMM in the step (9)
Data carry out clustering, and specific step is as follows:
(9.1) the data configuration Di Li Cray process for representing distance relation between signal to 2L+1 in matrix G mixes
Model;
(9.2) using Gibbs Sampling gibbs sampler algorithm to the model parameter in Di Li Cray mixed model into
Row is constantly updated, and the cluster result of 2L+1 data is obtained;
(9.3) judge Clustering Effect, if Clustering Effect is preferable, continue to execute step (10), it is no to then follow the steps
(9.2)。
Further, measured signal is judged for fault-signal, to fault-signal according to step (10) in the step (11)
Handled that specific step is as follows:
(11.1) system issues early warning for fault-signal, reminds operator;
(11.2) measured signal and the fault-signal being added at first in matrix E2 are rejected and (is defaulted as QL+1) dissimilar distance
Value, generates new matrix E3;
(11.3) it rejects the fault-signal being added at first in database E1 and (is defaulted as QL+1) belonging to ranks, by matrix E3
It is added to last column of matrix E1 last line.
(11.4) return step (1.4) is updated database E1.
Further, measured signal is judged for normal signal, to normal signal according to step (10) in the step (12)
Handled that specific step is as follows:
(12.1) measured signal and the normal signal being added at first in matrix E2 are rejected and (is defaulted as Q1) dissimilar distance
Value forms matrix E3;
(12.2) it rejects the normal signal being added at first in database E1 and (is defaulted as Q1) belonging to ranks, matrix E3 is added
It is added to last column of matrix E1 last line;
(12.3) return step (1.4) is updated database E1.
Compared with the prior art, the advantages of the present invention are as follows:
A kind of anchor chain flash welding quality online evaluation method based on DTW and MDS of the invention has quantified two and had welded
Space-time dissimilarity between sensor signal in journey, and by sensor signal be embedded in three-dimensional space node (feature to
Amount), realize the dimensionality reduction to data and visualization.In addition, introducing nonparametric model --- Di Li Cray process hybrid guided mode
Type (DPMM) carries out clustering to feature vector, realize quickly and compared with high-accuracy to anchor chain Flash Butt Welding quality into
Row online evaluation.This method considers that the dynamic of system is special without complicated modeling process and a large amount of test sample
The timing dependence of property and measured signal and the sample database signal of last time, has accomplished to the real-time of sample database
It updates.It can identify and the abnormality of real-time early warning welding, it can be found that the potential quality problems in anchor chain welding process,
Improving production efficiency reduces production cost, to ensure that high quality and the navigation safety of anchor chain provide reliable guarantor
Barrier.
Detailed description of the invention
Fig. 1 is the structural diagram of the present invention;
Fig. 2 is the matrix conversion relational graph in specific embodiment;
Fig. 3 is the measured signal S in specific embodiment1Signal graph;
Fig. 4 is the measured signal in specific embodiment after normalizedSignal graph;
Fig. 5 is distance relation scatter plot of the signal in three-dimensional space after dimensionality reduction in specific embodiment;
Fig. 6 is cluster result figure in specific embodiment.
Specific embodiment
With reference to the accompanying drawings and detailed description, the present invention is furture elucidated.
A kind of anchor chain flash welding quality online evaluation method based on DTW and MDS of the present invention, including walk as follows
It is rapid:
Step 1) establishes database E1
Step 1.1) welds in record data from history according to actual welding experience and chooses L normal weld signal Q1,
Q2..., QLWith L failure welding signal QL+1, QL+2..., Q2L(2L selected signal is by electrode position signal and electric current
The 2D signal of signal composition, such as Q1=[A B], A=[a1, a2..., ai..., an]TFor electrode position signal, B=[b1,
b2..., bi..., bn]TFor current signal).
Step 1.2) data prediction.According to z-score algorithm to electrode position and electric current 2D signal Q1Carry out normalizing
Change processing:
Wherein μ1For the mean value of sample data A, σ1For the standard deviation of sample data A, A*For electrode position signal A normalization
Result that treated.μ2For the mean value of sample data B, σ2For the standard deviation of sample data B, B*For current signal B normalized
Result afterwards.2D signal after obtaining normalized According to above-mentioned formula to 2L signal respectively into
Row normalized, the signal after being normalized
Step 1.3) dynamic time warping (DTW) algorithm calculates the dissimilar distance of 2L 2D signal between any two.
Step 1.3.1) for the signal after normalizationWithDistance matrix Δ=[D is constructed firstI, j], wherein member
Plain DI, jIt indicatesWithBetween Euclidean distance:
N and M are respectivelyWithLength.
Step 1.3.2) the regular path W={ w for connecting (1,1) and (N, M) is searched in a two-dimensional matrix1,
w2..., wK, that is, w1=(1,1) and wK=(N, M), while meeting monotonicity and step-length less than the two constraint conditions of r.
Step 1.3.3) optimal regular path is found, from primary condition
Start, step-length is less than r, and searching algorithm is as follows:
Wherein θ (i-1, j-1), θ (i-1, j) and θ (i, j-1) indicate three lattice points (i-1, j-1) that may advance, (i-
1, j) it is indicated in current Cumulative Distance with the Cumulative Distance of (i, j-1), min (θ (i-1, j-1), θ (i-1, j), θ (i, j-1))
Minimum value.θ (i, j) is minimum Cumulative Distance and current lattice point distance DI, jThe sum of, total Cumulative Distance as current lattice point.
Step 1.3.4) finally calculate regular distance are as follows:
d1,2 indicate two 2D signalsWithDissimilar distance.
Step 1.3.5) according to step 1.3.1~step 1.3.4, calculate the dissimilar distance between any two of 2L signal
dI, j, i=1,2 ..., 2L, j=1,2 ..., 2L.
The dissimilar distance of the 2L 2D signal that step 1.4) finds out step 1.3 between any two, composition size are 2L*
The dissimilar distance matrix database E1 of 2L.
Step 2) judges whether system monitors new measured signal, is judged as YES, and thens follow the steps (3);It is judged as NO,
Then indicate that welding stops, system finishing process.
The electrode position signal C=[c generated in step 3) acquisition welding process1, c2 ..., ci..., cm]T, current signal
H=[h1, h2 ..., hj..., hm]T, sampling time T, sampling interval t.Electrode position signal C and current signal H is formed
One two-dimentional measured signal S1=[C H].
Step 4) data prediction.According to the two-dimentional measured signal S of step 1.2 pair1It is normalized, is normalized
Treated 2D signal
The DTW algorithm of step 5) step 1.3 calculates the measured signal after normalizationWith 2L data field signalBetween dissimilar distance dI, s, i=1,2 ..., 2L.
The dissimilar distance matrix E2 that the dissimilar distance composition size that step 6) acquires step 5 is 2L*1.
Matrix E2 is added to last column of the last line of matrix E1 by step 7), and composition size is (2L+1) * (2L+1)
Dissimilar distance matrix F.
The distance matrix G that dissimilar distance matrix F dimensionality reduction is (2L+1) * P with Multidimensional Scaling method (MDS) by step 8)
(P represents dimension), and keep distance relation original between data.
Step 8.1) is to reconstruct gram in the dissimilar distance matrix F of (2L+1) * (2L+1) from the size that step 7 obtains
Matrix B:
Wherein H=I-11T/ L is matrix centralization, and I is the unit matrix that size is L, and 1 is the column vector of L 1 composition,
And F(2)In each element be dI, j 2。
Element b in step 8.2) matrix BijIt can indicate are as follows:
Gram matrix B is defined as vector product B=XX known to step 8.3)T, it is further broken into: Wherein V is eigenvectors matrix, and Λ is the diagonal matrix of characteristic value.Institute is in the hope of vector matrix
Are as follows:X=[x1, x2..., xi..., xj..., xL]T, matrix G=X after finally acquiring dimensionality reduction.
Step 9) carries out clustering to 2L+1 P dimension data in matrix G with Di Li Cray process mixed model (DPMM).
The data configuration Di Li Cray process that step 9.1) represents distance relation between signal to 2L+1 in matrix G is mixed
Molding type.
Step 9.2) joins the model in Di Li Cray mixed model using Gibbs Sampling gibbs sampler algorithm
Number is constantly updated, and the cluster result of 2L+1 data is obtained.
Step 9.3) judges Clustering Effect, if Clustering Effect is preferable, continues to execute step 10, no to then follow the steps 9.2.
Does step 10) judge that measured signal clusters as normal signal class? it is judged as NO, measured signal belongs to failure letter
Number, then follow the steps 11.It is judged as YES, measured signal belongs to normal signal, thens follow the steps 12.
Step 11) judges that measured signal for fault-signal, is handled fault-signal according to step 10.
Step 11.1) system issues early warning for fault-signal, reminds operator.
Step 11.2) rejects measured signal and the fault-signal being added at first in matrix E2 and (is defaulted as QL+1) dissmilarity
Distance value generates new matrix E3.
Step 11.3) rejects the fault-signal being added at first in database E1 and (is defaulted as QL+1) belonging to ranks, by matrix
E3 is added to last column of matrix E1 last line.
Step 11.4) return step 1.4 is updated database E1.
Step 12) judges that measured signal for normal signal, is handled normal signal according to step 10.
Step 12.1) rejects measured signal and the normal signal being added at first in matrix E2 and (is defaulted as Q1) it is dissimilar away from
From value, matrix E3 is formed.
Step 12.2) rejects the normal signal being added at first in database E1 and (is defaulted as Q1) belonging to ranks, by matrix
E3 is added to last column of matrix E1 last line.
Step 12.3) return step 1.4 is updated database E1.
It is as shown in Fig. 1 quality online evaluation system work flow diagram.
Step 1) establishes database
Step 1.1) welds in record data from history according to actual welding experience and chooses 100 normal weld signal Q1,
Q2…Q100With 100 failure welding signal Q101, Q102…Q200(200 selected signals are by electrode position signal and electricity
Flow the 2D signal of signal composition, such as Q1=[A B], A=[a1, a2..., ai..., an]TFor electrode position signal, B=
[b1, b2..., bi..., bn]TFor current signal).
Step 1.2) data prediction.With z-score algorithm to electric current and electrode position 2D signal Q1, Q2…Q200Into
Row normalized, the 2D signal after obtaining normalized
Step 1.3) dynamic time warping (DTW) algorithm calculates the dissimilar distance of 200 2D signals between any two.
The dissimilar distance of 200 2D signals that step 1.4) finds out step 1.3 between any two, composition size are
The dissimilar distance matrix database E1 (such as attached drawing 2) of 200*200.
Step 2) judges whether system monitors new measured signal, is judged as YES, and thens follow the steps (3);It is judged as NO,
Then indicate that welding stops, system finishing process.
The electrode position signal C and current signal H generated in step 3) acquisition welding process, forms a two dimension letter to be measured
Number S1(as shown in Fig. 3), sampling time 67.6s, sampling interval 0.1s.
Step 4) data prediction.To electrode position and electric current 2D signal S1It is normalized to obtain S1 *=[C*
H*] (as shown in Fig. 4).
Step 5) calculates the measured signal after normalization with DTW algorithmWith the dissmilarity between 200 data field signals
Distance dI, s, i=1,2 ..., 200.
Dissimilar distance matrix E2 (such as attached drawing that the dissimilar distance composition size that step 6) acquires step 5 is 200*1
2)。
Matrix E2 is added to last column of the last line of matrix E1, the not phase that composition size is 201*201 by step 7)
Like distance matrix F (such as attached drawing 2).
It is 201*3 apart from square that dissimilar distance matrix F dimensionality reduction is size with Multidimensional Scaling method (MDS) by step 8)
Battle array G (3 represent dimension), and keep the initial range relationship between signal.As attached drawing 5 be dimensionality reduction after data three-dimensional space point
Cloth.
Step 9) carries out clustering to 201 3 dimension datas in matrix G with Di Li Cray process mixed model (DPMM),
If attached drawing 6 is cluster result.
Does step 10) judge that measured signal belongs to normal signal class? 6 cluster result with reference to the accompanying drawings, measured signal category
It in normal signal, is judged as YES, thens follow the steps 12.
Step 12) judges that measured signal for normal signal, is handled normal signal according to step 10.
Step 12.1) rejects measured signal and the normal signal being added at first in matrix E2 and (is defaulted as Q1) it is dissimilar away from
From value, form matrix E3 (such as attached drawing 2).
Step 12.2) rejects the normal signal being added at first in database E1 and (is defaulted as Q1) belonging to ranks, by matrix
E3 is added to last column (such as attached drawing 2) of matrix E1 last line.
Step 12.3) return step 1.4 is updated database E1.
The principles and effects of the invention, and the implementation that part uses only is illustrated in the above embodiments
Example, and is not intended to limit the present invention;It should be pointed out that for those of ordinary skill in the art, not departing from wound of the present invention
Under the premise of making design, various modifications and improvements can be made, and these are all within the scope of protection of the present invention.