Ebrahim Rokrok
email: ebrahim.rokrok@ubi.pt

Miadreza Shafie-Khah
email: miadreza@ubi.pt

Hamid Reza Karshenas
email: karshen@cc.iut.ac.ir

Esmail Rokrok
email: rokrok.e@lu.ac.ir

João P S Catalão
email: catalao@fe.up.pt

A Hybrid Anti-Islanding Method for Inverter-Based Distributed Generation

Keywords: inverter-based distributed generation, islanding, non-detection zone, quality factor, total harmonic distortion

Nowadays, high penetration of Distributed Generations (DG)s in power systems caused some protection issues. One of these issues is unintentional islanding. As regards IEEE 1547 standard, this situation must be recognized immediately, and DG must be separated from the load in less than 2 seconds. In this paper, to detection of islanding in an inverter-based distributed generation, a new hybrid method with high performance is proposed. In the proposed method, a primary detection of islanding is conducted by measuring the voltage harmonic distortion at the Point of Common Coupling (PCC), as well as comparing the variations to a specified threshold level. After this primary detection, a temporary reactive current signal is injected to the PCC by the inverter of DG, and its terminal voltage and frequency are measured. In the case of deviation of voltage or frequency from permissible range, definitive detection of islanding is determined. Simulation results indicate the efficiency and accuracy of the proposed detection method in different circumstances, especially for loads with the different quality factors.

Introduction

Due to the technical, economic and environmental advantages, integration of distributed generation units to power systems is growing increasingly. It seems that in the future, we will face with complex grids with a significant number of DGs [START_REF] Shrivastava | A Proposed Hybrid Method for Islanding Detection[END_REF].

In this regard, analysis of the issues and problems related to the connection of DGs is very important. One of these issues is unintentional islanding. Unintentional islanding happens when the switch of grid side is disconnected without a prior plan and in an unforeseen way, and subsequently, the DG has to feed the local loads alone.

According to IEEE 929-1988 standard, the DG must be disconnected immediately from the load once it islanded [START_REF]IEEE Recommended Practice for Utility Interface of Photovoltaic(PV) Systems, Sponsored by IEEE Standards Coordinating Committee 32 on Photovoltaic, IEEE Std. 929-2000[END_REF]. So, it is crucial to immediately detect islanding state and then separate the DG from the load.

Generally, there is two main categories for detection methods: 1) local methods 2) remote methods. Local methods are classified to passive methods, active methods and hybrid methods. Remote methods are also divided into two general methods: at the utility level and communication-based methods.

In passive methods, the detection procedure is based on the measurement of variables such as frequency, voltage amplitude and harmonic distortion at the PCC. Passive techniques are low cost and have short operating time. These methods have no effect on grid's power quality. Various passive methods including 1-Voltage and frequency protection [START_REF] Bae | Islanding detection method for inverter-based distributed generation systems using a signal cross-correlation scheme[END_REF], 2-voltage and current harmonics detection [START_REF] Mahat | Review of islanding detection methods for distributed generation[END_REF], 3-Voltage phase jump detection [START_REF] Aljankawey | Passive method-based islanding detection of renewable-based distributed generation: the issues[END_REF], 4-Comparing the rate of change of frequency [START_REF] Bower | Evaluation of islanding detection methods for utilityinteractive inverters in photovoltaic systems[END_REF], 5-Voltage unbalance [START_REF] Jang | An islanding detection method for distributed generations using voltage unbalance and total harmonic distortion of current[END_REF], 6-Output power change rate [START_REF] Mahat | Review of islanding detection methods for distributed generation[END_REF], 7-Rate of change of frequency over power [START_REF] Pai | A detection algorithm for islanding-prevention of dispersed consumer-owned storage and generating units[END_REF] have been studied. The main problem of these methods is that they have Non-Detection Zones (NDZs). NDZ is a region in which the islanding detection technique cannot detect islanding state [START_REF] Etxegarai | Analysis of remote islanding detection methods for distributed resources[END_REF]. This limitation of passive schemes is solved by using active schemes.

The main idea of an active scheme is that when a DG is islanded, a small disturbance will lead to a substantial change in system parameters, while the change are small when the DG is connected to the grid [START_REF] Chandrakar | An Assessment of Distributed Generation Islanding Detection Methods[END_REF]. The active methods including: 1-Impedance measurement [START_REF] Bower | Evaluation of islanding detection methods for utilityinteractive inverters in photovoltaic systems[END_REF], 2-Detection of impedance at specific frequency [START_REF] Bower | Evaluation of islanding detection methods for utilityinteractive inverters in photovoltaic systems[END_REF], 3-Slip mode frequency shift [START_REF] Bower | Evaluation of islanding detection methods for utilityinteractive inverters in photovoltaic systems[END_REF], 4-Frequency bias or active frequency drift [START_REF] Bower | Evaluation of islanding detection methods for utilityinteractive inverters in photovoltaic systems[END_REF], 5-Sandia frequency and voltage shift [START_REF] Kunte | Comparison and review of islanding detection techniques for distributed energy resources[END_REF], 6-Frequency jump [START_REF] Bower | Evaluation of islanding detection methods for utilityinteractive inverters in photovoltaic systems[END_REF] can be noticed. Active methods have small NDZ. Instead, they have longer operating time than passive methods and have a negative effect on grid's power quality [START_REF] Etxegarai | Analysis of remote islanding detection methods for distributed resources[END_REF].

For a more accurate detection of islanding, the hybrid methods (both active and passive method) are used. These methods take advantage of the two-stage detection process. First, a passive method can be used as the primary diagnoses. After that, an active method is applied as the passive scheme became suspects to the islanding [START_REF] Teoh | An overview of islanding detection methods in photovoltaic systems[END_REF]. Hybrid methods including 1-Method based on voltage unbalance and positive feedback, 2-Method based on the shift of the voltage and reactive power [START_REF] Mahat | Review of islanding detection methods for distributed generation[END_REF][START_REF] Chandrakar | An Assessment of Distributed Generation Islanding Detection Methods[END_REF] can be cited.

In this paper, a hybrid detection method with high accuracy is proposed to detect the islanding state in an inverter-based DG. In this method, the primary detection is done by measuring the voltage harmonic distortion at the PCC and comparing its variation with a threshold level. Then, for a definitive detection of islanding, a reactive current signal is injected by the inverter of the DG to the PCC, and its voltage and frequency are measured. If the deviation of voltage and frequency passes the allowable limits, islanding is detected. Simulation results indicate the efficiency of the suggested method in different conditions.

Relationship to Smart Systems

The environmental issues besides increasing concern for traditional energy resources lead to increasing concentrations on distributed generation based on renewables. The grow of DG penetration level in the future smart grids leads to increasing need for high-performance anti-islanding protection methods [START_REF] Teoh | An overview of islanding detection methods in photovoltaic systems[END_REF]. Therefore, anti-islanding protection is so important that specific capabilities and specifications for antiislanding are required in the countries with a developed power grid system [START_REF] Boroojeni | Overview of the Security and Privacy Issues in Smart Grids[END_REF].

To connect the DGs to the grid, there are some conditions that must be considered. Standard institutions have published these conditions. On of the very significant conditions which are required to distributed generators is detecting the islanding state.

Unintentional islanding, because of loss of synchronism, can have undesirable effects on power system stability [START_REF] Bahrami | From demand response in smart grid toward integrated demand response in smart energy hub[END_REF]. It is likely to damage the electrical appliances and equipment in the island. It is also dangerous for personnel or people. So, in modern smart grids, it is necessary to use effective and reliable methods to detect islanding conditions [START_REF] Arasteh | Iot-based smart cities: A survey[END_REF]. Numerous methods have been proposed to detect unintentional islanding so far. These methods are different in terms of cost, efficiency, execution speed and power quality issues. This paper, proposes an effective antiislanding detection method to the goal of reliable operation in future smart grids. The basis of islanding detection in reactive current injection method is making the reactive flow component in DG's output current through the control system and measuring the frequency and voltage at the PCC. To this end, a reactive triangular current signal with the frequency of 20 Hz can be used. The amplitude of this signal is considered as 10% of DG's rated current.

Islanding Detection by Reactive Current Injection

The voltage and frequency deviation lay outside of the standard ranges if the local load and DG's output power is not matched with each other. In this case, islanding can be diagnoses easily by voltage and frequency relays. However, if the DG's output power matches with the local load, frequency and voltage deviation are so small that relays can't detect islanding. In this case, injection of reactive current causes the frequency or voltage will be outside of the standard ranges and islanding is detected by voltage and frequency relays.

Proposed Method

For improving power quality in reactive current injection method, it can be combined with a passive scheme. To detect islanding, first the passive scheme is used, and if it suspects of islanding, reactive current is injected. The reactive current injection will continue for a short time. If voltage or frequency was out of range during this period, the islanding has been detected, and DG will be separated. Otherwise injecting reactive current is interrupted and passive method is re-applied. So, DG does not have to inject reactive current continuously, and thus power quality is improved.

The passive method that used in this paper is measuring of the voltage Total Harmonic Distortion (THD) at the PCC. In the control system of inverter, the d-q components of the voltage are available and the voltage THD is obtained from these components [START_REF] Rahmani | A combination of shunt hybrid power filter and thyristor-controlled reactor for power quality[END_REF]. In the suggested technique, voltage THD is sampled and is stored. The number of samples is fixed, and by adding a new sample in every cycle, the oldest sample is discarded. An average of samples is calculated by a moving window. The new sample will be compared with the average of previous samples. If the difference between these two is greater than a defined threshold level, the primary diagnosis of islanding is made, and then DG injects the reactive current. The flowchart of Figure 2 shows islanding detection procedure by proposed method.

Simulation Results

To demonstrate the usefulness of the suggested method, a DG is connected to the local load and the utility grid (Fig. 1) is simulated in the Matlab-Simulink. The inverter is controlled in the PQ control mode. The modeling detail is presented in [START_REF] Bae | Islanding detection method for inverter-based distributed generation systems using a signal cross-correlation scheme[END_REF]. The characteristics of load, system and DG are specified in table 1. Simulations results are given for three different states. In these simulations, the DG's output power is considered equal to the local load. In the other words, the worst loading conditions are considered. According to IEEE 929-2000 standard, allowable range of frequency is 59.3 Hz < < 60.5 Hz and allowable voltage range is 0.88 p.u. < < 1.1 p.u. that by taking effective amount 220 V for phase voltage, it will be 193.6 V < < 242 V.

Case 1: Islanding Detection by Permanent Injection of Reactive Current for a Load with a Low-Quality Factor:

In the case of accordance of DG's real power and loads with high/low-quality factor, islanding is not detected based on voltage and frequency measurement. So, the triangular reactive current with the frequency of 20 Hz and the amplitude of 10% of the DG rated current is continuously injected. Figure 3 shows the frequency and voltage quantity at PCC. At t = 1 (s), the grid is disconnected, and islanding occurs.

As can be seen from these figures, frequency and voltage range are excluded from standard limit and islanding is detected. For the high-quality factor load, by decreasing the amplitude of injected reactive current up to 5% of the DG nominal current, detection can be done. But in any case, continuous injection of reactive current can reduce the system's power quality. In figure 4, the average of THD of the voltage at PCC (average of 50 samples with 1 kHz sampling rate) and reactive current injected are depicted. At t = 1 (s), the grid is disconnected, and islanding happens. At t = 1.02 (s), THD changes will be higher than the threshold level (3%), and the primary detection is done. Then the reactive current is injected. Figure 5 illustrates the voltage and frequency of PCC . It is observed that the voltage is out of range in a short time and islanding is detected. Current injection is stopped, and DG must be separated. Non-linear loads, such as rectifiers, when connecting to PCC can cause changes in the voltage THD levels. In this simulation, at the moment t = 1 (s), a rectifier as a non-linear load is connected to PCC. THD changes are more than the threshold, and the primary detection of islanding is done. Then the reactive current is injected within 0.1s (Figure 6). Figure 7 shows the frequency and voltage of PCC. It is observed that the voltage and frequency will not be out of allowable range. So DG is not islanded, and injection of reactive current will be stopped, and DG will continue to work.

Conclusions

In connection of DGs to power systems, unintentional islanding is one of the important problems that must be investigated. According to existing standards, this phenomenon should be immediately diagnosed. Grid and load characteristics can determine factors for selection of an islanding detection method. This paper suggested a hybrid approach to detection of islanding. In the beginning, the primary detection of the islanding was done by measuring the THD of voltage at the PCC and comparing its variation to a threshold level. After confirmation of primary detection, for definite detection, a reactive current signal was injected to the PCC and voltage, and frequency deviations were measured at this point. Simulation results showed the efficiency of the suggested technique especially for the loads with non equal quality factor. Likewise, the switching of non-linear loads and correct diagnosis of nonislanding was simulated.

Figure 1 Fig. 1 .

 11 Figure 1 depicts the inverter-based DG and the local load at the PCC. When islanding occurs, the Circuit Breaker (CB) opens, and DG alone feeds the local load.

Fig. 2 .

 2 Fig. 2. Islanding detection by suggested method

Fig. 3 .

 3 Fig. 3. Voltage and frequency of PCC with permanent reactive injection for low-quality load

Fig. 4 .

 4 Fig. 4. The average of THD of the voltage at PCC and injected reactive current

Fig. 5 .

 5 Fig. 5. Voltage and frequency of PCC with temporary reactive injection for low-quality load

Fig. 6 .

 6 Fig. 6. The average of THD of the voltage at PCC and injected reactive current.

Fig. 7 .

 7 Fig. 7. Voltage and frequency of PCC with temporary reactive injection for low-quality load.

Table 1 .

 1 Test system characteristics.

	Grid	Nominal voltage	381 V
		Frequency	60 Hz
		Rated power	60 kW
		Rated voltage	381 V
	DG	Switching frequency	5 kHz
		DC link	800 V
		Coupling reactance	2.5 mH
	Load	High-quality factor	Q=2.3
		Low-quality factor	Q=0.2

Acknowledgment. This work was supported by FEDER funds through COMPETE 2020 and by Portuguese funds through FCT, under Projects SAICT-PAC/0004/2015 -POCI-01-0145-FEDER-016434, POCI-01-0145-FEDER-006961, UID/EEA/50014/2013, UID/CEC/50021/2013, and UID/EMS/00151/2013. Also, the research leading to these results has received funding from the EU Seventh Framework Programme FP7/2007-2013 under grant agreement no. 309048.


Eman Al-Hawri
email: esalhawri@ualg.pt

Noelia Correia
email: ncorreia@ualg.pt

Alvaro Barradas

Ceot

RELOAD/CoAP P2P Overlays for Network Coding Based Constrained Environments

Keywords: P2P, RELOAD, CoAP Usage, Network Coding

The Internet of Things will bring into the Internet all kinds of smart systems, which will be able to interact with each other. Therefore, applications relying on data sharing for collaboration will increase, and effective distributed solutions for data storage become necessary. This need led to the proposal of a CoAP Usage for RELOAD, a generic P2P protocol that accepts pluggable application layers (Usages). This allows P2P overlay networks to be built where constrained systems store their data and clients are able to retrieve it. Since many smart systems rely on wireless networks to communicate, where network coding can be used to reduce packet error rate, P2P overlays should be prepared to store data from network coding based networks. More specifically, encoding vectors and encoded data must be stored, and a decoding service is required. In this article, we propose a CoAP Usage extension so that network coding based constrained networks can use RELOAD/CoAP P2P distributed storage.

Introduction

Smart systems appear everywhere and this is expected to increase in the near future [START_REF] Jones | Humans' Critical Role in Smart Systems: A Smart Firefighting Example[END_REF]. Such trend, combined with the potential for the Internet of Things (IoT) to connect tens of billions of objects to the Internet, will allow geographically distributed systems to collaborate and smart services to emerge. In such scenarios, peer-to-peer (P2P) networks may have a key role allowing federated peers to collaborate and improve their businesses.

In the context of federated constrained systems/networks some open standards become important. Within Internet Engineering Task Force (IETF), the Constrained RESTful Environments (CoRE) working group has focused on the development of Constraint Application Protocol (CoAP), a data messaging/transfer protocol providing a request/response interaction model between application endpoints [START_REF] Shelby | The Constrained Application Protocol (CoAP)[END_REF][START_REF] Correia | An Energy Aware Resource Design Model for Constrained Networks[END_REF]. The "coap://" Uniform Resource Identifier (URI) scheme is used to identify CoAP resources, while "/.well-known" is defined as a default entry point for resource discovery. The Internet media type "application/link-format" is assigned for CoRE Link Format payloads [START_REF] Shelby | Constrained RESTful Environments (CoRE) Link Format[END_REF][START_REF] Nottingham | Defining Well-Known Uniform Resource Identifiers (URIs)[END_REF].

More recently, CoAP Usage for REsource LOcation And Discovery (RELOAD), a base protocol that provides a generic self-organizing P2P overlay network service, was proposed [START_REF] Jimenez | A Constrained Application Protocol (CoAP) Usage for REsource LOcation And Discovery (RELOAD)[END_REF]. The use of pluggable application layers, called Usages, allows RELOAD to fit any purpose [START_REF] Jennings | REsource LOcation And Discovery (RELOAD) Base Protocol[END_REF]. In a RELOAD/CoAP architecture the proxy nodes form a distributed P2P overlay network to announce resources, allowing clients to discover them. More specifically, the overlay can be used: as a lookup service, to store existing resources, and as cache for data.

Many applications (e.g. industrial, environmental) require smart systems to communicate using wireless constrained networks. Such constrained environments usually have energy efficiency and end-to-end packet error rate concerns, which are competing goals (e.g. a packet may be sent through multiple paths to reduce error rate but this increases energy consumption). An elegant way of achieving a balance between these two goals is to use Network Coding (NC) [START_REF] Keller | SenseCode: Network Coding for Reliable Networks[END_REF]. When NC is used, nodes can perform some linear combination on the received packets and route encoded packets. At the destination, the decoding process can be applied to recover the original packets. Since linear combinations of packets are being done, the sink will be able to recover lost packets from a sufficient number of other arriving packets.

In this article, we propose an extension of CoAP Usage so that NC based constrained networks can benefit from RELOAD/CoAP P2P distributed storage. That is, although packets will travel from sources toward sinks/gateways, their final destination will be the P2P overlay where storage is done. When compared with the work in [START_REF] Jimenez | A Constrained Application Protocol (CoAP) Usage for REsource LOcation And Discovery (RELOAD)[END_REF] a new data Kind structure is proposed for encoded data and encoding vectors to be stored. For the decoding process, required when original data packets are not received, a decoding service is required at the P2P overlay network. Such architecture allows constrained networks to reduce packet error rate while benefiting from an effective distributed solution for data storage. This work serves as a basis for future proposal of algorithms that determine the most effective routing trees, for packet forwarding toward sink/gateway nodes, and best placement of coding nodes.

The remainder of this article is organized as follows. Section 2 explains how smart systems can benefit from our proposal. Section 3 discusses network coding, while Section 4 presents the proposed architecture and extension of CoAP Usage. Finally, in Section 5 some conclusions are drawn.

Relationship to Smart Systems

A smart system is a collection of sensing, actuation, and controlling functions, allowing situations to be analyzed and decision making. Such systems mainly rely on sensor information sources, which might be geographically distributed [START_REF] Jones | Humans' Critical Role in Smart Systems: A Smart Firefighting Example[END_REF]. With the increasing presence of smart systems in the Internet, applications relying on data sharing will increase and effective solutions for storage/discovery of data become necessary.

Although Cloud storage solutions have emerged, extra storage space always requires extra physical disks and processing, meaning that connecting hundreds of millions of sensors to the Cloud will be extremely demanding. Besides this, such places are known as storage places meaning that they are exposed to attacks. P2P approaches can overcome both these issues because participating peers/proxies also contribute to storage and processing, peers communicate directly posing no burden on a specific set of servers, and bandwidth bottlenecks are avoided. Encrypted communication tunnels can also be built between peers.

CoAP is a Web application transfer protocol that was developed for constrained systems to provide RESTful services. Although devices will be heterogeneous regarding their radio layer, CoAP is expected to become a common application layer protocol. For this reason, the CoAP Usage for RELOAD has been proposed, avoiding the use of centralized servers. The use of P2P overlays is particularly useful for power-constrained systems that are expected to explore sleeping modes for higher energy saving. This is so because clients can retrieve information directly from the overlay without performing either a connection to the proxy or the power-constrained system. Thus, RELOAD/CoAP P2P overlays are an effective response to many of the challenges that smart systems face.

Many smart systems rely on wireless constrained networks to communicate. Therefore, it makes sense to prepare P2P overlays to store data arriving from NC based wireless networks. More specifically, encoding vectors and encoded data must be stored, and a decoding service supplied. NC improves packet delivery rate and provides some degree of protection because an attacker cannot control the outcome of the decoding process without knowing all other coded packets [START_REF] Fragouli | Network Coding: An Instant Primer[END_REF]. These issues are critical for smart systems.

Network Coding

In network coding the nodes take several packets and combine them together for transmission, instead of simply relaying the data packets they receive [START_REF] Fragouli | Network Coding: An Instant Primer[END_REF]. This approach can be used to improve the throughput, efficiency, scalability, resilience to attacks and eavesdropping in networks. In the case of sensor Networks it can be used to reduce packet error rate [START_REF] Keller | SenseCode: Network Coding for Reliable Networks[END_REF].

When linear global coding is used the encoded packets are transmitted along the network, where encoding can be performed recursively. When packets reach their destination the decoding process can be applied on these packets for the original ones to be extracted. In the following discussion it is assumed that:  Each packet consists of bits, small packets are padded with 0's;  s consecutive bits form a symbol over finite field ;  Each packet is a vector of symbols;

 The resulting linearly combined packets also have length .

Encoding

Let us assume the original packets (

). An encoded packet will be a vector of symbols,

, where the symbol will be:

(1) where coefficients are in , while and are the symbols of and , respectively. The encoding vector is used by recipients to decode the data. Since the encoding process can occur recursively through the network, any intermediate node can receive the encoded packets and encode them again to generate a linear combination of these packets. Although a different set of coefficients is used to make the new linear combinations, , the corresponding encoding vector is not simply since coefficients are with respect to the original packets . That is, the re-encoded packet ends up being tagged with an encoding vector whose elements are:

Decoding

When a node receives arrivals , it needs to retrieve the original packets. This can be achieved by solving the system:

This linear system has equations that need to be solved to extract the unknowns (unknowns are ). To perform this, it requires that to be able to recover the original data, which means that the number of received packets should be at least equal to the number of the original packets.

Proposed P2P Architecture

Motivation

Network coding is an elegant way of finding a balance between energy efficiency and end-to-end packet error rate, which are competing goals. However, network coding based constrained wireless networks cannot benefit from RELOAD/CoAP P2P storage. For this reason we propose to extend CoAP Usage data Kind. A decoding service, to be provided by the P2P overlay, is required.

Overall Architecture

At the wireless section the nodes are organized in a way that packet flowing toward a sink/proxy node is ensured. Fig. 1 shows the proposed architecture. Depending on factors like location, energy and functionality, nodes can be of type:  Sensing: Data sources that forward their packets according to some routing table. Nodes can turn to sleep mode to reduce energy consumption.

Storing Data and Standard Extensions Needed

Data Kinds

The data Kinds defined by CoAP Usage include the CoAP-REGISTRATION, to announce resources available, and CoAP-CACHING for the storage of sensor measurements [START_REF] Jimenez | A Constrained Application Protocol (CoAP) Usage for REsource LOcation And Discovery (RELOAD)[END_REF]. Although the CoAP protocol itself supports the caching of sensor measurements to reduce the response time and network bandwidth consumption for future requests (see [START_REF] Shelby | The Constrained Application Protocol (CoAP)[END_REF]), the additional caching mechanism of CoAP Usage allows such data to be stored in the P2P overlay, improving even more the response time and bandwidth use because nodes can go to sleep mode for longer periods of time.

Regarding CoAP-CACHING, the possibility of storing proxy data and sensor data directly are both considered. Their resource names will be their CoAP URIs (e.g. "coap://overlay-1.com/proxy-1/", "coap://overlay-1.com/proxy-1/sensor-temp"). That is, the proxy data structure supports data from multiple sensor nodes forwarding their data to a proxy, while the sensor data structure stores measurements of a specific sensor node. Listing 1 shows the data stored for proxy with NodeID "9996172" and URI "coap://overlay-1.com/proxy-1", where "mt" is the measurement time of data, "ttl" is the time-to-live, and "v" is the measurement value.

Listing 1. Storage of proxy data. Resource-ID=h("coap://overlay-1.com/proxy-1/") KEY=9996172, VALUE=[ </sensor-1/>; {mt=100000;ttl=10000;v=38}; {mt=100055;ttl=456990;v=42}; {mt=134000;ttl=234000;v=30} </sensor-2/>; {mt=100000;ttl=10000;v=40}; {mt=400000;ttl=17000;v=25}] The "h(...)" is the hash over the URI, because the key space for storage in the overlay must be numeric. Listing 2 shows a direct storage of data from sensor with URI "coap://overlay-1.com/proxy-1/sensor-1". Proxy with NodeID "9996172" is the one responsible for the sensor-1.

Listing 2. Storage of sensor data.

Resource-ID=h("coap://overlay-1.com/proxy-1/sensor-1") KEY=9996172, VALUE=[ {mt=100000;ttl=10000;v=38}; {mt=100055;ttl=456990;v=42}; {mt=134000;ttl=234000;v=30}]

Requirements Regarding Network Coding

Network coding based constrained networks forward original and encoded packets toward the proxy participating as peers in the P2P overlay network. Therefore, for network coding based constrained networks to benefit from such a distributed storage, the data Kind must also allow the storage of:  Encoding vectors: Required for the decoding. For deterministic network coding these may be stored at the overlay at peer registration time (done once). A proxy stores encoding vectors of sensors for which it is responsible for.  Encoded packets: Since decoding may not be done if a sufficient number of encoded packets has not arrived, storage of encoded packets is needed. Therefore, the current CoAP Usage data Kind must be extended. Listing 3 shows an example when using such extended data Kind. . Moreover, these encoding nodes can hear each other. In this case, the linear combinations of packets from children plus packets they have heard is done (

). When a single packet gets lost, it can be retrieved when the decoding is performed. Please note that encoding can be performed at different areas of the wireless section, and nodes may forward packets toward different proxies/gateways. Therefore, decoding might require encoded packets stored by different proxies. Therefore, a relevant research issue is how to build routing trees that increase the effectiveness of encoding. Also, other encoding scenarios are possible (e.g. and could forward some overheard packets so that multiple packets can be recovered) with different impacts on bandwidth usage.

When a client needs to fetch sensor data from the overlay network, such data can be directly available (original data) or there might be a need to perform the decoding process, using stored encoded data and encoding vectors, in order to extract the original data. This decoding would be accomplished by RELOAD nodes able to provide such decoding service. Fig. 3 illustrates a scenario where the decoding service is requested. A fetch request by some client may involve fetching original data and encoded data, which also requires fetching the encoding vectors, so that the highest amount of sensor measurements is returned to the client.

Since peers face the problem of finding the peers providing the decoding service, the Recursive Distributed Rendezvous (ReDiR) service discovery mechanism can be used [START_REF] Maenpaa | Service Discovery Usage for REsource LOcation And Discovery (RELOAD)[END_REF]. ReDiR ensures that the load is distributed among the nodes providing the service.

CoAP Option

CoAP allows options to be included in a message [START_REF] Shelby | The Constrained Application Protocol (CoAP)[END_REF]. Each option instance specifies the option number, length of the option value, and the option value itself. For the proxy to be able to differentiate the type of payload at CoAP packets, which may be of original or encoded type, the CoAP option numbers registry should include an entry referring to encoded data. A CoAP packet carrying encoded data must carry such option.

Conclusions and Future Work

This article discusses how to federate network coding based constrained networks through RELOAD and CoAP Usage. The proposal is for network coding based constrained networks to be able to store encoding vectors and encoded data at the P2P overlay network, which requires an extension of CoAP Usage data Kind. This provides a scalable and efficient way of discovering cached sensor data of geographically dispersed sensor networks, allowing large scale applications to emerge, while taking advantage of network coding at the wireless section. This architecture serves as a basis for future proposal of algorithms that determine the most effective routing trees and placement of coding nodes.



  Encoding: Node able to perform encoding. Besides forwarding original packets, extra encoded packets are created by linearly combining received packets and packets overheard from neighbors. These might be required to have more energy, memory and processing capabilities than others.  Relay: Work just as relays and forward any received packets, either original or encoded, towards the sink. Perform no encoding/decoding operations.

Fig. 1 .

 1 Fig. 1. Overall architecture.

Fig. 2

 2 Fig. 2 Example of network coding at constrained network.

Fig. 3 4 . 3 . 3 .

 3433 Fig. 3 Decoding at RELOAD/CoAP P2P overlay network.

  The first value regards to the current data Kind structure and second value includes predefined encoding vectors and arriving encoded data.

	Listing 3. Extended sensor data.
	Resource-ID=h("coap://overlay-1.com/proxy-1/")
	KEY=9996172,
	VALUE=[
	</sensor-1/>; {mt=100000;ttl=10000;v=38};
	{mt=100055;ttl=456990;v=42};
	{mt=134000;ttl=234000;v=30}
	</sensor-2/>; {mt=100000;ttl=10000;v=40};
	{mt=400000;ttl=17000;v=25}]
	ENCODING=[
	{enVector1;enVector2;...};
	{1stcodedData;2ndcodedData;...}]

Acknowledgment This work was supported by FCT (Foundation for Science and Technology) from Portugal within CEOT Research Center and UID/MULTI/00631/2013 project. Eman AL-Hawri is supported by a grant from Thamar University -Yemen.


Neda Hajibandeh
email: hajibandeh.n@ubi.pt

Miadreza Shafie-Khah
email: miadreza@ubi.pt

Saber Talari
email: saber.talari@ubi.pt

João P S Catalão
email: catalao@fe.up.pt

The Impacts of Demand Response on the Efficiency of Energy Markets in the Presence of Wind Farms

Keywords: Demand Response, Electricity Market, Stochastic programming, Wind production

In this paper, an optimal scheduling of thermal and wind power plants is presented by using a stochastic programming approach to cover the uncertainties of the forecasted generation of wind farms. Uncertainties related to wind forecast error, consequently wind generation outage power and also system load demand are modeled through scenario generation. Then, with regard to day-ahead and real-time energy markets and taking into account the relevant constraints, the thermal unit commitment problem is solved considering wind energy injection into the system. Besides, in order to assess impacts of Demand Response (DR) on the problem, a load reduction demand response model has been applied in the base model. In this approach, self and cross elasticity is used for modeling the customers' behavior modeling. The results indicate that the DR Programs (DRPs) improves the market efficiency especially in peak hours when the thermal Gencos become critical suppliers and the combination of DRPs and wind farm can be so efficient.

Introduction

Different countries have increased contribution of renewable energy resources by planning and applying protectionist policies of renewable energies [START_REF] Kennedy | Use of electricity price to match heat load with wind power generation[END_REF]. In some countries, wind sources participate in the electricity markets disregarding imbalance penalties [START_REF] Bathurst | Trading wind generation in short-term energy markets[END_REF]. Imbalance penalties are defined as power planned by supplier minus generated power. It is used for security and appropriate utilization of system and avoids to be trifled with market. In some power markets, wind resources will be allowed to offer energy in the market, but some of supportive methods are used to increase their income. These methods usually increase power imbalance in the time of use and thereupon, will follow increasing the cost for the system [START_REF] Matevosyan | Minimization of imbalance cost trading wind power on the shortterm power market[END_REF].

In [START_REF] Yu | Valuation of switchable tariff for wind energy[END_REF], a changeable tariff method has been used to specify income of wind power unit in the power market. In the current method, the consumption cost rises in proportion to its increase and therefore, more consumption is not associated with more subsidy and high consumption customers are in the focus of rising cost instead of whole customers. In [START_REF] Pinson | Trading wind generation from short-term probabilistic forecasts of wind power[END_REF][START_REF] Morales | Short-Term Trading for a Wind Power Producer[END_REF], the method of profit maximization is used to participate wind power plants. Modelling of uncertainties is necessary for these methods. Also, since the interval between time of bidding and time of use may be high, wind power plant's income will be reduced in these methods. A supportive method for contribution of wind power plant to the power markets has been discussed in [START_REF] Parsa Moghadm | A new method for pricing of wind power in short-term power markets[END_REF]. However, if the content of wind resources increases, use of supportive methods will be inefficient.

In this paper, two-stage stochastic bidding considering uncertainty in the market price is carried out. Uncertainty in the market price is modelled as probability density function and finally, each renewable generating unit presents a set of its strategies as probability density function. Among the presented models for estimation of wind speed, Weibull distribution has the best fitting for statistical data, so in most articles it is used as a suitable distribution to estimate the wind speed [START_REF] Moeini-Aghtaie | Incorporating large-scale distant wind farms in probabilistic transmission expansion planning-Part I: Theory and algorithm[END_REF][START_REF] Kianoosh | A novel multi-time-scale modeling for electric power demand forecasting: From shortterm to medium-term horizon[END_REF]. Appropriate values for parameters estimation of this probability function accepted for wind speed have been given in [START_REF] Yu | Probabilistic load flow evaluation with hybrid latin hypercube sampling and cholesky decomposition[END_REF][START_REF] Verbic | Probabilistic Optimal Power Flow Applications to Electricity Markets[END_REF].

In the current paper, the aim is to model players' behavior in the imperfect market and obtain the optimum point to tariff the DRPs, while the scope of research is from the perspective of independent system operator (ISO). A model is proposed for day-ahead and real-time energy markets with implementation of DRPs in presence of the wind turbines. In fact, system uncertainties including outage of wind farms are merged in a two-stage stochastic model.

The remainder of this paper is structured as follows. Relationship to smart systems is provided in section 2. In section 3, modelling the wind power units in the market is introduced and their mathematical model is presented. Numeric results of the model are presented in section 4, and the last section concludes the paper.

Relationship to Smart Systems

With the expansion of smart meters, like Advanced Metering Infrastructure (AMI) and Internet of Things (IoT), in demand side of power systems, implementation of different methods of DR is going to be much more applicable [START_REF] Verbic | Probabilistic Optimal Power Flow Applications to Electricity Markets[END_REF]. A suitable DR method can not only decrease total operation cost but also provide security and safety of the network operation [START_REF] Boroojeni | Overview of the Security and Privacy Issues in Smart Grids[END_REF].

In [START_REF] Çiçek | Demand Response Management for Smart Grids With Wind Power[END_REF], DR is discussed considering wind units connected to a smart grid. They have tried to maximize the social welfare while the intermittent nature of wind may impose some real challenges. It is performed a comparison with the predictable scheduling and with a non-smart grid. The proposed approach balances the wind power fluctuations in the grid due to DR management.

In continuous we proposed DR programs as well to mitigate the challenges of grid including wind units.

The Proposed Model

In the current paper, the price-based DRP, Time of Use (TOU) [START_REF] Heydarian-Forushani | Robust scheduling of variable wind generation by coordination of bulk energy storages and demand response[END_REF][START_REF] Heydarian-Forushani | Flexible security-constrained scheduling of wind power enabling time of use pricing scheme[END_REF], is considered. Equation (1) denotes the optimal customer's demand in 24 hours while taking part in price-based DRPs [START_REF] Arasteh | Iot-based smart cities: A survey[END_REF].

24 0 0 1 0 [ ( ) ( )] ( ) ( ) 1 ( , ). () t tt d t d t E t t t                (1)
where () dt and 0 () dtare the final and initial electricity demand, respectively. ( , ) E t t represents the elasticity of demand. Considering to a guaranteed purchase of electricity from the renewable resources including wind and solar, in many studies and planning, renewable loads are considered as negative loads when setting the market prices based on offer for sale of all power plants. In addition to, in some markets, these renewable resources can also bid their price in the power market and sell their energy as thermal and other power plants.

But, according to the policy makings of the governments to encourage and attract investor toward generating electricity from the renewable energies and developing clear energies in the countries, they usually purchase the electricity of clear resources from the vendors at prices several times the market clearing price to make an incentive to attract investors to this industry and guarantee to purchase the electricity at high and fixed price [START_REF] Aalami | Demand response modeling considering Interruptible/Curtailable loads and capacity market programs[END_REF].

The unit commitment program and its aggregate constraints can be modeled as below:

_ _ _ _ _ , , , , , , , , , , 1 1 1 1 1 _
_ _ _ , , , , , , 1 1 1 (
)

NT NG NM NT NG e G Eng G UC G UC G DC G DC i t i i t i t m i t m i t i t i t i t t i m t i NT NW NG G UE G up G DE G dn w i t i t w i t i t w t w i Minimize SUC MPC U P C C R C R C r C r                                 (2)
where ,,

e i t m
P denotes the production of segment m in a linear form of cost function. , it SUC denotes the start-up cost.

, i i t MPC U is the minimum production cost. The costs of start-up, minimum generation, and the electricity of producer plants are included in the objective function. The second part of the objective function is associated with the offer price of up/down reserve from production plants. The next term consists of the scenarios consideration. The prices with regard to the expected delivered up/down reserve through production plants are formulated in the next term. The scenarios of wind power are generated based on a roulette wheel mechanism presented in [START_REF] Shafie-Khah | Strategic offering for a price-maker wind power producer in oligopoly markets considering demand response exchange[END_REF]. The objective function is subjected to following constraints.

Day-Ahead Equations

Equation (3) guarantees the demand-supply balance. As regard with modelling the linearized transmission limits, DC load flow is used as formulated through [START_REF] Yu | Valuation of switchable tariff for wind energy[END_REF]. Furthermore, the branch limitations are modelled in [START_REF] Pinson | Trading wind generation from short-term probabilistic forecasts of wind power[END_REF]. Wind units considered in the day-ahead session are constrained due to the predicted wind production in [START_REF] Morales | Short-Term Trading for a Wind Power Producer[END_REF]. Electricity and capacity equations of thermal plants are proposed in ( 7)- [START_REF] Verbic | Probabilistic Optimal Power Flow Applications to Electricity Markets[END_REF]. Block electricity output of thermal plants and the limits are described through [START_REF] Parsa Moghadm | A new method for pricing of wind power in short-term power markets[END_REF]. Equations ( 8)-( 9) restrain the generation of thermal plants. The reserve up/down limits are described in ( 10)- [START_REF] Verbic | Probabilistic Optimal Power Flow Applications to Electricity Markets[END_REF] as well. The inequality ( 12) denotes the start-up limit of thermal plants. Constraints ( 13) and ( 14) formulate the minimum up/down times of thermal plants, respectively [START_REF] Shafie-Khah | Unified solution of a nonconvex SCUC problem using combination of modified branch-and-bound method with quadratic programming[END_REF].

,0 ,, , .... , b b b b WP S C it j t l t wf t i G wf WF j J l L P P L F b t             (3)
 

0 0 0 , , , .... , l t b t b t l F X l t      (4)
G DC i t i t P R i t    (9)
_ , ... 0, .

G UC i t i R RU i t     (10)
_ , ... 0, .

G DC i t i R RD i t     (11) , , , 1 .
( .. ), .

i t i i t i t SUC SC U U i t     (12)     , , , 1 2 1
, .... i t MUT i t i i t i t i tt U MUT U U MUT i t           (13)   , , 1 , 2 .
... , i t MDT i t i i t i t i tt U MDT U U MDT i t          ( 14
)
The Impacts of Demand Response on the Efficiency of Energy Markets 291

Real-Time Equations

This stage is dealing with fulfilling the limits in the realization of all scenarios. The demand-supply balance is taken into account for all the scenarios in (15) by considering the updates of wind generation. Constraints ( 16)-( 17) are similar to (4)-( 5) that consider for all the scenarios. The delivered up/down reserve in all scenarios needs to be limited to the planned reserve capacity formerly submitted to the markets ( 18)- [START_REF] Shafie-Khah | Unified solution of a nonconvex SCUC problem using combination of modified branch-and-bound method with quadratic programming[END_REF]. Constraint [START_REF] Fu | AC contingency dispatch based on securityconstrained unit commitmen[END_REF] characterizes the net generation of thermal plants in real-time. Equation ( 21) represents the technical constraints of thermal generators. Ramp up/down limit is given in ( 22)-( 23).

    _ _ , 0 , , , , , , , , , , ..
            (1 5)   , , , , , , , . , .
.

l w t w t b w t l F X l w t      (1 6) max max ,, . , ... , l l w t l F F F l w t     (1 7) __ , , , .... 0 , , G up G UC i w t i t r R i w t    (1 8) __ , , , .... 0 , , G dn G DC i w t i t r R i w t    (1 9) __ , , , , , , , . , .. ,

 

, , , ,

, .

i w t i w t i it i i t P P RU U SUR U i w t        ( 2 2)

 

, ,

, .

i w t i w t i i t i i t P P RD U SDR U i w t        ( 2 3)

Numerical Results of the Model

In order to indicate the impact of DRPs on the oligopolistic behavior of electricity market in presence of wind farm, the IEEE six-bus test system is employed [START_REF] Fu | AC contingency dispatch based on securityconstrained unit commitmen[END_REF]. The mixed-integer linear programming has been modeled in GAMS 24.0 and solved by CPLEX 12.0. In addition different types of TOU programs are studied as presented in Table 1. It is assumed that 20% of consumers are responsive demand except the TOU-3 tariff that its price tariff is considered as the same as TOU-1 but at this program 40% of consumers are responsive demand.

The impact of different types of TOU programs on Genco 1 is compared with the generation in base case without the presence of wind farm and in presence of the wind units, the power output of Genco 1 in these cases are presented in Fig. 1 and Fig. 2, respectively. According to Fig. 1, Genco 1 is affected by the load shifting arisen from TOU tariffs. On this basis, the generation in valley period is increased based on the low tariff, while the generation reduces in the peak period. Fig. 2 depicts the same great affection but the very considerable and beneficial changes in base case in presence of wind units. As it is shown there is a comprehensive reform in the curve and chart. It should be noted that the prices in base case program is obtained from the simulation of the electricity market without implementation of DRPs. In the base case, the average of market prices is considered as electricity tariff in all hours. In TOU programs, the mentioned tariff is considered as the tariff in off-peak hours. The self-and cross-elasticities are extracted from [START_REF] Zhao | Multi-Stage Robust Unit Commitment considering Wind and Demand Response[END_REF]. Developing the investigation of the impact of different types of TOU programs on the behaviour of market players Figs. 3 and4 are presented. These figures depict the power output of Genco 2 without the presence of wind farm and in presence of the wind units respectively. These results show the different tariffs of TOU demand response in presence of wind farm can more considerably effect on shifting peak loads to Valley. Fig. 3 shows the significant impact of TOU programs on the electricity market prices in the peak period, because of the reduction of offered prices of the system's Gencos. The impact of different types of TOU programs on objective function is presented in Table 2. As it is expected, it shows that total price after implementation of DRPs with presence of wind farm is less than that in the system with no renewable units.

Conclusions

In this paper, modelling the power market was conducted and bidding of power plants and making the supply curve and then its intersection with the demand curve to find clearing price of market were modelled. Next, the impacts of uncertainty of wind farms outages on electricity price were investigated by modelling them as negative loads. Lower electricity prices reduced profits from the sale of electricity for thermal power plants that had higher utilization cost and made them reduce their motivation to take part in the electricity markets.

Regarding the unstable nature of wind energy and the problem of market price reduction in the case of wind energy, the impact of a demand response program on such a system was studied. In other words, finally by adding the demand response planning to the models, the electricity market and approach to the real condition were studied. The presence of both the wind energy and demand response program led to lower prices and provided price adjustment and market stability.



  are the final and initial electricity tariffs, respectively.

  price of downand up-reserves of power producers. price of up-and down-deployed reserves of each unit. down-reserve capacities of each unit, respectively. up-and down-deployed reserves of each unit.

Fig. 1 .Fig. 2 .

 12 Fig. 1. Impact of different types of TOU program on the generation of Genco 1 without the presence of wind farm.

Fig. 3 .Fig. 4 .

 34 Fig. 3. Impact of different types of TOU program on the generation of Genco 2 without the presence of wind farm.

  .. ,,

	G up i w t r	G dn i w t r	W wf w t P	WP S wf t P	l w t F	l t F	b w t
	b i G	b wf WF		b l L

  .

	i P	w	t		i P	t		G i w r	up t		G i w r	dn t	i 	w	t	0)	(2
	i P	min U	i	, t		i P	, , w t		i P	max U	i	, t	.. . .  i	, w	,	t	1)	(2

Table 1 .

 1 Tariffs/incentives of considered DRPs (€/MWH)

		Case		Valley (1 to 8)	Off-peak. (9-11,22-24)	Peak. (12-14 ,19-21)	Critical peak (15 to 18)
		Base case (fixed-rate)	63.2	63.2	63.2	63.2
		TOU-1		31.6	63.2	94.8	94.8
		TOU-2		15.8	63.2	126.4	126.4
		TOU-3		31.6	63.2	94.8	189.6
		200	TOU-1
			TOU-2
	Power (MW)	140 160 180	TOU-3 Base case
		120
		1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
					Time (h)

Table 2 .

 2 Total cost for different DRPs in compere of presence or absence of wind farm

	Case	Without considering the wind units in the system	With considering the wind units in the system
	Base case (fixed-rate)	2.0935E+5	2.0036E+5
	TOU-1	1.9799E+5	1.8994E+5
	TOU-2	1.8692E+5	1.7940E+5
	TOU-3	1.8886E+5	1.8153E+5

Acknowledgment. This work was supported by FEDER funds through COMPETE 2020 and by Portuguese funds through FCT, under Projects SAICT-PAC/0004/2015 -POCI-01-0145-FEDER-016434, POCI-01-0145-FEDER-006961, UID/EEA/50014/2013, UID/CEC/50021/2013, and UID/EMS/00151/2013. Also, the research leading to these results has received funding from the EU Seventh Framework Programme FP7/2007-2013 under grant agreement no. 309048.


Vitor Silva
email: vsilva@deetc.isel.ipl.pt

Manuel Barata

Manuela Vieira

Reconfigurable Photonic Logic Architecture: An Overview

Keywords: Optoelectronics, photosensor, a-SiC technology, pin, amorphous silicon, logical functions, digital light signal

The photosensor studied in this document, is an amorphous silicon structure deposited on transparent glass allowing illumination on both sides. It responds to wavelengths from near infrared range to the ultra-violet. The front illumination surface is used for inputting light signal. The dynamic characteristics of the photosensor are altered by using optical bias on either surface of the sensor, thus the same input results in different outputs. Experimental studies made with the photosensor evaluate its applicability as a multiplexer, demultiplexer and logical operations device. A memory effect was observed. A programmable pattern emission system, and a validation and recovery system were built to illuminate the sensor with input light signals and to analyze the resulting output.

Introduction

Research work of the a-Si:H, a-SiC:H pi'npin photosensor [START_REF] Vieira | Self-biasing effect in colour sensitive photodiodes based on double p-i-n a-SiC:H heterojunctions[END_REF] has shown that it has a nonlinear property of changing its bandwidth not only with the electrical bias but also a change of its bandwidth occurs with a light shining over the sensor, in either surface, despite the applied electrical bias [START_REF] Vieira | Multilayered a-SiC:H device for Wavelength-Division (de)Multiplexing applications in the visible spectrum[END_REF]. Several applications have been done or proposed and the possibility of using this sensor for communication is studied even though the throughput is presently 12000 bps per channel.

This suggests that the channel selection which is made by digital switching over electrical channels to be de-multiplexed can, with this approach, be selected at the sensor with light selectors thus bringing to the photon side of the interface the capability of choosing the desired channel. Using Manchester code instead of the previous work with NRZ (No Return to Zero) code improves channel discrimination at the reception. The sensor is also looked upon its capability of producing a single electrical output with several input channels. This photocurrent translation is studied to identify logical operations as the AND, OR, NOT and XOR, and other more complex as the adder. A memory effect has also been identified and studied herein. Experiments with random values show the dispersion of the signals at the reception and several strategies to reproduce the input channels are proposed. Several programs had to be built and are used as tools to illuminate the sensor and analyze the sensor output. Observation of the device's behavior arose several questions that span the proposed work: How many channels can be transmitted by WDM, in visible light, with the sensor by selecting the desired channel with ultra-violet light?; What wavelengths ranges are best suited for the de-multiplexing function?; Which are the logical functions that can be translated by this sensor?; How to build complex logical functions with the device?; How to de-multiplex light channels using light selectors with one sensor?; How to build a memory due to charges stored by light?. The answer to these questions is presented in this document, along with other study paths.

Relationship to Smart System

A smart system uses a feedback loop of data, providing evidence for decision-making. The system can monitor, measure, analyze, communicate and act, based on the sensors' information [START_REF]Smart infrastructure: the future[END_REF]. Smart systems can be classified in several levels: those that collect usage and performance data to be used for a next version of a smarter system, those that collect, process and present data for humans to make a better decision, and those that collect data to take action without any human intervention.

A smart system is based on data, and that is its core. Data can be easily acquired and stored but it will also easily increase in quantity. As a resource, its ownership is also a point to be taken into consideration. Data must be analyzed, fused with other data sources, interpreted and sourced into mathematical models that will hopefully provide a highly reliable decision making tool for society and especially for those whose jobs are involved in taking decisions.

A system needs feedback, and that aspect is fundamental in any smart system, not only to increase its performance but also to improve its robustness. Data of different sources may come from the same physical reality which brings our attention to redundancy. This redundancy, which can also be constituted by different systems, is also an advantage due to possible error conditions or flaws.

The device presented in this paper is a sensor that is sensitive to light and as such it can be inserted into a smart system data loop. One of the observed characteristics of the sensor is that it holds memory of the visible light that has impinged onto its surface, even when not connected to a circuit. This could be applied as a sensor to be located in a closed box or case; an environment where no electricity is present. If the box or case is opened under visible light and then shut again, it would be possible to know that at least one opening occurred by reading the sensor under a controlled no light condition.

Device Structure and Operation

The sensor is a two stacked pin structure (p(a-SiC:H)-i'(a-SiC:H)-n(a-SiC:H))-(p(a-SiC:H)-i(a-Si:H)-n(a-Si:H)). Thicknesses and optical gap optimized for light absorption in the red and blue ranges; i-(1000 nm; 1.8 eV), i'-(200 nm; 2.1 eV) [START_REF] Vieira | Three Transducers Embedded into One Single SiC Photodetector : LSP Direct Image Sensor , Optical Amplifier and Demux Device[END_REF]. This structure is 1cm 2 in area, built with silicon carbon [START_REF] De Cesare | a-Si:H/a-SiC:H Heterostructure for Bias-Controlled Photodetectors[END_REF], can be seen in Fig. 1, where the wavelength arrows indicate absorption depths during operation. The wavelengths mostly used are: λV=400 nm, λB=470 nm, λG=524 nm and λR=626 nm.

Fig. 1. Sensor structure and operation

The experimental setup use LEDs as light sources: as digital signals and as bias lighting. The digital signals are usually: violet (400 nm), blue (470 nm), green (524 nm) and red (626 nm), and shone over the entire front surface of the device. The background lighting is ultra-violet (390 nm) and is set either at the back or at the front side of the sensor, and lighting is applied in a continuous non pulsating flux. Compared to the optical bias intensity, the intensity of the signal sources is lower.

Using a monochromator with 10 nm steps, from 300 to 800 nm, spectral response curves were produced, and the resulting photocurrent stored in a file with the corresponding input wavelength. The device operation point was set at -8 V because a previous study suggests that, that electrical bias is the most suited to allow for a steady state optical bias and channels with visible light impulses, while outputting a photocurrent that changes with the input wavelengths [START_REF] Vieira | Three Transducers for One Photodetector: essays for optical communications[END_REF]. The spectral response for a violet (400 nm) optical bias at the front and back surfaces of the sensor is presented in Fig. 2 Fig. 2. Sensor photocurrent output using optical bias wavelength of 400 nm at the a) front and b) back sides.

The experimental results of Fig. 2 a), show that the photocurrent increases in the 470 to 700 nm bandwidth when the sensor is lit on the front surface. To compare both graphs in of Fig. 2, the thick black curve represents the dark level and is the same on both figures. With increasing LED current through the LED that shines over the back surface, the photocurrent decreases gradually in the 470-700 nm bandwidths, and there is an almost identical increase of the photocurrent in the 400-470 nm range. The photocurrent gain, which is the output photocurrent divided by the dark current level, is shown in Fig. 3 The spectral gain shown in Fig. 3a), is reduced within the short wavelengths (< 470 nm) and increased over the long wavelengths (> 470 nm), behaving as a selective filter centered in 650 nm with bias illumination at the front. With bias lighting shining over the back surface, Fig. 3b), the opposite behavior is noticed; the short wavelengths gain increases while the long wavelengths gain decreases. This resembles a filter centered at 440 nm. The sensor acts as a selective filter, where the gain of the short and long pass wavelengths is controlled by the optical bias. The gains of both filters suffer almost no changes when the LED currents are above 10 mA.

Experimental Setup

The sensor is biased with -8 V and the experimental setup shown in Fig. 4. Both end surfaces are clear for lighting. The setup shows the LEDs relative position to the sensor. The optical bias LEDs, Front and Back, are both ultra-violet (390 nm). An optical bias lit LED has its illumination maintained at a fixed level. The current of each LED can be controlled in 127 steps from 0 to 30 mA, and both LEDs are never lit simultaneously. The data channel LEDs are: Ultra-violet (U: 390 nm), Violet (V: 400 nm), Navy (N: 430 nm) , Cyan (C: 460 nm) , Blue (B: 470 nm) , Green (G: 524 nm) , Lime (L: 565 nm), Orange (O: 605 nm) , Red (R: 626 nm) and Magenta (M: 640 nm). Each data channel can have its current changed from 0 to 30 mA in 127 steps, but the values used are usually 0 to 5 mA range with different synchronized patterns.

Fig. 4. Sensor and LED relative positions and equipment

All LEDs are software controlled by the PiscaLed [START_REF] Silva | PiscaLed -User's Manual[END_REF][START_REF] Silva | PiscaLed -Technical Manual[END_REF] system that drives them physically by communicating with the HexaLed driver [START_REF] Silva | HexaLed-User's Manual[END_REF]. Data values supplied by the PiscaLed are shaped into configurable frames and encoded or not in Manchester coding; the frame can be raw, with the data bits presented to the channel LEDs, in a frame with a preamble, start of frame, data values and end of frame. The preamble is a sequence of several [010101] bits on all channels, used at the reception to determine the maximum intensity value, used for normalization and synchronization. The start of frame begins with a slight difference in the preamble [0110] followed by data. The sequence of [010100] at the end of the frame precedes the switching off of all channels. To analyze the results several programs developed within this thesis were used namely the IndicaLed [START_REF] Silva | HexaLed-User's Manual[END_REF][START_REF] Silva | IndicaLed[END_REF]11].

Each data bit can be coded in non return to zero (NRZ) or Manchester [START_REF] Atmel | Manchester Coding Basics: Application Note[END_REF]. When a large number of equal data bits are transmitted the resulting NRZ output is either no illumination (bits = 0) or continuous (bits = 1); resulting in no photocurrent changes. With Manchester coding there is always a change in photocurrent due to the pulsed pattern. There are more solutions to overcome the NRZ pattern for example by the introduction of a scrambler or other type of encoding [START_REF] Choi | Report: Parallel Scrambling Techniques for Digital Multiplexers[END_REF].

The photocurrent output of the sensor is named differently according to its optical illumination and signal source: dark, back or front. The Dark photocurrent is defined as the output current when the sensor is in darkness. The Front signal is the photocurrent output with optical bias applied to the front surface of the sensor and pulsing data LEDs shining, and consequently the Back photocurrent output is the electrical signal produced with the optical bias at the back surface and the pulsating data LEDs lit.

The photocurrent output is converted to a voltage by the current to voltage converter and is connected to an oscilloscope. The voltage signal is sampled at the oscilloscope and sent to the computer, as shown in Fig. 4. The Data stored consists on the data LEDs input and converted output photocurrent, so that the analysis can be validated by having both the expected result and the obtained output. The signals are stored as received, Dark, Front and Back signals read with their minimum value set to 0.0 V, and normalized between 0.0 and 1.0 for analysis.

Five Channel WDM

The multiplexing of several data channels into one channel is an efficient way to communicate between two peers with the demultiplexing of the single channel into the original ones. Wavelength division multiplexing (WDM) uses different wavelengths for each channel. A five channel WDM with each channel at 12000 bps allows for a raw transmission rate of 5*12000 = 60000 bps. Two selectors, the front and back illumination of the background, are used to select the channels. As a summary the front illumination would sieve two channels and the back illumination would sieve another two, and the remaining channel selection process has a different approach [START_REF] Silva | Five channel WDM communication using a single a:SiC-H double pin photo device[END_REF]. To study the five channels multiplexer an experiment was made and the result is displayed in Fig. 5 Shown in Fig. 5 is the output of the pi'npin when it is bathed by the signal wavelengths (dark) and simultaneously by the front illumination of the background (front) and the background at the back of the device (back). The digital input signals applied to the LEDs, at the top of the figure, contain the input data to each channel. These digital signals help guiding the eyes to the front signal and showing that all 32 combinations are there. The back signal follows the violet input channel (400 nm) very strongly and distinguishes between dubious classifications of the front signal. The blue (470 nm) channel can also be recovered by the back signal. After the extraction of both violet and blue channels, the red=626 nm, orange=605 nm and green=524 nm can be easily identified.

The orange wavelength can be extracted because the gain of that wavelength (αO-front=4.53, αOback=0.54) is different from the other gains. Using the clustering approach [START_REF] Silva | Reconfigurable photonic logic architecture[END_REF], applied to the front and back signals of The pi'npin sensor responds to the orange O 605 nm signal depending on the other signals that are also shining at the sensor. With five different wavelengths, 2 5 =32 possible combinations lead to the 16 areas in Fig. 6 a) which represent the combinations that have the presence of the O 605 wavelength. The area marked with a circle belongs to the influence of O 605 when no other signal wavelength is active. The clusters for the other wavelengths are also shown in Fig. 6 b) to e). The graph of Fig. 6 f) is the over position of all individual wavelengths. There are only 31 areas on this graph because de 00000 bit is not plotted, as each individual graph only indicates where the wavelength is active.

Additional channels may be introduced using only the front and back selectors, but due to the cross gains of one channel over another difficult the extraction of the individual channels [START_REF] Silva | Reconfigurable photonic logic architecture[END_REF].

Logic Functions

The logic functions that are the basic of present digital technologies are mathematic operators of Boolean Algebra. The theoretical work done by George Boole in 1847 is presented in "The mathematical analysis of Logic" [START_REF] Boole | The mathematical analysis of Logic[END_REF]. Using the Boolean logical functions with mathematical state theory more complex structures were built creating the reliable computers that are available at this date [START_REF] Nishimura | Boolean valued decomposition theory of states[END_REF].

The Boolean logic functions, based in mathematical set theory, necessary to build other logic functions are: NOT (negation), AND (conjunction), OR (disjunction) [START_REF] Tanenbaum | Structured computer organization[END_REF]. The implementation of these mathematical constructs in hardware has been done with several techniques [START_REF] Millman | [END_REF]. The basic logical functions can be implemented on a pi'npin device [21], as well as the Majority function, which is also known as the voting function [22].

Digital Light Signals

Logical functions are used as logic gates [23] and other logical functions are created by combining those basic gates. Some circuits are known by a name due to their function. One of those circuits is the multiplexer which is a combinatorial function. The multiplexer can be used as a basic circuit producing results as simple as the basic logic gates. The NOT function is one of those applications built with a multiplexer and is presented in Fig. 7 A digital light signal is defined as: a signal pair with two components where one is the inverse of the other, and the wavelengths of one is from the long and the other from the short filter ranges [27].

Any long, short combination as a signal pair can be used, for example: (Red, Blue) pair and (Green, Violet), both shown in Fig. 7 b).

The two different digital light signal pairs are presented in Fig. 8 with the same data sequence. By subjecting both digital light signal pairs shown in Fig. 8 to the Front and Back bias lighting, it is clear that the Front signal follows the Red and Green input, and Back signal follows Blue and Violet signals.

A visible digital light signal D is the multiplexed signal of two wavelength channels; from the long and from the short wavelength ranges. Represented as D[L, S] where L and S represent the channel color [26], long and short-wavelength range, respectively.

NOT Gate.

The NOT gate shown in Fig. 7 b) is built by a long and a short wavelength channels (for example red and blue or green and violet) is controlled by the violet irradiation. The construction of this gate urged the definition of the digital light signal. Thus the digital light signal is the base of all logical functions built with this device. Fig. 8 shows examples of the NOT function, with the Back ultra-violet light.

Transmitting a False or a True value for a long period of time would degrade the recovery of the output signals, as only the ac component is used. To improve the photocurrent output it is necessary that a True or False bit value changes in time during its bit length. This can be solved by using the Manchester coding [START_REF] Atmel | Manchester Coding Basics: Application Note[END_REF] which guarantees that there is a polarity change in the middle of each True or False bit time length. The photocurrent to be useful must be time dependent, so the logic signal, even if does not have its state changed, must vary in time. This obliges the digital signals to be synchronized and differential, thus a digital light signal must be Manchester coded [START_REF] Millman | [END_REF]21].

Two A digital light signal can be written as Equation 1.

(1) R(t) is the digital sequence for example = {0,1,1,0,0,1,0,1} and B(t) the inverse of that sequence e.g. = {1,0,0,1,1,0,1,0}. The dark photocurrent for each wavelength is iR for the Red and iB for the Blue.

Interaction of Two Digital Light Signals

Logic operators besides the NOT have expressions with two variables. Boolean logic has the associative and commutative properties of algebra that are applied when more than two variables are involved. The number of input variables and the operation that produces a single logical output is called a gate. In this section two light variables are studied as the basic building block of a logical gate. In order to effectively classify the output of the logical gate the sampling of the signal will also be addressed.

Two different digital light signals D[R, B] (Fig. 9a) and P[G, V] (Fig. 9b) illuminated the device and their combination is presented in Fig. 11 [27]. 0,0 0,5 1,0 1,5 2,0 The pattern selected in Fig. 11, shown in detail in Fig. 12 b), holds all possible combinations of the D and P signal and will be analyzed further in the text.

Fig. 12 shows signals Front and Back as a scatter graph, the sequence path where at each point, the back and front values meet at the same time instant i.e. functionOf( Front(t), Back(t) ). On the same figure the vertexes indicate the four combinations {00}, {01}, {10} and {11} of D and P. A simple classification grid can be used with threshold values which are drawn in solid and dashed lines on Fig. 12 a), to classify the logical output.

AND, OR, XOR Gate.

The selected logical function is built by choosing the threshold lines that define the result of the function.

D AND P logical function is defined as: True as output if and only if both inputs have True as a value i.e. {11}. In Fig. 11 corresponds to both Red and Green channels in their ON state (front highest level). Observing Fig. 11 and the scatter function of Fig. 12 a), a threshold line (TFb) can be drawn above which, any result represents the output function D AND P, isolating the {11} result.

The (D OR P) logical function is defined as having the output as True if either or both {DP} are True or equivalently the output is False if and only if both {DP} are False, i.e. {00}. Taking into account Fig. 11 and Fig. 12 a) corresponds to either red, green or both channels in their ON state (under front irradiation). Observing both figures a threshold line (TFa) can be drawn above which, any result is the function D OR P, i.e. {{01}, {10}, {11}}.

The Exclusive OR function, XOR, between two variables {DP} is True when only one of them holds the True value, i.e. {{01}, {10}}. It excludes the {11} from the OR. It can also be defined as the difference operation, which is True, when the variables hold a value which is different from the other. Observing the scatter graph of Fig. 12 a) it is possible to confine the {{01}, {10}} values between the two threshold lines TFa and TFb.

Memory Effect

The p'inpin device has been used throughout this work as a stateless component which means that its output is only dependent of its inputs regardless of the outcome history of past inputs or outputs. This however does not hold when the outputs are observed as a sequence of inputs. The identification of the input sequence, using a classification function with the output of the pi'npin, shows that past sequences do influence the output of the device which does in fact hold a memory of the illumination beforehand. Although this is a difficult task for signal identification it is necessary to understand this phenomenon to ease the identification task and also to use it as an advantage by constructing a volatile memory with the pi'npin device.

Paradigm Change

The observations made to indicate that there is a memory function that characteriz-es the pi'npin device started when the readings of the dark signal did not remain constant between experiments. Initially it was assumed that there was an influence of noise from the surrounding equipment and other devices. Several modifications were gradually made to the experimental setup to reduce the influence of the noise sources.

To understand the start condition of the pi'npin device and its influence over the output, changes were made to the software of the user interface and that of the microcontroller that drives the LEDs, to allow static readings [24,25]. The selection of a start condition, programmable delays and the possibility of short sequences, all time controlled and with adequate triggering for the oscilloscope, allowed the study that is presented in this section.

In all experiments till this point the optical bias was used as a steady lighting, namely in the digital light logical functions and WDM [START_REF] Nishimura | Boolean valued decomposition theory of states[END_REF]21,26]. This optical bias paradigm has to be changed, and seen as two light Control signals; the Back and Front Control signals, to use the sensor as a volatile memory [31]. On this section, the Front and Back lighting are no longer steady state, but impulses.

Conceptual Approach

The experimental setup with the relative positioning of the LEDs to the sensor is shown in Fig. 13 Data Sense signal Phase duration: to study the decay of the stored value through time, an experiment was set in which the Data Sense signal used in the previous experiments is repeated cyclically with a 0.5 ms interval. This is shown in Fig. 14, where the signals at the top guide the eyes. Presented in Fig. 14, are the results of the applied Back and Front Control signals, each with duration of 3 ms followed by the Hibernation phase lasting 3 ms. The Data Sense signal sequence is equivalent to 16 cycles at a frequency of 6000 Hz. These 16 cycles are then repeated.

Results show that there is amplitude decay in time of the output Data Sense signal despite the Control signal is either Front or Back. The decay rate, were it linear, is roughly twice higher in the Front Control signal (-83 μA/s) than in the Back Control signal (-46 μA/s) which means that they instead of crossing will maintain an amplitude equivalent to the Dark reference signal. Furthermore, the decayed amplitude of the Data Sense due to the Front Control will eventually be less than the highest amplitude of the Data Sense due to the Back Control. Observing Fig. 14 that would occur around 25 ms; this determines the volatile memory hold time due to the data sense signal profile.

Conclusion

The p'inpin device has proven to be versatile and with several applications in which it was used: multiplexer, logical gates and a volatile memory. This flexibility is its main advantage.

By experimental observation the simultaneous incidence of the front and back optical illumination is equivalent to a front bias illumination. This characteristic could be used by having the back surface always illuminated and using the front bias when convenient which could speed up the acquisition process.

The sensor illumination has always flooded the whole surface. Studying the use of masks to allow only certain parts of the sensor being used by spatially distributing the input wavelengths over the surface can produce curious results.

The photocurrent varies linearly with the flux intensity of the input signals. By using analogue signals a "light transistor" can be built using the background illumination as a constant amplification setting.

The possibility to change the pi'npin heterostructures by depositing more pins and enabling their junctions to be accessible by optical transparent contacts will definitely improve the research of this simple photosensitive device. The ideal device would be one that could also emit light; with optical inputs and outputs it would effectively be considered as an optical gate. The demultiplexer would then emit in separate channels, the logical functions would work as gates that could be connected as circuits including the memory component.

Due to the low throughput of 12000 bps of each channel the pi'npin sensor can be used in audio and signalling applications.

Fig. 3 .

 3 Fig. 3. Photocurrent gain due to bias lighting upon the a) front and b) back surfaces.

Fig. 5 .

 5 Photocurrent[A]

Fig. 5 6 .Fig. 6 .

 566 Photocurrent

Fig. 7 .

 7 Fig. 7. A multiplexer is used a) as an invert function, and b) 2 examples of the NOT function using the digital light signal pair (Red, Blue) and (Green, Violet) pair. The 2x1 multiplexer shown in Fig. 7 a) composed by a selector that chooses inputs Y and ~Y (NOT Y). When Invert input is 1, the output follows Y, and when the Invert selector is 0 the output follows ~Y. The Invert selector chooses between: a Y signal, or its inverse ~Y. Using the sensor's multiplexer capability [25] to act as an inverter is the basis of the work. Equation1shows, circuit in Fig.7a), the following transformations:

Fig. 8 .

 8 Photocurrent(A)

Fig. 9 .

 9 Fig. 9. Digital light signals and its multiplexer output signals under front and back irradiation a) D(Red, Blue) and b) P(Green, Violet) Two digital light signals are show in Fig. 9: (a) D[R, B] and (b) P[G, V]. By changing the background side illumination with an appropriate intensity and wavelength, results show that the digital light signal describes the basic logic functions [26]. Digital light signals D[R, B] and P[G, V] are plotted as a scatter graph in Fig. 10.

Fig. 10 . 9 .

 109 Fig. 10. Scatter graphs of Fig. 8 a) D[R, B] and b) P[G,V] Shown in Fig. 10 are the scatter graphs of the signals presented in Fig. 9. It is clear that only two values exist in each digital light signal D[R, B] = { {0}, {1} }, and P[G, V] = { {0}, {1} }. The scatter graph also shows that the front and back signal are inversely correlated, due to the negative slope of the graphs [28] as expected due to each digital light signal being a composition of a short and long wavelength [29].A digital light signal can be written as Equation1.

Fig. 11 .Fig. 12 .

 1112 Fig. 11. Result of the interaction of two digital light signals D[Red, Blue] and P[Green, Violet]The interaction of two digital light signal pairs red-blue and green-violet is shown in Fig.11. This signal is shown in Fig.12 a) as a scatter graph where the Front signal is set as the horizontal axis and the Back signal is set as the vertical axis.

Fig. 13 .

 13 Photocurrent[A]

Fig. 14 .

 14 Photocurrent[A]

  .

						Dark							Dark
	Photocurrent [A]	0.00 0.05 0.10 0.15	Front 400nm Background 3500Hz	Increassing Current	LED current [mA] 0.25 0.5 1 1.5 2 2.5 5 10 20 30	[nA] Photocurrent	30 10 20	Back 3500Hz 400nm Increassing Current	Background	LED	current 0.25 1 2 5 20	[mA] 0.5 1.5 2.5 10 30
									0
		400	500	600	700	800		400	500	600	700	800
				Wavelength [nm]					Wavelength	[nm]
	a)						b)

  .

	a)	Gain ( F )	400 450 500 550 600 650 700 750 800 1 2 3 4 5 6  (W/cm 2 ) 5 20 56 100 160 250 575 1270 2600 3800   F =400nm 3500 Hz Wavelength (nm)	b)	0.25 0.5 1 1,5 2 2,5 5 10 20 30 0.5 400 450 500 550 600 650 700 750 800 1.0 1.5 2.0 2.5 3.0  (W/cm 2 ) 5 20 55 100 160 250 575 1270 2600 3800   B =400 nm 3500 Hz Wavelength (nm)	0.25 0.5 1,5 2,5	Gain ( B )

Acknowledgments. Work supported by FCT, CTS multi annual funding, through PIDDAC Programs PTDC/EEA-ELC/111854/2009, PTDC/EEA-ELC/120539/2010.