• No results found

Design of an encoder converter for automated non-destructive testing

N/A
N/A
Protected

Academic year: 2021

Share "Design of an encoder converter for automated non-destructive testing"

Copied!
55
0
0

Loading.... (view fulltext now)

Full text

(1)
(2)
(3)

Design of an encoder converter for automated non-destructive testing

by

Per von Wowern

(4)
(5)

.

Examensarbete TRITA-ITM-EX 2018:9 Design of an encoder converter for automated non-destructive testing

Per von Wowern

Approved: Examiner: Supervisor:

20180216 Hans Bengt Johansson Bj¨orn M¨oller

Commisioner: Contact Person:

WesDyne Sweden AB Henrik Hang˚ard .

Abstract

.

WesDyne Sweden AB is a Non-Destructive Testing (NDT) company specialized in the examination methods ultrasonic testing, eddy current testing and visual inspection. To verify an examination procedure before the actual inspection at site, a test rig consisting of a three or four axes motion system is used. WesDyne saw a need to be able to modify the position signals from the position encoders in order to increase the flexibility and in some case the accuracy when scanning objects with ultrasonic or eddy current probes. Thus, this thesis is regarding the design and evaluation of an encoder converter. The main task is to transform from Cartesian to polar coordinates and calculate the shortest distance between two points in space. Although, these calculations will introduce a delay. It is therefore of interest to look into how delays affect the NDT measurements.

The selection of a microcontroller for the encoder converter was an important part of the thesis project. Initial tests were done with the Arduino Mega. It was concluded that more processing power was needed than the Arduino Mega could provide. The choice finally fell on the xCORE-200 eXplorerKIT from Xmos. The main tasks for the firmware developed for the xCORE-200 eXplor- erKIT was to sample position signals, modify the signals and then output the modified signals. A printed circuit board was designed to act as an adapter card between the motorcontroller, measurement instrument and the xCORE- 200 eXplorerKIT. The encoder converter consisted of these two cards encased

(6)

From the test results it can be concluded that conversion of position signals can improve accuracy in some cases of eddy current testing.

(7)

.

Examensarbete TRITA-ITM-EX 2018:9 Design av en enkoderomvandlare f¨or automatiserad of¨orst¨orande provning

Per von Wowern

Godk¨ant: Examinator: Handledare:

20180216 Hans Bengt Johansson Bj¨orn M¨oller

Uppdragsgivare: Kontaktperson:

WesDyne Sweden AB Henrik Hang˚ard .

Sammanfattning

.

WesDyne Sweden AB ¨ar ett f¨oretag inom of¨orst¨orande provning, med specalitet inom metoderna virvelstr¨om, ultraljud och visuell provning. F¨or att verifiera proceduren inf¨or en provning anv¨ands testriggar med tre och fyra axligt r¨orelsesystem.

WesDyne s˚ag ett behov av att kunna modifiera positionssignalerna fr˚an positions- enkodrarna f¨or att ¨oka flexibiliteten och i vissa fall f¨orb¨attra noggrannheten vid virvelstr¨om och ultrljudsprovning. Positionssignalerna anv¨ands f¨or att trigga m¨atningar med m¨atinstrumentet. Detta examensarbete handlar d¨arav om utveck- ling och testning av en encoderomvandlare. Dess huvuduppgift var att kunna r¨akna ut pol¨ara koordinater och kortaste distans mellan tv˚a punkter i rym- den. Ber¨akningarna kom att medf¨ora en f¨ordr¨ojning av postionssignalen. Det fanns d¨arav anledning att ¨aven unders¨oka hur olika f¨ordr¨ojningar p˚averkar m¨atresultat.

En viktig del av exjobbet var valet av mikrodatorplattform f¨or encoderomvand- laren. F¨orst gjordes tester med Arduino Mega. Dock uppt¨acktes det att denna inte var kraftfull nog f¨or uppgiften. Valet f¨oll slutligen p˚a xCORE-200 eXplor- erKIT fr˚an Xmos vilket ans˚ags b¨ast kunna uppfylla kraven. Huvuduppgifterna som ingick i den firmware som utvecklades till xCORE-200 eXplorerKIT var att l¨asa in postionssignaler, g¨ora om signalerna och sedan skicka ut dessa.

Ett kretskort designades f¨or att fungera som l¨ank mellan motorstyrenheten, m¨atinstrumentet och xCORE-200 eXplorerKIT. Detta byggdes in i en l˚ada med

(8)

testresultaten visar att omvandling av positionssignaler kan ¨oka noggrannheten vid vissa fall av virvelstr¨omsprovning.

(9)

Acknowledgments

Jag vill rikta ett stort tack till Henrik Hang˚ard och Anders Werner p˚a WesDyne som gjort detta examensarbete m¨ojligt. Jag vill forts¨atta tacka Henrik f¨or allt st¨od som jag har f˚att under examensarbetet. Vidare vill jag ¨aven tacka de ¨ovriga anst¨allda p˚a WesDyne som alltid varit hj¨alpsamma och gjort att jag verkligen har k¨ant mig v¨alkommen fr˚an dag ett.

Sedan vill jag tacka min handledare p˚a KTH Bj¨orn M¨oller f¨or st¨od under exa- mensarbetet. Paolo Kallio gav mig v¨ardefulla tips g¨allande kretskortsdesignen vilka jag ¨ar v¨aldigt tacksam f¨or.

Sist av allt vill jag tacka Freddi Haataja f¨or alla KTH ˚ar!

(10)

Contents

1 Introduction 5

1.1 Background . . . 5

1.1.1 Scanning of circular objects . . . 6

1.1.2 Scanning of profile curves . . . 8

1.2 Research questions . . . 9

1.3 Purpose . . . 9

1.4 Requirements . . . 10

1.5 Delimitations . . . 10

1.6 Method . . . 11

1.7 Ethical considerations . . . 11

2 Frame of reference 12 2.1 Encoders . . . 12

2.1.1 Absolute and incremental encoders . . . 12

2.2 Non-destructive testing . . . 13

2.2.1 Eddy current . . . 13

2.3 Calculating polar coordinates and distance . . . 15

2.3.1 Polar coordinates . . . 15

2.3.2 Distance . . . 15

2.4 Embedded platform . . . 15

2.5 Motor Control Panel . . . 17

3 Implementation 18 3.1 Overview of the encoder converter . . . 18

3.2 Electronic design and hardware . . . 20

3.3 Embedded software . . . 20

3.3.1 Sampling task . . . 21

3.3.2 Count task . . . 21

3.3.3 Transform task . . . 22

3.3.4 Output pulses task . . . 23

3.3.5 Ethernet and Transmission control protocol . . . 23

3.4 Graphical interface application . . . 24

4 Results 25 4.1 General setup . . . 25

4.2 Delay test . . . 25

4.2.1 Timing . . . 25

4.2.2 Setup . . . 26

(11)

4.2.3 Result . . . 27

4.3 Polar coordinates test . . . 28

4.3.1 Setup . . . 28

4.3.2 Result . . . 29

4.4 Distance test . . . 30

4.4.1 Setup . . . 30

4.4.2 Result . . . 30

5 Discussion and Conclusion 32 5.1 Discussion . . . 32

5.1.1 Conclusion . . . 33

6 Recommendations for future work 34 6.1 Future work . . . 34

Appendices 38 A Comparison of microcontrollers . . . 40

B Schematics for the adapter card . . . 41

C Circuit board for the adapter card . . . 43

D Bill of materials for the Encoder converter . . . 45

(12)

Abbreviation

DC Direct Current ET Eddy Current Testing

FPGA Field-Programmable Gate Array GUI Graphical User Interface

IC Integrated Circuit

IDE Integrated Development Environment MAC Media Access Control

MCP Motor Control Panel NDT Non-destructive testing PCB Printed Circuit Board PPR Pulses Per Revolution RT Radiographic Testing

TCP Transmission Control Protocol TTL Transistor–Transistor Logic USB Universal Serial Bus UT Ultrasonic Testing VT Visual Testing

WCET Worst-Case Execution Time

(13)

Chapter 1

Introduction

The introduction chapter explains the background and framework of the thesis.

1.1 Background

WesDyne Sweden AB is a leading supplier and manufacturer of non-destructive testing (NDT) equipment and services. The main focus is on nuclear power plants. Considering the hazardous environment, remotely operated manipula- tors are used for the inspection. Eddy Current Testing (ET), Ultrasonic Testing (UT) or Visual Testing (VT) are used to look for cracks or other material de- fects. The manipulators are often custom made for the specific task and area to be inspected.

Before final design and manufacture of a manipulator, the NDT procedure is often emulated using a test rig. In the test rig, objects with known defects are scanned. The test rig consists of a motion system with four degrees of freedom.

It has three prismatic joints and a revolute joint. The prismatic joints enable translational motion in Cartesian x, y and z axis. The revolute joint corresponds to a rotational axis w about the z axis (Figure 1).

(14)

Figure 1: Motion system with four degrees of freedom and a setup ready to inspect a tube with known defects

Each axis is actuated by a geared brushed Direct Current (DC) motor equipped with optical rotary incremental encoders. A mechanical arm is attached to the motion system. The end effector of the arm is a customized UT or ET probe.

Measurement equipment is used to acquire and analyze the signals from the probe. Position signals from the encoders of only two of the four axes can be used for triggering and mapping scanning measurements from the probes.

As with the current configuration, scanning is confined to be in the direction of the axes in order to obtain correct scanning data. In various scanning cases it would be beneficial to use other trigger signals than the position signals ac- quired directly from the axes. Other trigger signals would allow more freedom and possibilities in scanning objects. Therefore WesDyne would like to explore the possibility to use polar coordinates and distance traveled as trigger signals.

To clarify this choice, two cases are described below.

1.1.1 Scanning of circular objects

In inspection of circular objects such as cylinders or circular plates, the scan- ning is restrained by the encoder signals obtained from the axes of the motion platform. Figure 2a depicts the scanning of the interior surface of a tube with the current setup. The arm is static in the center of the cylinder and rotates around the w axis. The position signals from the w axis are used to map the position with the data acquired from the probe. Custom radial arms need to be designed and manufactured to match the radius of the tube (Figure 3). The error from the backlash in the rational unit increases with length of the arm.

Also, long radial arms are wobbly which affect the scanning measurements.

(15)

(a) Scanning with a long radial arm at the center of the cylinder. The arm is only actuated in the rotational w axis.

(b) Scanning with a short radial arm following the surface of cylinder. The angle from polar coordinates of x and y

Figure 2: Top down view of two different scanning configurations when scanning a tube. The left figure shows the conventional way of scanning. Where the right figure shows how the scanning could be done with the use of polar coordinates.

Figure 2b shows the same tube but with a different scanning setup. Here, the whole radial arm follows the curve of the cylinder and moves in a circular pattern. The rotational w axis rotates in order to keep the probe tangential to the surface of the tube. Thus the angle φ would be used as a trigger signal for the scanning measurements. The angle would be calculated by the probes position in the x and y plane. The accuracy of the scanning would increase as the Cartesian axes of the motion system have greater resolution compared to the rotational w axis. Additionally, the same short generic radial arm could be used to scan a variety of tubes with different dimension. In scanning of circular discs the probe move in a radial pattern. Thus the radial position of the probe would be favorable to use as a trigger signal. These examples of scanning shows the need for the ability to converting to both angle and radial position of the probe.

(16)

Figure 3: Setup for scanning the exterior surface of a tube with a long radial arm static at the center of the tube.

1.1.2 Scanning of profile curves

The other case arises when the movement vector of the probe is not parallel to the orthogonal-planes of the Cartesian coordinate system in the motion system.

For example the scanning of a profile curve depicted in Figure 4. The measure- ments from the probe are sampled in equal intervals along the x-axis. Though it would not be equal spaced intervals along the path of the scanned curvature. If instead intervals of the distance covered of the probe could be used as a trigger signal, the precision would improve.

Figure 4: Scanning of a surface along curved path.

(17)

1.2 Research questions

The following research questions are the main tasks to answer:

1. Can a generic radial arm controlled with polar coordinates obtain equal measuring accuracy as customized radial arms with different lengths when in- specting surfaces of circular objects?

2. What will the accuracy be when scanning along a curved surface with the distance traveled as the trigger signal for the ET instrument?

However, the distance covered and polar coordinates will be calculated from the position in Cartesian coordinates in real time. The new trigger signals will be delayed due to signal processing and computations. The delay could result in displacement in the position mapping of ET measurements. Following question would then also be of interest.

3. How does the delay of the position signals affect the accuracy of the ET measurements?

1.3 Purpose

There are commercially available encoder peripherals that allows scaling of the encoder signals. An example of such a product is the FM260 from MoTrona [1]

which can scale the encoder signal by multiplication with a scalar. The author has not found any device that implement more advanced encoder signal con- verting features as inclined in section 1.1. This thesis involves the development, design and manufacture of a prototype. The prototype should include hardware and firmware which comply with the equipment and setup used by WesDyne.

The prototype will be used for tests in order to answer the research questions.

(18)

1.4 Requirements

WesDyne’s requirements on the encoder converter HARDWARE:

• The prototype should not exceed a size of 100x200x300 mm including enclosure and connectors.

• The prototype should have a robust design which can handle transporta- tion and harsh handling.

EMBEDDED SYSTEM:

• The system shall transform position in Cartesian coordinates to polar coordinates and be able to calculate arc length from three encoder signals.

• The system will operate by using a 5V direct current supply with maxi- mum current drain of 500 mA.

• The system shall acquire and sample differential encoder signals A and B, for up to four incremental quadrature encoders (x,y,z,w) with a frequency range from 0 to 32 kHz.

• The system shall have an 100MB/s Ethernet communications channel and include physical layer device and Media Access Control (MAC).

• Output two encoder signals simultaneously from a range of eight types [x, y, z, w, r, Φ, distance, step].

GRAPHICAL USER INTERFACE SOFTWARE:

• A graphical user interface software for observing the motion of the probe and controlling the encoder converter.

• Shall communicate over Ethernet Transmission Control Protocol (TCP) with the encoder converter.

1.5 Delimitations

Due to resource and time limits of the thesis, the following restrictions have been made:

• Only incremental encoders with quadrature 5V output signals are consid- ered.

• Only one type of setup for each test of polar coordinates and distance calculations.

• ET is the only NDT method applied in the tests.

• The prototype is adapted for WesDyne’s motor control unit, measurement equipment and motion system.

• Only microcontrollers are considered as the main computational unit.

(19)

1.6 Method

A quantitative research design was used to answer the research questions. All three research questions have hypotheses that could be verified by measurable test values obtained by observable experiments.

Literature study was done in order to investigate the state of the art regarding encoders and embedded systems. Suitable algorithms and design was reviewed and examined regarding the application.

In the final stage of the thesis, three experiments were done with the imple- mented prototype, the encoder converter. Test cases were designed in order to get quantitative and generalized data. Gathered data was then statistically analyzed in order to answer the research questions.

1.7 Ethical considerations

WesDyne is not only providing nondestructive examinations and services to the nuclear market although it is their biggest business area. Nuclear power has been a debatable and controversial topic both in Sweden and globally since its beginning. The prototype developed in this thesis is generic designed for auto- mated NDT. Although, there is a possibility that the results from the master thesis may be used in some way regarding NDT of nuclear related parts. How- ever the NDT examinations and inspections help the nuclear power plants to retain a safe operation.

(20)

Chapter 2

Frame of reference

The theoretical framework for the thesis.

2.1 Encoders

An encoder is a sensor device used for position measurements and converting motion to electronic signals. The motion can be rotational or translational depending of the design of the encoder. Rotary shaft encoders measure the rotation angle of the shaft and linear encoder measures the distance traveled.

There are many different principles for acquiring position data. The major methods are magnetic, optical and mechanical, where optical is the most used method in industrial applications [2].

2.1.1 Absolute and incremental encoders

Disregarding the working principle, there are two different categories of en- coders: absolute and incremental. Absolute encoders indicate a angle relative to the specific starting position. Each position in the shaft in turn corresponds to a specific bit pattern from absolute encoder. In order to count multiple rev- olutions, a counter is included in the encoder system. Thus the advantage of absolute encoder is that it gives the absolute position whenever the encoder shaft has moved, even during power off. However, this increases complexity and therefore the cost of the encoder. The output from the absolute encoder can be either parallel or serial data [3].

Incremental encoders on the other hand work like a ruler without numbers.

It outputs an alternating high and low digital signal A, evenly placed in one rotation. In order to know the position of the encoder, the user needs to contin- uously count the output signals. Usually a signal B, which is 90out of phase relative to signal A is also output. To determine the direction, the user needs to keep track of the sequence of the signals A and B. Figure 9 shows quadrature encoder signals, where signal B is ahead of signal A which generally implies a counter clockwise direction. Thus signal A leading signals B would indicate a clockwise direction.

(21)

The resolution of an incremental encoder is expressed as Pulses Per Revolu- tion (PPR), where pulses are the amount of rising edges of Signal A. To further increase the precision it is possible to both detect rising and falling edges of Signals A and B, which gives the resolution by a factor of four (4x-encoding).

There are commercial available encoders that have up to 10000 PPR [3]. With 4x-encoding the smallest angle change possible to detect would be 0.009.

Figure 5: Quadrature signals from an incremental encoder

It is common to use rotary encoders although the movement of end effector or tool is translational. In XY motion-tables a lead screw is frequently used to convert rotational motion to translational motion. If the encoder is attached before the gear the linear resolution R is

R = P

Eenc· Renc· N. (1)

Where Eenc is the number of counted signal edges, Renc is the PPR of the encoder, P is the pitch of the lead screw and N is the gear ratio [4].

2.2 Non-destructive testing

NDT is used to examine material properties and detect defects in components.

It can be used as a quality assurance in the process and manufacturing indus- tries as well as an inspection method for components in use. Common used methods in NDT include UT, ET, VT and Radiographic Testing (RT) [5].

NDT is widely used in nuclear power plants. Many components in a nuclear power plant undergo high stresses and are situated in highly corrosive environ- ments [6]. In addition it is proven that constructional steel alloy’s mechanical

(22)

Basic principle:

An alternating voltage source is applied to a coil of copper wire. The induc- tance in the coil induces an alternating magnetic field around the coil. When the magnetic field is in contact with a conductive material it creates Eddy cur- rents flowing in the material. A crack or defect in the material disturbs the flow of eddy currents which reduces the secondary magnetic field induced by the eddy currents. Furthermore this affects the impedance of the circuit which can be monitored with an eddy Current instrument [10]. An illustration of the described principle can be seen in Figure 6.

Figure 6: The physical principles of eddy current testing [11]

.

Eddy current testing can be configured in many different setups depending on the aim and the material of the test specimen. The chosen frequency of the alternating voltage depends on the material, coil arrangement and depth of penetration. Generally a low frequency increases the scanning depth but de- creases the sensitivity to small defects.

A reflection mode probe consists of two separate coils. The primary coil is acting as a driver thus applied with alternating voltage creating eddy currents in the test specimen. The secondary coil only acts as a sensor and is used to pickup the change of eddy current. In this setup each coil can be adapted to suit its purpose. The secondary coil is usually made small in order to increase sensitivity to detect small defects [12]. The downside of the reflection mode probe is increased complexity of manufacture [13].

C-scan image is an NDT software feature useful for automated scans. Each measurement is mapped with the position of the probe at the specific sample time. The result is plotted in xy-plane,usually in a color scale displaying the amplitude of the measurements [14].

In order to calibrate probes and to verify inspection procedures, objects with known defects are used. Defects are usually artificially created in test blocks.

It can consist of holes, slits or notches depending on the application. Elec- tronic discharge machines are often used to machine these features due its high

(23)

precision [15].

2.3 Calculating polar coordinates and distance

2.3.1 Polar coordinates

There are many different ways to describe the location of a point in three- dimensional space. The Cartesian coordinate system with perpendicular x, y and z axis is the oldest and is useful in many cases [16], [17]. Although it sometimes might be desirable to apply another coordinate system. For exam- ple when describing a point on a geometrical object that is not of rectangular shape. Position on a circular object is handy to describe in polar coordinates.

According to Hall [18] cartesian coordinates x and y can be transformed to polar coordinates by

r =p x2+ y2 φ = arctanx

y. (2)

φ is angle around the z axis and r is the radius.

2.3.2 Distance

[19] States that the shortest distance between two points, p1= (x1, y1, z1) and p2= (x2, y2, z2) expressed in Cartesian coordinates is

d =p

(x2− x1)2+ (y2− y1)2+ (z2− z1)2. (3)

2.4 Embedded platform

The most important decision was the choice of processor unit in the encoder converter. On the market today, there is a vast amount of different hardware platforms available which could be suitable for the encoder converter.

To get a feeling what kind of system that would be required initial experiments with encoder signal sampling were done with an Arduino Mega. A dedicated

(24)

used a LPC1768 microntroller with a ARM Cortex-M3 processor with a maxi- mum clock frequency of 100 MHz. For an unaltered output of the received en- coder signal they measured an average throughput time of over 1 ms.Although it is application dependent it seemed as a long delay time with no modification of the encoder signal.

Field-Programmable Gate Array (FPGA) is known to be well suited for signal processing of signals with high frequencies [21]. Therefore FPGA have previous been used for sampling and position estimation of encoder signals [22]. There are also FPGAs with integrated high performance micro processors. However, the author has no previous experience with FPGA or any type of hardware description language. As tools for FPGA is known to be complicated to learn, there would not have been enough time in the thesis project for a FPGA based application [23].

Functions and specification requirements which were taken into account when choosing embedded platform:

• Ethernet

• TCP Library

• Free or cheap Tool chain with debug support

• Digital pins > 20

• Processing power

• Hardware encoder decoding

• Low throughput input to output

• Floating point unit

• Documentation and support

Regarding the author’s previous knowledge and experience with microcontrollers and the C programming language, only similar solutions were considered. The encoder converter was only intended to be a prototype, therefore only micro- controllers with development boards were taken into account. A comparison table of the final selection of evaluation boards which was considered is shown in section D.

Ultimately the microcontroller platform xCORE-200 eXplorerKIT from Xmos was selected. Xmos’s line of microcontroller distinguishes itself from other tradi- tional microcontrollers due to its xCORE architecture. Significant key features are parallelism and real time deterministic behavior. In [24] three different mi- crocontrollers with equivalent processor speed were benchmarked regarding the delay of a signal from input to output. The Xcore processor from Xmos had indisputable the best result in this aspect. The xCORE-200 eXplorerKIT fea- tures two 500 MHz processors. For each processor (Xmos Tile) the processing power is shared between up to eight threads (Xmos cores) running in parallel.

(25)

High performance aside, Xmos also offers a free to use Integrated Develop- ment Environment (IDE) with debugger, time analyzer and scope tracer. It also includes a well documented programming guide, libraries and examples for Ethernet and TCP.

2.5 Motor Control Panel

The Motor Control Panel (MCP) is WesDyne’s system for control of manipula- tors and motion systems with up to four motors. The latest version, MCP-4000, features the Galil DMC-4143 motion controller. Scanning patterns for the tests were programmed in the Galil language. Aside from the three main tests, the MCP along with a small three axis motion system was used throughout the whole project to continuously test and evaluate the encoder converter.

(26)

Chapter 3

Implementation

The implementation part was by far the largest part of the thesis and included designing and building of the encoder converter prototype.

3.1 Overview of the encoder converter

The encoder converter can be used with any NDT instrument that acquire 5 V Transistor-Transistor Logic (TTL) quadrature encoder signals in 4x-mode. A block diagram of the encoder converter and its adjacent systems can be seen in Figure 7 and the physical appearance of the encoder converter is shown in Figure 8. The input to the encoder converter is up to four differential quadrature encoder signals and three digital select signals from the MCP. The following eight outputs are possible:

x, y, z, w Unaltered encoder signals from the input.

Φ Angle in the xy-plane. The difference between the new and previous angle.

r radius in the xy-plane. The difference between current and previous radius.

Distance Vector distance in the xyz-space. The difference between current and previous position in the xyz-space. The digital select signal +/−distance, determine which direction to output encoder pulses.

Step Outputs a chosen amount of quadrature pulses when a digital select sig- nal, Stepf orward or Stepbackward, is received from the MCP. The Step is intended to be used along with the Distance output.

Two of the eight encoder signals can simultaneously be output . The encoder converter features buffered copies of the two output encoder signals. Thus, it is possible to connect the encoder converter with two measurement instruments simultaneously.

The encoder converter can be powered by the channel 1 D-subminiature connec- tor or Universal Serial Bus (USB). The power source should have a minimum current output of 300 mA.

(27)

Figure 7: Overview of the encoder converter and its functions

(28)

3.2 Electronic design and hardware

An adapter card was designed in order to complement the Xmos xCORE-200 eXplorerKIT. The adapter card is mounted piggyback on the xCORE-200 eX- plorerKIT. It acts as an interface between the MCP, Xmos and the NDT in- strument.

The four differential Encoder signals are received from the MCP. The signals are converted to single ended with a differential line receiver. A termination resistor is placed in parallel between each differential pair to reduce reflection.

The single ended encoder signals are shifted to 3.3 Volt and then sampled by the xCORE-200 microcontroller.

The outputs, single ended encoder signals, are shifted back to 5 Volt via a buffer circuit and are accessible through the D-subminiature connectors. The adapter board and the xCORE-200 eXplorerKIT are powered by 5V. Schematics and board design of the adapter card can be found in Appendix B and C.

3.3 Embedded software

The software was developed in XC using xTIMEComposer studio Community version 14.2.4 for the XE216-512-TQ128 microcontroller. This is included in the xCORE-200 eXplorerKIT. XC is a programming language based on C with additional elements to utilize particular features in Xcore technology.

The software is structured into modules which run on different cores. The modules consist of tasks which can be seen in Figure 9. The cores enable the tasks to run independently when the tasks are not in communication with each other. One of the main principle is event driven programming. Different tasks communicate with each other through the XC feature interface.

(29)

Figure 9: Overview of the tasks and their connections in the embedded software

3.3.1 Sampling task

The task on this core is dedicated to sample the incoming encoder signals.

The input is eight quadrature encoder signals, A and B signals of four encoder channels. The digitals pins are on the same 8-bit port and concurrently sampled.

If a change occurs between the samples, the state of the port is sent to the count task via the interface. The maximum encoder signal capacity is three encoder signals simultaneously with a frequency of 28.8 kHz each. At higher frequencies the encoder converter misses pulses.

3.3.2 Count task

The quadrature encoder signals are decoded into counts for each channel. The decoding into counts is done by using a quadrature encoder matrix. Current and previous sampled value of the signals A and B of each encoder are stored as a 4-bit binary number 0bA B A B . The number is used as an index

(30)

3.3.3 Transform task

The Transform task is the largest and most complex part of the software. It uses the event based approach using the XC feature select and cases. The cases and their assignments can be seen in Figure 10. If different events occur simul- taneously the cases execute in order of priority. Many of the cases are related to the interaction with the Graphical User Interface (GUI). The positions to cal- culate are decided based on user input. For output of [x, y, z, w] no transform or calculation is needed. When output of polar coordinates, distance or step is desired further actions are employed.

Figure 10: Events included in the Transform task

The flow of the algorithm for calculating the distance is shown in Figure 11.

A limit is set to ensure that there have been enough counts since the latest distance calculation otherwise it is dismissed. There are two reasons for this limit. Due to control design and load it is possible that the head of the motion system flicker around a specific position which would lead to drift in the distance measurement. Furthermore the motion system used is not moving the axis in perfect simultaneously timing. Thus, this leads to that the encoder converter interprets the linear movement as a step pattern. If calculation then is done for each count the output distance is much greater than the actual distance traveled.

The distance moved from previous calculation is determined by Equation 3.

For the calculation of square root the math.h function is invoked. The result is scaled to counts and rounded down to an integer before return.

(31)

Figure 11: Flowchart for the function calculating distance.

Polar coordinates are calculated using Equation 2. The math.h function atan2(x,y) returns angle in the interval [ π, −π ] radians. Thus to convert to the angle phi in the range [ 0, 360] the following formula is used.

φ =atan2(x, y) · 180

π + 180. (5)

The output of pulses is determined by the difference of the new and previous values of angle and radius. The angle difference is checked for zero crossing and adjusted accordingly. The difference is then scaled and rounded off to integer to be used as output. Values are saved for next iteration and the function return angle, radius and the amount of pulses to output for r and phi.

3.3.4 Output pulses task

This task receives the amount of pulses to output and the direction of the pulses from the previous task. An adaption of the look up table in Equation 4 is used to output the quadrature signals. The reverse encoder matrix consists of different output states of signals A and B. Previous output and the direction make up the index and serve as prerequisites for the output. The output frequency is capped

(32)

The TCP task only acts as a server in connection with the GUI. It only lis- tens to received messages and only answers if requested. Messages are received as strings but it is necessary to convert them back to the right data-type. The data and their indication are sent to the Transform task.

3.4 Graphical interface application

In order for a user to remotely control the encoder converter a software appli- cation was created. It was developed with Visual basic 2010 and is a windows application. The user is able to set the settings of the encoder converter such as offset value of position, scale factors and select which encoder signals as output.

Position values are displayed and continuously updated. An overview of the GUI is shown below in Figure 12.

Figure 12: Overview of the GUI used to control the encoder converter.

(33)

Chapter 4

Results

In this chapter the results from the three tests, used for verifying the encoder converter, are explained.

4.1 General setup

The delay and distance tests were executed using a 3-axis motion system. The polar coordinates tests needed a rotational axis and thus a larger 4-axis mo- tion system was used. Both motion systems were controlled by the MCP. The scanning patterns were written in the Galil language and executed by the MCP.

For the data acquisition, the ET instrument R/D Tech TC5700 was used along with the software Multiview version 4.1. The TC5700 was chosen because it was the ET instrument with the lowest encoder signal maximum frequency available at WesDyne. The C-scan images obtained were used to determine the position of the notches. The measurements were done at the middle of the notches and at the same height for each test. To acquire the delay times of the encoder signals an Agilent DSOX2024 oscilloscope was used.

4.2 Delay test

The purpose of the delay test is to study how the delay of position signals to the ET instrument affects the scanning results. Calculations of distance and polar

(34)

no alternating calculations of the encoder signal were done. The time between the input and output signal of the xCORE-200 eXplorerKIT was 4 µs. This time would then be added in addition to the timing of the functions to get a total delay estimation. In delay aspect, the worst case would be if distance and polar coordinates both were output. The worst time delay would then be 303 µs.

4.2.2 Setup

A test block of stainless steel with machined notches of different depth was used for the delay test scans. The test block measured 200 x 80 mm (Figure 13). A run file was made for the MCP to control the motion system in a bidirectional raster pattern in the x-y plane. The maximum velocity for the scanning probe was set to 100 mm/s with an acceleration and deceleration of 400 mm/s2. The probe was a WesDyne made reflection mode ET probe, commonly used for weld inspections and is shown in Figure 13. Only the front transducer was used during the tests.

Figure 13: ET Probe and test block used during the delay and distance tests.

(35)

4.2.3 Result

As a reference the first scans were done with the x and y encoder signals directly to the ET instrument. For the other scans, the encoder signals were passed through the encoder converter before input to the ET instrument. The output was a copy of the input encoder signal. 4 µs was the default delay between the input and output of the encoder signals from the xCORE-200 eXplorer KIT.

Fixed delays were intentionally introduced in the firmware. Six different delays between 104 µs and 30 004 µs were tested. Three different scans for each delay setting were carried out. From the C-scan data, the horizontal position of the third and fifth notch from the left, of each scan were measured. The mean value for each delay setting was calculated. The difference of the measurements from the scans with delay compared to the reference can be seen in Table 1.

Table 1: Measurements from the delay tests.

Reference encoder converter

Delay of

encoder signals (µs) no delay 4 104 504 1504 5004 10 004 30 004 Third notch

Average (mm) 65.31 65.35 65.38 65.43 65.60 66.33 67.10 70.55

Error (mm) - 0.04 0.07 0.12 0.29 1.02 1.79 5.24

Fifth notch

Average (mm) 115.43 115.45 115.45 115.50 115.65 116.33 117.10 120.10

Error (mm) - 0.02 0.02 0.07 0.22 0.91 1.67 4.68

With delays up to 504µs, the error was smaller than 0.12 mm on both notches.

When both calculation of distance and polar coordinates was activated it was concluded in subsection 4.2.1 that the worst latency was estimated to be 303µs.

Accordingly the use of encoder the converter should not displace the position of the notch more than 0.12 mm compared to the reference scan.

For delays greater than 1.5 ms it was apparent that the C-scan image was

(36)

(a) No delay. (b) 1504µs delay.

(c) 10 004µs delay. (d) 30 004µs delay.

Figure 14: C-scan images from the delay tests with different delay of the encoder signal. Rainbow scale is used to indicate measurements. Areas with no defect is indicated by green whereas red indicates discontinuities (notches).

4.3 Polar coordinates test

Test to validate the function of the output angle from the encoder converter.

4.3.1 Setup

The test block examined for the Polar coordinates test was a piece of cylindrical thick wall tubing in stainless steel. The outer diameter of the tube was 70.1mm and machined notches were located on the outer surface area. The exterior surface was scanned in a rotational pattern in the x-y plane with the ET probe tangential to the surface. After a full turn, the probe moved 0.5 mm in axial direction (z axis) and then continued the rotational movement in the other direction. Total scan height was 60 mm. The probe had a tangential velocity of 100 mm/s with an acceleration and deceleration of 256 mm/s2. A reflection mode ET probe was used in this test as well, but another model more suited for inspections of circular objects.

(37)

Figure 15: Test rig setup used in the inspection of the cylinder.

4.3.2 Result

First scans were done with the encoder signals directly from the rotational w axis of the motion system as trigger signals to the ET instrument. The output resolution from the w axis encoder was 80 Pulses Per Degree (p/). Two differ- ent output settings were used with the encoder converter to compare with the reference scans. The output from the encoder converter was the angle calculated from the x and y coordinates of the base of the probe arm. In the motion system used the x and y axes had resolution of 1000 p/mm. Thus it was possible to increase the resolution with the use of the encoder converter. The resolutions used were 80 p/and 800 p/. Four scans were done for each kind of settings.

The C-scan images were analyzed and used in order to measure where the first 90 notch was indicated on the scans. The mean value of the angle was calcu- lated for each case. The difference between the reference angle and the angle obtained when using the encoder converter is shown in Table 2.

Table 2: Measurements from the scanning of the exterior surface of the cylinder.

Encoder converter Angle (φ) output with two different resolutions (p/) was compared with feeding the encoder signals directly from the w axis.

Reference (w axis) encoder converter

Resolution (p/) 80 80 800

(38)

4.4 Distance test

Test to validate the function of the output distance and step from the encoder converter.

4.4.1 Setup

Setup was very similar to the one used in the delay tests in section 4.2. The same testblock used for the delay test was also used for the distance tests, al- though it was oriented to make a 45 angle with y and x axis of the motion system as shown in Figure 16. A digital angle ruler was used to measure the angle between the test block and the y axis of the motion system.

The motion system was programmed to scan parallel to the direction of the test block in a bidirectional pattern. Distance was output from the encoder converter when scanning along the test block. The step length was 1 mm and was output by the step output from the encoder converter. The coil of the ET probe was visually aligned with the edge of the test block. The reference for start position of the scans were offset to 10 mm in x and 5 mm in y from the edge.

Figure 16: Test block is angled at 45with the positive Y axis.

4.4.2 Result

The scans were done with speed of 39 mm/s and 133 mm/s. Three scans for each different speed setting were carried out. Table 3 shows a summary of the results.

The measurements from the c-scans are compared to the expected position of the notches relative the reference point. The distance between the two notches and comparison with measured distance in the scans is also included.

(39)

Table 3: Measurements from the distance tests with different probe speeds.

Third notch (63.82 mm) Fifth notch (113.82 mm) Between notches (50 mm)

Probe speed

Average error (mm)

Error range (mm)

Average error (mm)

Error range (mm)

Average error (mm)

Error range (mm)

39 mm/s 0.15 0.05 0.19 0.05 0.03 0.10

133 mm/s 0.10 0.10 0.12 0.01 0.05 0.10

(40)

Chapter 5

Discussion and Conclusion

Discussion and conclusion regarding the results of the thesis.

5.1 Discussion

The aim of this thesis was to investigate if manipulation of encoder signals could be used in NDT. As expected, the delay tests clearly showed a correlation between the delay of the encoder signals and the position error. Thus it is im- portant to keep the delay time of encoder converter as low as possible. However, it was too few delays tested to determine any specific relation. As stated in the results of the delay tests it was concluded that the position error would not be greater than 0.12 mm. However, the maximum average error obtained in the polar and distance tests was slightly higher, 0.19 mm.

From the polar coordinate tests the encoder converter had similar scanning results as using the w axis (Table 2). However, it is fair to say that the localiza- tion of the notch with 800 (p/) was better than with 80 (p/) from the encoder converter. The range of values for 800 (p/) was even lower compared to the reference with the w axis.

In the distance tests the lowest error was when comparing the distance between the notches. The error was significantly larger when the position of the notches was referenced from the starting position. This probably corresponds to the fact that the starting position of the probe was visually aligned and manually measured with a caliper, thus error prone. Although no drawing was available it is safe to say that the distance between the two machined notches three and five is of higher accuracy. Further no significant difference can be observed between the two probe speeds.

Only straight line scanning were done in the distance test in 4.4. It is un- certain what the position accuracy would be when scanning double curvature profiles. It is likely that the error would be greater compared to when the dis- tance is calculated as linear movement. Although, it is certain that the distance output gives better accuracy than using the encoder signals from the encoders directly. The linear approximation of the curvature with the distance output

(41)

would probably be sufficient for most scanning applications. The position reso- lution usually used by WesDyne is in the range of 1000 p/mm.

5.1.1 Conclusion

WesDyne wanted to investigate the possibility to use alternated position signals for NDT scanning of parts. The aim of the thesis was to perform the conversion of the position signals and evaluate the performance. WesDyne saw a need for two conversions which could be beneficial for the scanning. The use of polar coordinates when scanning circular objects and calculation of distance. The conversion calculations will introduce a delay of the position signals.

The delay of the position signals depends on calculation of position conver- sions. Tests were done to detect the correlation between the delay of position signals and position error in the ET measurements. A clear relationship be- tween the delay and the error was observed. With a delay over 0.5 ms a quite linear relationship was seen. The maximum introduced delay of the developed encoder converter were estimated to be 0.3 ms. Compared with the delay tests, this would indicate an error not greater than 0.12 mm. The maximum allowed error when scanning depends on many different factors related to the circum- stances. As a general guideline, according to WesDyne, the error should not exceed 0.5 mm.

Conversion of position Cartesian coordinates to polar coordinates when scanning circular object was compared to using the position signals from the rotational unit. The use of polar coordinates keeps the resolution independent of size of the scanned object, compared to using the rotational unit. Even though the test object was small there was an increase of the precision with polar coordinates in the tests.

Distance as a position signal is useful when the scanning direction is not a circular pattern or parallel to the Cartesian axes. The tests showed slightly lower accuracy than the 0.12 mm anticipated from the delay tests. However it was well below the 0.5 mm guideline.

From the results it can be concluded that conversion of encoder signal can improve precision and flexibility of ET scanning . However more tests with scanning of different objects would be needed to make a more general statement

(42)

Chapter 6

Recommendations for future work

Here are some ideas and recommendations for future work regarding the encoder converter and encoder signal converting in automated NDT.

6.1 Future work

The encoder converter prototype almost accomplished all of WesDyne’s require- ments. The xCORE-200 eXplorerKIT and the adapter card worked as a good platform. Most of the possible improvements is related to the software. It did not sufficiently sample all four encoder channels simultaneously at full speed.

However, it is rarely that all axes move at the same time and if so scanning would still be possible with a lower speed. The main cause of this limitation of sampling was due to the synchronous interface connection between the sampling task and the count task in the embedded software. A more suitable solution would be to use a asynchronous channel between the two tasks. Thus the sam- pling task does not need to wait for the count task to be ready in order to transfer the sampled value.

The calculation of distance and polar coordinates was by far the most time consuming part of the embedded software. Therefore it would be recommended to work with those functions in order to decrease the overall delay. It is mainly due to the many floating-point arithmetics used in these functions. Mainly the functions sqrt and atan2 from the math.h . The xCORE-200 eXplorerKIT does not have a floating-point unit and thus needs to emulate the arithmetic in software. A possible alternative would be to implement and use algorithms in fixed point math. It would lower the precision and increase code complexity but would most likely decrease the execution time significant.

(43)

Although, if it would be a need for encoder signals in the MHz range, a hard- ware redesign would be needed for proper signal integrity and electromagnetic interference protection in those high frequencies. The adapter card could be redesigned as a multilayer Printed Circuit Board (PCB) with surface mounts components and shielding of the high frequency traces. However, this would increase complexity of assemble as well as possible repair and rework of the board. A reasonable choice would then be to also change the Xmos board with a high end FPGA board.

There was only enough time in the thesis to try the encoder converter with ET. For UT the same type of encoder signal is used for triggering the encoder signal. Thus the encoder converter could be used for UT as well. It would be of interest to do the same tests done in this thesis with UT, to see if the delay and position error relation is different compared to ET.

(44)

Bibliography

[1] moTrona, “FM260 Frequency and pulse multiplier - for signal processing of incremental encoders and sensors,” http://www.motrona.com/fileadmin/

files/datenblaetter/Fm260 dse.pdf.

[2] E. P. Company, “WP-2011: The basics of how an encoder works,” http://

encoder.com/core/files/encoder/uploads/files/WP-2011.pdf, March 2012.

[3] Dynapar, “Incremental & Absolute Encoders: What’s the Best Solu- tion for Your Application?” http://www.dynapar.com/Technology/White Papers/White Paper Downloads/#.

[4] T. International, “Calculating the best gear ratio from mo- tors to an axis,” http://www.trminternational.com/site/q-a-a/

163-calculating-encoder-ratios-for-best-accuracy.html.

[5] N. R. Center, “About NDT,” https://www.nde-ed.org/AboutNDT/

aboutndt.htm.

[6] B. Gueorguiev, P.Trampus, and L. M.Davies, “Role of NDT in condition based maintenance of nuclear power plant components.” Rome: LMD Conultancy, International Atomic Energy Agency, Oct. 2000.

[7] K. Farrell, T. Byun, and N. Hashimoto, “Deformation mode maps for tensile deformation of neutron-irradiated structural alloys,” Journal of Nuclear Materials, vol. 335, no. 3, pp. 471 – 486, 2004. [Online]. Available:

”http://www.sciencedirect.com/science/article/pii/S0022311504006737”

[8] J. Enkvist, Human factors aspects of non-destructive testing in the nuclear power context. A review of research in the field, 1999.

[9] L. Cartz, Nondestructive Testing. Materials Park, OH, USA: A S M International, 1995.

[10] P. E. Mix, Introduction to Nondestructive Testing: A Training Guide.

Hoboken, NJ, USA: John Wiley and Sons, Inc., January 2005.

[11] J. Garc´ıa-Mart´ın, J. G´omez-Gil, and E. V´azquez-S´anchez, “Non- destructive techniques based on eddy current testing,” Sensors, vol. 11, no. 3, pp. 2525–2565, 2011. [Online]. Available: http:

//www.mdpi.com/1424-8220/11/3/2525

(45)

[12] Probe mode of operation. https://www.nde-ed.org/EducationResources/

CommunityCollege/EddyCurrents/ProbesCoilDesign/ProbesModeOp.

htm.

[13] Olympus. Eddy current probe selection information | olympus IMS. https:

//www.olympus-ims.com/en/ec-probes/selection/.

[14] E. Bozzi, G. Cavaccini, M. Chimenti, M. G. Bono, and O. Salvetti, “Defect detection in c-scan maps.(author abstract)(report),” Pattern Recognition and Image Analysis, vol. 17, no. 4, December 2007.

[15] P. Herman, Jr, “Manufacturing NDT Reference Standards,” The NDT Technician, vol. 07/2005, no. 2, Jul. 2005. [Online]. Available:

http://www.phtool.com/pages/mfg NDT ref standards.pdf

[16] P. H.Dana. (1999, December) The geographer’s craft project. http://www.

colorado.edu/geography/gcraft/notes/coordsys/coordsys f.html.

[17] D. Z. Goodson, Mathematical Methods for Physical and Analytical Chem- istry. Hoboken: Wiley, 2011.

[18] N. Hall, “Rectangular and Polar Coordinates,” https://www.grc.nasa.gov/

www/k-12/airplane/coords.html, May 2015.

[19] J. Lambers. (2009, October) Three-dimensional coordinate systems. http:

//www.math.usm.edu/lambers/mat169/fall09/lecture17.pdf.

[20] A. DAHLQVIST and V. Karlsson, “Design and optimization of a signal converter for incremental encoders: A study about maximizing the bound- ary limits of quadrature pulse conversion,” KTH, Skolan f¨or industriell teknik och management (ITM), Maskinkonstruktion (Inst.), 2016.

[21] B. von herzen, “Signal processing at 250 mhz using high-performance fpga’s,” vol. 6, pp. 238 – 246, 07 1998.

[22] M. Nandayapa, C. Mitsantisuk, and K. Ohishi, “High resolution position estimation for advanced motion control based on fpga.” IEEE, October 2012, pp. 3808–3813.

[23] R. Bishop, The mechatronics handbook. Mechatronic system control, logic and data acquisition, 2nd ed., ser. The electrical engineering handbook

(46)

Appendices

(47)
(48)

A Comparison of microcontrollers

Table4:ComparisonofpossiblemicrontrollerplatformsfortheEncoderconverter XmosstarterkitxCORE-200eXplorerKITPIC32MZEFstarterkitstm32f4 controllerXS1-A8-DEVXE216-512-TQ128PIC32MZ2048EFM144STM32F407VGT6 clockrateOrMIPS500MHz500MHzpertile(2tiles)200MHz163MHz cessor32-bit32-bit32-bit32-bit output/inputpins15532675 YesYes,20timersYes,nine16-bitTimersyes,upto17timers areencoderdecoderNoNoNoYes 64KB512KB512KB192KB 256KB1MB2MB1MB NoNoYesYes ,phyandMIIYes,withshieldYesYesYes,withshield libary/supportYesYesYesYes 95x50x60mm105x80mmnotspecifiednotspecified levels3.3V3.3V3.3V3.3V

(49)

B Schematics for the adapter card

(50)

Figure 18: Schematic of the adapter card,second page

(51)

C Circuit board for the adapter card

Figure 19: Circuit board design top layer

(52)
(53)

D Bill of materials for the Encoder converter

Table5:BillofmaterialforEncoderconverter ManufacturerComments TIBuffer/levelshifterfrom5Vto3.3V TIBuffer/levelshifterfrom3.3Vto5V NXPDifferentialreceiver SAMTEC32x22.54mmpitchBoard-To-BoardConnector SAMTEC8x12.54mmpitchBoard-To-BoardConnector AMPHENOL10-pinWire-To-BoardConnector2.54mmpitchmale AMPHENOL10-pinWire-To-BoardConnector2.54mmpitchreceptable PHOENIXCONTACTScrewterminal4pin,3.81mmpitch MULTICOMP0.1uFcapacitor MULTICOMPThroughholeresistor1.3K,0.6W,+-1% unknownThroughholeresistor120,0.25W,+-5% VISHAYThroughholeresistor560,0.6W,+-1% TOSHIBAOptocouplerDIP-20 HAMMONDAluminumIP66127x165x77mm AMP-TECONNECTIVITYCablegland,M16,5mmto10mm,PA6 MHConnectorsRJ45-connector XMOSxCORE-200eXplorerKITwithEthernet AMP-TECONNECTIVITY20-pinribboncableconnector,male2.54mmpitch AMP-TECONNECTIVITY20-pinribboncableconnector,female2.54mmpitch AssmannIC-socket,DIL20 TECONNECTIVITYIC-socket,DIL16 MaxxtroCAT6Ethernetcableflex0.5m MULTICOMPD-sub9pinconnectorforIDCribboncableconnector HARTINGD-Subscrews,13mm,M3,4-40

(54)
(55)

References

Related documents

The purpose of this research is therefore to create an Adaptive Neuro-Fuzzy Inference System (ANFIS) model to predict yarn unevenness for the first time using input data of

Swedenergy would like to underline the need of technology neutral methods for calculating the amount of renewable energy used for cooling and district cooling and to achieve an

46 Konkreta exempel skulle kunna vara främjandeinsatser för affärsänglar/affärsängelnätverk, skapa arenor där aktörer från utbuds- och efterfrågesidan kan mötas eller

The increasing availability of data and attention to services has increased the understanding of the contribution of services to innovation and productivity in

Generella styrmedel kan ha varit mindre verksamma än man har trott De generella styrmedlen, till skillnad från de specifika styrmedlen, har kommit att användas i större

Parallellmarknader innebär dock inte en drivkraft för en grön omställning Ökad andel direktförsäljning räddar många lokala producenter och kan tyckas utgöra en drivkraft

Närmare 90 procent av de statliga medlen (intäkter och utgifter) för näringslivets klimatomställning går till generella styrmedel, det vill säga styrmedel som påverkar

Following Ullman´s mechanical design process theory and using CAE, we were able to design a model than can successfully adapt to the six target models variating only the thickness