<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>An Approach for Synthesizing Energy-Efficient Controllers for Production Systems from Scenario-Based Specifications?</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Joel Greenyer</string-name>
          <email>greenyer@inf.uni-hannover.de</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Daniel Gritzner</string-name>
          <email>daniel.gritzner@inf.uni-hannover.de</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Leibniz Universität Hannover, Fachgebiet Software Engineering</institution>
          ,
          <addr-line>Welfengarten 1, D-30167 Hannover</addr-line>
          ,
          <country country="DE">Germany</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>Rising costs of energy production have made saving energy an important topic in many areas, including modern production systems. One idea is taking advantage of the braking energy becoming available when decelerating moving components of a machine. However, using the braking energy is a difficult task, as it requires the synchronization of the movement of different parts of a production system. Storing this energy often is not an economically viable solution. Optimizing the entire production process, in particular recognizing all optimization opportunities while still fulfilling all requirements, is a difficult and error-prone task. To support engineers in this task, we propose behavior modeling through scenario-based specifications, to be able to automatically generate all valid behavior strategies for the system, combined with energy usage modeling through state machines, to automatically identify the most energy-efficient strategy.</p>
      </abstract>
      <kwd-group>
        <kwd>Energy-Efficiency</kwd>
        <kwd>Optimization</kwd>
        <kwd>Scenarios</kwd>
        <kwd>Controller Synthesis</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>
        Rising costs of energy production have made saving energy an important topic
in many areas, including modern production systems. However, not all ideas for
saving energy are easily implementable. One increasingly popular idea is taking
advantage of the braking energy becoming available when decelerating moving
parts of a machine [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ].
      </p>
      <p>Using the braking energy is a difficult task, though, as it requires the
synchronization of the movement of various parts of a production system. A simplified
example of this is shown in Fig. 1 which shows the power consumed by two robot
arms over time. When the two arms move after each other, the braking energy
is lost entirely. If the second arm starts accelerating at the same time as the first
arm starts decelerating, the total energy cost for moving both arms decreases
significantly as the cost for moving the second arm is reduced by taking
advantage of the braking energy of the first arm. Storing braking energy instead of
using it directly is often not an economically viable solution.
? This research is funded by the DFG project EffiSynth.</p>
      <p>2.5
power consumption 2
over time 1.51</p>
      <p>0.5
blue – arm A -0.50
red – arm B -1
-1.5
2.5
ctooontvsaeulrmptoipmwtieeorn 1.512
0.5
0
unoptimized arm</p>
      <p>movement
arm accelerates
and moves
arm decelerates</p>
      <p>While the basic idea of using braking energy is simple enough, applying this
to an entire production process is a difficult task. The behavior of the system
cannot be modified arbitrarily without violating requirements. This may make
finding opportunities for optimization difficult and this difficulty is further
increased if multiple mutually exclusive opportunities are present. Choosing the
best combination of these opportunities is a non-trivial task, and manually
implementing the optimizations may even introduce new defects.</p>
      <p>As a solution to these challenges we propose an automated approach to
finding the optimal behavior strategy for a production system. Our approach
combines scenario-based behavior modeling and state machines for modeling energy
usage. From the scenarios we can automatically generate all valid behavior
strategies, i.e., strategies which do not violate the specification. The energy models
can then be used to identify the most energy-efficient strategy.</p>
      <p>
        In this paper we expand on our work in [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] by adding explicit energy models
to improve readability of the models and to separate the modeling of an object’s
attributes such as energy usage from the modeling of the object’s class’
behavior. Additionally, we extend our approach to include iterative improvements of
the generated strategies to add the ability to account for complex electrical
phenomena not captured by our models. In ongoing research we also work towards
generating executable code for the generated strategies.
      </p>
      <p>This paper is structured as follows: Sect. 2 introduces an example of a
production system used to explain our approach. Sect. 3 explains our approach for
finding the most energy-efficient controller and Sect. 4 describes preliminary
results of this approach. The paper concludes with an outlook for future research
in Sect. 6 and related work in Sect. 5.
2</p>
    </sec>
    <sec id="sec-2">
      <title>Example</title>
      <p>the press finishes, a different robot arm picks up the pressed item and places it
onto a deposit conveyor belt.</p>
      <p>The intended system behavior and requirements can easily be described in
short, intuitive scenarios, e.g., (a) arm A must be back at the conveyor belt
before the next blank arrives and (b) both arms must move away from the press
before it starts pressing to avoid damage to the arms.
3</p>
    </sec>
    <sec id="sec-3">
      <title>Approach</title>
      <p>Our approach combines scenario-based modeling and state machines as models
for energy usage. An overview of the approach is shown in Fig. 3. Scenarios
model the intended behavior of the system and can be used to automatically
derive controllers for the system, i.e., strategies for the system to behave that do
not violate any requirements. The energy state machines can then be used to find
the most energy-efficient candidates. Since the energy models and algorithms to
identify these candidates use approximations, a more detailed, computationally
more expensive, evaluation of each candidate is performed. These evaluations
take into account the actual power over time curves of each component as well
as the time it takes to perform the different actions. This evaluation step offers
two benefits (a) the confidence in the ranking of the candidates is increased and
(b) the approximate values in the energy model can be updated to reflect the
actual energy usage more closely. Candidate selection and evaluation is performed
iteratively until the most energy-efficient controller is found. For this controller,
PLC code, to run on an actual controller used for production systems, is
generated.
3.1</p>
      <sec id="sec-3-1">
        <title>Scenario-Based Behavior Modeling</title>
        <p>Scenarios are an intuitive way to describe how components of a system may, must
or must not behave. They can be used to easily describe the intended behavior,
as well as requirements, of a system from an inter-component point of view. The
scenario in the top-left of Fig. 3 describes how the system must react when an
arm successfully picks up a blank. The arm is instructed by the controller to
:Controller :Arm
blankPickedUp
moveToPress
accelerating
moving
decelerating
arrivedAtPress</p>
        <p>controller synthesis
press.start</p>
        <p>armA.decelerate
armB.accelerate
armB.accelerate
arrivedAtPress</p>
        <p>-5
decelerating
5
accelerating</p>
        <p>10
moving
update
energy values
generate
PLC code</p>
        <p>extract precisely calculate
best candidates actual power consumption
move towards the press and, while doing so, it will continuously report its state
to the controller.</p>
        <p>
          A formal, scenario-based specification is a collection of scenarios. In our
approach, we use a modeling language extending the concepts of Live Sequence
Charts to specify scenarios and we use the Play-Out algorithm [
          <xref ref-type="bibr" rid="ref4">4</xref>
          ] to determine
how a collection of scenarios gets interwoven into a valid behavior strategy.
3.2
        </p>
      </sec>
      <sec id="sec-3-2">
        <title>Energy Consumption Modeling</title>
        <p>We propose using state machines to model the approximate energy consumption
of each component in a system. In such a state machine, the transitions are
labeled with the same events which are also used in scenarios. The example
shown at the top of Fig. 3 illustrates this. When arm A gets instructed to move
to the press, it will start accelerating. This event will cause both the scenarios
and the associated state machine to progress further. The arm is now in a state
in which it will use approximately 10 units of energy. Eventually, a decelerating
event will occur indicating that 5 units of braking energy are now available to
other components.
3.3</p>
      </sec>
      <sec id="sec-3-3">
        <title>Controller Synthesis</title>
        <p>
          The aforementioned Play-Out algorithm, together with a modified game-solving
algorithm used by UPPAAL TIGA [
          <xref ref-type="bibr" rid="ref1">1</xref>
          ], can be used to automatically generate
behavior strategies for the specified system [
          <xref ref-type="bibr" rid="ref2">2</xref>
          ]. The scenario-based specification
induces a game graph whose transitions correspond to actions and state changes
of the components of the system. Controllers for the system can be found in this
graph by searching for cycles which satisfy all scenarios. The existence of such
cycles, i.e., being able to follow transitions indefinitely without running into a
state that violates the specification, is equivalent to the specification being free
of inconsistencies.
The controller synthesis generates candidates which are only optimal according
to approximate energy values. In order to increase the confidence in our results,
we generate multiple good candidates and evaluate each of those candidates
using more precise models such as the actual power curves and time required for
each activity. Additionally, these calculations also provide us with new
approximate values to be used in our energy models to generate better candidates in
subsequent iterations.
To prevent defects, including wasting energy, as well as mitigating some of the
cost caused by putting effort into writing a scenario-based specification, we work
on automatically generating code for programmable logic controllers (PLCs)
from controller we synthesized in previous steps.
4
        </p>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>Preliminary Results</title>
      <p>We implemented a prototype which assigns energy values to the transitions of
candidate controllers. Every time a transition causes an energy model to change
its state, the transition is assigned a non-negative energy value. If, e.g., the arm
modeled in the top-right of Fig. 3 changes its state from accelerating to moving,
the corresponding transition in the controller is assigned a value of 10 minus any
available braking energy.</p>
      <p>To compare different candidates, we calculate the occurrence probability of
each transition in a controller by treating controllers as Markov chains with each
outgoing transition being equally probable. A controller’s estimated mean energy
consumption is the sum of each transition’s probability times its energy value.</p>
      <p>With this prototype and a model of the system shown in Fig. 2 with both
arms consuming and producing equal amounts of energy when moving from or
to the press, we were able to identify a strategy which could recoup more than
80% of the braking energy of the arms.
5</p>
    </sec>
    <sec id="sec-5">
      <title>Related Work</title>
      <p>
        Pellicciari et al. [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] try to utilize idle times of individual robot trajectories.
Wigström et al. [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ] use dynamic programming to determine an optimal task
schedule for a multi robot cell. However, neither approach is able to
automatically find optimization opportunities outside of isolated time windows or
predefined energy exchange opportunities between components. Other approaches
usually have similar issues, as well as often relying only on approximations.
      </p>
      <p>
        To the best of our knowledge, synthesizing energy-efficient discrete controllers
for production systems has barely been investigated outside of our own work in
[
        <xref ref-type="bibr" rid="ref3">3</xref>
        ]. There are algorithms for synthesizing time-optimal strategies from timed
game automata in UPPAAL TIGA [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] or from Markov decision processes in
PRISM [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ]. However, neither tool is able to optimize for energy-efficiency. Also,
we strongly believe that our scenario-based approach is easier to use.
6
      </p>
    </sec>
    <sec id="sec-6">
      <title>Future Work</title>
      <p>In future research, we are cooperating with researchers from the field of
mechatronics. Issues, we want to address cooperatively, are the precise calculation of
how much power a controller consumes, PLC code generation, as well as the
evaluation of the approach proposed in this paper on an actual hardware as it
is found in real production systems.</p>
      <p>Furthermore, we want to expand our models and synthesis algorithms to also
include time information. Our goals are to (a) model real-time requirements
such as “new blanks arrive at least every four seconds”, as well as (b) to identify
components which may move more slowly without slowing down the overall
process to take advantage of the fact that slower movement requires less energy.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <given-names>G.</given-names>
            <surname>Behrmann</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Cougnard</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>David</surname>
          </string-name>
          , E. Fleury,
          <string-name>
            <given-names>K. G.</given-names>
            <surname>Larsen</surname>
          </string-name>
          , and
          <string-name>
            <given-names>D.</given-names>
            <surname>Lime.</surname>
          </string-name>
          UPPAAL-Tiga:
          <article-title>Time for Playing Games!</article-title>
          <source>In Proc. 19th Int. Conf. on Computer Aided Verification (CAV)</source>
          , pages
          <fpage>121</fpage>
          -
          <lpage>125</lpage>
          ,
          <year>2007</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <given-names>J.</given-names>
            <surname>Greenyer</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            <surname>Brenner</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Cordy</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Heymans</surname>
          </string-name>
          , and
          <string-name>
            <given-names>E.</given-names>
            <surname>Gressi</surname>
          </string-name>
          .
          <article-title>Incrementally synthesizing controllers from scenario-based product line specifications</article-title>
          .
          <source>In Proc. 9th joint meeting of the European Software Engineering Conference and the ACM SIGSOFT Symposium on the Foundations of Software Engineering</source>
          <year>2013</year>
          ,
          <year>2013</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <given-names>J.</given-names>
            <surname>Greenyer</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            <surname>Hansen</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Kotlarski</surname>
          </string-name>
          , and
          <string-name>
            <given-names>T.</given-names>
            <surname>Ortmaier</surname>
          </string-name>
          .
          <article-title>Towards synthesizing energyefficient controllers for modern production systems from scenario-based specifications</article-title>
          .
          <source>Procedia Technology (Proc. of the 2nd Int. Conf. on System-Integrated Intelligence</source>
          , SysInt
          <year>2014</year>
          ),
          <volume>15</volume>
          (
          <issue>0</issue>
          ):
          <fpage>388</fpage>
          -
          <lpage>397</lpage>
          ,
          <year>2014</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <given-names>D.</given-names>
            <surname>Harel</surname>
          </string-name>
          and
          <string-name>
            <given-names>R.</given-names>
            <surname>Marelly</surname>
          </string-name>
          .
          <article-title>Specifying and Executing Behavioral Requirements: The Play-In/Play-Out Approach</article-title>
          . SoSyM,
          <volume>2</volume>
          :
          <fpage>82</fpage>
          -
          <lpage>107</lpage>
          ,
          <year>2003</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <given-names>M.</given-names>
            <surname>Kwiatkowska</surname>
          </string-name>
          , G. Norman, and
          <string-name>
            <given-names>D.</given-names>
            <surname>Parker</surname>
          </string-name>
          .
          <source>PRISM 4</source>
          .
          <article-title>0: Verification of probabilistic real-time systems</article-title>
          .
          <source>In Proc. 23rd Int. Conf. on Computer Aided Verification (CAV'11)</source>
          , volume
          <volume>6806</volume>
          <source>of LNCS</source>
          , pages
          <fpage>585</fpage>
          -
          <lpage>591</lpage>
          . Springer,
          <year>2011</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <given-names>M.</given-names>
            <surname>Pellicciari</surname>
          </string-name>
          ,
          <string-name>
            <given-names>G.</given-names>
            <surname>Berselli</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Leali</surname>
          </string-name>
          ,
          <article-title>and</article-title>
          <string-name>
            <given-names>A.</given-names>
            <surname>Vergnano</surname>
          </string-name>
          .
          <article-title>A method for reducing the energy consumption of pick-and-place industrial robots</article-title>
          .
          <source>Mechatronics</source>
          ,
          <volume>23</volume>
          (
          <issue>3</issue>
          ),
          <year>2013</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <given-names>O.</given-names>
            <surname>Wigstrom</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B.</given-names>
            <surname>Lennartson</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Vergnano</surname>
          </string-name>
          , and
          <string-name>
            <given-names>C.</given-names>
            <surname>Breitholtz</surname>
          </string-name>
          .
          <article-title>High-level scheduling of energy optimal trajectories</article-title>
          .
          <source>IEEE Transactions on Automation Science and Engineering</source>
          ,
          <volume>10</volume>
          (
          <issue>1</issue>
          ):
          <fpage>57</fpage>
          -
          <lpage>64</lpage>
          ,
          <year>2013</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>