Full text
Coupling of a Powerline Communication Modem to an Industrial Fieldbus Network Jose Puche Planells Supervisor: Dipl. –Ing. Joao Daniel Lopes Universität Stuttgart Institut für Steuerungstechnik der Werkzeugmaschinen und Fertigungseinrichtungen Prof. Dr.-Ing. Dr. h.c. mult. Alexander Verl June 2014
3 Acknowledgment I would like to give special thanks to the entire institute for supporting this project during this time and especially to my supervisor Joao Daniel Lopes who always trusted me and from who I have learnt a lot. I would want also to thank to my mother and my closer family, which always are supporting me and are always aware of me. To my girlfriend Patri, who always has been there supporting me and cheering me up in the bad moments. Finally I want to thank to all my friends. Especially all these friends that I have made during the last 18 months in Stuttgart and with I have spent such incredible moments.
4
5 Table of Contents 1. Motivation ............................................................................................................... 11! 2. Industrial Communication Levels and Requirements ............................................. 13! 3. State of the art .......................................................................................................... 15! 3.1. Commercial Powerline Communication ....................................................................... 15! 3.1.1. Main issues with Powerline ................................................................................... 15! 3.1.2. Commercial Ethernet Powerline in the industrial communication ....................... 15! 3.1.3. Benefits of Powerline Communication? ................................................................ 16! 3.2. Developed Industrial Powerline Communication ......................................................... 16! 4. Design concept ........................................................................................................ 17! 4.1. FPGA-based OFDM Modem ........................................................................................ 17! 4.1.1. Orthogonal Frequency Division Multiplexing ...................................................... 17! 4.1.2. FPGA-based Powerline Modem ............................................................................ 19! 4.2. Hardware Design .......................................................................................................... 20! 4.2.1. FPGA ..................................................................................................................... 20! 4.2.2. Analog-to-Digital and Digital-to-Analog Transceiver Boards .............................. 23! 4.2.3. High Frequency Modulation Boards ..................................................................... 25! 4.2.4. Coupling/Decoupling Circuitry ............................................................................. 29! 4.3. Software Design ............................................................................................................ 31! 4.3.1. FPGA-Based Transceiver Program Structure ....................................................... 31! 4.3.1.1. Theoretical Introduction .............................................................................................. 32! 4.3.1.2. Data Source .................................................................................................................. 36! 4.3.1.3. Cyclic Redundancy Check ........................................................................................... 37! 4.3.1.4. Convolutional Encoding .............................................................................................. 37! 4.3.1.5. Interleaver .................................................................................................................... 38! 4.3.1.6. Modulation ................................................................................................................... 39! 4.3.1.7. Zero Padding ................................................................................................................ 40! 4.3.1.8. Fast Fourier Transform ................................................................................................ 42! 4.3.1.9. Preamble and Prefix ..................................................................................................... 43! 4.3.1.10. Receiver Synchronisation .......................................................................................... 43! 4.4. Ethernet POWERLINK and B&R System ................................................................... 44! 4.4.1. Ethernet ................................................................................................................. 44! 4.4.2. Protocol Description .............................................................................................. 44! 4.4.2.1. POWERLINK v1 vs. POWERLINK v2 ...................................................................... 45! 4.4.3. B&R System Description ...................................................................................... 46! 4.4.3.1. Hardware topology ...................................................................................................... 46! 4.4.3.2. Software ....................................................................................................................... 48! 4.4.4. Real-Time System Configuration .......................................................................... 48! 4.4.4.1. Network Configuration ................................................................................................ 49! 4.4.4.2. Ethernet POWERLINK Parameters ............................................................................ 49! 5. Ethernet POWERLINK over Powerline .................................................................. 51! 5.1. Ethernet and Media Independent Interface ................................................................... 51! 5.2. Coupling Principle ........................................................................................................ 53! 5.3. Software Designs .......................................................................................................... 53! 5.3.1. Ethernet Coupling Design ..................................................................................... 53! 5.3.1.1. Receiver_ethernet block .............................................................................................. 54! 5.3.1.2. Transmitter_ethernet block .......................................................................................... 55! 5.3.2. Additional Designs ................................................................................................ 55! 5.3.2.1. Latency Measurement .................................................................................................. 56! 5.3.2.2. Data Rate Measurement ............................................................................................... 56! 5.4. System Implementation ................................................................................................ 56! 5.4.1. Software ................................................................................................................. 56!
6 5.4.1.1. Migrating and Merging ................................................................................................ 56! 5.4.1.2. Ethernet Coupling ........................................................................................................ 57! 5.4.2. Hardware ............................................................................................................... 62! 5.4.2.1. Channel Response ........................................................................................................ 62! 5.4.2.2. Baseband Analysis ....................................................................................................... 62! 5.4.2.3. Channel Access Management ...................................................................................... 64! 5.4.2.4. Fine Tuning .................................................................................................................. 71! 6. Results and Discussions ........................................................................................... 75! 6.1. Signal-to-Noise Ratio Measurements ........................................................................... 75! 6.2. Constellations ............................................................................................................... 76! 6.3. Latency Measurements ................................................................................................. 77! 6.4. Ethernet Connection Analysis ...................................................................................... 78! 6.4.1. Ethernet POWERLINK Runtime .......................................................................... 81! 7. Conclusions and Further Development ................................................................... 83! 8.!Bibliography and References ................................................................................... 85!
7 Table of Figures Figure 1: Industrial Communication levels .............................................................................. 13! Figure 2: Commercial Powerline Systems ............................................................................... 15! Figure 3: dSpace Communication over Industrial PLC ........................................................... 16! Figure 4: FDM vs. OFDM ....................................................................................................... 18! Figure 5: OFDM Transmitter ................................................................................................... 19! Figure 6: OFDM Receiver ....................................................................................................... 19! Figure 7: Transceiver Stages .................................................................................................... 20! Figure 8: Terasic DE2-115 Development Board ..................................................................... 21! Figure 9: DE2-115 Features ..................................................................................................... 21! Figure 10: Altera Cyclone IV Features .................................................................................... 22! Figure 11: Marvell 88E1111 Ethernet Controller .................................................................... 22! Figure 12: HSMC ..................................................................................................................... 23! Figure 13: Transceiver Board ................................................................................................... 24! Figure 14: High Frequency Board ............................................................................................ 26! Figure 15: Transceiver Stages .................................................................................................. 28! Figure 16: Non-Inverter and Inverter Configurations .............................................................. 28! Figure 17: Coupling Board Design .......................................................................................... 29! Figure 18: Coupling Stages ...................................................................................................... 30! Figure 19: LC Resonator .......................................................................................................... 30! Figure 20: Schottky Diodes Circuit .......................................................................................... 31! Figure 21: Transmitter and Receiver Blocks ........................................................................... 32! Figure 22: Transceiver Software Stages .................................................................................. 32! Figure 23: BPSK vs. 16QAM Bits ........................................................................................... 35! Figure 24: BPSK vs. 16QAM Effective Data .......................................................................... 35! Figure 25: BPSK vs. 16QAM Sampling Rate .......................................................................... 36! Figure 26: BPSK vs. 16QAM Data Frequency ........................................................................ 37! Figure 27: Without Interleaving vs. with Interleaving ............................................................. 38! Figure 28: BPSK vs. 16QAM constellation ............................................................................. 39! Figure 29: Binary vs. Gray ....................................................................................................... 39! Figure 30: Ideal filtering .......................................................................................................... 40! Figure 31: Real filtering ........................................................................................................... 41! Figure 32: Periodic signal representation ................................................................................. 41! Figure 33: Zero Padding "in the Middle" ................................................................................. 42! Figure 34: 8-Point FFT ............................................................................................................. 43! Figure 35: Ethernet frame ........................................................................................................ 44! Figure 36: Network topologies ................................................................................................. 45! Figure 37: POWERLINK v1 cycle .......................................................................................... 46! Figure 38: POWERLINK v2 cycle .......................................................................................... 46! Figure 39: B&R system ............................................................................................................ 47! Figure 40: POWERLINK over Powerline implementation ..................................................... 51! Figure 41: MII Board configuration ......................................................................................... 52! Figure 42: Transmitter Ethernet signals ................................................................................... 52! Figure 43: Receiver Ethernet signals ....................................................................................... 53! Figure 44: Receiver_ethernet block ......................................................................................... 54! Figure 45: Transmitter_ethernet block ..................................................................................... 55! Figure 46: Ethernet Data storage stage .................................................................................... 58! Figure 47: Ethernet Data Treatment Stage ............................................................................... 58! Figure 48: Ethernet Data .......................................................................................................... 58! Figure 49: OFDM Transmission packet ................................................................................... 59! Figure 50: Word Stuffing ......................................................................................................... 61! Figure 51: Channel Response ................................................................................................... 62! Figure 52: Evaluation board ..................................................................................................... 63!
8 Figure 53: Receiver amplification stage .................................................................................. 63! Figure 54: ADP-2-1 electrical schematic ................................................................................. 65! Figure 55: Coupling board with ADP-2-1 ............................................................................... 66! Figure 56: Direction switching block ....................................................................................... 66! Figure 57: MSWA-2-20 electrical schematic .......................................................................... 67! Figure 58: Output selection logic ............................................................................................. 67! Figure 59: LM258 Pulse Response .......................................................................................... 68! Figure 60: TLC072A Pulse Response ...................................................................................... 69! Figure 61: Switching board ...................................................................................................... 69! Figure 62: Coupling Board one port ........................................................................................ 70! Figure 63: New coupling schematic ......................................................................................... 70! Figure 64: Switch Control signal vs. Data signal ..................................................................... 70! Figure 65: Transmitter stages ................................................................................................... 71! Figure 66: Transmitter Amplification stages configuration ..................................................... 71! Figure 67: Transmission gains ................................................................................................. 72! Figure 68: Receiver stages ....................................................................................................... 72! Figure 69: Receiver Amplification stage configuration ........................................................... 72! Figure 70: Reception gains ....................................................................................................... 73! Figure 71: Signal-To-Noise Ratio at transmission ................................................................... 75! Figure 72: Signal-to-Noise Ratio at reception ......................................................................... 76! Figure 73: Transmitted Constellation vs. Received Constellation ........................................... 77! Figure 74: Wireshark Capture - POWERLINK cycle .............................................................. 78! Figure 75: Wireshark Capture - POWERLINK flow graph ..................................................... 79! Figure 76: Ethernet POWERLINK analysis ............................................................................ 79! Figure 77: Managing Node Ethernet information .................................................................... 80! Figure 78: Controlled Node Ethernet information ................................................................... 80! Figure 79: PReq Frame Data .................................................................................................... 80! Figure 80: PRes Frame Data .................................................................................................... 81! Figure 81: Managing Node configuration ................................................................................ 82! Figure 82: Controlled Node configuration ............................................................................... 82!
9
16 Although the commercial Powerline Communication systems achieve higher data transfer rates (higher than Fast-Ethernet in some cases), the achieved latency, jitter and cycle times are not enough small to be applicable for most industrial communications, where the real-time data transmission is essential. 3.1.3. Benefits of Powerline Communication? The main benefit is the flexibility. With Powerline Communication the communication network can be established between two far away points (e.g. in large assembly lines) without need of extra cables, only the power supply cables. The robustness of the power line cables is also higher than conventional communication cables, which, on industrial environment, is a factor to take into account. 3.2. Developed Industrial Powerline Communication The basis of this project was the implementation of a Powerline Communication system to command a drive through a dSpace Controller board, the DS1103 and two developed Powerline modems. Figure 3: dSpace Communication over Industrial PLC These Powerline modems were based on a DBF3C120 board with a FPGA Altera Cyclone III integrated, a transceiver board with analog-to-digital and digital-to-analog (DAC and ADC) converters and a high frequency board (HF board). This communication was unidirectional, i.e. the communication was only to command the drive but not to read any information from it. This implementation presents a limitation; it can only be used with a dSpace system, which is not an industrial communication standard [2]. Data
17 4. Design concept In this chapter the concept of the existing Industrial Powerline Communications modem as well as the target system will be explained. Here are included, the hardware, the software, the Ethernet POWERLINK protocol and the B&R System descriptions. 4.1. FPGA-based OFDM Modem Transmitting digital data through a conventional DC cable, where different signals at different frequencies and voltages are being also transmitted, is more difficult than transmitting through an Ethernet cable. The data must be processed in order to avoid mixing it with unwanted signals. To process the digital information on an analog carrier signal, an Orthogonal Frequency Division Multiplexing (OFDM) with modulation in amplitude modem is designed. The result signal can be further transmitted easily through different communication channels, e.g. cable, air, fiber, or in the project case, a DC cable. 4.1.1. Orthogonal Frequency Division Multiplexing Orthogonal Frequency Division Multiplexing is a technique for multiplexing several signals into one channel, which means, sending several signals at the same time each one in a different frequency. Its main principle is grounded in the Frequency Division Multiplexing techniques (FDM) but with the objective of the efficient use of the available spectrum for transmitting multiple subcarrier frequencies. With FDM several signals (or subcarriers) with a determined bandwidth and in a determined central frequency are transmitted. Both bandwidth and central frequency are chosen specifically for the transmission channel. FDM techniques are designed to divide the available spectrum in smaller frequency signals instead of transmitting a unique wide bandwidth signal. With this technique it is possible to adapt the signal to the transmission channel, compared with a single carrier method, by equalizing the different signals to the channel response. That means transmitting each subcarrier with slightly different characteristics to adapt it to the frequency that is going to be transmitted through. To this purpose, it is needed a previous channel estimation. The OFDM is a concrete case of FDM, with better usage of the available bandwidth. This better usage will allow more subcarriers in the same bandwidth to be transmitted, and thus, higher data rate. The main difference with the FDM is that the frequencies that are used for multiplexing the different signals are closer, achieving a higher spectral efficiency of the available bandwidth. This is achieved thanks to the orthogonality of the transmitted subcarriers. As a result the crosstalk between subcarriers is theoretically eliminated and the inter-carrier guard band is in not required.
18 The orthogonality requires a minimum spacing between two consecutive subcarriers of ∆𝑓= 1 𝑇 !𝐻𝑧 (1) Where T is the symbol duration. Therefore, with N subcarriers, the total bandwidth will be 𝐵𝑊 =𝑁!×!∆𝑓 (2) In the case of FDM technique, is needed a spacing of ∆𝑓= 2 𝑇 !𝐻𝑧 (3) Therefore the subcarriers are not orthogonal to each other and a guard band is needed to avoid channel crosstalk. The total bandwidth needed to transmit the same amount of subcarriers is then twice as with the OFDM. The total bandwidth for the project is set to 10 MHz and the number of OFDM subcarriers is set to 32. This means that each subcarrier must have a bandwidth of ∆𝑓= 𝐵 𝑁 =! 10!𝑀𝐻𝑧 32 =312.5!𝐾𝐻𝑧 (4) 𝑇!"#$%& = 1 ∆𝑓=3.2!𝜇𝑠 (5) In band base, the total bandwidth of 10MHz signal is generated in two 5 MHz channels. These are In-Phase channel and In-Quadrature channel. After generating these two signals, a signal modulator modulates both signals in Quadrature at the defined carrier frequency of 100 MHz. In the next pictures both FDM and OFDM in band base are depicted. It is clear the difference in terms of subcarriers for a given bandwidth. Figure 4: FDM vs. OFDM In left picture, a FDM multiplexing scheme is used, and for a given bandwidth of 10 MHz (from -5 to +5 MHz), 16 subcarriers are transmitted. In the right picture, an OFDM multiplexing scheme is used and for the same bandwidth, 32 subcarriers are transmitted because the separation between them is reduced to the half.
19 In terms of digital signal codification, first the Binary Phase Shift Keying (BPSK) modulation was implemented. To achieve more efficient data transmission, and thus a higher data rate, a 16-Quadrature Amplitude Modulation (16-QAM) was finally implemented. The following schematics offer an overview of the system: Figure 5: OFDM Transmitter Figure 6: OFDM Receiver Where the constellation mapping generates the BPSK or 16QAM symbols, the 𝐹𝐹𝑇!! and 𝐹𝐹𝑇 blocks indicate the Inverse Fast Fourier Transform and Fast Fourier Transform, essential blocks for the OFDM, 𝑓 ! indicates the carrier center frequency of 100MHz, and 𝑠𝑡!and 𝑟!(𝑡) represent sent signal and received signal respectively [3]. 4.1.2. FPGA-based Powerline Modem To implement the described characteristics, a device that has the capabilities of digital signal processing is needed. For this purpose a Field Programmable Gate Arrays (FPGA) system was chosen. An FPGA is an integrated circuit built with logic blocks that can be programmed by a designer for a desired functionality. This kind of devices is called Programmable Logic Devices (PLD), and unlike the Relay Logic Devices, which once that is implemented cannot be changed, PLDs allow that changes can be easily made. These devices are perfect for implementation of new features and make the tasks of developing, debugging and updating easier. Furthermore, the provided development boards included several ports which are needed for the implementation, e.g. Ethernet port, HSMC port as well as switches, LEDs,
20 LCD display etc. Everything together makes the FPGA development board the perfect choice for the purpose [4]. For the implementation of the hardware, a Hardware Description Language (HDL), and a development environment must be used. In the project the VHDL language and the Altera Quartus II environment are used. Altera offers a complete solution to design, program and optimize the desired system. In the design process, an Altera’s offered solution plays an important role, the Altera MegaCore IP Library. The IP (Intellectual Property) Cores are blocks previously designed to implement complex functions in an easier way, e.g. Cyclic Redundancy Check (generator and checker), Triple-Speed Ethernet with MAC support, Viterbi decoder etc. This device and its capabilities as well as the used software will be described during the two sections of this chapter, the hardware design and software design sections. 4.2. Hardware Design The hardware is one of the two essential parts of the system. A proper implementation of the specification into hardware as well as the maximum optimization thereof, will play an important role in the global performance of the system, i.e. minimum Bit Error Rate, maximum Signal to Noise Ratio etc. Figure 7: Transceiver Stages On the hardware side the following parts are described: ! FPGA – OFDM Signal Processor. ! AD/DA Transceiver Board. ! High Frequency Modulation Board. ! Coupling/Decoupling Circuitry. All these parts together make the whole Powerline system. 4.2.1. FPGA The FPGA is the core of the OFDM modem. Its task is to generate the proper OFDM digital signals and send it further to the Digital-to-Analog converter, as well as receive the digital signals from the Analog-to-Digital converter and processing it. The development board used is the Terasic DE2-115 with the Altera Cyclone IV chip. This board provides different solutions for multiple needs.
21 Figure 8: Terasic DE2-115 Development Board Some of the features that are included are here illustrated: • Altera Cyclone IV 4CE115 FPGA device • Altera Serial Configuration device • USB Blaster (on board) • 2MB SRAM • Two 64MB SDRAM • 8MB Flash memory • SD Card socket • 4 Push-buttons • 18 Slide switches • 18 Red user LED and 9 Green user LEDs • 50 MHz external oscillator • 24-bit CD-quality audio CODEC • VGA DAC • 2 Gigabit Ethernet PHY with RJ45 connectors • USB Host/Slave • RS-232 transceiver and 9-pin connector • PS/2 mouse/keyboard connector • IR Receiver • 2 SMA connectors for external clock input/output • One 40-pin Expansion Header with diode protection (GPIO) • One High Speed Mezzanine Card (HSMC) connector • Eight 7 segments displays • 16x2 LCD module • TV Decoder Figure 9: DE2-115 Features For the project, the most important characteristics of this development board are the Cyclone IV 4CE115 FPGA device, the Gigabit Ethernet PHY Port, the High Speed Mezzanine Card (HSMC) connector, the switches and buttons and the LCD Display [5]. Altera Cyclone IV 4CE115 FPGA device The core of the board is the Altera Cyclone IV EP4CE115 C7. This device contains the programmable logic blocks inside. It has been chosen to meet the required specifications for the purpose [6].
22 EP4CE115 Logic elements (LEs) 114,48 Embedded memory (Kbits) 3,888 Embedded 18 × 18 multipliers 266 General-purpose PLLs 4 User I/O Banks 8 Maximum user I/O 528 Figure 10: Altera Cyclone IV Features Gigabit Ethernet PHY Port The Terasic DE2_115 board provides Ethernet support via two Marvell 88E1111 Ethernet PHY controllers. These controllers are connected each one to a different Ethernet port installed on the board. Both controllers include 10/100/1000 Mbps Gigabit Ethernet transceiver and support GMII/MII/RGMII/TBI MAC interfaces. Nevertheless for the given board only MII and RGMII modes are supported. The selection of the operation mode is easily accessible through two jumpers provided on the board, JP1 and JP2, which allow the selection the mode for both ports independently. In the next figure, the connections between the FPGA and one Ethernet port, through the Marvell controller, are depicted [5]. Figure 11: Marvell 88E1111 Ethernet Controller High Speed Mezzanine Card (HSMC) connector The HSMC interface provides the Terasic DE2-115 board a mechanism for extending the peripheral-set by means of add-on cards. This can couple high speed signalling requirement as well as with low-speed device interface support. The HSMC connector connects directly to the Cyclone IV FPGA with 172 pins. The voltage level of the I/O pins on the HSMC
23 connector can be adjusted to 3.3V, 2.5V, 1.8V or 1.5V for matching the required digital voltages level using a provided jumper on the FPGA. Since the designed boards work with 3.3V logical levels, this option must be selected. Figure 12: HSMC The connector provides 3 independent signal banks. Each bank provides clock signals in both directions. Bank 1 has a dedicated JTAG and a system management bus (SMBus) and 8 channels CDR in both directions. Banks 2 and 3 have 12V and 3.3V power supply pins and provide 60 differential channels or 120 single-ended I/O pins. For the project case, this connector is essential for the connection between the FPGA board and the transceiver board. This connection is possible thanks to a developed adapter board, which provides the connections between the HSMC port and the provided DBF ports on the transceiver boards [7]. 4.2.2. Analog-to-Digital and Digital-to-Analog Transceiver Boards Each FPGA board has to be able to send and receive digital signals. After generating the OFDM signals, in order to be modulated and transmitted to the channel, the signals have to be converted first into analog signals. Also, the received demodulated signals have to be converted to digital signals in order to be interpreted by the FPGA board. To achieve these goals, a transceiver board was developed. This board provides two independent channels of communication, one in each direction. The main features of the designed board are: ! Digital-to-Analog converter for transmitter side, symmetrical analogic output AD9765, up to 40 MSPS. ! Analog-to-Digital converter for receiver side, symmetrical analogic input AD9248, up to 40 MSPS. ! Connectivity with dSpace system. ! Testing jumpers and measure points.
24 The layout of the board is showed and described in the next figure: Figure 13: Transceiver Board In the layout, the transmitter and receiver parts are distinguished and delimited by the vertical blue line, transmitter on the right side, receiver on the left side. The board needs positive and negative external power sources between 6.5 and 30V for positive and between -6.5 and -30V for negative (the needed voltage supply for the components is 3.3V and 5V and the regulators’ datasheet specify a max dropout voltage of 1.5V and a absolute maximum of 30V). Connections to the FPGA board are possible thanks to the Adapter Interface and the adapter board mentioned before. The pins of the Analog-to-Digital converter and Digital-to- Analog converter are connected to these two interfaces. Connections to the High Frequency boards are possible thanks to the 8 SMA connectors, 4 on the transmitter side and 4 on the receiver side [8]. SMA Connectors Analog connection for transmitting and receiving signals to/from the High Frequency Boards. These connectors offer 50Ω characteristic impedance and a maximum frequency of 18 GHz for the connection of a coaxial cable.
25 Analog Devices AD9765 12-Bit 125 MSPS Dual TxDAC+ Digital-to-Analog Converter with 50Ω characteristic impedance. This dual Digital-to-Analog converter is chosen due to the need of transmitting In-Phase and In-Quadrature signals of the OFDM. 3.3V logic voltage is supported. The main applications of this component are in Communications, Quadrature Modulation, Digital Synthesis and others [9]. Analog Devices AD9248 14-Bit Dual Analog-to-Digital Converter with 50Ω characteristic impedance. Available in 20,40 and 65 MSPS. Currently used the 40 MSPS version. This dual Analog-to-Digital converter receives the In-Phase and In-Quadrature single-ended analog signals, provided by the AD8138, and converts it into digital signals [10]. Analog Devices AD8138 Low distortion differential ADC Driver with 50Ω characteristic impedance. The modulator needs a differential signal input centered on a 500mV DC, thus a driver and proper resistors are needed. Therefore, on the transmitter side, transmitted signal must be converted from single-ended to differential in order to be modulated. On the receiver side, received signal must be converted from differential to single-ended in order to do the sampling [11]. Mini-Circuits SXLP-4.7+ The SXLP-4.7+ is a surface mount Low-Pass Filter with stop frequency of 4.7 MHz with 50Ω characteristic impedance [12]. Adapter Interface For the transmission of the digital signals from the FPGA to the Digital-to-Analog converters and from the Analog-to-Digital converters to the FPGA an interface is needed. For this purpose a DBF connector is used, due to the former system, which used a DBF3C120 board. DSpace Interface and Voltage Converter This interface provides communication between the FPGA board and the dSpace system. 4.2.3. High Frequency Modulation Boards After generating the base band In-Phase and In-Quadrature signals, the signals have to be modulated at the desired working frequency. To the project case, this frequency is 100 MHz. A modulation is the process of changing the properties of a periodic signal, which is called carrier signal, with a modulating signal, which contains the information to be transmitted. The main aims of modulating the signal to upper frequencies are adapting the signal to the channel
32 Figure 21: Transmitter and Receiver Blocks The blocks showed before work with the 50 MHz signal clock provided by the FPGA circuitry. Furthermore, taster (to power up and to start the transmission) and reset signals are assigned to switches and buttons placed in the Terasic development board. Figure 22: Transceiver Software Stages During this section, the different blocks of the system will be explained through the ground theory of the transmission. There are two signal treatments along the system. First, a treatment of the raw data, including data packaging, error prevention and modulation, where data still has a digital meaning. Secondly, after the modulation block, modifications of the signal with the aim of constructing the analog subcarriers and the OFDM symbols to be transmitted. 4.3.1.1. Theoretical Introduction The initial communication protocol of this Powerline Communication system was developed for dSPACE. DSPACE is a company that offers different hardware and software solutions to accelerate the development of complex control systems with ease in a vast amount of industries. In the former system design, a dSPACE DS1103 Controller board was available in one computer. This Controller board was used to command a drive with a second dSPACE system. Both dSpace systems were connected to each FPGA through the dSPACE Interface of the Transceiver board. The process consisted in writing the desired information in real-time to
33 the FPGA to command the drive that is placed at the other side of the Powerline channel. The dSPACE also had the function of controlling the quality of the reception. Hence the communication between the dSPACE system and the FPGA was bidirectional. This system had a working frequency of 32 kHz, and the OFDM system should be designed according to this working frequency. That means that the cycle time of the communications should be according, !𝑇!"!#$ = 1 𝑓= 1 32!𝑘𝐻𝑧 =31.25!𝜇𝑠 (12) This cycle time value will define the number of data OFDM symbols and also the maximum data rate for a given modulation. In this case, as described at the OFDM description section in equation 5, the symbol duration is 3.2µs. For the proper symbol detection and to avoid Intersymbol Interference (ISI), a guard time between symbols is inserted. This guard time is established as 𝑇 !"#$% =! ! !×!𝑇!"#$%& =0.8!𝜇𝑠. (13) Then the total OFDM symbol duration is 𝑇!"#$ =𝑇!"#$%& +𝑇 !"#$% =4!𝜇𝑠. (14) Then, the maximum OFDM symbols are 𝑁!"#$%&! =!!".!"!!" !!!" =7.8125 →7!𝑂𝐹𝐷𝑀!𝑠𝑦𝑚𝑏𝑜𝑙𝑠. (15) Apart from data symbols, training symbols for the channel estimation and equalization are needed. These symbols have the same duration as the data symbols. In this case, 5 symbols are transmitted. Data symbols will transmit data, training symbols have two purposes, one symbol is for frame synchronization, and the other is for the channel estimation. Data symbols are generated by gathering and packing codified streams of transmitted bits.!The need of transmitting training symbols has as side effect a reduced net data rate [2]. To codify the transmitted bits into analog signals in order to increase the data rate, a digital modulation scheme is used. A digital modulation allows the transmission of several bits into one analog signal by modifying an analog carrier signal. Several types of digital modulations are available: ! Phase Shift Keying (PSK): Symbols are represented by changes in the phase of the signal. ! Frequency Shift Keying (FSK): Symbols are represented by changes in the frequency of the signal. ! Amplitude Shift Keying (ASK): Symbols are represented by changes in the amplitude of the signal.
34 ! Quadrature Amplitude Modulation (QAM): Symbols are represented by changes in the amplitude of two quadrature signals. In the design, two codification schemes are available: Binary Phase Shift Keying (BPSK) and 16 Quadrature Amplitude Modulation (16-QAM) [20]: ! Binary Phase Shift Keying (BPSK): BPSK is the simplest form of Phase Shift Keying modulation. In this modulation, only two different codified symbols can be transmitted, “0” and “1”, represented with a phase of 0° and 180° respectively. BPSK is the digital modulation with highest Signal to Noise Ratio (SNR) and lowest Bit Error Rate (BER) because the symbols are far away from each other. The BPSK is also the less efficient because only transmits 1 bit per symbol. ! 16 Quadrature Amplitude Modulation (16QAM): QAM is a form of Amplitude Shift Keying, but instead of transmitting one signal, two signals are transmitted at the same time: In-Phase and In-Quadrature signals. In 16- QAM, two amplitude signals with 4 different amplitude levels each one are transmitted. Each level of each signal represents two bits “00”, ”01”, “10” and “11”. Combining both signals, a maximum number of 16 possible codified symbols are achieved. Thus the efficiency increases compared to BPSK up to 4 bits per symbol. The!modulation!used!is!essential!for!the!system!design,!and!must!be!adapted!to!meet!the! required! data! rate! for! the! application.! In this case, as specified in the OFDM modem description, 32 subcarriers along the 10 MHz bandwidth are available and 5 OFDM data symbols are transmitted. The maximum number of transmitted codified symbols on each cycle time is defined by these two parameters: 32!𝑠𝑢𝑏𝑐𝑎𝑟𝑟𝑖𝑒𝑟𝑠!×!5!𝑂𝐹𝐷𝑀!𝑠𝑦𝑚𝑏𝑜𝑙𝑠 =160!𝑐𝑜𝑑𝑖𝑓𝑖𝑒𝑑!𝑠𝑦𝑚𝑏𝑜𝑙𝑠 (16) ! The! advantage! of! the! 16QAM! modulation! over! the! BPSK! modulation! is! clear,! because! 16QAM!transmits!4!bits!each!symbol!whereas!BPSK!transmits!only!1!bit.!! ! Therefore,!in!BPSK!the!amount!of!bits!transmitted!each!cycle!time!is:! ! 𝑁!"#$!!"#$ =𝑆𝑦𝑚𝑏𝑜𝑙𝑠!×𝐵𝑖𝑡𝑠 𝑆𝑦𝑚𝑏𝑜𝑙 =160!𝑏𝑖𝑡𝑠 (17) Meanwhile in 16QAM is: 𝑁!"#$!!"!"# =𝑆𝑦𝑚𝑏𝑜𝑙𝑠!×𝐵𝑖𝑡𝑠 𝑆𝑦𝑚𝑏𝑜𝑙 =640!𝑏𝑖𝑡𝑠 (18) In each cycle time more data, apart from the desired data, is transmitted. A 16 Cyclic Redundancy Check (16CRC) block for frame checking as well as a Convolutional Encoder block for adding redundancy are added. That means that the effective number of bits is lower than the calculated above. The 16CRC block adds a 16-bit word to the data, and the Convolutional Encoder has a coding rate of!! !, meaning that for one bit of raw data, two bits
35 are transmitted. Both blocks are described in later lines. Therefore, for each modulation the following number of brute and effective bits are transmitted each cycle time: Modulation Number of Brute Bits Effective Bits Data Rate BPSK 160 80 2.56 Mbits/s 16QAM 640 320 10.24 Mbits/s Figure 23: BPSK vs. 16QAM Bits The data is processed in words of 16 bits, then, 𝑁!"#$%!!"#$ = 80 16 =!5!𝑤𝑜𝑟𝑑𝑠!!!,!!!𝑁!"#$%!!"!"# = 320 16 =!20!𝑤𝑜𝑟𝑑𝑠 (19) In both cases, one word is reserved to transmit the 16CRC, so the effective parameters are: Modulation Effective Bits Total Words Data Words Effective Data Rate BPSK 80 5 4 2.048 Mbits/s 16QAM 320 20 19 9.728 Mbits/s Figure 24: BPSK vs. 16QAM Effective Data After modulating the signal, the modem must build the different subcarriers that will conform the final OFDM signal. The core of the OFDM is the Discrete Fourier Transform (DFT) and Inverse Discrete Fourier Transform (IDFT) performed by the high efficient algorithms Fast Fourier Transform (FFT) and its inverse (IFFT). These are two computational algorithms used in signal theory to change between time-domain and frequency-domain signals. The signal from modulation block is time-domain, but to construct the OFDM signal, different subcarriers have to be differentiated by the IFFT. Therefore, the modulated signals are mapped in frequency domain and later converted to time-domain signals with the IFFT algorithm. Since the FFT algorithms work on streams with lengths of power of two, some zeros should be added to each data symbol. The length of the FFT (NFFT) is a key value to the system. The following relationship must be always kept: 𝑆𝑎𝑚𝑝𝑙𝑒!𝑅𝑎𝑡𝑒!(𝐻𝑧) 𝑁!!" = 𝐵𝑎𝑛𝑑𝑤𝑖𝑑𝑡ℎ!(𝐻𝑧) 𝑆𝑢𝑏𝑐𝑎𝑟𝑟𝑖𝑒𝑟𝑠 =! 1 𝑇!"#$%& (20) Since 32 subcarriers and a bandwidth of 10 MHz are specified, both sample rate and FFT points are variables to be chosen. For the purpose, as described in hardware design part of this
36 chapter, a 40 MSPS Analog-to-Digital converter is used, which limits the maximum sample rate to use. For each modulation, the chosen sampling rate and the points of the FFT are in the next table specified: Modulation NFFT Sampling Rate BPSK 64 20 MSPS 16QAM 128 40 MSPS Figure 25: BPSK vs. 16QAM Sampling Rate Hence, the working frequency of each BPSK and 16QAM program will be 20 MHz and 40 MHz respectively. To generate the required frequency, an Altera’s PLL MegaCore block is used. This block can be configured to take the 50 MHz signal from the circuitry and modify it to obtain a clock signal with a different frequency. This PLL block also allows implementing more than one output independent clocks for a given input. As defined before, the main characteristic of an OFDM modem is the transmission of several orthogonal subcarriers to increase the spectral efficiency. Sometimes can occur, that the orthogonality between both signals is lost, due to the non-ideal channel characteristics. Losing the orthogonality will cause Inter Symbol Interference (ISI). To avoid this effect, a cyclic prefix is added at the beginning of each OFDM symbol as guard interval. Furthermore, as described at the OFDM symbols definition, there are the two training symbols introduced after adding the cyclic prefix. The first training symbol is a preamble symbol, and it is necessary to the proper synchronisation of the receiver. This symbol just transmits a complete OFDM symbol with zeros in order to detect the peak of power when the data is received. To avoid Inter Symbol Interference (ISI) caused by time-shift between symbols, cyclic prefixes before each data symbol are added. These prefixes are added in the reserved guard interval time. If the time shift between symbols is shorter than the guard time, the ISI is completely removed. 4.3.1.2. Data Source The first designed block is the data source of the program. In this case, a known sequence stored in a local file is transmitted. This sequence contains data with values from 0x0000 to 0xFFFF. This block will send 16-bit words from the local file to the next block at a fixed frequency. This sending frequency is determined by the modulation scheme and the cycle time used. 𝑇!"#$ =! 𝑇!"!#$ 𝐷𝑎𝑡𝑎!𝑊𝑜𝑟𝑑𝑠 !𝑠!!!,!!!𝑓 !"#$ =! 1 𝑇!"#$ = 𝐷𝑎𝑡𝑎!𝑊𝑜𝑟𝑑𝑠 𝑇!"!#$ !𝐻𝑧 (21)
37 Modulation Data Words Sending Frequency BPSK 4 0.128 MHz 16QAM 19 0.608 MHz Figure 26: BPSK vs. 16QAM Data Frequency To generate this frequency, another output clock of the implemented PLL block with the convenient ratio is activated. After generating the symbols at the sending frequency, these are stored in a RAM module to be read afterwards at working frequency of the system, defined before in FFT description. At the receiver side, the received data is compared with the data stored in a RAM module, which is identical to the transmitted data. A counter will be incremented by one every time a received bit does not match with the stored bit. 4.3.1.3. Cyclic Redundancy Check Next to the Data Source block, a Cyclic Redundancy Check (CRC) generator block is implemented. The CRC is a commonly used method to help the receiver to check if there is some data corrupted. The block generates a code, based on the previous Data Words of the same cycle and then adds this code as the last 16-bit word of the transmission. The receiver, once it has received all the data words in one cycle, calculates the CRC and compares the result with the given CRC value from the transmitter in the last word. The block has inside an error counter, which is incremented by one every time the CRC calculated is not the same as the value received in the last block and CRC valid and CRC bad output signals, which are asserted to indicate if the CRC is valid or not. To generate the value, successive modulo 2 divisions on the data stream are performed, storing the remainder. In these divisions, the received data is divided by a 17-bit word “11000000000000101” defined by the polynomial!𝑥!" +𝑥!" +𝑥!+1. To perform this calculation in both directions the Altera CRC Compiler MegaCore is available. The IP Core permits different configurations, e.g. configure it as CRC generator or CRC checker, the number of channels, the data width or the CRC code. In this block, a parallel to serial conversion is also performed. This is done because the next block needs serial data in order to do the convolutional encoding [21]. 4.3.1.4. Convolutional Encoding Since the transmission channel is not ideal, distortions over the signal can be produced. For bit error detection and correction, a convolutional encoding method is used. In the transmitter part, the incoming bit stream of length L is transformed into another of length M, where M is greater than L. The output stream depends on the input at the current cycle and also on the input of the previous cycle.
38 In the receiver part, for error correction, a Viterbi error correction algorithm is used. It is based on maximum likelihood principle, which is a statistical model that can estimate the most probable message given a received sequence. For implementing this feature, the Altera Viterbi IP MegaCore is available. 4.3.1.5. Interleaver As a complement of the convolutional encoding, an interleaver is also implemented. Its main goal is to prevent burst errors in detection due to long duration noise. Interleaving a message is a way of organizing the transmitted digital information, changing the order, and spreading several parts of the message along a defined stream of bits, making the detection easier. The difference between a non-interleaved transmission and an interleaved transmission that is affected by noise is shown in the next tables: Without interleaving Message: aaaabbbbccccddddeeeeffffgggg Message sent: aaaabbbbccccddddeeeeffffgggg Message received: aaaabbbbccc____deeeeffffgggg With interleaving Message: aaaabbbbccccddddeeeeffffgggg Message sent: abcdefgabcdefgabcdefgabcdefg Message received: aaaabbbbccc____deeeeffffgggg Message reordered: aa_abbbbccccdddde_eef_ffg_gg Figure 27: Without Interleaving vs. with Interleaving In the first case, the most part of the message “dddd” is not properly detected due to the noise. However in the interleaved case, only one bit is missing in each part of the message, so it can be rebuilt with the error correction techniques. To implement the technique at the transmitter side, a RAM stores the desired data and afterwards a state machine will interleave it following a pseudo-random sequence stored in a file. The opposite process is made at reception to undo the process. Interleaving introduces some latency to the system because the transmitter has to read the defined stream length in order to reorganize the data, and the receiver must wait until the entire message is received to properly deinterleave the message.
39 4.3.1.6. Modulation The modulation is the process of modifying a specific characteristic of an analog signal to transmit the information. In the design, as mentioned before, two modulations are implemented; Binary Phase Shift Keying (BPSK) and 16 Quadrature Amplitude Modulation (16QAM). The block that implements the modulation is the mapping block. This block generates a two-dimensional signal in the complex plane!𝑎+𝑗𝑏, to map it later in a constellation map. Both signals will be transmitted further at the same frequency but with a phase shift of 90°, representing real plane (cosine), and imaginary plane (sine). In next figure, both real (I) and imaginary (Q) planes are represented: Figure 28: BPSK vs. 16QAM constellation The constellations are mapped with a Gray codification. That means that between two consecutive values, only one bit is different for an easier detection. Following an example of a 2-bit Binary/Gray codification: Decimal Binary Gray 0 00 00 1 01 01 2 10 11 3 11 10 Figure 29: Binary vs. Gray As the output signal of the block contains amplitude information, represents an analog signal and thus must have the width of the analog-to-digital converter, which in this case is 12-bit wide. ! In case of BPSK modulation, only two values are available, “000010100000” (160) to represent “1”, and “111101100000” (-160) to represent “0”. These values are in real plane only; the imaginary plane is always zero. Therefore, every input bit will have a 12-bit output.
40 ! In case of 16QAM modulation, four values on each plane are available, “000000110010” (50) to represent “01”, “000010010110” (150) to represent “00”, “111111001110” (-50) to represent “11” and “111101101010” (-150) to represent “10”. Therefore, every 4-bit input will correspond to two 12-bit outputs. At the receiver part, a symbol recovery block will detect the symbols and will convert them back to digital data. 4.3.1.7. Zero Padding The zero padding is a process of filling a sampled signal before performing any other process over it. The FFT and IFFT algorithms are more efficient with input data streams of a power of two lengths. To adapt the digital signal to this length, a zero padding block is used. In addition, zero padding is a good solution to prevent aliasing after generating the OFDM signal due to the oversampling. By adding zeros to the signal the desired signal will be oversampled with a factor of: 𝑣= 𝑁!!" 𝑁 !,𝑁!!" >𝑁 (22) Where NFFT is the length of the FFT and N is the length of the data symbol. The aliasing appears for a sampling frequency (fs) lower than the Nyquist frequency 𝐹 !=2!×𝐵 (23) Where FN is the Nyquist frequency and B is the bandwidth of the sampled signal. When sampling, the spectrum of the sampled signal is 2π periodic, i.e. is repeated each fs, appearing alias of the original signal .In an ideal situation, with a perfect filter response and meeting the previous condition the alias are outside of the filter and aliasing does not appears. Figure 30: Ideal filtering
41 In a real situation, where the filters are not ideal, it might occur that part of the alias goes inside of the pass band of the filter, mixing with the desired signal and interfering with it. Figure 31: Real filtering The oversampling of the signal prevents the aliasing by moving away the alias in frequency domain due to the new higher sample frequency. Because the spectrum will be 2π periodic and it is impossible to transmit negative frequencies in base-band, the IFFT vector represents the frequencies between 0 and 2π, i.e. between 0 and fs. The start of the vector represents the lower frequencies meanwhile the middle of the vector (π) represents the high frequencies. The end of the vector represents the negative frequency components of the spectrum, which contains the half of the transmitted subcarriers. After the generation, the transmitted signal is 2π periodic and disposed as shown before. Figure 32: Periodic signal representation To preserve the negative frequency components of the signal, which contain modulated information, and to preserve the conjugate symmetry of the vector, the zero padding must be done by adding the zeros in the middle of the stream, instead of just adding at the end. If this is not done, the negative spectrum part will be in higher frequencies that the positive part and then, will be filtered afterwards.
48 4.4.3.2. Software B&R Automation Studio B&R Automation Studio is an integrated software development environment, which includes tools for all parts of an automation project, making in the foundation for applications of any size and scope. For every project, several stages are defined: planning, implementation, testing, production, commissioning and service. For every stage, Automation Studio always provides an interface to the machine. Therefore the Automation Studio offers solutions for: ! Creating programs ! Creating visualizations ! Creating motion applications ! Running diagnostics ! Configure communication parameters For the described system there is a project already implemented, which operates the two described drives. For each drive a specific is created with variables and operation commands. B&R Automation Runtime The target system runs a Windows XP embedded version to manage the devices. This Windows XP version offers Real-Time capabilities. Installed on the IPC the B&R Automation Runtime (ARwin) software is fully embedded in the target system. It allows application programs to access I/O systems and other devices. There are different types of target systems defined by the processor type and architecture used in the system. B&R uses several platforms defined by the generation of the system. ! System Generation 3 (SG3) ! System Generation Compact (SGC) ! System Generation 4 (SG4) The used system is a SG4 and thus, the applied configurations will be determined by this platform. 4.4.4. Real-Time System Configuration Programming and configuring the real-time system is basic to drive the servomotors. For the communication, in order to transfer the program and the configuration, a direct connection between the external pc and the target system is needed. To establish the communication, an Ethernet cable is available to connect the external PC with the target system. Then, an IP configuration must be performed to allow both computers to connect. This section introduces also the POWERLINK parameters for real-time communication such as cycle time or response time that are essential for the proper working of the system. This
49 configuration will be performed in the Automation Studio and afterwards transmitted to the target system. 4.4.4.1. Network Configuration As described, a network configuration in both IPC and the Engineering computer must be done, to allow the communication. For this purpose ARwin offers a configurator program. Furthermore a guide in the Automation Studio is provided. The configuration consists on reserving three IP addresses of the same subnet: ! Two IP addresses are for the target system. Of these two, one IP address is for an external access to the system, and the other for a virtual port, which communicates the RTOS with the drives. ! The third IP address is for the external PC, where the Automation Studio is installed. The external IP of the target system will be configured in the Automation Studio to access to it. 4.4.4.2. Ethernet POWERLINK Parameters In this section, the most important parameters for the project will be introduced and described. The adaptation of these parameters to the topology of the system is essential to the proper functioning and the quality of the real-time communications. Two groups of parameters are described, parameters of the managing node side and parameters of the controlled node side [25]. Managing Node parameters 1. Module Type The module type parameter determines the functions that are available for a POWERLINK interface module. This is a read-only value and cannot be changed. 2. Operating Mode Specifies the POWERLINK protocol that the network should work with. The available modes are: Ethernet, POWERLINK V1 and POWERLINK V2 (default value) 3. MTU Size Determines the size of the data range of an asynchronous POWERLINK frame. It can take different values depending on which operating mode is the system in: 1500 for Ethernet, 262 for POWERLINK V1 or a value between 300 and 1500 of POWERLINK V2 (default 300). 4. Baud Rate Determines the baud rate on 1-port Ethernet modules. For Ethernet mode 100 Mbit auto and 100 Mbit half duplex is available. For POWERLINK V1 and POWERLINK V2 only 100 Mbit half duplex is available. 5. Cycle time Establishes the POWERLINK cycle time in microseconds. It can takes values from 400 to 30000 for POWERLINK V1 and from 200 to 100000 for POWERLINK V2.
50 6. Mode Specifies the mode used to operate the interface between Managing Node (default), Controlled Node or Secondary Managing Node. 7. Asynchronous timeout This parameter can be used to set the timeout for asynchronous frames in microseconds. It is defined between 5 and 30000 for POWERLINK V1 and between 5 and 100000 for POWERLINK V2. The default value for POWERLINK V2 is 25 microseconds. Controlled Node parameters 1. Mode Specifies the mode used to operate the interface between Managing Node (default), Controlled Node or Secondary Managing Node. 2. Response timeout Specifies the response timeout for the node in microseconds. Can take values from 1 to 30000 in both versions of POWERLINK, default value is 25 microseconds. 3. Synchronization Mode This parameter is available for POWERLINK bus controllers and determines the way of synchronization of the Controlled Node. The different options are Start of POWERLINK cycle as sync (default), Poll request as sync, Poll response MN as sync or no synchronization.
51 5. Ethernet POWERLINK over Powerline After describing the basic system, where this project started from, and the system, where the modems are implemented, this chapter introduces and describes the updates performed in software as well as in hardware designs to transmit Ethernet POWERLINK frames. One of the key concepts of this task is the transparency of the modems for the B&R system; i.e. the transmitted Ethernet frames must not be modified. Therefore, the modems must transmit the complete received frames without encapsulate or add extra information such origin/destination (MAC layer) or CRC. Figure 40: POWERLINK over Powerline implementation As seen on the previous figure, the network topology is no longer a line topology, but a bus topology. The information travels through the power line cable and each node reads and writes the information from/to the bus. 5.1. Ethernet and Media Independent Interface Since the goal of the project is to couple an Ethernet POWERLINK signal to the described OFDM modem, first a theoretical introduction of the Ethernet transmission characteristics is needed. The first step is defining the way of data transmission along the Ethernet cable. The target system specifies a 100BASE-TX Ethernet standard for data transmissions in a half-duplex mode. That means, only one direction of communication at a given time is possible. The 100BASE-TX is the most used Fast Ethernet specification, and uses Cat 5 Ethernet cables for data transmission. These cables have four pairs of wires inside, but only uses two of them,
52 one pair for transmission and other for reception. In addition, the transmitted signals are differential and the pairs are twisted for noise cancelling. Before transmitting the data through the Ethernet cable, the data must be adapted. To this purpose the described Marvell 88E1111 chip is available. This chip allows two different media independent interfaces modes as described in hardware design part. To match with the POWERLINK system, the MII mode is selected by shorting connectors 2 and 3 of jumper JP1 and JP2 on the Terasic development board as indicated in the next figure: Figure 41: MII Board configuration The MII transfers 4-bit words in each direction clocked at 25 MHz to achieve 100Mbit/s speed. Selecting the proper mode in the FPGA is essential to make the transmission properly matching the configuration with the connected devices. After taking the 4-bit words, the MII controller encodes the data through a 4B5B encoding clocked at 125 MHz to send it further to the Ethernet cable [26]. To manage the Marvel controller chip, as well as to provide MAC and CRC support, an Altera’s MegaCore IP block is provided, the Triple Speed Ethernet IP Core. Since the system needs to be transparent and no MAC support is needed, this block will not be used, and the signals must be managed directly from the designed blocks. At the software part, the provided signals by the MII are the following: Transmitter TX_CLK Transmit Clock TXD(3..0) Transmit Data TX_ER Forces transmission of illegal code TX_EN Enable Transmit Data Figure 42: Transmitter Ethernet signals
53 Receiver RX_CLK Receive Clock RXD(3..0) Received Data RX_DV Receive Data Valid RX_ER Receive Error Indication COL Collision Indication CRS Non-Idle Medium Indication Figure 43: Receiver Ethernet signals The most relevant signals for the Ethernet coupling are TX_CLK, TXD(3..0), TX_EN, RX_CLK, RXD(3..0) and RX_DV. For transmission, the wanted data is written at 25 MHz clock in the TXD (3..0) bus. At the same time, TX_EN line must be asserted to indicate the validity of the transmitted data. TX_EN must be kept during all the time valid data is transmitted. TX_CLK is a clock source of 25 MHz from the Marvell controller for data clocking. At reception part, RXD(3..0) data signal is provided by the MII at 25 MHz The 25 MHz reference clock is on RX_CLK signal and the validity of the received signal is assured while RX_DV is asserted [5]. 5.2. Coupling Principle As described before, words of 4 bits clocked at 25 MHz are transmitted to the MII to be sent to the Ethernet cable. Since the OFDM modem works with a 16-bit width bus, an adaptation block is necessary. The main function of this block is taking 4-bit words from the MII Ethernet at 25 MHz and making 16-bit OFDM words to be transmitted by the modem (receiver_ethernet). At reception side, another block (transmitter_ethernet) will undo this operation in order to transmit data further to the Ethernet cable. Both blocks operate at a frequency of 100 MHz in order to process incoming data faster than received. The special characteristics of the modem i.e. the maximum data rate of 9.728 Mbits/s, which is far lower from the Ethernet standard data rate of 100Mbit/s or the fixed number of 16-bit OFDM words transmitted each cycle time, will determine the design of these blocks. 5.3. Software Designs 5.3.1. Ethernet Coupling Design In this section, the first implementation of the desired feature, the Ethernet Coupling, is described. The implementation is designed in two blocks, receiver_ethernet and transmitter_ethernet that are placed inside the transmitter and receiver modem blocks respectively. These blocks have the main task of receive/send data from/to the Ethernet
54 connectors to make the transmission possible. Both blocks work with a frequency of 100 MHz, which is fast enough to process the signal, as well as with a 25 MHz frequency, which is the data coming frequency, and the sending frequency of the OFDM modem, 0.608 MHz. 5.3.1.1. Receiver_ethernet block A described in the introduction of the chapter, the main target of the receiver_ethernet block is receiving 4-bit words from MII, clocked at 25 MHz, making words of 16 bits, and sending further to the CRC generator block of the modem at a frequency of 0.608 MHz (clk_process). Figure 44: Receiver_ethernet block This block is placed inside of the data generation block and substitutes the BER generator block, which contained the known sequence to be transmitted in the original program. For the implementation, three stages are implemented inside of this block. 1. Storage of 4-bit received words: In this stage, after eth_valid (RX_DV) rising edge, four independent 4-bit registers store the received 4-bit word at a certain clock time. A finite state machine commands the load signal of every register, asserting the registers sequentially from the rising edge of eth_valid signal until eth_valid is denied. 2. Packing received words: After receiving the fourth 4-bit word, a register packs the four words from the registers. Then, a finite state machine, zero_send, reads the register and sends every word to a FIFO register, asserting the write enable of the FIFO. The FIFO is needed because the reading frequency of the modem (0.608 MHz) is lower than the frequency of the incoming data. The size of the FIFO must be chosen to be able to store enough data without overflow. Since the protocol specifies a poll-request communication (i.e. only one node is asked at once), the largest data frame transmitted from the Node will determine the minimum capacity of the FIFO. In Powerlink, the Start of Cycle (SoC) and the Poll Request (PReq) to the first node frames are transmitted sequentially, so they can be considered together. The sizes of these frames are specified later on chapter 6.4 and will give an approximation of the needed size of the FIFO.
55 3. Sending to OFDM modem: The last stage of the receiver_ethernet block is a finite state machine, data_send, which plays an important role in the coupling with the OFDM modem. This block will command the read request signal of the FIFO at 0.608 MHz at the right time in order to send the information to the next block. 5.3.1.2. Transmitter_ethernet block The main purpose of this block is receiving the packets received by the Powerline modem at a frequency of 40 MHz, and packing them. Then, transmit the result data further through the Ethernet connection at a frequency of 25 MHz Figure 45: Transmitter_ethernet block The transmitted_ethernet block is placed after the data symbol detection of the OFDM receiver. To implement the functionality, two stages were designed inside of the Transmitter_ethernet block. 1. Storage of received data: First stage is a FIFO that stores the received data clocked at 40 MHz in order to read it after at a 25 MHz clock rate. 2. Processing and transmission to Ethernet: Then, a finite state machine (piso_fsm) takes the output and splits it in four packets of four bits for sending forward to a transmission FIFO. This FIFO has a writing frequency of 100 MHz and a reading frequency of 25 MHz.Once this is done, the same state machine controls the reading from the FIFO directly to the Ethernet port as well as the assertion of the Ethernet data valid signal. 5.3.2. Additional Designs Apart from the available main program blocks, some blocks were designed to make measurements of latency and maximum data rate. These blocks will be only used in specific programs for testing and demo purposes.
56 5.3.2.1. Latency Measurement To measure the latency of the system in the transmission of a concrete transmitted 16-bit value, a specific block was designed. This block counts clock cycles from the time a value is generated at the transmitter part, until the same value is detected at the receiver part. Then, the value is converted to seconds by multiplying by the clock frequency and displayed on the available LCD display. To measure the latency with this block, only a single board must be used, connecting the transmitter part with the receiver part. 5.3.2.2. Data Rate Measurement To measure the data rate of the system another specific block was designed. This block counts the number of valid blocks received in the interval of one second. For this, every time the CRC check block asserts the data valid to “1” (that means that all the packets of the last cycle are properly received), the counter will increase one value. After each second, the total value of this counter will be multiplied either by 4 (in the case of BPSK) or by 19 (in the case of 16QAM), in order to get the amount of packets received. The resulting value is multiplied by 16 to obtain the total amount of bits received within one second. The final result is the amount of bits per second, e.g. the data rate. This calculation is done every second. As in the latency measurement block, the data rate is showed on the LCD display. 5.4. System Implementation 5.4.1. Software 5.4.1.1. Migrating and Merging The old FPGA worked with some libraries that were not compatible with the most recent version of the Altera’s development environment available, and thus an older version of the program was needed. But this old version didn’t support the Altera’s MegaCore IP libraries of the new FPGA board, used for this project. Therefore in order to adapt the existing software, an update of the MegaCore IP blocks of the programs was needed to make possible the migration to the new board. Moreover, as described in previous lines, a transceiver program for the transmission and reception at the same board was needed. This task presented the issue that, due to the independency of the program design on each part (receiver and transmitter), some files had the same name in both designs, but with different functionality. Hence when everything was placed in one folder, the compiler was not able to identify which was the correct file for each block, either transmitter or receiver. Therefore, in order to be properly recognized and compiled, these files had to be identified and changed.
57 5.4.1.2. Ethernet Coupling The Ethernet coupling presents some special subjects in the software part. These were: 1. The transmitter_ethernet block must transmit the whole Ethernet frame as the receiver_ethernet block has received it. Since an Ethernet frame has usually more data than the data transmitted in one OFDM cycle time, this will infer in the transmission of several OFDM packets to transmit one Ethernet frame. 2. The OFDM modem only sends data to the channel after the reception of the 19th word, which implies that for a given cycle that it will wait until the reception of this last word, although there is no more data to transmit. 3. The fact of sending more than two consecutive words of zeros will affect to frame synchronization at reception. The solution achieved is described in the next points. 1. Storing and delimitation of the Ethernet frame The amount of data transmitted each OFDM cycle time determines the design of the Ethernet coupling because, unlike the Ethernet, which transmits always data at a certain speed and there is not a cycle time, the OFDM cycle sends on every cycle a determined number of packets. This has implications in terms of data rate, response time and also represents an issue to face with. First, the OFDM transmitter has to receive the data from the MII clocked at 25 MHz and has to adapt it to the modem characteristics and speed, i.e. packets of 19 words of 16 bits, and a sending frequency of 0.608 MHz. Then, the OFDM receiver must store the received data converting again to the 4-bit Ethernet words, and transmit at 25 MHz frequency. However, the receiver cannot know the limits of the received Ethernet frames, because the received words only contain data, and the modem speed is several times slower than the Ethernet speed. Furthermore, the possibility that a 16-bit word is not filled with 4-bit words, due to the end of the reception, must be covered. To deal with this issue, the receiver_ethernet block was updated. Each 4-bit register of the first stage is substituted for a 5-bit register to store the received four bits and also the data valid bit. Moreover, the finite state machine, which controls the load signals of the registers, is updated to fill always the 4 registers. Hence, if there is no more data but any register is not filled, it will be filled with the available data (“0000”) and the corresponding data valid, a “0” (i.e. not valid). This will help to discard later the invalid 4-bit words. Then, a word of 20 bits is built and registered.
64 𝐺𝑎𝑖𝑛!"# =1+ 𝑅!" 𝑅!" =1.5736 (28) This would be the gain in a non-inverter configuration of the amplifier. But the real configuration is an inverter amplifier, which has a different formula: 𝐺𝑎𝑖𝑛!"# = 𝑅!" 𝑅!" =0.5736 (29) The issue was solved by changing the relation of the resistors to obtain a gain higher than 1. With the resistors R70 = 220Ω and R72 = 120Ω a gain of about 1.83 (~2.63dB) is obtained. 5.4.2.3. Channel Access Management The transmission channel is the same for transmitting and for receiving the signal, and because, the access to the medium is time-divided (i.e. the frequency used for transmission and reception is the same and the medium is only accessed by one transceiver at the same time) each transceiver is connected to one coupling board. This board defines an input and an output port to/from the channel. But these two ports are essentially connected to the same path in the board; there is no possibility to define the direction of the transmission. Therefore, when a transmission is performed by one transceiver, the half of the transmitted power (~3dB) returns to itself through the receiver port. Due to the high losses provoked in the transmission channel to the signal (about 10 dB), it results that more power returns to the sender than reaches the receiver. The sender will also receive information at the same time the same information that is sending. For example, for a -10dBm transmitted signal, the returning signal and the received signal power are: 𝑅𝑒𝑡𝑢𝑟𝑛𝑖𝑛𝑔!𝑃𝑜𝑤𝑒𝑟!(𝑑𝐵𝑚)=!−10𝑑𝐵𝑚 −3𝑑𝐵 =−13𝑑𝐵𝑚 (30) 𝑅𝑒𝑐𝑒𝑖𝑣𝑒𝑑!𝑃𝑜𝑤𝑒𝑟!(𝑑𝐵𝑚)=−10𝑑𝐵𝑚 −3𝑑𝐵 −3𝑑𝐵 −15𝑑𝐵 =−31𝑑𝐵𝑚 (31) The fact that the returned signal has higher power than the received signal makes impossible the detection of the real received signal. Therefore, the next situation is presented: 1. The circuit is designed to send enough power to overcome the losses of the channel. Then if there is too much power at reception of transmitter because of the returning signal, the components could be damaged. This must been taken in account when looking for a solution. 2. Connecting only one direction on each transceiver, the transmission is possible. 3. It is not possible to solve this just by increasing the transmission power because of the high losses provoked by the channel. The returning power will always increase at the same time as the received power, but due to these high losses, the returning power on transmitter part will always be higher than the received power on reception, making the discrimination impossible.
65 Therefore, a way to isolate both transmission and reception channels is needed. To achieve this goal, two possible solutions are offered. 1. Splitter/Combiner and Software In order to isolate both channels, the Wilkinson splitter concept is available. The Wilkinson splitter is a transmission line design to split a signal from one port into two ports keeping these output ports isolated. This design works also in the other direction. It can combine two different signals from the output ports into the common port. The isolation between output ports is theoretically infinite but in real conditions it reaches about 30-40 dB of isolation. This design is mainly for microwave applications (above 300 MHz) because transmission line theory is applied. However, the working frequency is only 100 MHz. Even so, a solution is available. A component (ADP-2-1), which performs this functionality with lumped elements, can be used at lower frequencies. The ADP-2-1 is a surface mount Power Splitter/Combiner, which works in frequencies from 0.5 to 400 MHz [27]. Figure 54: ADP-2-1 electrical schematic This component splits the received signal in PORT S to PORTS 1 and 2 with an attenuation of 3dB in each one (50% of the signal power to each port). It allows also combining signals from PORT 1 and PORT 2 into PORT S, each with an equal weighing of 50% of the incoming power. The important feature of this component, which makes it interesting for the application, is the shown isolation between PORT 1 and PORT 2. Using this component, theoretically extra losses of about 25 dB are added to the returned signal to overcome the losses caused by the channel (about 15dB) and allowing the detection. Furthermore, introducing these losses, a possible damage of the receiver part in next stages due to high power is avoided. In theory, in the final implementation, with a transmitter and a receiver, the signal would decrease about 6dB, 3dB in transmission from PORT 2 to PORT S, and 3dB more in reception from PORT S to PORT 1. Then the expected new power values of the received and returning signals are: 𝑅𝑒𝑡𝑢𝑟𝑛𝑖𝑛𝑔!𝑃𝑜𝑤𝑒𝑟!𝑑𝐵𝑚 =!−10𝑑𝐵𝑚 −3𝑑𝐵 −25𝑑𝐵 =−38𝑑𝐵𝑚 (32) 𝑅𝑒𝑐𝑒𝑖𝑣𝑒𝑑!𝑃𝑜𝑤𝑒𝑟!(𝑑𝐵𝑚)=−10𝑑𝐵𝑚 −3𝑑𝐵 −3𝑑𝐵 −15𝑑𝐵 =−31𝑑𝐵𝑚! (33) With these theoretical results, the received power would be always about 7dB higher than the returning power and thus the detection should be possible just by increasing the transmitted power about 6-7dB.
66 The layer design to fit the new component shows as follows: Figure 55: Coupling board with ADP-2-1 Besides of introducing this component and in order to avoid unexpected detections, an additional software block is also designed. This block has the main goal of switching the received signal off when something is transmitted just before the synchronization takes place. Therefore, when something is going to be transmitted, the receiver part of the transmitter will not detect anything. Figure 56: Direction switching block On the depicted block, the inputs x_real_out and x_imag_out are the connected to the transmitter block, where the transmitted signal arrives from, and the inputs real_in and imag_in are connected to the Analog-to-Digital Converter, where the received signal comes from. The outputs real_out and imag_out are connected to the Digital-to-Analog Converter, to send the signal, and the outputs x_real_in and x_imag_in are connected to the receiver block, to carry the received signal. The functions description of the block are: 1. Detecting if there is new data to be transmitted (if data_valid is asserted). 2. If there is no new data, data flow between real_in/imag_in and x_real_in/x_imag_in is established and each clock cycle, data_valid signal is checked. 3. If there is new data, data flow between x_real_out/x_imag_out and real_out/imag_out is established. Meanwhile, any data from real_in/imag_in is discarded and no longer transmitted to the receiver block. Once the data flow is established, data_valid is checked every cycle time (every 31.25 µs).
67 4. When no more data is incoming, the state machine keeps the data flow to the output until the current cycle is done to be sure that all the information is transmitted. Although this presented solution seemed a good possible solution, in practice the maximum isolation achieved between ports was only about 14-15 dB, which was not enough and therefore the returned power through the receiver channel was greater than the received power. This was caused by an impedance mismatch at the output port of the ADP-2-1. The ADP-2-1 applications note specifies a drop of the maximum isolation if the output is not properly matched with the next stage. Is specified an isolation of about 6dB in case of a full mismatch and a theoretically unlimited isolation in case of full match. 2. Software Controlled Switch The second possible solution includes implementing a switch between transmitter and receiver introducing a new component, the MSWA-2-20, and implementing some changes in the software block and in the hardware designed for the previous solution. The MSWA-2-20 component is a surface mount switch that has one common RF input port and two independent RF outputs and is designed to conduct an RF signal from the common port to one of the two outputs. The output port is selected with two control ports. The aim is to connect two pins of the FPGA in order to control the switch. The switch will substitute the ADP-2-1 to achieve the desired isolation between both ports. Figure 57: MSWA-2-20 electrical schematic This component offers a typical isolation between outputs of 60dB @ 100 MHz with typical insertion losses of 0.65dB @ 100 MHz. The MSWA-2-20 is also absorptive, which means that the non-switched port is terminated with 50Ω impedance. This will help to avoid reflections in case of full impedance matching. To select the output, two control signals are needed. The output is selected by introducing a 0V or a –V voltage in the control ports, following the next table: Control Ports RF Outputs 1 2 1 2 0 -V OFF ON -V 0 ON OFF Figure 58: Output selection logic Where –V is a negative voltage between -5 and -8 volts [28].
68 These voltages are generated on the FPGA with the control block designed in the previous solution in the transceiver program but with a new feature, activate or deactivate the signals that switch both control ports. The signals are mapped to two pins of the GPIO connector available on the Terasic development board. Then, two cables connect these two pins with the designed board. The supplied FPGA voltages are logic voltages, which can be selected between 1.5V, 1.8V, 2.5V or 3.3V. To fit the supplied voltages with the needed voltages of the control ports, an operational amplifier is used on each channel [5]. To choose the proper operational amplifier, the frequency response is a parameter that has a big importance. The control signal must change between logic states fast enough to activate the switch before the modulated signal arrives to it. If an operational amplifier with bad frequency response is chosen, the output signal to the control port will not reach the desired voltage level at the right time and the switch will not be at the right position to transmit or receive. For example for a LM258 general-purpose amplifier, with a maximum frequency response without high signal degradation of about 10 KHz the signal frequency response to a pulse is [29] Figure 59: LM258 Pulse Response It is perceived that the maximum value at the output (blue line) for a given pulse at the input (red line) is reached after 15µs, which is not enough fast for this application (as mentioned before, the cycle time is 31.25µs). Therefore, an operational amplifier with higher frequency response has to be chosen in order to insure that the switch is activated before the signal arrives. The chosen operational amplifier is the TLC072A. This is a general-purpose operational amplifier, with a better frequency response. The pulse response of this operational amplifier is
69 Figure 60: TLC072A Pulse Response This pulse response is considerably faster and the output will reach the desired values (about - 5V) at the right time in order to command the switch before the signal arrives [30]. The time taken by the MSWA-2-20 to switch between channels is about 5 ns, which is negligible. A new small board is designed to place the new components. This board contains only these two components, connecting the outputs of the operational amplifiers to the control inputs, and the inverted inputs to a cable to connect easily the GPIO port of the Terasic board as described before. The input and output ports of the switch are connected to the high frequency board to receive and send the signal through a common connector. Figure 61: Switching board The amplifier is connected in inverter configuration. To achieve the required level of -5V, an amplification of about 2 is needed. Following the equation of the amplification for an inverter amplifier configuration (7), the used resistors are: 𝑅!=200!Ω!,𝑅!=523!Ω! (34) The obtained gain will be about 2.615 (~4.1 dB). The amplifier must be supplied with a symmetrical DC voltage of at least the desired output voltage plus 1.5V. In this case, the regulated supply voltages of the high frequency board, which have approximated values of +8V and -8V, are taken. Then the maximum output can reach maximums between +6.5V and -6.5V. The second case, -6.5V, is enough to control the switch. For this implementation, the coupling boards are redesigned and now only one common port for receiving and transmitting is needed. Also the ADP-2-1 of the previous design is no longer
70 needed. Therefore, the board contains a DC connector, the DC blocking capacitance a 1:1.5 balun, the diode bridge, and one SMA connector. Figure 62: Coupling Board one port The schematic of the boards’ disposition is the following Figure 63: New coupling schematic The effectiveness of this component is measured on an isolation of about 40 dB between the two ports. The time-domain results of the performance achieved with the use of the described amplifier in addition with the switch are depicted in the next figure: Figure 64: Switch Control signal vs. Data signal In red color one of the signals that activates the switch. In blue color, the signal of the common port, where are differentiated the incoming and the outgoing signals.
71 5.4.2.4. Fine Tuning To achieve the best transmission quality, with the lower bit error rate possible, the transmission power has to be adapted. For an easier calculation of the power in the different nodes, the Managing Node Modem is placed in between the two Controlled Nodes so it can be assumed that the losses caused on the transmission channel are the same for both Controlled Nodes since the distance are the same. Therefore, similar power transmitted from the Managing Node must arrive into both Controller Nodes and the same amplification is needed on both Controlled Nodes in order to transmit the signal to the Managing Node. On the design, it is possible to adapt the gain either on the transmitter part or the receiver part of the High Frequency Boards. To this purpose, the designs of the boards are checked in order to achieve the best adaptation possible. 1. Transmitter: The transmitted power of each board must be adapted for a proper transmission of the signal. The signal transmitted from the Managing Node must arrive properly to both Controlled Nodes. The gain adaptations, in addition to the used topology and the software detection threshold (chapter 3.3.1.10), will help to detect properly the signals transmitted between the Managing Node and the Controlled Nodes. It is possible to raise this threshold to avoid detecting low power signals that can arrive improperly. Since the Managing Node is placed between the Controlled Nodes in the channel, the transmitted signal from one Controlled Node will be detected only on the Managing Node. Figure 65: Transmitter stages After performing some tests and measurements, the final resistors configuration is R (Ω) Managing Node Controlled Node 1 Controlled Node 2 R1 680 Ω 750 Ω 680 Ω R8 330 Ω 220 Ω 300 Ω R9 - 750 Ω - R15 - 300 Ω - Figure 66: Transmitter Amplification stages configuration
72 Unlike the Managing Node or the Controlled Node 2, whose power after first amplification stage was enough for the transmission, the Controlled Node 1 modulator presented a malfunction, which caused a low output power. Therefore the two amplification stages were needed on this node. With the given resistors and the formulas 6 (non-inverter configuration) the obtained gains are: Node Stage 1 Gain Stage 2 Gain Total Gain Managing Node 4.85 dB - 4.85 dB Controlled Node 1 6.44 dB 5.44 dB 8.88 dB Controlled Node 2 5.14 dB - 5.14 dB Figure 67: Transmission gains 2. Receiver: At reception, the gain adaptation is made to assure the proper power level at the input of the demodulator. Figure 68: Receiver stages R (Ω) Managing Node Controlled Node 1 Controlled Node 2 R70 680 Ω 680 Ω 680 Ω R72 221 Ω 330 Ω 330 Ω Figure 69: Receiver Amplification stage configuration
73 With the given resistors and 7 (inverter configuration) the obtained gains are Node Amp. Stage Gain Total Gain Managing Node 4.88 dB 1.88 dB Controlled Node 1 3.14 dB 0.14 dB Controlled Node 2 3.14 dB 0.14 dB Figure 70: Reception gains With these configurations a perfect communication between the Managing Node and the Controlled Nodes is achieved, with no Bit Error Rate. The power measurements are described on next chapter.
80 sending the Poll Request (PReq) frame. The Controlled Node answers sending a Poll Response (PRes) back with the bit RD (Ready) set to 1, indicating to the Managing Node that the drive is ready to operate. Figure 77: Managing Node Ethernet information Figure 78: Controlled Node Ethernet information Thanks to the acquired data in the Protocol Analyzer, it is possible to explain the difference of time between the estimated response time and the real Ethernet response time. For example: For a 94 Bytes request sent by the Managing Node (PReq) to the node 85, the new calculated delay time is: • Total Ethernet data: Data Bytes + Preamble Bytes = 94 Bytes + 7 Bytes = 101 Bytes. • Estimation of necessary extra packets to keep synchronization: This estimation can be done looking at the raw data received at the Protocol Analyzer Figure 79: PReq Frame Data It is noticed a big amount of sequential zeros, which will cause the adding of extra packets to avoid the loss of synchronization. For this case the amount of extra words caused by the sequentially transmitted zeros will be approximately 16 words (32 Bytes). • Total Transmitted data: Total Ethernet data + Extra data for sync. = 101 Bytes + 32 Bytes = 133 Bytes = ~67 OFDM words è 4 OFDM packets. 𝑡!"#$ =94.86!𝜇𝑠 +!3!𝑝𝑎𝑐𝑘𝑒𝑡𝑠!×!31.25!𝜇𝑠!=188.61!𝜇𝑠 (44)
81 For a 116 Bytes response sent by the Controlled Node (PRes) from the node 85, the new calculated delay time is: • Total Ethernet data: Data Bytes + Preamble Bytes = 116 Bytes + 7 Bytes = 123 Bytes. • Estimation of necessary extra packets to keep synchronization: This estimation can be depicted from the raw data received at the Protocol Analyzer Figure 80: PRes Frame Data As done with the PReq estimation, the amount of extra words caused by the sequentially transmitted zeros will be approximately again 16 words (32 Bytes). • Total Transmitted data: Total Ethernet data + Extra data for sync. = 123 Bytes + 32 Bytes = 155 Bytes = ~78 OFDM words è 5 OFDM packets. 𝑡!"#$ =94.86!𝜇𝑠 +!4!𝑝𝑎𝑐𝑘𝑒𝑡𝑠!×!31.25!𝜇𝑠!=219.86!𝜇𝑠 (45) The total response time estimated for the transmitted data (without calculating the Ethernet coupling data treatment times) will be: 𝑡!"#$ =219.86!𝜇𝑠!+!188.61!𝜇𝑠!=408.47!𝜇𝑠 (46) 6.4.1. Ethernet POWERLINK Runtime Since the Powerline modems introduce a considerable delay into the transmitted channel, the Ethernet POWERLINK parameters need be changed in order to be adapted to the new conditions. The response time calculated before should be introduced on the Automation Studio parameters to allow the communication. Although the minimum measured response time is 555 µs and 470 µs respectively, to give some flexibility and prevent losing Ethernet frames due to eventual higher delays, the introduced Response Timeout will be 1000 µs and 600 µs respectively. The Asynchronous Timeout is also defined at 1000 µs. Therefore the new Cycle time must be also changed to adapt it to the new conditions. There are two Controlled Nodes with maximum response time of 1000 µs and 600 µs respectively, and eventually can occur an Asynchronous Frame, which has a maximum response time of 1000 µs. Hence the Cycle time is 𝑡!!!"!#$ =𝑅!"#$!+𝑅!"#$!+𝑅!"#$!" =2600!µμs (47) Due to the requirements of the task time, the total Cycle time must be multiple of 400 µs, hence the calculated Cycle time is 2800 µs.
82 Figure 81: Managing Node configuration Figure 82: Controlled Node configuration With the described configurations and measurements, the communication between the Managing Node and the Controlled Nodes is possible with low rate of losses. Therefore, it was possible to command of the servo drives, as well as reading the information from the sensors (speed, position, direction etc.).
83 7. Conclusions and Further Development The described results and measurements show that the implementation of OFDM transmission technique for Powerline Communication is applicable in industrial communications systems. The data rate and the latency achieved show the viability of the system and open new possibilities with the further development. The interferences produced by the drives are far lower in frequency spectrum, so with the use of the coupling board, the modem and the signal are immune to them. The basic points that have to be improved are: ! The latency must be lower. ! The latency must be constant to minimize the jitter. ! The achieved data rate must be higher to get closer to the Fast-Ethernet standard. To achieve these goals, the implementation of Orthogonal Frequencies Division Multiple Access (OFDMA) to assign different subcarriers to different nodes in order to have several transmissions at the same time is the first step. With this implementation, the nodes are permanently connected to the managing node, reducing the latency. In order to increase the data rate, the implementation of 64QAM digital modulation is also a good point to start. Moreover, the adaptation of the modem cycle time to the application cycle time (in this case Ethernet POWERLINK cycle time) is also an interesting modification to be implemented, transmitting a complete Ethernet frame each modem cycle and reducing therefore latency.
84
85 8. Bibliography and References [1] “Homeplug Alliance - IEEE 1901,” 2014. [Online]. Available: http://www.homeplug.org/tech/ieee_1901/. [2] S. Schmitz, “Industrielle Powerline-Kommunikation für Antriebseinheiten in Werkzeugmaschinen,” Stuttgart, 2010. [3] H. Rohling, OFDM Concepts for Future Communication Systems, Hamburg: Springer, 2011. [4] V. D. Eraso Garcia, “Commissioning and Enhancement of a Powerline Communication System,” 2012. [5] DE2_115 User Manual, Terasic Technologies Inc., 2010. [6] Cyclone IV FPGA Device Family Overview, Altera Corporation, 2014. [7] High Speed Mezzanine Card (HSMC) Specification, Altera Corporation, June 2009. [8] S. Schmitz, Dokumentation des OFDM-Modems, 2009. [9] AD9765 12-Bit 125 MSPS Dual Digital-to-Analog Converter Datasheet (Rev. G), Analog Devices, Inc, 1999-2011. [10] AD9248 14-Bit 40 MSPS Dual A/D Converter Datasheet (Rev. B), Analog Devices, Inc, 2010. [11] AD8138 Low Distortion Differential ADC Driver Datasheet (Rev. F), Analog Devices, Inc, 2006. [12] SXLP-4.7+ Surface Mount Low Pass Filter Datasheet (Rev. OR), Mini-Circuits. [13] ADL5385 30 MHz to 2200 MHz Quadrature Modulator Datasheet (Rev. A), Analog Devices, Inc, 2012. [14] ADL5387 30 MHz to 2 GHz Quadrature Demodulator Datasheet (Rev. B), Analog Devices, Inc, 2013. [15] RHP-73+ Metal Shield High Pass Filter Datasheet (Rev. OR), Mini-Circuits. [16] RLP-105+ Metal Shield Low Pass Filter Datasheet (Rev. OR), Mini-Circuits. [17] AD8009 Low Distortion Amplifier Datasheet (Rev. F), Analog Devices, Inc, 2004. [18] True Sinewave Clock Oscillator Datasheet, Crystek Crystals, April 2008. [19] FKP 1 Polypropylene Capacitors for Pulse Applications, WIMA, 2013. [20] Digital Modulation in Communications Systems — An Introduction, Agilent Technologies, 2001. [21] CRC Compiler User Guide, Altera Corporation, November 2009. [22] FFT MegaCore Function User Guide, Altera Corporation, November 2013. [23] D. Jones, “Decimation-in-Frequency (DIF) Radix-2 FFT,” 17 Sep 2006. [Online]. Available: http://cnx.org/content/m12018/1.6/. [24] “Ethernet-Powerlink Website,” 2014. [Online]. Available: http://www.ethernetpowerlink.org.
86 [25] Automation Studio Help, B&R, 2014. [26] IEEE Standards for Local and Metropolitan Area Networks - 802.3u Fast Ethernet, IEEE , 1995. [27] ADP-2-1 Surface Mount Power Splitter/Combiner Datasheet (Rev. D), Mini-Circuits. [28] MSWA-2-20+ Surface Mount Switch Datasheet (Rev. C), Mini-Circuits. [29] LM258 Dual Operational Amplifier Datasheet, Texas Instruments, May 2013. [30] TC072 Low-Noise JFET-Input Operational Amplifier Datasheet, Texas Instruments, February 2014. [31] F5D4079 Surf Powerline AV+ Networking Adapter Product Sheet, Belkin, 2010. [32] T. M. Schmidl and D. C. Cox, “Robust Frequency and Timing Synchronization. s.l.,” in IEEE Transactions on communications, VOL. 45, NO. 12, December 1997.