1 Introduction

Traditional power grid was designed to operate according to a vertical structure defined by generation, transmission and distribution, supported by several control devices which guarantee the power grid stability, reliability and efficiency [1]. Nowadays the traditional power grid is a system supported by obsolete technology [2] and at the same time it has to deal with new challenges such as increasing consumption, more inaccessible and costly fossil fuels, penetration of renewable source generation, energy markets and several power grid stakeholders. Allowing an active participation of energy consumers, reducing greenhouse gas emissions and minimizing the new implantation of traditional power plants, are other challenges that should be considered [13]. In order to provide an answer to these challenges, the smart grid appears as a key element for future power grid design. Mainly because smart grids allow bidirectional power flow and data communication, also because they are based on digital technology and permit to offer new services to consumers supported by smart metering, digital control technologies and by the increasing consumption awareness.

Smart grids encompasses a panoply of themes, methodologies and technologies, however in this paper highlight is given to smart consumption where three main contributions are introduced: (i) to model a prosumer, showing the economic dispatch problem solution based on generation and consumption forecast given by neural networks; (ii) to develop a demand response (DR) computational tool to support consumers decisions based on fuzzy clustering and (iii) to design smart applications for demand side. These main contributions allow giving support to those challenges derived from the incorporation of distributed generation into the power grid. In addition, the proposed DR model is developed with the purpose of “giving intelligence” to consumers, allowing them to take advantage of smart grids implementation, in what regards to consumers active participation in power grid management and also contributing for energy efficiency increase. The smart applications provide the interface between computational tools, developed models and consumers. The smart meters, when integrated in a control structure, allow the implementation of advanced mathematical models.

2 Relation to Cyber-Physical Systems

Considering Cyber-Physical Systems (CPS) as the interaction between computers and physical devices is an important aggregation element in smart grids development and operation. The information exchange between consumers and power grid operator through smart meters is one of the several prevailing CPS in smart grid environment. The mobile communication used to perform demand response actions, allowing household devices management, helps supporting the desired consumers’ active role in grid management. This feature also depends on CPS.

In this paper the relation to CPS is present, in a straightforward way and in an indirect way. An indirect relation to CPS can be found in the prosumer modelling. The prosumer model accuracy depends on consumption and solar radiation forecast data. For the forecast implementation radiation data derived from the Alcáçovas weather station, is used. A processing system is needed to handle the data provided by the sensors and signal acquisition hardware. In addition, a communication system is also involved in this process. Several straightforward relations to CPS can be found in the demand response model deployment. Demand response actions depend on information provided by smart meters. In this paper this provided information is used to define a computation tool that supports consumers in energy management. Through the knowledge of energy price evolution given by the grid operator, available power information and power consumption history data, a fuzzy clustering based software is developed to define which loads can be connected by a domestic consumer, taking into consideration his consumption profiles and operation modes, as described in Sect. 4. These preferences can be related with energy price or lifestyle, namely by defining which loads are eligible to be managed (connected or disconnected), or by defining which hours are more adequate to connect or disconnect loads. Also it is important to notice that the smart applications development and implementation described in Sect. 5 are intrinsically related to CPS. The consumer owned smart meter development incorporates a sensor unit, processor unit, transmitter and display. The hardware is based on Arduino platform. The distributor owned smart meter is the Energy Box [4], which consists on a CPS itself. Moreover, the implementation of smart application presented is based on a strategy that follows an advanced control strategy. This advanced control strategy is designed to perform temperature control actions. The advanced control actions are designed and implemented in Matlab software. The Matlab inputs are references provided by users and the outputs are transmitted to a SCADA system through OPC protocol, in order to perform consumers’ tasks, resorting to a programmable logic controller network (PLC). The advanced control is developed in Matlab, because the required computation is not possible on a SCADA system. However the SCADA system is the interface between Matlab and the PLC network. The PLC network is the system actuator, because it receives the information provided by the SCADA system and executes the control action. Computers are used to monitor and to carry out control actions while physical systems, such as sensors and actuators, are the bridge between the cyber system and the end energy consumer.

3 Prosumer Modeling

Several prosumer models are described in literature [512]. There are models based in intelligent systems [5, 7, 8], in stochastic correlation [6], in predictive control [10], in graphs [11] in multi-objective methodology [12] and in the aggregation of consumer and producer models [9]. In this paper the analyzed prosumer is a domestic consumer, which is simultaneously a solar photovoltaic energy producer. Because distributed generation has intrinsically intermittent characteristics, the prosumer´s production forecast and consumption forecast is included in economic dispatch problem solution. The prosumer model (1–7) is based in [9] and considers energy buying prices given by energy market, obtained from OMEL’s data base [13]. In addition constant selling energy price is considered. The considered generation and consumption power result from forecast models.

$$ Max_{{P_{b} ,P_{l} ,P_{s} }} U\left( {P_{l} } \right) $$
(1)

Subjected to the following constraints:

$$ \lambda {}_{b}P_{b} - \lambda {}_{s}P_{s} \le \overline{W} $$
(2)
$$ \lambda {}_{b} - \lambda {}_{s} \ge 0 $$
(3)
$$ P_{b} + \overline{{P_{g} }} = P_{l} + P_{s} $$
(4)
$$ P_{l_{min} } \le P_{l} \le P_{l_{max} } $$
(5)
$$ P_{s} - \overline{{P_{g} }} \le 0. $$
(6)

Where P b, P l and P s are, buying power, load power and selling power, respectively, \( U\left( {P_{l} } \right) \) is the utility function given by (7). λb and λs are the buying and selling price, respectively. \( \overline{W} \) is the consumer budget and \( \overline{{P_{g} }} \) is generation power. P lmin and P lmax are minimum and maximum load power, respectively.

$$ U\left( {P_{l} } \right) = \sum\limits_{t = 1}^{n} {\gamma \left( t \right)} \, P_{l} \left( t \right) = \left[ {\gamma \left( 1 \right) \ldots \gamma \left( n \right)} \right] \, \left[ {\begin{array}{*{20}c} {P_{l} \left( 1 \right)} \\ \vdots \\ {P_{l} \left( n \right)} \\ \end{array} } \right] . $$
(7)

In (7), \( \gamma \left( t \right) \) is the consumption preference factor vector given by (8–9), which depends on consumption time and is settled accordingly to the Portuguese winter and summer hourly cycles definition [14].

$$ \gamma \left( t \right) = \gamma_{winter} \left( t \right) = \left[ {3\,\,3\,\,3\,\,3\,\,3\,\,3\,\,3\,\,3\,\,2\,\,1\,\,1\,\,2\,\,2\,\,2\,\,2\,\,2\,\,2\,\,2\,\,2\,\,1\,\,1\,\,2\,\,2\,\,3\,\,3} \right] $$
(8)
$$ \gamma \left( t \right) = \gamma_{summer} \left( t \right) = \left[ {3\,\,3\,\,3\,\,3\,\,3\,\,3\,\,3\,\,3\,\,2\,\,2\,\,1\,\,1\,\,1\,\,2\,\,2\,\,2\,\,2\,\,2\,\,2\,\,1\,\,1\,\,2\,\,2\,\,3\,\,3} \right] $$
(9)

The consumption preference factor values are shown in Table 1.

Table 1. Consumption preference factor values

The consumer budget is 1.00 €/day, which under some consumption circumstances, can imply the occurrence of consumers load management in order to assure that this budget limit is not exceeded.

The mathematical model (1–7) incorporates prosumer preferences on selling or buying energy without considering prosumer energy storage capability and its cost. Energy selling price is 0.142 €/kWh, which was chosen accordingly to the Portuguese current selling price values.

Solar photovoltaic energy production is higher on summer; however, despite that fact, energy buying prices are superior to winter energy prices, which can be justified by the summer increased average consumption when compared to the average winter consumption.

In this paper, consumption and production are forecasted resorting to artificial neural networks (NN). For the consumption forecast, the forecasted radiation is converted into power generation, resorting photovoltaic solar system PV curves [13] and considers a 5 kW prosumer’s power generation capacity. For radiation forecast a feedforward multilayer perceptron NN with 19 inputs, 43 units in the hidden layers and 1 output, is considered. A sigmoid activation function is used in the hidden layer and an identity active function on the output layer is used. The training process is carried out by Lavenberg Marquard backpropagation algorithm, using the gradient descendent method and the root mean square error is the chosen performance. The stopping criterion is carried out by cross validation method. The NN is trained with radiation and temperature hourly mean values from 4 years (2005, 2007 to 2009). For the consumption forecast, a feedforward multi-layer perceptron NN with 19 inputs, 49 units in the hidden layer and 1 output is considered. The activation functions used in the hidden and output layers are the same considered in the radiation forecast NN, as well as the training process, performance indicator and stopping criterion. The NN is trained using consumption and temperature hourly mean values available from year 2012. Both consumption and production forecast NN’s are tested for a winter and a summer month, using data not provided to the NN during the learning process. Because input data is mainly time series, Pearson correlation is used in order to define inputs’ pattern. The implemented consumption NN system is shown in Fig. 1. The last two inputs showed in Fig. 1 give the consumption pattern for a 24 h period [15].

Fig. 1.
figure 1figure 1

Consumption forecast NN.

Fig. 2.
figure 2figure 2

Daily January EDPS.

Three scenarios and six case studies are described for the prosumer model analysis, considering daily and monthly time horizons: (a) self-consumption and energy bought in energy market; (b) total produced energy sold and total consumed energy bought in free energy market, and (c) total produced energy sold and total consumed energy bought in energy market considering load shifting.

The economical dispatch problem solution (EDPS) for scenario (a) considering a daily time horizon is shown in Figs. 2 and 3.

Fig. 3.
figure 3figure 3

Daily July EDPS.

From comparison between Figs. 2 and 3 it can be observed that generated power on July is superior to January because solar radiation and solar hour duration is superior during summer. Consequently the power sold on July is superior to the power sold on January and therefore the bought power on July is inferior to the bought power on January. In scenario a) a daily time horizon is used to show in detail the EDPS result and the balance between generation and demand, regarding the possibilities of self-consumption or selling the generated power. The comparison of EDPS between winter and summer is also shown with more detail when daily time horizon is considered. The EDPS results for this scenario are shown in Table 2.

Table 2. Daily EDPS results

In Table 2, the utility value is adimensional and behaves like a satisfaction indicator, because it gives information about the appreciation of using prosumer’s production.

From Fig. 2 and Table 2 analysis considering January, a prosumer’s profit would have been achieved if the generated energy was sold instead of consumed. From Fig. 3 and Table 2 analysis considering July, generated power was enough to meet consumption and the remaining generated power was sold, resulting on prosumer’s profit.

The EDPS for scenario (b) considering a monthly time horizon is shown in Figs. 4 and 5.

Fig. 4.
figure 4figure 4

Monthly January EDPS for scenario (b).

Fig. 5.
figure 5figure 5

Monthly July EDPS for scenario (b).

On Figs. 4, 5, 6 and 7, the load power matches with buying power and generated power matches with the power sold. In order to contribute to representation clarity, only the first and the last 24 h of each month are detailed, i.e., 0–24 h and 720–744 h. For the generated power 9 solar hours are considered during winter and 15 solar hours during summer. In this scenario the necessary budget to accomplish the desired consumption without performing load shifting or load shedding actions, is superior to 1 €/day.

The EDPS results for this scenario are shown in Table 3.

Table 3. Monthly EDPS results for scenario (b)

The lack of prosumer flexibility in performing consumption adjustments resulted into the predefined budget limit violation and therefore the energy cost has increased, despite selling all generated energy. The utility values are compatible with the previous scenario, showing a slight increase on January and a slight decrease on July. For this compatibility analysis the conversion of monthly utility values into average daily utility values is considered.

The EDPS for scenario (c) considering a monthly time horizon is shown in Figs. 6 and 7.

Fig. 6.
figure 6figure 6

Monthly January EDPS for scenario (c).

Fig. 7.
figure 7figure 7

Monthly July EDPS for scenario (c).

The EDPS results for this scenario (c) are shown in Table 4.

Table 4. Monthly EDPS results for scenario (c)

In this scenario, the compliance of budget ceiling led to a load shifting and resulted on the utility value reduction, on both months. The referred load shifting resulted from EDPS outcome as a conjunction of budget ceiling compliance and the P b , P l , P s and P g values.

In the six case studies the generated power on summer is superior to the one observed during winter as well as the load power. This is justified, not only by the increased solar radiation during summer, but also with geographical characteristics that show higher thermal amplitude during summer when compared to the one verified during winter. The prosumer model drives to a lower energy expenditure when the load shifting occurs, however if consumption needs increases the load shedding is mandatory, in order to accomplish the budget limit [16].

4 Demand Response Model

Usually, DR programs are classified into two main types: Time-Based Program (TBP) [1720], which is also described as Price-Based Programs [17, 18] or Time-Based Rate program [21] and Incentive-Based Program. The proposed model [22] is TBP type based on fuzzy subtractive clustering algorithm and intends to give consumers flexibility in order to take advantage of economic benefits allowing the load management that best fits consumer’s profiles or life-styles. Consumers load management is possible through methods of load scheduling and load shedding. The loads selected to be under consumer management actions are named as controllable load. Consumers’ profiles and operation modes were obtained from analysis of consumption behaviour that allowed a consumption pattern definition. Three consumer profiles were set to ensure the coverage of DR generalization on the model and help consumers cope with price changes over one day period. Two operation modes are set for each consumer profile. An example of a priority list is shown in Table 5 [22].

Table 5. Controllable load priority list for cleaning mode.

The priority list shown in Table 5 is the same for all consumer profiles because it assures that consumer choice and preferences are kept, despite a possible adjustment on energy price through a different profile setting. I.e., considering the settled operation mode, all consumption profiles can be chosen accordingly with energy price that consumers’ are willing to pay for. Therefore, for any consumption profile, the consumers’ preferences are obeyed because CL priority list is common to the 3 profiles. Table 5 shows the relation between consumer profiles and energy prices, where economic profile is only related with low energy price, moderate profile is related with low energy price and also allows a medium energy price and finally the extravagant profile is related to all levels of energy prices, allowing a consumption which is energy price independent. The necessity of pattern recognition associated with a control which supports consumers’ decisions for DR model design is fulfilled using fuzzy clustering method. For the control implementation, an off-line fuzzy clustering technique is used because it is intended to determine a DR behaviour pattern and to design a controller that performs the adequate adjustments between the inputs and controller parameters, in order to guarantee an appropriate DR model behaviour. The controller is implemented in the Matlab-Simulink® software resorting to the Fuzzy Logic Toolbox.

The demand response model is shown in Fig. 8 [22].

Fig. 8.
figure 8figure 8

Demand response model scheme.

The subtractive clustering technique applied in this paper and all DR model considerations are described in [22]. For DR model analysis Figs. 9 and 10 are used as comparison base. The consumer load diagram without DR model implementation is shown in Fig. 9.

Fig. 9.
figure 9figure 9

Load diagram without DR model.

Fig. 10.
figure 10figure 10

Controllable loads evolution stage without DR model.

The correspondence between Fig. 9 and the controllable load power diagram is shown in Fig. 10.

The available power, Pa, the base power consumption, Pc, and the energy price (Ep) with DR model implementation are shown in Fig. 11. The available power is assumed to be given by the electric power grid and cannot be exceeded by load power. The base power consumption corresponds to the non-controllable load power consumption.

Fig. 11.
figure 11figure 11

Power and energy price evolution with DR model.

Considering that an economic profile is selected, the total power consumption, Pt, the base power consumption and available power are shown in Fig. 12. Where the total power consumption diagram is the controllable load power consumption added by the controllable load power consumption.

Fig. 12.
figure 12figure 12

Power evolution for economic profile.

The correspondence between Fig. 12 and the controllable loads power diagram is shown in Fig. 13. The load power diagram corresponds to the load scheduling resulted from the developed fuzzy subtractive clustering algorithm detailed in [22].

Fig. 13.
figure 13figure 13

Controllable loads evolution stage for economic profile.

From comparison between Figs. 11 and 13, it is shown that controllable loads are only connected when energy price is low. In addition, DR model assures that consumption is never superior to available power.

Considering that an ideal profile is selected, the total power consumption, the base power consumption and available power are shown in Fig. 14.

Fig. 14.
figure 14figure 14

Power and energy price evolution with DR model for ideal profile.

The ideal profile allows consumers to connect the same controllable loads used without DR model implementation, i.e., is a combination of the 3 profiles in order to allow the same consumption flexibility that consumers have in absence of DR model. As a result, even with DR model consumer can reach the same consumption profile shown in Fig. 9.

From Fig. 14 analysis, it is shown that total power consumption is never superior to available power and that total power consumption diagram is more flattened than the load power diagram shown in Fig. 9. The correspondence between Fig. 14 and the controllable loads power diagram is shown in Fig. 15.

Fig. 15.
figure 15figure 15

Controllable loads evolution stage for ideal profile.

For the DR model implementation in the physical system, smart applications development is needed, in order to allow incorporation of the advanced mathematical models into the smart metering and monitoring system.

5 Smart Applications Development and Implementation

The developed strategy is based on the incorporation of two Smart Meters (SM) types in the smart consumer environment (consumer owned SM and distributor owned SM). The consumer owned SM runs over a wireless platform and the distributor owned SM employs the wired environment [4]. The consumer owned SM is a set of simple devices, essentially constituted by a sensor unit and a mobile display, and usually run over a wireless network. Therefore, this system is appropriate to domestic purposes.

The main intention of consumer owned SM is to supply simple data in order to support consumption patterns of consumers. The consumer owned SM is developed with double interface between Supervisory Control And Data Acquisition (SCADA) systems and mobile displays [4]. For the implementation, ZigBee protocol is used, which is suitable for small distances and commonly applied for domestic environments. The developed hardware is based on Arduino platform. Part of this system implementation is shown in Fig. 16. This is an original implementation and consists of 3 sub-systems: the sensor and processor unit, the mobile display and centralized unit, which is the SCADA system.

Fig. 16.
figure 16figure 16

Consumer owned SM sensor unit and mobile display [4].

The distributor owned SM is composed by sheltered devices with closed communication protocols, which are constituted by a sensor unit that measures the consumed electricity and remotely informs the local distributer. The consumption information exchange is the main distributed owned SM purpose, because it allows the electricity local distributor to know about the clients’ consumption, providing a significant reduction of operational costs. In addition, this data provides important information to the distributor, concerning the consumer patterns, the optimization of energy selling prices, the electric grid management and consumption trends [4]. The presented strategy pursues the advanced control structure shown in Fig. 17 which is composed by 2 levels: the Operational level (SCADA system) and the Interactive level that optimizes the consumers’ preferences in relation to control references [4]. The interactive level allows the assumption of advanced control actions. The considered controller development consists on a room control temperature, with distributed interfaces that allows receiving inputs accordingly to room users’ temperature preferences. The considered room is connected to the master actuator unit which receives commands from SCADA system in order to perform control temperature regarding restrictions of consumption minimization. On its turn, the master actuator unit commands the HVAC actuator which performs room temperature adjustments. The control algorithm topology is a model-based predictive controller, which is implemented on Matlab platform. Matlab is connected to the SCADA system through OPC protocol. Details of controller design and achieved results can be found on [4]. The operational level consists on a hierarchical cascade control shown in Fig. 18.

Fig. 17.
figure 17figure 17

Two-level supervisory control architecture [4].

Fig. 18.
figure 18figure 18

Operational level controller [4].

The first control loop is managed by local programmable logic controllers and the second control loop is controlled by a SCADA system. The SCADA system inputs referred by (F1(t) .. Fi(t)) are named as comfort laws, because they allow to accommodate users decisions about room temperature, luminosity and consider energy consumption supplied by the SM, as described in [4]. These comfort laws derived from the interactive level shown in Fig. 17. The SCADA system output gives the necessary data to the interactive level. The operational level also incorporates and manages sensors and actuators, namely temperature, luminosity and HVAC. The resulted data is fed as input to the SCADA system.

6 Conclusions

The prosumer economical dispatch problem solution is obtained considering a time dependant cost function that incorporates consumption preferences. Because consumption preferences increase on off-peak and shoulder hours, this prosumer model is in line with DR actions. In addition, the NN incorporation supports grid operator and enhances the grid management efficiency by providing forecast information about production and consumption. In this paper the implemented NN for winter and summer periods gave satisfactory results. For the scenarios considered in this paper, it can be concluded that self consumption is not always the best decision for decreasing the prosumer energy bill. Mainly because prosumer’s profit depends on energy selling and buying prices, which are dependant of wholesale energy market. In addition, it can be concluded that the budget limit compliance in association with consumption preferences led to a load shifting.

The DR model is obtained resorting to subtractive fuzzy clustering techniques and intends to be an efficient domestic consumer’s supporting tool on load management. Three consumption profiles and two operation modes are considered, in order to give consumers’ flexibility to perform DR actions accordingly to their consumption preferences. From the considered case studies, it is visible that, the proposed DR model assures that controllable loads priority list is obeyed and that controllable loads are connected in accordance to the settled consumption profile. Also, the case studies analysis shows that the proposed DR model allows consumer to connect the same controllable loads which were also connected considering the absence of DR model, because the model allows consumers to take advantage of the offered consumption profiles and operation modes. For the analyzed case studies, the DR model guarantees that total consumed power is never higher than the available power. Moreover, it can be concluded that power valley filling can be achieved with the DR model resulting on reshaped consumption diagrams that are mainly instigated by energy price information.

This paper shows an energy management system development with SM for electricity consumers in a smart grid context. The integration of two types of SM is considered; the consumer owned SM and the distributor owned SM. The SM are connected to a SCADA system that supervises a PLC network. The developed control strategy is based on a hierarchical cascade controller. A complete new platform connecting the SCADA supervisory system, the Matlab software, and the two existing main topologies of electricity smart meters (distributor owned and customer owned) is developed. This methodology contributes to provide SCADA systems with the ability to handle advanced control techniques for consumer energy management systems.