1 Introduction

Recent trends show that power consumption is a problem which is discussed and approached more often not only because of the ascending trend of energy costs but also because using and developing green solutions is encouraged by governments, European Union [1] and other bodies around the globe.

In recent years many authors have discussed this problem and proposed solutions, for example in Ref. [2] a mathematical programming model of the flow shop scheduling problem is discussed. This considers peak power load, energy consumption and associated carbon footprint in addition to cycle time in order to reduce carbon footprint. Reference [3] investigates the analytical energy modelling for the explicit relationship of machining parameters and energy consumption, resulting a model which is applied to optimize the machine setup for energy saving.

Reference [4] considers a dynamic scheduling problem which minimizes the sum of energy cost and tardiness penalty under power consumption uncertainties; in Ref. [5] a method for reducing the total energy consumption of pick-and-place manipulators for given Tool Centre Point (TCP) position profiles has been developed, and in Ref. [6] an energy consumption change forecasting system using fuzzy logic to reduce the uncertainty, inconvenience and inefficiency resulting from variations in the production factors has been proposed. Minimizing power consumption in milling and machining manufacturing processed was also approached in Refs. [79].

In the above mentioned papers energy monitoring is done using wattmeter devices [10] connected in the decision making infrastructure or using smart meters by measuring the energy consumption of a consumer and providing this information over a network, by employing a two way communication between the meter and the central control or supervisory system.

The novelty of the approach consists of an agent-based energy monitoring framework where resource consumption (both total energy consumed and the amount of energy consumed for each operation) is locally measured, stored and then used at a global level for allocating workload to resources using a multi-criteria optimization model. The paper is structured in six sections: in the first two the actual trend in power monitoring and optimization in manufacturing is presented; Sect. 3 describes the data acquisition system; Sect. 4 discusses the agent based model for power optimization, Sect. 5 presents the energy consumption optimization solution using ILOG OPL; the Sect. 6 reports experimental results and formulates conclusions.

2 Power Consumption

The instantaneous power received from the supply source is, according the power transfer theorem, the product of the instantaneous voltage \( u\text{(}t\text{)} = U\sqrt 2 \,\text{sin}(\omega t + \phi ) \) and current \( i(t) = I\sqrt 2 \,\text{sin}(\omega t + \gamma ) \), and is given by \( p = u(t) \cdot i(t) \). By replacing the voltage and current with their expressions one obtains the instantaneous power as:

$$ \begin{aligned} p & = u(t) \cdot i(t) = U\sqrt 2 \,\text{sin}(\omega t + \phi )I\sqrt 2 \,\text{sin}(\omega t + \gamma ) = 2UI\,\text{sin}(\omega t + \phi )\text{sin}(\omega t + \gamma ) \\ & = UI\left[ {\text{cos}\left[ {\left( {\omega t + \phi } \right) - \left( {\omega t + \gamma } \right)} \right] - \text{cos}\left[ {\left( {\omega t + \phi } \right) + \left( {\omega t + \gamma } \right)} \right]} \right] \\ & = UI\left[ {\text{cos}\,\phi - \text{cos}\left( {2\omega t + \phi + \gamma } \right)} \right] = UI\,\text{cos}\,\phi - UI\,\text{cos}\left( {2\omega t + \phi + \gamma } \right) \\ \end{aligned} $$
(1)

where ϕ − γ = φ and 2*sin(α)*sin(β) = cos(αβ) − cos(α + β), ω being the angular velocity, γ is the initial phase for U, φ is the initial phase for I and cos(φ) is the power factor.

The instantaneous power is hence a periodical value depending on the power supply voltage and the electric current in the circuit, with a constant component and a component whose frequency is twice ω; this second component is called oscillating or fluctuating power due to electric and magnetic fields produced by the circuit [11].

Of particular interest is the average value of the instantaneous power which is named the active power P, and is commonly referred to as the average power, real power or true power. This type of power is given by:

$$ P = \tilde{p} = \frac{1}{nT}\int\limits_{0}^{T} {p\;dt} $$
(2)

where P is the average value of the instantaneous power p measured for a number of full periods n.

By integrating Eq. (2) the active power can be obtained as:

$$ \begin{aligned} P & = \bar{p} = \frac{1}{nT}\int\limits_{0}^{nT} {p\,dt} = \frac{1}{nT}\int\limits_{0}^{nT} {[UI\,\text{cos}\,\varphi - UI\,\text{cos}\left( {2\omega t + \phi + \gamma } \right)]dt} \\ & = UI\,\text{cos}\,\varphi \frac{1}{nT}\int\limits_{0}^{nT} {dt - \frac{UI}{nT}\int\limits_{0}^{nT} {\text{cos}\left( {2\omega t + \phi + \gamma } \right)dt} } \\ & = UI\,\text{cos}\,\varphi \frac{1}{nT}t\left| {_{0}^{nT} } \right. + \frac{UI}{nT}\sin \left( {2\omega t + \phi + \gamma } \right)\left| {_{0}^{nT} } \right. \\ & = UI\,\text{cos}\,\varphi \frac{1}{nT}(nT - 0) + \frac{UI}{nT}\left[ {\sin \,\left( {2\frac{2\pi }{T}nT + \phi + \gamma } \right) - \sin \left( {\phi + \gamma } \right)} \right] \\ & = UI\,{ \cos }\,\varphi .\\ \end{aligned} $$
(3)

The active power is the rate at which energy is expended, dissipated, or consumed by the load and is measured in units of watts [12].

This expression is null under nondissipative or purely reactive circuits and is positive for dissipative circuits. The active power can be expressed also, under single-phase pure sinusoidal conditions, using the resistance or the conductance:

$$ P = UI \,\cos \varphi = RI^{2} = GU^{2} $$
(4)

where R is the electrical resistance of the receptor expressed in Ω, and G is the conductance (the inverse of the resistance), expressed in Ω−1.

Equation (1) shows that the instantaneous power oscillates with the angular frequency of 2ω around its average value, which is the active power.

Even if the powered receptor (consumer) is of passive type, the active power received is always positive (P > 0); there are moments during a period when the instantaneous power is negative, because it is sent out of the circuit. In these moments, the energy accumulated in the magnetic field of coils or capacitors is sent back partially to the power supply.

The apparent power is measured in volt-amper (VA) and is defined by the product S = UI > 0. The apparent power can be expressed also using the impedance and the admittance:

$$ S = UI = ZI^{2} = YU^{2} $$
(5)

where Z is the impedance of the circuit expressed in Ω and Y is the admittance (the inverse of impedance) expressed in Ω−1.

The power factor is the positive rapport between active power and apparent power (having values between 0 and 1):

$$ 0 \le k_{p} = \frac{P}{S} \le 1 $$
(6)

In pure sinusoidal regime the power factor has the expression:

$$ k_{p} = \cos \,\,\varphi $$
(7)

The reactive power is represented by Q = UI sin(φ) ≠ 0. The reactive power (positive in the case of inductive circuits and negative for capacitive circuits) can be expressed using the reactance and the susceptance as below:

$$ Q = UI\,\sin \varphi = XI^{2} = BU^{2} \ne 0 $$
(8)

where X is the reactance of the receiver expressed in Ω and B is the susceptance (the inverse of the reactance) expressed in Ω−1; in this way the reactive power is null for resistive circuits [13].

In our case, if we want to compute the energy which is paid to the supplier we will measure the instantaneous power consumption during each operation, in kW, and the time required for each operation in order to complete, in seconds. The energy is then given by:

$$ Energy ( \text{KWh)} = \frac{{\sum\limits_{for\_each\_second} {Instrantaneous\_Power} }}{{3{,}600}}Operation\_duration $$
(9)

3 Data Acquisition System

In order to compute the instantaneous power, which integrated over time provides the energy consumed, the instantaneous voltage and current must be measured using an acquisition board characterized by: (i) sampling frequencies above 120 Hz (double the frequency of the supply system), (ii) local processing capabilities and (iii) easy access to network. Taken into consideration observations i–iii and the fact that we wanted an external acquisition board which should be reused for different resources, an Atmel based platform was chosen due to its simplicity in programming and in the realization of the electronic schematic used to interface current and voltage sensors. Thus, the data acquisition system is based on an Arduino Mega 2560Footnote 1 open source electronics prototyping platform equipped with a Wi-Fi shield (required in order to communicate with other equipment in the cell), see Fig. 1.

Fig. 1
figure 1

Data acquisition system

The Wi-Fi shield is connected to a wireless router which allows data transfer between the acquisition board and the supervising system. The Arduino board is connected using a serial cable with the wattmeter (which is a Fluke 124 Industrial ScopeMeter) providing information about power consumption, voltage and current intensity every second. The Arduino board is also connected with the resource (robot) through a digital input (at the Arduino board)—output (at the robot) channel which allows synchronizing the power measurement with each robot operation.

When the robot starts a new operation the digital output signal is turned on/off for each different motion. In this way, by detecting the high-low and low-high transitions the Arduino board is able to synchronize the instantaneous power measurement with each robot operation and then transmit the data to the supervising system.

4 Integrating Power Consumption into the Optimization Model

The scope of this research is the design of a framework in which the energy consumed during production execution is individually collected from each workstation resource in order to predict future energy consumption and for an efficient allocation of workloads on resources. The manufacturing systems suitable for the proposed energy monitoring framework have a decentralized infrastructure consisting of multiple individual workstations containing one or more resources each of them being accessed through a single representative agent (Fig. 2), designed to offer information about: (i) the resource state, (ii) the total power consumption, (iii) the available operations and (iv) their characteristics (processing time, power consumption, quality, a.o.).

Fig. 2
figure 2

Power consumption measurement and integration into the optimization model

Collecting information is possible through an agentification process consisting of individual software agents associated to each workstation. These agents are responsible for decision making, activity monitoring and communication through a standard environment. In the reported research, the workstations are industrial robots which realize assembly operations. Thus, the software agent controls the physical resource (the robot manipulator) through the robot controller and processes data from the acquisition board.

The gathering, processing and integration of information about each resource is done at workstation level by the associated agent and forwarded to an entity in charge of putting together information from all resource into a centralized model used to optimize resource allocation (Fig. 2).

The collection of energy consumption for each resource in the context of production optimization and manufacturing execution has three elements (Fig. 2): (i) Data acquisition, (ii) Production planning and resource scheduling and (iii) Orders execution.

As described before, Data acquisition is done individually for each workstation; the process is realized by the resource agent and has two facets (Fig. 3):

Fig. 3
figure 3

Agent-based collection of energy consumption

  1. 1.

    A continuous process in charge with instantaneous energy integration. This process is used to compute the total energy consumption of a resource (Fig. 3i):

    1. (a)

      The acquisition board monitors the instantaneous power consumption of the resource and sends it to the resource’s agent which integrates it;

    2. (b)

      The optimization model is updated every time an operation is processed.

  2. 2.

    An energy consumption integration process synchronized with the operation execution. This is used to compute the energy consumption for a given operation (Fig. 3ii).

    1. (a)

      The Programmable Logic Controller (PLC) signals the resource agent the operation to be executed;

    2. (b)

      The resource agent executes a specified program on the physical resource. This signal is used as the start of the interval while the energy consumption for that operation will be monitored;

    3. (c)

      The termination of the operation executed by the physical resource is acknowledged to the resource agent. This confirmation is forwarded to the order agent to advance to the next operation, and is also used as a signal which updates the optimization model (the cumulated, total energy consumption of the resource and its energy consumption for each operation).

The result of the energy collecting process described above is the total energy consumed by each resource and a data log containing the operation type, associated resource, start time, end time and energy consumed. In the global planner only the latest energy consumption for each operation will be used each time it is called.

The Production planning and resource scheduling module uses a request from the global planner to each resource agent to update the optimization model, followed by the answers from the resource agents and by the aggregation of this information into the optimization model used by the global planner.

The physical realization of orders with production planning and resource scheduling optimized relative to energy consumption is done through the Orders execution process. The planned and scheduled orders are sent by the global planner to the entity in charge of executing the production, in this case a PLC which routes the products according to their optimized schedule. The PLC’s task is to associate each order with a pallet, to route the pallet towards the scheduled resource and to request the execution of the scheduled operation from the resource agent. The subsequent operation execution triggers an update of the energy consumed during the operation (Fig. 3).

5 Optimization Solution

Each workstation Pi, 1 ≤ i ≤ 4 in the shop floor layout described in Fig. 4 contains one resource—a robot (P1, P2) or two resources—a robot and a machine tool (P3, P4) which can execute a set of operations characterized by different parameters. The cell features a certain flexibility meaning that some operations can be executed by different workstations, but with different energy footprints due to the fact that resources are different. In literature this type of layout is called job-shop [14]. The Job Shop Scheduling Problem (JSSP) has been intensely studied from the point of view of makespan minimization [15, 16]. However, from an energy minimization viewpoint considering the real-time consumption of manufacturing resources, to the best of our knowledge there have not been reported results in the literature.

Fig. 4
figure 4

Shop floor layout

Detailed scheduling problems deal with interval dimensions, start and end time of operations, sequences, resource selection, and are best tackled by constraint programming (CP) approaches.

A comprehensive list of CP solvers and libraries addressing various combinatorial problems including detailed scheduling can be found in [17]. From this list we have chosen IBM ILOG [18] because it can be easily integrated with separate applications using standard C++, C# or JAVA code through the Concert technology. It also has a powerful programming language, the Optimization Programming Language (OPL) which allows easy modelling of: precedence constraints (commands like endBeforeStart , startAtEnd , a.o.), overlapping constraints ( noOverlap ), alternative resources ( alternative , synchronize ) and pulse functions used for resource loading constraints ( pulse , cumulFunction ). Other advantages include: (i) decoupling the problem model from the data, which can be loaded at runtime, and (ii) specification of a search procedure through the definition of the search tree to be explored and of the search strategy, allowing thus the reduction of runtime.

A standalone ILOG OPL optimization problem consists of a project which has at least the following components: a model of the problem, a data file used to instantiate the model and a run configuration which associates the model with a data file. The model is the core of the project and contains: data declaration, decision variables, the objective function, constraints, post- and pre-processing directives used to put the data in the correct format for the optimization algorithm and display the results in an understandable form.

The detailed composition of the CP model with the succession in which the components appear in the model is as follows:

  • Declaration of variables used. These are on one hand the operations to be executed (Ops) and on the other hand the modes of execution (Modes) including processing time and energy consumed:

    • Ops = {<global operation index, local operation index, order index, precedence constraints between operations belonging to the same order>… }

    • Modes = {<global operation index, processing machine, processing time, energy consumed>… }

  • Decision variables are modelled as time intervals and sequences of time intervals: intervals for executing all defined operations, intervals used by the resources to execute possible operations and a sequence of operations for each resource.

  • The objective function is defined as the minimization of the energy consumed by the resources when executing a batch of orders. A detailed description of the objective function will be given in Sect. 6 (experimental results) since a simple energy minimization is not sufficient from the point of view of resource utilization (when compared with a more classical optimization criterion like makespan minimization).

  • The combination of all decisions variables forms the search space. Nevertheless, not all combinations are possible; these limitations are generated by the constraints that the physical system is subjected to. The following constraints are defined in our case:

    • Precedence constraints ( endBeforeStart ) model the sequence in which operations must be executed;

    • Alternative constraints are used to synchronize the operation execution with a possible execution mode on a resource. The scheduling procedure consists in declaring all the possible intervals as decision variables and select only the ones that are mandatory as it results from the product definition;

    • Overlapping constraints: two operations should not be executed on the same resource at the same time and the number of processed orders is limited by the number of pallets existing in the system;

    • Non-preemptive constraints: order and operation execution are uninterruptable. This means that once an order is inserted for execution it cannot be replaced by another one until it is finished. The same statement is valid for an operation being executed on a resource.

The separation between data and model allows running the same optimization problem with different initialization data. The resource agents supply the execution times and the energy consumption to a data file for each operation executed. It is in this data file that the latest information from all resources is aggregated and further used to initialize a CP model.

The optimized solution results by executing a running configuration. With the above defined and initialized data the ILOG CP Optimizer uses the following technique for searching an optimized solution: (1) choose a decision variable; (2) assign a value to it; (3) reduce the search space by propagating constraints to other decision variables; (4) if step 3 fails goto 2 for a different value, otherwise goto 1. After all possibilities are tested or when another stop condition is reached (amount of time, number of infeasible solutions, a.o.) the best combination will be retained.

6 Experimental Results, Conclusions and Future Work

For the practical experiment the energy consumption and operation execution time were measured for all robot operations (an example is shown in Fig. 5 for a single operation over time) for each workstation P1–P4 (Fig. 4) using the system described in Fig. 1. The measured results, which are used for energy efficient resource allocation, are presented in Table 1.

Fig. 5
figure 5

Power consumption for a production operation executed by a Viper s650 vertical articulated robot

Table 1 Energy consumption and execution time for an operation

The experiments have been done in the industrial manufacturing cell of the CIMR Research Centre in Bucharest,Footnote 2 the layout of which is shown in Fig. 4. The platform is composed of four workstations able to execute a wide range of operations. These operations can be either be executed on several resources (redundant) or executed only on a given resource (exclusive).

The results in Table 1 (columns 4 and 5) were used to configure the data file which instantiates the CP optimization model used by ILOG.

The ILOG-based mixed planning and scheduling model has been tested by executing a batch of 30 orders (Table 2) on the physical manufacturing structure shown in Fig. 4. The ILOG model with the characteristics presented in Table 2 was run on a machine with a Dual Core 2.6 GHz processor with 4 GB of RAM; the results of the different optimization problems are discussed.

Table 2 Characteristics of the optimization problem
  1. (i)

    Makespan minimization (MM) characteristics:

    • Classical optimization criterion;

    • Does not take into account the energy consumed;

    • Objective function: minimize the completion time of the last executed operation (makespan);

    • Decision variables: start and end of the time intervals associated to each operation and the execution mode of each operation (which resource will execute the operation);

    • Constraints: each resource can execute a single operation and each order can receive a single operation at a given time; there is a fixed number of orders being processed at a given time; order processing is uninterruptible: once an order starts being executed it cannot be replaced by one waiting to be inserted unless another order is finished; operation execution is uninterruptible.

  2. (ii)

    Energy consumption minimization (ECM) characteristics:

    • Objective function: not applicable. By choosing only the resources that consume less energy the total consumed energy will be minimized. Thus we do not deal with an optimization problem but with finding a combination which generates the minimum of a function;

    • Decision variables: the same as in the case of makespan minimization;

    • Constraints: the same as in the case of makespan minimization plus additional constraints forcing the operations to be executed on the resources which consume the minimum energy.

If in the makespan minimization case a search space can be defined which is processed by the optimization algorithm in order to compute a solution, in the case of energy minimization the optimization problem can be reduced to finding the resources that execute an operation with the minimum energy consumption and then sequencing the needed operations on these resources. If each resource has a different energy consumption, the optimization problem is reduced to choosing only the most economical resources (from an energetic point of view) and sequencing operations on them.

As can be seen from Table 3 in the energy minimization case the consumed energy is reduced to a minimum, but the resource utilization, defined as resource working time divided by the makespan, is much smaller than in the makespan minimization case. Another drawback of the energy minimization procedure is that the resources that consume more energy are never used which results in a smaller utilization rate. Also, due to the fact that the energy minimization procedure is much simpler (find the first correct combination of intervals) than the makespan minimization procedure (analyse all the possible combinations of intervals), its execution time is smaller.

Table 3 Comparison of the three optimization modes
  1. (iii)

    In order to improve the resource utilization the two solutions presented above have been combined into a single multi-criteria optimization problem, namely makespan minimization with energy constraints (MMEC), with the characteristics:

    • Objective function: minimize the completion time of the last executed operation (makespan);

    • Decision variables are the same as in the case of makespan minimization;

    • Constraints: the same for minimization of energy consumption.

    By running this problem a reduction in makespan can be observed as compared with the energy minimization technique resulting in a better resource utilization.

    As a conclusion the novelty elements proposed in this paper are:

    • The extension of the resource informational counterpart (resource agent) with energy consumption functionalities;

    • The development of a multi-criteria optimization model combining energy consumption and makespan minimization.

The proposed control framework measures energy consumption individually for each operation executed by the manufacturing system resources. This information is processed locally by a software agent associated to each resource and forwarded to the centralized planner implemented using IBM ILOG OPL. The resulted planning and scheduling sequence is then used for executing the production orders. The advantage of this framework and its associated optimization algorithm is the real-time actualization of energy consumption used to update the CP multi-criteria optimization model. By taking into account both the time and the consumed energy an improvement of these two parameters can be observed in comparison with the situations where they are optimized separately. On the other hand a poor utilization of workstation resources can be observed in the case when there is a strict differentiation between their parameters (processing time and energy consumed).

Future research will cover the following directions: (i) Defining a product report containing information about its execution and energy consumption; (ii) Analyse the dependence between the energy consumption and resource utilization in order to increase the resource utilization; (iii) Creating a cost effective energy consumption monitoring system.