• No results found

Probing Tool for Ensuring Compatibility of Electromagnetic Near Fields

N/A
N/A
Protected

Academic year: 2021

Share "Probing Tool for Ensuring Compatibility of Electromagnetic Near Fields"

Copied!
64
0
0

Loading.... (view fulltext now)

Full text

(1)

Electromagnetic

Compatibility Scanner

Probing Tool for Ensuring Compatibility of Electromagnetic Near Fields

ERIK VON KEYSERLINGK

(2)

Probing Tool for Ensuring Compatibility of Electromagnetic Near Fields

August 31, 2020

Erik von Keyserlingk erikvk@kth.se

Abstract

With the increasing amount of wireless devices in use today. All from Bluetooth head- phones to smart fridges, which communicates wirelessly to a server or phone. The need for the radio frequency spectrum to be free from disturbances is necessarily. There are today regulations stating how much a device is allowed to transmit into the radio fre- quency spectrum, this is to prevent and control disturbances from electronics which does not intend to transmit into the radio frequency domain. In this report a setup is proposed to conduct near field scanning of planar surfaces such as PCBs. This to locate if a trace of component is transmitting or if the transmitted energy is higher than allowed. This report includes verification of self made probes through tests and simulation as well as comparison with commercially available probes. As well as eval- uation of a robotic arm for use as the probe mover and the evaluating of a software defined radio with amplifier.

(3)

Sammanfattning

Antalet tr˚adl¨osa enheter som tillkommer idag ¨okar stadigt. Allt fr˚an bluetooth h¨orlurar till smarta kylsk˚ap som kommunicerar tr˚adl¨ost med en server, telefon eller liknande.

Detta inneb¨ar att radio-spektrumet beh¨over vara fri fr˚an st¨orningar. Idag finns det best¨ammelser som s¨ager hur mycket en elektonisk produkt ¨ar till˚aten att s¨anda ut i radio-spektrumet, b˚ade f¨or kommunikation och oavsiktligt transmittering. Detta ¨ar f¨or att kontrollera och f¨orebygga uts¨anda st¨orningar fr˚an fr˚an elektronik som kan st¨ora kommunikation och vetenskapliga m¨atningar. I denna rapport utv¨arderas ett system som kan skanna ett omr˚ade f¨or dess n¨arf¨alt, b˚ade det magnetiska och elektriska f¨alt.

Ett s˚adant omr˚ade ¨ar typiskt en PCB eller annan elektronisk konstruktion. Detta f¨or att kunna lokalisera komponenter eller ledningar som radierar energi . Denna rapport beskriver tillverkning av n¨arf¨altsprober med simulering och verifikation j¨amf¨ort med kommersiella prober av test ¨over ett tillverkat testkort. Ut¨over det utv¨arderas en robot arm som anv¨ands f¨or att flytta en probe ¨over det omr˚ade av intresse samt utv¨ardering av en software defined radiotillsammans med en f¨orst¨arkare.

(4)

Contents

1 Introduction 8

2 Background 10

2.1 Electromagnetic compatibility of planar structure . . . 10

2.2 Literature study . . . 11

2.3 Software defined radio . . . 15

2.4 Existing test equipment . . . 16

3 Overview and objective 18 4 Theory and methodology 19 4.1 Quantization noise . . . 19

4.2 Magnetic field theory . . . 20

4.3 Kinematics of robotic arm . . . 21

5 Hardware and evaluation of hardware 22 5.1 Hackrf One - Software Defined Radio . . . 22

5.2 Noise floor of HackRF . . . 22

5.3 Preamplifier . . . 24

5.4 Robotic arm . . . 24

5.5 Probes . . . 24

5.6 Probe holder . . . 25

5.7 Device under test (DUT) . . . 25

6 Near field probe and device under test 27 6.1 Theory of the near field from the device under test . . . 27

6.2 Manufacturing probes and probe holder . . . 29

7 Software 31 7.1 G-code . . . 31

7.2 Arm control, communication and firmware modification . . . 31

7.3 Software defined radio interface and GNU radio companion . . . 32

7.4 Simulation software . . . 32

7.5 Developed software . . . 33

8 Elecromagnetics - Simulation 35 8.1 Model to simulate . . . 35

8.2 Procedure . . . 35

8.3 Results - magnetic probe . . . 37

8.4 Results - electric probe . . . 39

8.5 Discussion . . . 41

9 Experimental part 1: Mechanical test 43 9.1 Test setup . . . 43

(5)

9.2 Kinematics of the robotic arm . . . 44

9.3 Test results . . . 46

9.4 Discussion . . . 47

10 Experimental part 2: Electromagnetic tests 49 10.1 Test setup . . . 49

10.2 Tests results . . . 49

10.3 Discussion . . . 52

11 Conclusion and outlook 55 11.1 General conclusion . . . 55

11.2 Limits . . . 55

11.3 Future work . . . 56

12 Acknowledgement 57 References 57 Appendix A Potential from two charge distributions 59 Appendix B Swift controller Pyhton class 60

List of Figures

1 Probe designs . . . 13

2 Block diagram of front end SDR . . . 16

3 Signal to noise for quantifier . . . 20

4 Effect of quantization on signal . . . 20

5 Wire over plane . . . 22

6 FFT of quantized signal . . . 23

7 Noise floor comparison . . . 23

8 Theoretical Hy component of magnetic field . . . 28

9 Theoretical Hz component of magnetic field . . . 28

10 E and H field over, device under test . . . 29

11 Flow graph for GNU Radio Companion . . . 34

12 Probe and device under test, front view . . . 36

13 Drawing of the probe model used . . . 36

14 Model used in simulation . . . 37

15 Device under test in the test runs . . . 38

16 Home made electric and magnetic probes . . . 38

17 Integrated field of simulation, probe 1 mm above . . . 39

18 Integrated field of simulation, probe 10 mm above . . . 39

19 Impedance of the test board . . . 40

20 H-field in zx plane from the test board . . . 40

21 Port impedance real part . . . 41

22 Port impedance imaginary part . . . 41

(6)

23 Difference in argument of the impedance . . . 41

24 Argument of the impedance, with and without probe . . . 41

25 Simulation with E-field probe, 1mm above . . . 42

26 Simulation with E-field probe, 10mm above . . . 42

27 Rotation of axis for the robotic arm . . . 46

28 Measurement for repeatability of arm . . . 46

29 Plot of error for variance in angle reading sensor . . . 47

30 Amplitude of the magnetic field, 1mm, self made probe . . . 50

31 Amplitude of the magnetic field, 1mm . . . 50

32 Amplitude of the magnetic field, 10mm, self made probe . . . 50

33 Amplitude of the magnetic field, 10mm . . . 50

34 Amplitude of the magnetic field, 20mm, self made probe . . . 52

35 Amplitude of the magnetic field, 20mm . . . 52

36 Amplitude of the magnetic field, 1mm, small probe . . . 52

37 of the magnetic field, 20mm, small probe . . . 52

38 Amplitude of the electric field, 1mm, small probe . . . 53

39 of the magnetic field, 10mm, small probe . . . 53

40 Amplitude of the magnetic field, 20mm, small probe . . . 53

List of Tables

1 Variables for noise floor calculation . . . 23

2 -90 milli decibel converted . . . 24

3 Table of parameter value for Hz component calculation . . . 28

4 Difference in amplitude of small and large lobe . . . 39

5 Distance from joint to measure point on wall . . . 45

6 Table of parameters for the arm . . . 45

7 Length of the links of the robot arm, [1] . . . 45

8 What θi corresponds to . . . 45

9 Variance around axis . . . 47

10 Settings for the HackRF . . . 51

11 Variance comparison, magnetic field . . . 51

12 Size of lobe comparison . . . 51

13 Amplitude difference . . . 51

14 Difference max amplitude . . . 51

15 Variance of probe, electric field . . . 51

(7)

1 Introduction

The technical advances in the wireless technology such as WiFi and Bluetooth means that the wireless spectrum is used much more frequently and more of the available bandwidth is in use. Bluethooth and WiFi are examples on protocols utilises the frequencies assigned in the ISM band. The ISM radio bands are slots in the wireless spectrum reserved for use other than in telecomunication. The name ISM is the acronym for Industrial, Scientific and Medical and origins in the United States.

Since the radio spectrum already is in great use, a disturbance could create a large impact on devices that utilises parts of the spectrum. A faulty device or a poorly shielded microwave oven could radiate enough power to make it impossible for other devices to communicate through WiFi or Bluetooth. The development of a proposed network society, where more and more devices are connected through wireless technology. Such as temperature sensors in buildings, actuators for doors etc. This is what is widely said to be the ”internet of things”, with the number of wireless devices growing the need for undisturbed communication is increasing. This advance in number of wireless devices illustrate the need of strict regulations of devices to limit the unwanted transmissions of power in the frequency bands that are used for communication. Such regulations are enforced by the European Commission in the European Union and by the Federal Communication Commission, FCC, in the United States. The goals of the regulations are to ensure Electromagnetic Compatibility (EMC), and correct operation of different devices in the electromagnetic environment.

Without good EMC regulations, the enormous increase of wireless technology will be severely limit the performance of any wireless communicating and it will not reach its full potential.

Both in the EU and US electronics that are sold within each market needs to comply with the current regulations specific to each unions regulation. The process of getting a device certified includes tests that measure the radiated emissions, the tests costs can be significant and takes time. That is why it would be of great use for a simple and low cost test device for smaller companies and individuals.

In this report the usability and limits of an simpler and cheaper EMC scanner solution is evaluated. Where all components are ”off the shelf” or can easily be made with little knowledge about electronics. This has the advantages that it is a painless and cheap solution for small scale EMC testing.

Common reasons of interference from unwanted radio frequency interferences are from high frequencies traces on printed circuit boards (PCB) such as clock frequencies, a square wave at a few MHz contains contains allot of high frequencies components this can easily be seen when calculating the Fourier transform. Other sources of disturbances could come from faulty radio components or a traces that are close to a half wave length (or other fractions) of the frequency carried by that trace thus acting as an half wave antenna [2].

EMC includes both the ability of an electronic device to function correct in the intended environment as well as to not disturb any other electronic devices in its environment. The two parts of EMC is there for emission and susceptibility. Where the susceptibility is the ability to not get affected by disturbances of other devices or electromagnetic sources within some given bounds. The other part, emissions, is the level of interference of a

(8)

device to its environment. The purpose of the emission part in EMC is to control the electromagnetic environment which all devices operate in and thus minimise the interference and disturbances.

There are four aspects of transferring electromagnetic energy, radiated susceptibility, radi- ated emission, conducted susceptibility and conducted emission. Conducted susceptibility and emission refer to the transfer of energy through cables and other conducting material such as housing for a device. A good example of conducted emission would be when large motors are started and stopped which could cause large transients in the power network, both locally in one building or for larger areas such as for small towns. Where as radiated susceptibility and emission is the transfer of electromagnetic energy wirelessly and picked up by cables or traces on a PCB which could cause errors. Important to note is that radiation does not necessarily only influence other devices but can also affect the faulty device it self and introduce hard to locate bugs and errors.

Here follows an overview of the sections in the report. Background and summary of literature study is given in section 2 where the foundations this report is stated. The stated objectives are given in section 3. Relevant theory are stated in section 4. All hardware is explained in section 5 and a deeper explanation of the theory regarding near field probes is given in section 6. After that follows the section 6.2 explaining the software used and developed during the project. Then follows the section devoted to explain the simulations in conducted in section 8. The results of the mechanical tests and electromagnetic tests are presented together with a discussion of the results in section 9 and 10 respectively.

(9)

2 Background

This section is devoted to present previous work by other authors. In in the Literature study section, design approaches are presented on probe designs, examples of setup of a system to move a probe over a test board as well as introduction to literature of robotic arms. Presented here is as well an explanation why a system for measuring electromagnetic compatibility is necessary together with the regulations that is relevant for a system like this. An overview of software defined radio is presented since it is essential to this project as well as existing test equipment.

2.1 Electromagnetic compatibility of planar structure

Electromagnetic compatibility is the ability which an apparatus is able to operate in an environment without introducing an excessive amount of disturbances both conductivity and through transmission. Every wire and trace that conducts current generate a magnetic and an electric field which could interfere with other electronics. Sometimes Interference is desired but most often it is undesired. Interference or disturbances from other devices can be rather harmless but annoying such as when a thunder storm interfere with signals for an analog TV and make the image unrecognisable. In the case of an analog TV it is quite harmless but it is still very undesired. If a disturbance is strong enough it could lead to the destruction of a device or part of a device.

A good example of when there is low or no electromagnetic compatibility is when a old microwave oven is in use, the WiFi reception will drop or disappears. This is because of that both the microwave oven and the WiFi router is working in the same part of the spectrum, the ISM band around 2.4 GHz. Then when the microwave oven is turned on and if it does not have enough shielding some radiation might leak out and interfere with WiFi signals or other communication on the same part of the spectrum.

The European interference standard is set by the ”EMC Directive 2014/30/EU” [3]. The standard describes how much a device is allowed to transmit radially outside its allowed spectrum, the conductive allowed interference and immunity against such disturbances. The purpose of the directive is to keep the side effects generated from such electronic devices under reasonable control. The directive limits electromagnetic emissions from equipment to ensure that devices that needs to use radio and telecommunication but also other equipment.

The main objective of the directive is to regulate such that electronic devices comply with the rules regarding electromagnetic compatibility when placed on the market.

The cost of getting a new product out on the market can be expensive. A big expanse is the certification of the product, CE in EU, FCC in the USA. If the certification fails then the design needs to be reconsidered and the tests needs to be conducted again. If part of testing could be done during the design phase of a project, the chances of passing the EMC test will increase since problems would have turned up in early tests. Thus decreasing the total cost of launching a product.

If a device or a PCB is found to exceed the allowed radiated amount one needs to go through the design to find the fault. It is not a trivial task to find where the fault is on a PCB,

(10)

it could be a specific component or a trace that if given the wrong length could act as a transmitting/receiving antenna. Thus it would be of great advantage to know where the source of the radiation is.

The increasing amount on wireless devices in the world is increasing and that comes with challenges in an article K. Wiklundh and P. Stenumgaard [4] expresses challenges for the future when it comes to IoT because of the growing amount of devices in use.

2.2 Literature study

The field of electromagnetic compatibility is well researched and it does exists quite some theory and techniques to attenuate and minimise the interference between devices. Tech- niques for attenuate disturbances consists of for example smart layout of components and traces on PCBs as well as designing the housing of devices. The housing acts as shields against electromagnetic radiation, both from the device itself and from other devices. This reports main focus is discussing the techniques and theories for investigate near field and the influence of the measurement method to the near field. Here follows a comprehen- sion of literature that handles theory and techniques for investigate near field, as well as theory of kinematics of robotic arms. The literature here will we presented in a short sum- mary together with comments how the article impacts this thesis as well as if necessary, the advantages and disadvantages with the method and theory that is presented in that article.

One well cited source in the field of electromagnetic compatibility is J.S. Daheles PhD Thesis ”Electric Probe Measurements on Microstrip”, coauthor A.L. Cullen [5], where the authors investigate the microstrip and other similar circuits ”to get a physical understanding of the mechanism of signal propagation in these circuits”. This thesis is investigating the propagation of signals through microstrips on PCBs, and the corresponding electromagnetic field from the transmission line. The authors calculate the field strength for three different scenarios, electrostatic solution for a wire suspended over a plane, field of a wire over a ground plane and modal solution for a wire suspended in a rectangular wave guide. Where the last scenario is supposed to be a model for a microstrip inside a PCB sand-witched between two layers of ground planes. The report gives good insight of the theory regarding propagation through transmissions lines on PCBs, as well as practical tests and describe a probe design used in tests. In chapter 2.4 named ”comparison between microstrip and wire over ground plane”, the authors explains that the model of a wire over a plane calculated given static values to use as a good model. This is true for low frequencies and close to the source compared to the wave length of the frequency.

Academic literature regarding the manufacturing of probes is scarce, but there exists com- prehensive none academic articles that explain in depth the theory and manufacturing of probes. Though there exists plenty of literature regarding evaluation of field probes, as well as procedure on how electromagnetic scanning is conducted. Scanning procedure spans from using a XY-tabel, robotic arm or to use visual tracking of a probe.

In Nimisha Sivaramans report [2] on EMC measurement devices, a few different measure- ment methods are presented. A short description will follow presenting the different methods

(11)

and their application. The first method discussed is the TEM cell method, which measures the level of radiation of a product by placing the device inside a TEM cell. A TEM cell consists of two metal sheets, where one forms the top and bottom of a box and acts as ground and the other sheet is in the centre of said box and picks up radiation. The two sheets are then connected through a coax-cable connected to an amplifier and then into a spectrum analyser. This method gives an easy and fast solution to measure radiated energy, but it will not give any indications on where the radiation comes from. To be able to locate where on a device the radiation comes from, one needs to perform some sort of surface scan method. There are few methods one could use. One method is that one could construct a matrix of small probes and place the matrix on top of the device and then sample from each probe in the matrix. Another method is that a probe is used and moved across to scan over the whole device or a method using a matrix of probes. The method of using a probe matrix will give a quick scan since it does not require any displacement or moving parts, though it does require quite allot of components to build up all probes and RF-switches for the spectrum analyser, which will make that solution require more parts. The spatial resolution is limited to how close and how many probe units one can fit in the matrix. To measure the radiation pattern of a device one would need to place the device further away and rotate it around its axes and the measurement device needs to utilize an antenna. The author resonate why and what advantages one get from investigating the near field. Where he states that it has an advantage when it comes to accuracy, reliability, cost and application range compared with that of the far field measurements. This comes of that the near field is less influenced by unpredicted disturbances that comes from such things as weather and scattering. The near field test are less dependant on test conditions and does not need to be conducted inside of an anechoic chamber. This makes near field measurement cheaper and quick to conduct compared to far field measurements.

In the paper [6] Olli V¨a¨an¨anen presents a ”do it yourself” approach to making current probes for EMC troubleshooting. The technique he is using here is to wind a coil around a wire and measure the induced voltage, thus he is able to calculate the the current passing through the wire. A big drawback with this approach is that one needs to have a coil go around the wire under interest to get any data. This approach would be more suitable as a permanent installation to measure the current in a wire. Another paper that explains magnetic field probes is the paper ”Probing, the magnetic field probe” [7], where the author explains the fundamentals of a near field probe as well as preforming measurements of a probe.

According to the measurements a probe with a central gap in the loop is to prefer, and even better would be to have a terminating resistor. This is because that design gives the flattest frequency response from the probe across the spectrum compared to other designs.

The basics of a magnetic field probe is just a loop of wire to induce current from the magnetic field. Such loop is unshielded and an electric field will have a large impact on the induced voltage, thus not giving accurate readings of the magnetic field if a string electric field is in presence. In the paper ”The high-frequency behaviour of the shield in the magnetic-field probes” [8] the authors go into depth explaining the use of a shield. The paper discusses the design of four different probes, one with a unshielded loop. The four different probe designs are displayed in figure 1.

(12)

Figure 1: Drawing of the four different probe designs presented in paper [8]

All four probes are made out of a wire loop connecting back the the handle. Three of the probe designs have a shielding with a gap, but the gap in the shield is at a different places on the loop. One where the loop connects back to the stem, one with the gap at the opposite side of the stem connecting to the loop and the last design is also at the centre of the loop but the central wire is shorted to the shield. The authors calculate how the frequency response for each probe should be and compare that to measurements of the probes as well as compare the different probes with each other. The design of a good magnetic probe should be such that any influence from a simultaneous electric field should be negligible with respect to the desired response from the magnetic field. This implies that the loop should be small with respect to the wavelength. When this requirement is satisfied the loop will act as an elementary magnetic dipole. In quasi static scenarios and at low frequencies the shield acts as Faradays shield and one would not expect any current flowing through the shield. However, with increasing frequency current starts to flow along the surface of the shield. The shield will act as a Farady shield as long as the thickness of the shield is small with respect to the skin depth δ. The paper proceeds to make an equivalent circuit of the probe and calculate the frequency response for each probe design. As well as to measure the response for each frequency. The frequency response for the probe with a gap next to the stem connecting to the loop has one pole and one zero, meaning that around those the response is highly dependent on the frequencies present. This will lead to data that will be difficult to analyse since it is dependent on the frequencies that are present. The frequency response for the probe with the slot in the middle of the probe loop gives a flat frequency response for the given frequency span. The remaining shielded probe has a pole and zero close to each other, thus measurement in that region will be hard to analyse. Given the data from this paper, a good probe for our purpose would be the probe with the gap in the centre of the loop.

The test procedure used in this report is a modified version of the test procedure described in paper [9]. The paper describes a test procedure for testing differential probes. The authors constructs both a loop probe and a dipole pole probe. The tests are then conducted by traversing the probes over a test board with a wire over a large ground plane. Their probes are then mounted on a 5 axis robot arm, a computer saves the acquired data from a spectrum analyser which is connected to the probe. Their robotic arm has a maximum scanning area of 2000mm by 1000mm by 600mm and the mechanical resolution is 0.01mm in

(13)

each axis. The arm has an angle resolution of 1.6 ∗ 10−4rad for its two rotations. According to the authors, to ensure a good resolution of measurements of the field the probe needs to be held close to the surface of the device under test. This is achieved by a 3D positioning system with a laser triangulating system. A laser illuminates the device under test from one angle and viewed by a camera opposite the laser. The height of the probe is recorded and is used to make the resulting images. The loop probe is used to get the magnetic field for each component, the probe measures the magnetic field perpendicular to the loop and the magnitude of the three components are acquired by rotating the probe 90around each axis. The dipole probe is used to measure the tangential components of the electric field.

The probe is made out of two rigid coaxial cables soldered together, the centre conductors protrude out from the outer conductor and are bent to be in a straight line with each other.

The outer conductor of the probe is grounded and the spectrum analyser is measuring the difference between the two centre conductors. The sampled data is then compared to results from a simulation.

In the paper ”Signal and Noise Measurement Techniques Using Magnetic Field Probes” by Douglas C. Smith [10] elaborates on the slots on the magnetic probes. It is explained in the paper that it is the uniformity of the electric field that the probe is in that determines how well the shielding works. When measuring plane waves this will not be much of a problem.

However, probes are usually held against components on a circuit, and the field close to components are rarely uniform. If the electric field couples differently to one side of the gap more than the other, different currents will be experienced by each side. This difference in voltage will induce a current on the inner loop and the shield will not have the desired effect. The author proceeds with conducting three experiments, where an electric field is applied on different sides of a probe with a centre gap. From the tests one can deduct that a un-uniform electric field results in an induced current from the voltage difference induced by the electric field.

In paper [11] an EMC scanning method with an optical tracking solution is proposed. Where instead of having a robotic arm or other automatic method to move a probe across the area of interest a person will move the probe and the movement is tracked by cameras. Fastened to the probe is reflectors that reflects infrared light, this makes it possible to track the probe in software. Though a disadvantage with this setup is the bulky probe that has four large reflectors to make it possible to track it both in space. The difficulties with the approach is the interpolation of samples, since it is difficult to get a even sampling in space using a handheld probe. The authors developed an algorithm to produce a map of interpolated values.Though the proposed solution like this could make it easier and faster to scan an object. Without any mechanical components this might be a good approach. The result from the hand held probe is then compared to a measurement using a conventional mechanical procedure. It it obvious for the reader to see that the results from the mechanical procedure does give a higher quality of the output in terms of accuracy.

The field of robotic arms is well studied and there exists allot of well documented theory to calculate the model of a robotic arm. Relevant to this work is the techniques to calculate the kinematics of a robotic arm. The dynamics of a robotic arm is well covered such in the book [12]. This thesis uses techniques to calculate the forward kinematics of a robotic

(14)

arm.

In this section different design solutions has been presented regarding scanning an area to evaluate the shape of the produced near field of a device. All relevant design approaches include a mechanical part that moves a probe over such as an XY-table, robotic arm or visual tracking of a handheld probe. All approaches with their respective advantages and disadvantages. Presented here is as well practical information on how to construct a probe as well the theory of the behaviour of a near field probe, the chosen design is presented later in this report and the choice of the design is motivated as will with regards to presented literature.

2.3 Software defined radio

One could use a few different approaches to sample a high frequency signals, few are pre- sented and investigated in the literature study. One could use a digital oscilloscope to sample the signal, however oscilloscope usually become increasingly expensive the greater bandwidth they cover. Another solution would be to use a spectrum analyser which will give the calculated spectrum of the desired band. But high end broadband spectrum analysers run into the same issue as oscilloscopes. The requirements of a device for this application is, low cost, preferably small size, large bandwidth and large working space in the frequency domain. A software defined radio fulfil of all of these requirements, where one usually costs around a few hundred Euros. It is small in size and depending on the SDR the working range is up to a few GHz and the bandwidth is on the order of tens of MHz. SDRs are usually used as a radio receiver and transmitter for development of new protocols or for hobbyists to use in projects. A great advantage of a SDR is its ability to be configured to sample anywhere in the working range of its spectrum. Together with tools such as GNU radio companion, one can preform complex DSP tasks. The SDR used in this report is the HackRF one [13] made by Michael Mossmann, the HackRF is explained in more depth in section 5.1. The figure 2 shows a typical block schematic of a SDR.

With a SDR one has the ability to change at what frequency one wants to use as the centre frequency. This is done by mixing the received signal with the desired centre frequency.

The mixed signal is now sampled for the In-phase and quadrature components, or in short the IQ channels. The I and Q channels are referred as the equations (2) and (3), where A(t) is the amplitude of the sampled signal at that point in time. Together they give the received signal in equation (1). The I and Q channels are offset from each other by π2rad, which becomes clear in equation (3). Because we know the frequency and phase of the IQ channels we only need to know the amplitude A(t) of each channel to reconstruct the original received signal or to construct our own signal. Some of the features using I and Q channels is that is all done in hardware and as mentioned before one only needs to know the amplitude of the I and Q channels to reconstruct the original signal. A huge advantage is that it is possible to see if a frequency is positive or negative, that is if the I or Q channels is leading in phase. When it comes to constructing signals that needs to utilise a phase shift protocol to transmit data one simply needs to change the sign or value of one channel or both depending on the desired phase shift. This is because two sinusoidal signals can be used to construct any signal just by changing the amplitude of the two. Thus one does not

(15)

LO

LNA BPF Mixer

Phase diff

π/2

LPF

LPF

ADC

ADC

I

Q

Figure 2: Block diagram of front end of a generic software defended radio

need to track the phase a signal should in software, that comes inherent from the amplitude of the I and Q channels.

cos(2πf t + φ(t)) = I(t) + Q(t) (1)

I(t) = A(t) cos(2πf t) cos(Φ(t)) (2)

Q(t) = A(t) cos(2πf t + π/2) sin(Φ(t)) (3)

2.4 Existing test equipment

It does exist equipment that conducts measurements on planar structures such as PCBs.

Such equipment usually works by moving a probe with the help of a X-Y table, where two or more motors drive a cartage holding the probe. The probe holder depending on the design may be able to also move in z-direction and rotate around its own z-axis. The possibility to move up and down in z-direction can be useful in cases where large components needs to be passed. In the case where the table does not have the possibility to move up and down the height of the probe needs to be set to the highest point of the structure that is under investigation. This could be set beforehand in software where some areas are set to be needing more height. Another solution presented in the paper ”Characterization of the open-ended coaxial probe used for near-field measurements in EMC applications” [9] where the authors present a solution where the height of the cart is continuously adapted depending on the height of the device under test. This is achieved by projecting a laser matrix on the structure and record the patter with camera and through the distortion of the matrix on

(16)

can calculate the displacement in height needed to avoid touching the device under test with the probe. This gives the ability to get a measurement close to the area of interest and thus a good spatial resolution of the source of the magnetic field. The terminal of the probe is connected to a analog to digital sampler, usually a spectrum analyser or a software defined radio. The samples are then collected and saved by a computer. The sampled data is often presented as a heat map overlayed on an image of the scanned device.

Another but not as common solution to perform the scanning is to construct a matrix of probes. The probe matrix is usually a PCB with loops made in the etching process, or loop elements soldered on top of a PCB. To preform the measurement the matrix is placed above the device under test and samples are then recorded using the same method as described before using a spectrum analyser or a software defended radio. A disadvantage with this is that if there exists components that are tall compared to the rest of the area of interest the measurement will be taken far away and the spatial resolution will not be as good as if the probe would have been close. An advantage is that, depending on the hardware used for sampling the full measurement will be conducted during a shorter time. As well as that it would have the possibility to discover local momentary fluctuations in the field, since the measurement is not limited to where in space it is.

An example of a commercial scanner solution is the scanners made by Detectus, a Swedish company specialised on developing electromagnetic compatibility scanner solutions. Their scanners use the solution described earlier of moving a probe over the area of interest using a XY-table, and the cart that is moved holds the probe. Sampled data are collected and visualised as a heat map overlayed on an image of the device that has been scanned.

(17)

3 Overview and objective

The objective of this thesis is to propose a good, simple and cheap method for testing and evaluating the performance of planar current carrying objects such as PCBs in terms of the radiating near field. The method should be utilising material that is ”of the shelf” or easy to construct with hand tools and 3D printers. The proposed method should be rigorous and limits of the method should be presented and evaluated such that a user know when it is suitable to implement the proposed or a variant of the method. Bellow follows a bullet point list of objectives for this thesis.

• Build up a testing environment to evaluate both self made probes and commercially available probes

• Construct probes according to existing theory and to have them to be compatible with available hardware

• Evaluate the probes in tests and compare the result of the test to commercially avail- able probes

• Construct a model in a simulation environment of the test board with probe and evaluate the performance of the model as well as the impact on the near field from the probe.

• Evaluate the performance and suitability of using a robotic arm as the mechanical mover of the probe.

• Evaluate performance of a software defined radio

• Develop software for controlling the arm and gnu radio as well as develop software for evaluating the data given by the simulation model.

(18)

4 Theory and methodology

In this section background theory is presented to give the reader technical knowledge of the calculations presented later in the report. As well to provide knowledge of the limiting factor of the software defined radio. The theory discussed here regards the quantisation noise, base theory of electromagnetic fields as well as kinematics of robotic arms.

4.1 Quantization noise

A limiting factor when conducting measurements with any digital device, such as a spectrum analyser and a SDR is that the signal needs to be quantified. Often when signals are described in theory only the sampling is considered when transitioning from the continuous domain to the discrete domain. In this case only the aliasing needs to be considered as unwanted, since the discrete signal can take any value. In real system the signal is not only discretizied but it is also quantized, meaning that the signal can only take some set of values. A quantifier defines as q[x] = arg min |l − x|, where l ∈ S and S is a set that contains all levels. The quantifier returns the level l that minimises the value |l − x|.

Assuming that our signal has an amplitude of U such as the span the quantifier should work over is 2U . If we then use b bits to quantify the signal we will have 2b = q levels in the quantified signal. A reasonable decision would be to have all levels l of the same size. The size of each level will be according to equation 4

l = 2U

q (4)

In the quantisation process an error is introduced, the error is described as the quantisation noise n. Given a signal s[t] the quantisation process will give the quantified signal sq = Q(s[t]) the noise will thus be nq[t] = s[t] − sq[t]. For instance a 3-bit ADC (Analog to Digital Converter) has only three bits the sampled signal can be described as, that is 23= 8 levels. In figure 4 a signal (blue) is received and quantisied (green) to 8 levels. The red line is the error at each sample from the true signal to the quantisied signal. It is apparent that with increasing number of bits for the quantisation the error will decrease. With an increasing number of bit the distribution of the error can be approximated as an uniform distribution between ±2l. Using the approximation the maximum signal to noise ratio for a sine wave that has the same amplitude as the quantisation range will be according to equation (5), where b is the number of bits in the quantisation.

SN R = 1.76 + 6.02b (5)

Using equation (5) to calculate the SN R with 8 bits gives a value of 49.92dB. Calculating the SN R from a simulation using a sine wave with length of 1000 samples and a frequency of f = 0.1 and still 8 bits b = 8 gives a SN R value of 49.98dB. The plot in figure 3 shows how the signal to noise ratio changes for the quantifier when the amplitude of the signal changes. In this case the signal is sinusoidal, 8 bits was used for the quantifier and the

(19)

length of the signal is 10000 samples. At amplitude 1 all levels of the quantifier is used and at amplitude 0.1 only 10% of the levels are used.

Figure 3: Signal to quantified nose with regards to how much of the range of the quantifier the signal is using.

Figure 4: Effect of quantization on signal.

Blue is the original signal, green is the quantified signal and red is the error

4.2 Magnetic field theory

Here a short introduction of electric and magnetic fields will be given. All currents are surrounded by a magnetic field proportional to the current. In the case of a straight wire carrying a current, the magnetic field will surround the wire in a plane orthogonal to the wire. The field will have the direction according to the ”right hand rule”, the field strength would be according to equation (6) where µ0is the permeability in vacuum, r is the distance from the wire to the point of interest. This is for the static and quasi-static situations. With more current carrying wires the fields will add according to the superposition principle. A PCB is in some sense a lot of straight wires carrying currents.

B = µ0I

2πr (6)

When solving for the magnetic field in a non static situation one needs to solve the differential equation given by Maxwell’s equations:

∇ × E = −∂B

∂t (7)

∇ × H = J +∂D

∂t (8)

Solving the differential equations are done in the simulation software. The analytic calcula- tions of the fields relies on the thesis report Electric Probe Measurements on Microstrip [5].

(20)

And are presented in more detail in section 6.1 together with the theory about the test board used during the tests. Important to point out is that is it the near field that is considered in this report.

4.3 Kinematics of robotic arm

Degrees of freedom in the context of mechanics and more specific robotic arms are the number of independent displacement motions a robotic arm can perform. The number of degrees of freedom for this specific robotic arm used in this thesis is three.

The set of equations that describes the movement of a robotic arm can be described in either the forward kinematics or the inverse kinematics. The forward kinematics are usually easier to calculate than the inverse kinematics. The inverse kinematics has the Cartesian coordinates as variables and calculate the angles, extensions etc of each joint. The solution to the inverse kinematics does not necessarily have one solution and one needs to be careful when applying the solution to a real world robotic arm since the solution might be an unreachable state for the arm. The forward kinematics takes the joint angles and other parameter as argument and calculates the Cartesian coordinates. The forward kinematics gives one solution for each set of input. The forward kinematics is calculated by starting at the origin of the base of the arm and adding each joints length multiplied with sinus with a phase depending on how the joint rotates with respect to the axis. The derivation is shown later in section 9.

(21)

5 Hardware and evaluation of hardware

In this section all hardware used during this thesis is presented. With the description of the hardware specification is given as well if available. A short motivation of the choice of the hardware is presented. Omitted from this section is trivial hardware such as coax cables, power adaptors, computers and so forth.

5.1 Hackrf One - Software Defined Radio

The software defined radio used during this research is the HackRF one. The choice of using the HackRF is because of its availability, low price and its large range of operating frequency. The operating frequency spans from 1 MHz t 6 GHz, well in the realm of the scope of this thesis. The HackRF was developed and constructed by Michael Ossmann in 2013 and with help of a Kickstarter campaign it was released in 2014. Because of its age, it has been well documented and tested both by it self and integrated with GNU radio.

• 1 MHz to 6 GHz operating frequency

• half-duplex transceiver

• up to 20 million samples per second

• 8-bit quadrature samples (8-bit I and 8-bit Q)

• Hi-Speed USB 2.0

• compatible with GNU Radio

h

a

l

w

Figure 5: Wire over plane, sketch of the device under test

5.2 Noise floor of HackRF

The level of the noise floor of the SDR determines how much energy a signal needs to have to contain to be able to detectable by the SDR. In this setup a low noise amplifier is used in front of the the SDR thus adding noise to the measurement. The noise is assumed to be uncorrelated and ergodic. Since the noise is assumed to be uncorrelated the noise floor will

(22)

Figure 6: Spectrum from quantized sig- nal. Red is the original sampled signal blue is the quantized 8-bit signal.

Figure 7: Noise floor comparison. Green trace is the mean value for the amplifier and the blue line is the hackrf without the amplifier

Table 1: Variables for noise floor calculation

var name val unit comment

BW 20 Mhz Bandwidth

NF 11.1 – Noise floor

T0 290 kelvin Temperature

k 1.38 ∗ 10−23 J/K Boltzmanns constant

be the mean value of the power FFT. This measured value will then be compared to the theoretical value of the noise floor.

Equation (9) is the equation for what the noise would be for a ideal receiver. The bandwidth BW = 20MHz and the gain GdB = 10. With the numerical values in the equation we get that the noise floor for an ideal receiver would be at room temperature: −90.98 dB.

N = 10 log10(BW) − 174 + GdB (9)

With the additional values we can calculate the theoretical minimum detectable signal with a noise figure, NF = 11.1 temperature in kelvin T0 = 290 and Boltzmanns constant k = 1.38 ∗ 10−23.

Noise floor = 10 log10(k ∗ T0∗ 1000) + NF + 10 log10(BW) (10) With the numerical values in equation (10) we get that the lowest theoretical detectable signal needs to be at least -89.86 dBm.

(23)

Table 2: -90 milli decibel converted

dBm Watts Volts rms Volts p Volts pp -90 0.100e-11 7.071 μV 9.998 μV 19.997 μV

5.3 Preamplifier

A pre-amplifier is used in series with the probe before the software defined radio. The choice to use a pre-amplifier is to be able to detect signals with a low amplitude. However, the use of a pre-amplifier adds a constrain to the setup since the pre-amplifier introduces noise to our system. And will depending of the noise figure of the amplifier, it has the possibility to limit detectable signals.

The pre-amplifier used during the probe tests a +30dB amplifier with the work range be- tween 9KHz and 3GHz. According to the datasheet [14], the noise figure at 2GHz is 4dB we will use that value as the noise figure for the whole span of the amplifier since no other is specified. With equation (10) the lowest detectable signal is calculated, and with a band- width of 20MHz at room temperature we get -96.97dBm.

Since the amplifier amplifies with 30dB, the noise will reach up to -66dBm after the am- plification stage and thus theoretical a signal above -96 dBm should be detectable if the pre-amplifier is in use. Given this, the amplifier in use is sufficient for the task set up in this thesis.

5.4 Robotic arm

As presented in the literature study chapter 2, there does exists a few different approaches to move a probe over an area of interest. Such as utilising a xy-table, robotic arm or track the probe visually with a set of cameras and reflectors on the probe. The choice of method fell on the use of a robotic arm for this project. This choice was made on the base of that a robotic arm is versatile, its accessibility as well as that the arm does is well documented, open source and with the abilities to use different tools attached to the end of the arm. The choice of the robotic arm fell on the ”uArm Swift Pro” from uFactory. The full source code to the arm is supplied on their GitHub [15].

The arm comes with a few tools that can be interchanged such as a laser, claw and a 3D printer extruder. With the arm comes an adapter so that a user has the ability to develop and use other tools than what is supplied by the manufacturer.

5.5 Probes

The induced voltage in a conductive loop is proportional to the strength of the magnetic field parallel to the plane the conductive loop is in. This is described by Faraday’s law in equation (11) [16]. Where A is the area and the magnetic field is homogeneous. Faraday’s law for un-homogeneous magnetic field is described by equation (12), where the magnetic field is integrated over the area S that is within the conductive loop.

(24)

V = A∂B

∂t (11)

V = ∂B

∂t Z Z

BdS (12)

The H-field probes used in this report consists of a loop, the function of the loop is to pick up the magnetic field. The voltage generated in the loop are carried by the transmission line to a SMA connector. The transmission line is also used as the handle to move the probe around without being too close with other conducive material to the source one wants to investigate.

To suppress the voltage induced due to a electrical field from the device under test the loop is shielded with the outer conductive copper layer connected to ground, the shield has a small slot such that the magnetic field has the ability induce a voltage in the inner loop.

Figure 12 shows a drawing of the H-field probe design used.

The E-field probe used in this report is just a straight rigid coaxial cable where one end is terminated with a SMA connector and the probe side has 10mm of the core conductor protruding out from the outer conductor.

5.6 Probe holder

Since the amplitude of the magnetic field is dependent on the rotation of the probe, a device is needed to rotate the probe. The probe holder consists of three parts, arm tool attachment, stepper motor and a tube for holding the probe. The arm tool attachment and the tube for holding the probe was printed with a 3D printer. The stepper motor is controlled from the robotic arm by utilising the stepper driver made for the E-axis for the 3D printer mode on the arm. All 3D printed parts was design in the Fusion 360 cad environment.

It is critical that the probe holder, as well as to rotate the probe keeps the probe perpen- dicular to the surface of interest and that the rotation is around the long axis of the probe.

If the rotation is not around the long axis of the probe, the area the probe is measuring will change when rotating. The probe, specific the magnetic field probe, needs to be per- pendicular to the surface to attenuate the voltage induced by the electric field, as explained in the section 2.2. Where the tests conducted in the article Signal and noise measurement techniques using magnetic field probes [10] shows that if the electric field is not homogeneous around the probes slot, a voltage will be induced.

5.7 Device under test (DUT)

To compare results from simulation and theory with test results conducted a test board was constructed. The test board has the same dimensions as the test board in simulation and theory, and goes as Device Under Test (DUT). In figure 15 the used DUT during this report is shown. The DUT consists of a cylindrical wire over a fibreglass sheet and a ground plane that covers the whole bottom of the fibreglass sheet. The ends of the test board is

(25)

terminated with a SMA connector in each end. The inductance Lwop is given by equation (13), where L is the length of the wire, D is the diameter of the wire, H is the height over the ground plane.

Lwop= µ0µrL

2π cosh−1H

D (13)

Z0= J ωLwop (14)

Z = R + Z0 (15)

In equation (13) the induction of the test board is shown and in equation 14 the reactance for the test board is shown. Equation (15) is the total impedance of the test board, where R = 50Ω. From equation (13) learn that the Lwop, inductance for wire over plane, is quite small. Thus the total impedance will consist mostly of the real value given by the end terminator R.

This design of a test board is common and presented in the literature in section 2.2 and is used for it simplicity and easiness to analytic calculate the resulting fields from the geometry of the board.

(26)

6 Near field probe and device under test

This section is devoted to the theory and manufacture of the device under test as well as the manufactured probes. Here will the electric and magnetic field be presented from analytical calculations from the device under test. After that a description on the manufacturing of the probes will follow. Derivation of the equations that describe the fields are presented in appendix A.

6.1 Theory of the near field from the device under test

The test board that is considered in these tests is in short described in section 5.7 and in figure 5 a sketch of the test board is shown. This section contains the theory of the near field from the test board. As mentioned earlier the test board consists of a wire over a ground plane. Since the electric field lines over the conductive plane need to be parallel to the normal of the plane one needs to find the distributed charge over the plane given a line charge ql. If one can find the distributed charge, then one can calculated the field-lines from the charge distribution. However, that is not a simple task. A closer look at the figure 5 and knowing that the width (w) of the conducting plane is much larger than the diameter if the wire as well as much larger than then distance (h) from the ground plane to the wire gives us the possibility to approximate the conductive ground plane to be infinite. The potential at infinity is considered to be zero thus the potential of the plane will also be zero. If a line charge of −qlis placed at −h parallel to the first line charge ql, the electric field lines will be parallel to the normal of the plane between the two line charges thus it will give the same solution as the original problem. The problem is now reduced to find the potential from two long parallel wires with the same but opposite charge. Calculations for the electric field can be found in appendix A [5].

Below follows the electrostatic fields from a wire over a plane, the electrostatic calculation are obtained from [17] and [5]. Equation (16) shows the relation of induced voltage from an electromagnetic field and the substitution of two constants used in equation (17) and (18).

Table 3 shows the numerical value of all constants used in the numerical solution for the calculated fields.

E = −∂φ

∂t n =p

h2− a2 η =r µ0

ε0

(16)

Ez= 4√ 2P Zc

ln(h+nh−n)

n(y2− x2+ n2)

(y2+ (z + n)2)(y2+ (z − n)2) (17)

Ey= 8√ 2P Zc ln(h+nh−n)

yzn

(y2+ (z + n)2)(y2+ (z − n)2) (18) Equations (17) and (18) both describes the electric field along the z-axis and y-axis. To get the magnetic field from the calculated electric field we simply scale the each component

(27)

Table 3: Table of parameter value for Hz component calculation Parameter value

a 0.0015 m

h 0.002 m

P 0.0001 W

Zc 50 Ω

z 0.8 m

ε0 8.854187 ∗ 10−12 µ0 1.256637 ∗ 10−6

of the E-field with 1/η according to (19). Given the numerical values in table 3 where the height over the device under test is 2 mm, the amplitude is calculated and plotted in figures 8 and 8. The plots are in dB-scale calculated according to the equations in (20).

One should note the difference in amplitude from the main lobe and the two side lobes in figure 8 where the amplitude is 20dB higher directly over the wire, compared two the point with the highest amplitude on the side lobes.

Hy = 1

ηEz Hz= 1

ηEy (19)

amp = 20 log

Hy

max(Hy)

amp = 20 log

Hz

max(Hz)

(20)

Figure 8: Theoretical Hy component of magnetic field, 2mm over the test board

Figure 9: Theoretical Hz component of magnetic field, 2mm over the test board The shape of the amplitude in figure 8 is because of the direction of the y-component of the magnetic field changes direction at some distance from the wire. In figure 10 the field lines

(28)

Figure 10: E and H field over, device under test. E-field is red. H-field is red.

for both the electric field (red) and the magnetic field (green) are plotted. If one where to draw a line at some height over the wire parallel to the y axis one would see that the Hy component first is pointing towards the centre, over the wire, and at some distance from the wire, the Hycomponent will be pointing in the other direction. The plot in figure 9 becomes zero over the wire since at that point the magnetic field will only have a y-component.

6.2 Manufacturing probes and probe holder

A h-field probes design includes a loop connected to a handle. When the loop is presented to a time varying magnetic field, a voltage will be induced because of induction from the magnetic field. This voltage is then measured at the probes terminal. There exist a few different variations of probe designs, but the large part of all probe designs consist of a square or circular loop. The probes used in this report are circular. Common for all loop probes are that the loop is shielded from e-fields with a outer sheet, but a small gap is made in the outer sheet the to prevent short circuiting, see figure 13.

The design of the probes was chosen to be one of the designs presented in paper [8]. Four probe designs has been presented each working according to the same principle where a loop is used to detect a changing magnetic field through induction. A magnetic field probe needs to be shielded from any electric field such that the voltage induced from the electric field is negligible, this is further discussed in paper [10] and in section 2.2. The application the probe will be used in is to measure the near field over a PCB or alike, thus one can assume that the origin of all magnetic field source will come directly underneath the probe such that the probe will be held over the area of interest with its handle normal to the plane that the PCB lies in. The probe design is made according to the one presented in figure 13. The choice fell on this design since it will attenuate any electric field symmetric along the handle of the probe. The design of the probe is as follows, a coaxial transmission line is bent in a loop of 10mm back to the handle. The centre conductor is connected to the outer

(29)

conductor and back to the handle ”shorting” the loop. A slot is then made at the opposite side of the loop where the handle is connected thus undoing the ”shorting” and the outer conductor will only acts as a shield. The material used in making the probe is a semi-rigid coaxial cable, with the outer and inner conductor made out of copper. The diameter of the inner conductor is 1mm and the outer diameter is 3.6mm. The end of the loop was soldered back the handle. Figure 16 shows the finished made probes. The electric probe is made by stripping of the outer layer up 10mm from the probe end. Both probes are terminated with a SMA connector.

Since the amplitude of the measured H-field is dependent on the angle of the probe against the field lines, one needs to rotate the plane that the probe loop lies in 180 degrees to get the full image of the magnetic field at the measured point. To accomplish this hardware had to be design to fit a probe as well be able to rotate it. The rotator consists of three parts, a motor, an adaptor from the motor to the probe and a holder that holds the motor as well as connects to to the robotic arm. The choice of motor fell on a stepper motor because its usability to control and incorporate onto the arm since the arm has an unused stepper motor controller that could be used. The adaptor and holder where both designed in Autodesk Fusion 360 and 3D-printed. The difficulties in designing the probe rotator is that it needs to hold the probe perpendicular to the device under test.

(30)

7 Software

This chapter discuss the software that has been used in this thesis as well as the language that software has been written in. The software for using HackRF is GNU radio companion which is a open source software defined radio compatible signal processing framework. The programming language used during the development has been mainly Pyhton because its compatibility and large framework. The scripts that GNU radio companion generates are in Pyhton which this makes Pyhton the obvious choice to incorporate the GNU radio programs in other projects. More over, Pyhton has a wide range of easy to install software from the Pyhtons package installer. However the software that is running on the arm is written in the Arduino environment, a language based on C++. All 3D printed parts was designed in the Fusion 360 cad software.

7.1 G-code

G-code is the language of describing displacement of tooling machines such as a CNC mill or lathe. The language describes motions that is linear or if the tool needs to travel in an arc in a certain speed. The uArm uses G-code as well to describe its movement of the end of the arm. A G-code command specifies the kind of motion ie, linear, arc, helix, and at what speed it needs to travel. It also specifies the coordinates the tool needs to move to, either relative the current position or relative global coordinates. An example of a G-code command could look like this: G0 X10 Y20 F100, which would be translated to move in a linear motion to the coordinates (10,10) at speed 100 mm/s. The calculations of the movement itself is made in the arm. A computer sends G-code commands to the arm to what coordinates it should move to, the arm then calculates how each motor needs to move.

The stepper motor used for the probe rotator is seen as the E axis of the arm.

7.2 Arm control, communication and firmware modification

Communication with the arm goes through a serial port from the computer to the arms usb- port via a usb-cable. By default the arm communicates through its serial port at 115200 baud. The serial port is both used to send G-code commands as well as to update the firmware that runs on the microprocessor. When the arm is in operation mode it only receives data and can not be updated.

The firmware that runs on the arm is provided as open source by the uArm factory, which makes it possible for anyone to modify and compile their own version of the software and upload it to the processor on the arm. The software needed to be modified in such a way that it could use the added stepper motor for the probe rotator. The software used by the arm is a modified version of the Marlin 3D printer software [18], this software was made to control 3D printers thus it already has stepper motor driver for four axis and it is only a question of enable the E axis driver in the software. As well as to change the parameters for the stepper motor to fit the one used for the rotator. That motor is then controlled by the G-code command ’E’, e.g G0 E10 which will be interfered as move E-axis linearly 10 degrees.

(31)

7.3 Software defined radio interface and GNU radio companion

GNU radio companion is a free and open source software toolkit for signal processing blocks and interaction with software defined radios. It can be used with an external software defined radio and is compatible with most software defined radios, or it is possible to use it without any hardware and just as simulation tool. The GNU radio tool is widely used in industry, academia and by hobbyists. It provides a good base to use ready made signal processing blocks or the ability to write blocks tailored to a specific task. Some examples of blocks that is native to GNU radio is a low pass filter, a FFT transformation with a GUI.

The software defined radio used in this project is as mentioned before the HackRF one. The HackRf is only the hardware used to receive and do the bare minimum processing of the received signals to produce the I and Q data stream. The interface between the HackRF and GNU radio is a block called ”osmocom source” [19]. Osmocom is the name of the project and source means that that block produce samples, where as a sink would consume samples. The Osmocom project covers much of mobile communications such as GSM, DECT and more as an open source package. The osmocom block is used to set the parameter of the HackRF such as the sampling rate which will be the bandwidth, the centre frequency and gains of the internal amplifier of the HackRF. All though GNU radio uses Pyhton as the language of the generated files from flowgraphs and is not used as the runtime signal processing, the scheduler and all GNU radio blocks are written in C++. Pyhton is used as the interaction language as it is easy and fast to develop in. All time critical processes that are handled in the background are written in C++. A note on the the block in GNU radio that calculates the Fourier transform of the signal is that it uses a factor of 20 when calculating the power of the signal see equation 21. Where as when the amplitude of the simulation is calculated we will use a factor of 10, this is because of that the simulation software already gives the square of the amplitude.

pwr = 20 log10 Xk

ref



(21)

7.4 Simulation software

The software used to build and simulate models of the probe over a test board is the simula- tion software from 3DS, CST Simulia. CST studio suite is a tool to compute electromagnet- ics, which include several different simulation methods. Such methods are, finite integration technique, finite element method. CST Simulia has the possibility to solve problems such as strength of mechanical components, aerodynamics and in this case, calculate the solution to a model in the electromagnetic domain. The software is used to solve Maxwell’s equations to evaluate situations which that involves electrostatics and to evaluate antennas used for high frequencies. The software has the possibility to calculate in the time domain as well as in the frequency domain. The software provides tools that could be used to simulate the presence of for example a hand or head, that would be useful when simulating things like antennas that will be used in an environment with humans.

(32)

The choice of using 3Ds Simulia as simulation software was because its wide range of calcu- lation capabilities as well as from recommendations. The version of software used is the free student version. This version limits some functions of the full software, but still provides sufficient functionality to solve the necessary tasks for this thesis.

7.5 Developed software

The company that manufacturers the robotic arm does supply a program to control the arm from a computer. The program has a GUI to set and move the arm into position, as well as to turn on and off certain modes such as 3D printing or using a laser. But there does not exist a proper solution to use that program to send commands from other sources than from the GUI, and one does not have the possibility to set a position that the arm should move to. Thus a program had to be developed to be able to control the arm. The program has to be able to send all necessary G-code commands as well as listen to feedback from the arm. The result was a Class called Swift, this class handles all interactions with the robotic arm. Other scripts can then use the class by importing it as a module.

During the initialisation of the class a serial port is opened to the arm at a baud rate of 115200. When the communication has been initialised, a separate thread is created to parse received messages from the arm. It is necessary to process the received messages since the arm gives a callback when a command has been executed. The receive thread sets a flag when a command has been executed so that the next command can be sent. Otherwise all commands will be sent as soon as another script calls on a function to send a command and it is not necessarily that the previous command has been executed by the arm controller.

The class has a queue for commands that should be executed. When a function for sending a commands is called the function adds the command to the queue, when the robotic arm gives a callback that it has executed the previous command the parser gives sets a flag isExecuted such that the thread that reads the queue will send the next command to the arm.

The script used to move the probes over the test board utilises both the class Swift and the script generated by GNU radio. Both imported classes needs to be initialised before used and started in separate threads. At the same time as the arm start to move the stream of samples from the HackRF is saved in a file. When the traversing is done the file is closed and the sample stream is directed into /dev/null in the GNU radio flow graph.

Figure 11 shows the flow graph of the GRC program used. Where the osmocom source talks to the SDR which in our case is the HackRf one. Here the RF gain is set to 10 dB, IF gain to 20 dB and BB gain 20 dB as well. Then the data stream goes from the osmocom source to the WX GUI FFT sink, this block calculate and display the calculated FFT of the signal. The data stream also connects to a selector block that is controlled by a variable.

The variable has a callback and is changed from outside of the flow graph. Depending on the value of the variable the stream either goes into a null sink where the data is discarded or it goes through a block that calculates the Power FFT of the signal which is then passed through to a block that saves the stream of data to a file. The colour on the terminals of the blocks corresponds to what data type that is passed. In this case the blue corresponds to a complex number this comes from the sampled I and Q channels. The red colour corresponds

(33)

to float numbers which comes from that the Power FFT calculates the amplitude thus the value will only be real. The relevant variables that are set in the GNU radio flow graph are samp rate, centre freq, output and name. The two first variables are set respectively to 20mHz and 45mHz. The output variable is controlled from outside the GNU radio script and sets where the stream of data should go out from the ’selector’ block. The name variable is the name of the file that is saved, the name is set to be the current time to prevent different files to be overwritten when tests are conducted after each other.

Figure 11: Flow graph for GNU Radio Companion

References

Related documents

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

Both Brazil and Sweden have made bilateral cooperation in areas of technology and innovation a top priority. It has been formalized in a series of agreements and made explicit

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

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

På många små orter i gles- och landsbygder, där varken några nya apotek eller försälj- ningsställen för receptfria läkemedel har tillkommit, är nätet av

Industrial Emissions Directive, supplemented by horizontal legislation (e.g., Framework Directives on Waste and Water, Emissions Trading System, etc) and guidance on operating

echocardiography in cardiac surgery. Listing criteria for heart transplantation: International Society for Heart and Lung Transplantation guidelines for the care of cardiac