FAULT LOCATION IN CNC SYSTEM SOFTWARE BASED ON THE ARCHITECTURE EXPANSION

Preliminary communication There are currently no appropriate methods to find CNC system software defects and eliminate hidden dangers. In order to improve CNC system reliability, the architecture expansion-based fault location method in CNC system software was proposed in this paper. The failure of CNC system software was 619 analysed, the expansion method of CNC system software architecture was proposed and the expansion component was established. The software data morphology information and running path were monitored and recorded, the failure pathway was obtained and a similar path set algorithm was adopted to generate the similar pathway set of the fault path. A least squares SVM-based suspicion model was established to determine the fault statement, eliminate faults and position the software fault in the level of the CNC system structure. Fault location experimentation was conducted in the multi-axis movement control card PCI-7344. The experiment’s result shows that the method proposed avoided the repeated testing and debugging by programmers. Without being limited by artificial factors and levels, it is a reliable method of CNC system software fault location.


Introduction
As the function of CNC systems becomes increasingly more powerful and the software size expands continuously it is hard to guarantee the reliability of the software.The software of CNC systems is required to carry out a large quantity of real-time online calculation therefore, ensuring stable operation is the primary focus to improve working accuracy and efficiency.The software failure of a CNC system is mainly caused by design error.In the process of software design, some defects are not discovered in the testing stage.In processing, those defects are activated which result in occurrence of failure and subsequently can seriously influence production.Through research on CNC system software fault location techniques, it is possible to discover software defects, eliminate hidden dangers, and ensure stable operation.
The CNC system fault analysis and fault location technique work to good effect in terms of solving hardware fault [1÷3] although it cannot be easily applied in CNC system software fault finding.Currently, most programmers and users discover the fault via debugging the program, which is quite an expensive and time consuming process.Due to the influence and limitation of human's ability and many factors in the debugging process, it is very hard to realize quick and accurate fault location of CNC system software.
Zhou discovered that function and memory correspond to each other and he monitored data access memory to complete the diagnosis and fault location [4].
Harrold created software programs running track spectra and obtained the difference between the system software running track [5].Renieris ran a program based on the path to locate the software failure by comparing the difference between failure and success paths [6].Wang found the code fault location by the extent of the path shape to the software [7].Other methods have also been proposed to solve the software fault location [8÷13].The fault location methods above require a large quantity of testing data and a regular result can be obtained only when the capacity of samples reaches certain degree.
The focus of previous work on software fault location of CNC system was solved by using similar path sets and artificial neural networks [14].These methods do not combine the operation behaviour of software with the overall software architecture to improve the overall level of reliability from a systematic perspective.This paper locates CNC system software faults through architecture expansion and begins from a systematic level to improve fault location of CNC software.The expansion component of CNC system software architecture is established, the software data morphology information and running path are monitored and recorded through the expansion component.
The remainder of the paper is organized as follows: Section 2 established CNC system software fault location methods on the basis of software architecture expansion; Section 3 set up the software architecture expansion of CNC system; Section 4 presented the similar path method to generate the similar pathway of the fault path and; Section 5 introduced the LS-SVM algorithm to calculate code degree-of-suspicion.Finally, an application example was given in Section 6 to verify the method proposed in this paper.
The system structure expansion based on the overall structure characteristics of CNC system software and the fault positioning method avoid the repeated tests and debugging of programmers.Without being limited by artificial factors and levels, it is a reliable CNC system software fault location method.

Software fault location method based on architecture expansion
The reliability of CNC system software is different from the reliability of the hardware, in essence: a hardware fault or failure is caused due to physical abrasion, and its reliability reduces with the increase of system operation time.However, a software fault is caused due to a design defect.In the case of software, initially the program defect is caused due to designer error or other objective reasons.The software fault just refers to the state under which the incorrect, abnormal, or nonstandard execution happens in software.If the software fault is not timely discovered, a serious accident will occur.When CNC system software operates to the defect path, the defect will be activated and then the fault will happen.Therefore, this paper starts from software architecture to research CNC system software fault location techniques through analysis on program operating path.The CNC system software architecture expansion method proposed is to carry out software fault location from the structure level of a CNC system.Firstly, this paper designs expansion components of CNC system software architecture.In the operation of a CNC system, the interaction is made between CNC system components and expansion components through semantic load and semantic perception to generate a monitoring task list and monitoring instruction list.The data form and operating path of program is also detected and recorded.Then, the similar path set of the failure path is generated according to a similar path algorithm.Through comparison, it is possible to obtain a feasible path with a concentrated similar path and construct a successful similar path.The next stage is to construct a code degree-of-suspicion calculation model based on LS-SVM to locate fault code.Finally, this paper provides a method for eliminating the fault.
This paper establishes a CNC system software fault location method based on architecture expansion, as shown in Fig. 1.

CNC system software architecture expansion
Through constructing the expansion of CNC system software architecture, the relevant components and algorithm were implanted into the system so as to carry out CNC software fault location and improve reliability of CNC systems.According to the software architecture of CNC systems, the expansion was made beyond the overall structure.The relevant functional components of fault location were added to obtain data form of the code and the operating path of the program by monitoring and recording operation information of the relevant program.The software architecture expansion of CNC system proposed in this paper is shown in Fig. 2.

Figure 2 CNC system software architecture expansion
According to the method of CNC system software architecture expansion proposed in this paper, we added monitoring and recording components to obtain related data and operation information of the path.This data included excavation analysis on tracking the moving trajectory of the CNC system software, analysis of source code and the state skipping record of the code and other functions.From an operation process of CNC system software perspective, the dynamic behaviour of software mainly consisted of data forms and instructions, and it referred to the relevance and interactive function between the operating path of the software program and the data.The CNC system software architecture expansion established in this paper is shown below: (1) Data form analysis: describe the state of dynamic change in data form of the software, and carry out analysis from the data, including data structure layout, storage arrangement, and change of data state.
(2) Instruction analysis: monitor and analyse the operating path of program and track and record the operating path of program (including sequence, cycle, skip, and other basic structure).When the operating path passes through defect code of software, the corresponding logics, cycle, call or other errors will happen.The software defect is then activated and the software fault is caused.
(3) Relevance and interaction: carry out relevance and interaction between data and instruction, then carry out mutual constraints between the operating path of software and data consumption, data utilization from instruction to data, or from instruction to instruction.
(4) Semantic load: due to expansion of relevant functional components in the original CNC system software architecture, the interrupting registration needs to be added if the system has access to newly added functional components.The software interrupting signal is reserved in the interrupting subsystem of the existing CNC system, and the semantic load is made in those reserved positions so as to realize the interaction between the software system result and the expanded functional components.
(5) Semantic perception: the relevant functional components expanded on architecture need to perceive the functional components of the original CNC system for convenience of monitoring and recording.Through adding monitoring on software instruction and execution tasks, it is possible to perceive the semantic information operated in program.The structure of functional components of the CNC system architecture expansion fault location is shown in Fig. 3.
Code input: program executed by CNC system software.
Instruction input: operating path of CNC system software, including sequence, cycle, skip, and other basic structure.
Monitoring task list: including data structure layout, storage arrangement, and change of data state, etc.; interaction and matching made between CNC system components and expansion components via semantic load and semantic perception to generate monitoring task list.

Code input
Instruction input

Monitoring task list
Path storage Data state Monitoring instruction list: the software has a giant operating path, and it is unnecessary to record all operating instructions, only the call of path, skip, and information interruption need to be recorded.

Generation of similar path set of CNC system
Firstly it was required to generate the software path according to recorded information about the operation of architecture expansion components and then generate a similar path set of the failure path according to the similar path algorithm; by contrast, we can obtain a feasible path in the similar path set and construct a successful similar path.

Analysis directed edge
Find Failure and successful path

Figure 4 Flow chart of control flow method
As the software scale continuously expanded and the layer became more complex, the systematic concurrency was continuously enhanced.The research and analysis on software code can enhance our knowledge of systematic function, and also lay a firm foundation for successive analysis on software faults.Due to the fact that the code of CNC systems is complicated and difficult to understand, it was very difficult to realize timeliness by use of manual analysis.Based on the features and processes of CNC systems, we adopted a control flow method to analyse the software program, as shown in Fig. 4.
Through the analysis on skip node between failure path and execution process, the path space was calculated out.Through the comparison between space and node and replacement, we obtained the similar path.Then, we needed to look up the information obtained from architecture expansion components, obtain a feasible path in the similar path set by contrast, and then construct a successful similar path.
The realization process is shown below: (1) Generate control flow diagram according to software code, and obtain failure path according to monitoring information on architecture expansion components (2) Find out branch predicate (3) Determine and mark the unrestraint side (4) Calculate the distance between the failure path and similar path (5) Add all obtained similar paths into the similar path set (6) Make comparison between path information of the similar path set and record the architecture expansion component monitoring information to obtain successful similar path set.

Code degree-of-suspicion model based on LS-SVM
The mapping from the operating path of CNC system software to fault was used as the calculation mode of code degree-of-suspicion, the similar path and defect path were taken as input and the fault was taken as output.The solution was then calculated by use of LS-SVM.LS-SVM is evolved from SVM and the solution was made mainly from original space mapping to higher space according to the mapping relation between input and output [19].The formula is shown below: where: ( ) where 2 ω refers to the degree of complexity, γ refers to the error penalty function, and emp R refers to the loss function.
There was a difference between selecting emp R and traditional SVM as for LS-SVM, and the secondary norm of error e was selected.
( ) where the constraint condition is: ( ) Introducing the Lagrange function into formula (3): where: k e refers to the error corresponding to the k item, and k α refers to the multiplier of Lagrange ( ) R k ∈ α .As for formula above, the following formula was obtained via 0 = ∂ ∂ ω The following formula was obtained via eliminating ω and e in the formula above: where: I refers to unit matrix, .There exists a kernel function where: k = 1,..., N. Thus the regression model of LS-SVM is: According to the similar path method proposed in the above section, the similar path of the failure path was generated.Then, we made conversion for the operating path of the CNC system program, by corresponding the fault position of the failure path and the similar path of the code to the input and output of LS-SVM according to actual operation situation.The sample of LS-SVM was , and i a and i b corresponded to input and output of LS-SVM respectively.

Examples of CNC system software fault location
This paper carried out fault location experiments on a programmable multi-axis controller PCI-7344 of NI.Firstly, we injected fault code into a NURBS interpolating program, and then generated a monitoring task list and monitoring instruction list according to the CNC system architecture expansion components designed in this paper in order to operate the interpolating program.We checked and recorded the data form of the program code and the operating path of program, and then generated similar path set of the failure path according to the similar path algorithm.By contrast, we obtained a feasible path in the similar path set, and constructed a successful similar path.Finally, we calculated the degree of suspicion and located the fault code.
The purpose of the fault injection was to inject a fault into a specific operating program by hand so as to accelerate the occurrence of an error in the system and cause the program to fail.We adopted the CNC system architecture expansion components established in this paper to monitor the response after the fault was injected into system, and also recorded the information to provide an effective basis for the following calculation and analysis.The CNC system software fault injection is an effective means used to locate faults, accelerate the occurrence of faults and confirm the methodology.Through injecting error code into the NURBS interpolating program, this paper realized fault injection.The fault injection process of the interpolating program designed in this paper is discussed as below.A k NURBS curve can be defined as: where: k i refers to the control vertex, ( ) refers to the primary function of k B spline, and ) ,..., , ( refers to the node vector.We took 3 parameters: control vertex d i , weight factor w i , and node vector U, as one part of the CNC program instruction.The NURBS curve is then formed within the CNC system.This paper adopted a cubic NURBS curve, and the set parameters are shown below: Control vertex d i :{(0, 0, 0 ), (−100, −100, 0 ), (−100, 100, 0 ), ( 0, 0, 0 ), ( 100, −100, 0 ), ( 100, 100, 0 ), ( 0, 0, 0 ) }. Weight factor w i : {1, 1, 1.2, 0.88, 1, 0.9, 1 }.Node vector u j : {0, 0, 0, 0, 0.32, 0.64, 1, 1, 1, 1, 1}.Interpolation cycle: T S = 1 ms.Feed rate: V = 50 mm/s.The maximum feed acceleration: a max = 200 mm/s 2 .The maximum chord error: ε max = 3 μm.Acceleration: A = 500 mm/s 2 .The NURBS curve is shown in Fig. 5, and the curve of interpolating speed is shown in Fig. 6.
Figure 6 The curve of interpolating speed When the fault code was injected and the interpolating NURBS operated, the fault occured in the CNC system.The fault was reflected by the fact that the obtained error in height of bow ε was larger than the setting value, as shown in Fig. 7.After obtaining a failure path and similar path set, this paper adopted code degree-of-suspicion, calculated according to LS-SVM to determine fault sentence.The directed edge of the failure path and similar path was taken as the input of LS-SVM, and the path execution result obtained via architecture expansion was taken as the output.It can be deduced by the interpolating control flow diagram analyzed above that the directed edge of the failure path and similar path consists of 8 paths.Therefore, this paper established an 8 input and 1 output system.Through calculation, the parameters of the SVM model were obtained.Following this, the directed edge of the CNC system software fault code was taken as the input to calculate the degree of suspicion.The result is shown in Tab. 3.
The degree of suspicion of all directed edges can be seen from Tab. 3, the highest degree of suspicion is 0.8235, and the corresponding directed edge is e 7 .According to the corresponding relation between code and directed edge, it can be known that the source code corresponding to directed edge e 7 is sentence 25 and sentence 26.Through checking sentence, we can know that the fault sentence is code 25, and this sentence is consistent with initially injected fault.To sum up, the CNC system software fault location method based on architecture expansion proposed in this paper can be used to successfully find out fault code in CNC system software.This paper analysed the fault mechanism of CNC system software, proposed a CNC system software architecture expansion method, and established a similar path set algorithm and degree-of-suspicion calculation model based on LS-SVM to carry out fault location in software from the CNC system structure level.Firstly, this paper analysed software fault mechanism of CNC system, and found that the software fault was caused due to the fact that the executive path of the program activates a defect in the software, and thus the CNC system fails.This paper then proposed a CNC system software architecture expansion method, and designed CNC system software architecture expansion components.Through semantic load and semantic perception, the interaction between CNC system components and expansion components was made to generate a monitoring task list, monitoring instruction list.The data form of program code and the operating path of the program were detected and recorded.Next, this paper proposed a similar path algorithm to generate a similar path set of an operating failure set; by contrast, we obtained a feasible path in the similar path set, and constructed a successful similar path.Furthermore, this paper established a code degree-ofsuspicion calculation model based on LS-SVM, and carried out fault location experiments on a programmable multi-axis controller PCI-7344, successfully locating fault code.The experimental result showed that the method of architecture expansion based on the overall structure of CNC system software and fault location through similar path and LS-SVM avoids the need for repeated testing and debugging by programmers.It is not limited by human factors and knowledge, and it is a feasible CNC system software fault location method.

Figure 1
Figure 1 Fault location of CNC system software

Figure 3
Figure 3 Structure of functional component of CNC system fault location weight vector, b R ∈ refers to the deviation value, and ( ) x ϕ refers to nonlinear mapping.The solution was made according to formula above, as shown below:

3 >Figure 7
Figure 7 Schematic diagram of interpolation fault To analyse the code, we firstly divided the program into the directed edge.The relationship between code, directed edge and node is shown in Tab. 1.The control flow diagram was formed next, as shown in Fig. 8.

Table 1
Division of directed edges } refers to the predicate node of the path branch.The similar path generated according to the similar path algorithm is shown in Tab. 2. By contrasting with the information of the operating path, we analyzed the execution result of the similar path and obtained a successful similar path set { 1

Table 3
The degree of suspicion of all directed edges