Christine Vanoirbeek
email: christine.vanoirbeek@epfl.ch

Vincent Quint
email: vincent.quint@inria.fr

Stéphane Sire
email: stephane.sire@epfl.ch

Cécile Roisin
email: cecile.roisin@inria.fr

A Lightweight Framework for Authoring XML Multimedia Content on the Web

Keywords: Authoring paradigms, Authoring for the web, End user authoring

), intended for web users with limited skills. The versatility of the tool is illustrated through a series of use cases that demonstrate the flexibility of the approach for creating various kinds of web content.

Introduction

Since its inception, the web has turned into an universal repository of rich content -i.e. content including text, images, graphics, music and videos -that is easily accessible through a web browser. Simultaneously, the web has progressively provided incentives for building complex back-end frameworks exposing attractive web based interfaces to end users. These interfaces have grown to the point where some applications are running in the browser for the most part, thus becoming web applications.

While a significant part of the web is fed from several sources of information, human users (authors) are also entering content directly through various kinds of tools. Authoring has rapidly evolved towards the production of HTML pages including complex contents such as tables or embedded components. Whereas tables have been added directly to the HTML language, multimedia objects were (and still are) poorly handled, because the dedicated standard, SMIL [START_REF] Bulterman | Synchronized Multimedia Integration Language (SMIL 3.0). W3C Recommendation[END_REF], has not been widely adopted, but also because alternate solutions require coding skills. However, the introduction in HTML5 of continuous content with the audio and video tags paves the way for a better integration of multimedia content in web documents.

In this context, the approach proposed in this paper shows how client-based authoring can fit a broad variety of needs, ranging from static HTML documents to multimedia content. To a large extent, this approach was made possible by the recent evolutions of the web, conducted mainly by two categories of actors: standard organizations and web developers.

As a standard organization, W3C played an important role in transferring research results from the hypertext and document engineering domains to web technologies. Among them, three features are important:

-The first one is a clear separation of the content from the appearance of a document. This resulted in core technologies for delivering content on the web (HTML and CSS), that constitute now the basis for the web platform, including audio and video modalities. -The second advance is the XML language, that incidentally led to a re-writing of the hypertext language for the web: XHTML. It encouraged the use of wellformed documents and opened the way to a set of languages and technologies for dealing with contents represented as hierarchical structures (XSLT for transforming XML data, DOM and SAX for processing content, XPath and XQuery for accessing content, etc.) -The third point is the capability to formally define generic content models for document classes. This was originally addressed by DTDs for document publishing purpose. Several other languages were then created (XML Schema, RELAX NG, Schematron, etc.) to provide additional features, such as typing, that significantly enhanced the processing potential offered to applications. As a consequence, there is a trend to develop authoring solutions that offer users the possibility to generate XML content compliant to a generic model (or schema).

Simultaneously, the community of web developers has promoted web browseroriented technologies, thus significantly contributing to a new evolution of the web as a medium: it is becoming a means for end users to feed and, to a certain extent, control the content of web sites, through web based interfaces and applications.

At the beginning, the authoring capabilities provided by a web browser were merely limited to the use of HTML forms. The Web 2.0 perspective created a real craze to provide users with new capabilities allowing them to enter content simply by using a browser, for instance in wikis and blogs.

From a technological point of view, the capabilities offered to end users to populate repositories of information through web browsers have been proposed under multiple forms (embedding proprietary applications, browser specific plug-ins, etc.). The development of script languages running on the client (among them, the now ubiquitous JavaScript) is the most significant change that considerably extended the potential offered to end users in terms of interaction. This evolution led to the development of so-called rich Internet applications that allow web pages to adapt their content and appearance according to user interactions, but also provide mechanisms to interact with back-end systems.

An important feature, aroused by the XML specification, is the development of a standard API, the DOM, to deal with data using XML trees as the primary representation of information. Coupled with a script language such as JavaScript, the DOM opened the door to the development of very powerful client-side applications for web authoring and for producing XML content.

As a matter of fact, it appears that the web progressively made it possible to merge sources of information that have been traditionally clearly separated: documents, data and multimedia content. Despite the fact that information available on the web may be produced in many different ways, it is to be observed that information is ultimately delivered in a document/hypertext way relying on hierarchical structures. XML and related languages and technologies are currently demonstrating the potential of this approach to bridge the gap between document, data and multimedia content.

All these evolutions of the web, its technologies and its usage have led us to devise an editing process that allows non XML savvy web users to easily create multimedia web content directly with their browser. This process is based on a lightweight framework called AXEL that was introduced in a previous paper [START_REF] Sire | Authoring XML all the time, everywhere and by everyone[END_REF]. In the present paper we extend the discussion introduced in the previous paper and we demonstrate, by using this tool for a variety of applications, that (i) web technologies enable a unified process for authoring documents, data and multimedia content, and (ii) that this process can be used by people with no previous knowledge of XML.

The paper is organized as follows. The next section gives an overview of the most common methods used for authoring XML content for the web, emphasizing three typical forms of web content: documents, data and multimedia; it also highlights the limitations of these methods. This overview is followed in section 3 by a short presentation of AXEL, the tool we have developed for authoring on-line all these contents. Its main features are discussed, including the templating language, the architecture and the user interface. This is illustrated by several applications involving different types of content. Section 4 discusses the results we have obtained so far. Finally, the conclusion summarizes the main contributions and suggests different extensions.

Authoring XML content for the web

Authoring paradigms for producing different kinds of XML content -data, document and multimedia -are separated. In this section, we synthesize the major trends in the domain, emphasizing important features such as the way to constrain the content with a model, compliance to web standards, and usability issues in relation with the targeted audience.

Authoring document-centric content

The typical way to edit XML documents is to use an XML editor, i.e. a stand-alone application that runs on a personal computer and that uses a DTD or a schema to make sure the document produced is valid (in the XML sense). The first tools of this kind were developed for SGML, the ancestor of XML, and even before the birth of SGML, for structured documents using different formats [START_REF] Quint | Grif: An Interactive System for Structured Document Manipulation[END_REF][START_REF] Furuta | Interactively editing structured documents[END_REF]. Most features offered by the precursors, by the SGML tools and by most XML tools date back from a pre-web period. Some more recent editors have been developed specifically for XML, but they are still based on the same principles: a DTD or a schema drives the editor to make sure the author can only enter a valid structure. In the broad category of XML editors, one can identify tools that provide an authoring environment where the focus is put on the document itself (ArborText Epic, FrameMaker), and those that provide a development environment (oXygen, XMLSpy), where developers can also prepare applications related to the edited documents. The latter category can manipulate schemas, XSLT transformations, and style sheets, for instance.

These stand-alone XML editors allow their users to take advantage of all features of the XML language, but they require a good knowledge of both XML itself and the document model in use, as expressed in a DTD or a schema. These editors are mostly intended for trained technical writers, who are more concerned with complex documentation than with the web: these tools are essentially web agnostic. An interesting exception is XOpus [27] which takes the approach of schema-driven editing, but runs in the browser. Similarly, easyDITA [START_REF]easyDITA: Content management, authoring and production all in one[END_REF] proposes a complete web solution for collaboratively authoring and sharing content, but only for DITA documents. As opposed to the previous tools, both tools require a web environment and allows authors to work on-line.

The presence of a schema that constrains the editor is often a difficulty for untrained users. They feel more comfortable with HTML stand-alone editors, that are closer to word processors, and therefore seem familiar to most authors. In addition, all these HTML editors take the web into account, even if the most popular ones require specific operations for publishing content on the web. The counterpart of the ease of use of HTML editors is the lack of structure in the documents they produce. Authors are inclined to create a rather flat structure with a lot of style, and they are in any case limited to the kind of structure allowed by the HTML language. Some tools even generate invalid HTML code.

There are also on-line HTML editors. Usually called Rich Text Editors, they are used to enter content for wikis, blogs or on-line mail clients. These tools are very simple and generate still less structured content and less valid HTML code, but any web user is supposed to be able to use them and they are fully part of the web: they run in the browser and the content entered by users is immediately available on the web. However, the notion of a DTD or a schema, even the HTML DTD, has almost disappeared. This is a real issue, as loosing validity and conformance to a model means that the content can not be safely processed in any other way than displaying it in a tolerant web browser. A middle ground can be found with templates. Templates are used server-side to generate HTML pages on the fly from data stored in a CMS or a data base. Different kinds of templates can also be used client-side to help authors structure the information they are entering through an editor.

Client-side templates for HTML pages are close in their purpose to those for word processors. They help authors to provide well structured information where it is needed, but do not force them to structure everything in a document. This may be especially useful for entering microformats in web pages, that can then be (re)used in different contexts. Templates can also help authors to organize HTML pages and to use the HTML markup consistently for certain types of web pages [START_REF] Campoy-Flores | Templates, microformats and structured editing[END_REF][START_REF] Huynh | Exhibit: lightweight structured data publishing[END_REF].

Authoring data-centric content

Despite the fact that XML inherits from SGML, its ancestor designed for representing structured documents, it is currently also widely used to deal with data-oriented content within enterprise information systems. The adoption of XML by enterprises is clearly related to the information integration problem. XML -and its family of technologies -has become a de facto solution for sharing content between disparate information systems [START_REF] Pokorný | XML in enterprise systems[END_REF]. Considering XML content as a single authoritative source offers a number of advantages, such as publishing rich content in a myriad of formats or re-purposing it for exploitation by web services as well as by any standard compliant application.

From an end user perspective, the creation of XML data-oriented content, is mainly supported by the use of XForms. This technology is extensively used in commercial applications or services offered to end users, either for general purpose (such as registration to an event, booking flights or hotels, accessing bank services, etc.) or inside an organization to collect internal data (travel expenses, various announcements, etc.) [START_REF] Hill | Beyond predictable workflows: enhancing productivity in artful business processes[END_REF]. As XForms is not currently supported natively by browsers, a number of frameworks have been developed which use the AJAX technology to offer it to end users.

The XForms language allows developers to specify, in a declarative way, a number of constraints regarding the pieces of information entered by end users through a form. It offers a binding mechanism that describes data types in accordance with the XML Schema standard data types. It also makes it possible to specify additional features which may be compared to functional dependencies in relational databases or to calculations in spreadsheets.

XForms, which is based on the Model View Controller approach, provides interesting features to guide end users during the data entering process. In addition to the expression of constraints on nodes (identified by XPath expressions), it offers indeed a view layer composed of intent-based user interface controls that may be adapted to users' habits by styling the user interface with CSS.

However, the compatibility with standards for generic content models (schemas) is weak for two main reasons:

-XForms is limited to expressing constraints related to data types (more precisely XML Schema data types); it does not support the complex elements that are defined by a schema. This is confusing because, for instance, the optionality of an element, which is not reflected on the XML data types, is proposed by the binding mechanism of XForms. -As already mentioned, XForms can state computational dependencies among data elements, a feature that is not available in schema languages used to define generic content models. This is generally addressed by using XSLT.

As a consequence, even if most system providers promote the automatic generation of XForms forms according to an existing schema, it is not a simple issue and it does not prevent developers from adapting the XForms models. This is a potential source of inconsistency. XForms also allows, through its binding mechanism, to specify if a field is read-only. This is also an issue, because such a property is in fact dependent on the context of use of data.

Although forms are a good means for entering structured data, other paradigms have been proposed, inspired from other kinds of documents, such as variable-data documents [START_REF] Lumley | Configurable editing of XML-based variable-data documents[END_REF].

Authoring web multimedia content

The area of multimedia authoring is wide, firstly because multimedia content tends to become the main information vehicle. Consequently many formats and associated tools exist, such as MPRO [START_REF] Boughoufalah | MPEG-Pro, an authoring system for MPEG-4 with temporal constraints and template guided editing[END_REF] for MPEG-4, HyperProp Editor [START_REF] Soares | Modeling, authoring and formatting hypermedia documents in the hyperprop system[END_REF] and Composer [START_REF] Laiola Guimaraes | Composer: Authoring tool for iTV programs[END_REF] for the iTV NCL language. Here, we focus on multimedia content that is published on the web and that can be authored together with other web contents. Therefore, we are only addressing the structure-based paradigm, as defined in [START_REF] Bulterman | Structured multimedia authoring[END_REF]. Note that the above mentioned tools usually rely on a template-based authoring user interfaces, in order to hide the inherent complexity of the multimedia authoring task [START_REF] Dos Santos | XTemplate 3.0: adding semantics to hypermedia compositions and providing document structure reuse[END_REF][START_REF] Dos Santos | Xtemplate 3.0: spatio-temporal semantics and structure reuse for hypermedia compositions[END_REF]. Thanks to their intrinsic modularity and their declarative paradigm, structured languages are good candidates for the development of such template-based editing features.

In several multimedia authoring systems [START_REF] Deltour | The LimSee3 multimedia authoring model[END_REF][START_REF] Dos Santos | Xtemplate 3.0: spatio-temporal semantics and structure reuse for hypermedia compositions[END_REF], templating is a means to bring reusability and expressiveness with usability. However authoring in this context is still an open issue because of the intrinsic complexity of the temporal structures and relationships that have to be handled. For instance, XTemplate 3.0 [START_REF] Dos Santos | Xtemplate 3.0: spatio-temporal semantics and structure reuse for hypermedia compositions[END_REF] proposes a wizard to guide the user in finding the appropriate hypermedia template among a template base. But this wizard tool misses the modular feature provided by the XTemplate 3.0 language, because it is restricted to one template per document. Therefore, while the language provides powerful expressiveness and reusable component features, it is still too complex for many users. As stated in [START_REF] Dos Santos | Xtemplate 3.0: spatio-temporal semantics and structure reuse for hypermedia compositions[END_REF], a graphical authoring tool would be useful but difficult to develop because of the complexity of the concepts involved.

A natural way to publish synchronous multimedia in XML on the web is to use the SMIL language [START_REF] Bulterman | Synchronized Multimedia Integration Language (SMIL 3.0). W3C Recommendation[END_REF], which was designed exactly for that purpose. Several authoring environments were developed for producing this kind of content (e.g. GRiNS [START_REF] Bulterman | Grins: An authoring environment for web multimedia[END_REF],

LimSee2 [START_REF] Deltour | A cross-platform SMIL2.0 authoring tool[END_REF]), but the SMIL technology is not widely deployed on the web. Only a few players are available and no web browser provide support for the SMIL language. It is then difficult to reach a wide audience on the web with the SMIL format. The alternative is to represent content in a widely supported, a-temporal document format such as HTML, and to add synchronization and user interactions by scripting. The issue then is the programming skills that are expected from authors, and the difficulty for web users to author content.

Another option is to use HTML pages that embed synchronous multimedia applications coded in some proprietary format (Flash or Silverlight for instance). There are convenient authoring tools for these formats, but contents encoded in such nonstandard formats raise several issues: they are poorly integrated in the web (how to link to a specific part of them?), they are difficult to reuse, they require special plugins which are often not available for mobile devices, and they can not be synchronized with the rest of the page where they appear.

The situation has changed recently with the raise of HTML5, which supports natively continuous content. New features have also been introduced in the CSS3 language. With these novel technologies, it is now easier to include sound and video in HTML pages, without requiring any plug-in. It is also possible to introduce certain temporal behaviors within HTML5 pages thanks to the new CSS3 animation and transition modules.web However, HTML5 and CSS3 are not sufficient for all multimedia applications, but with the help of SMIL Timesheets [START_REF] Vuorimaa | SMIL Timesheets 1.0. W3C Recommendation[END_REF], user interaction and complex synchronization schemes can be added to HTML5 pages. Some JavaScript implementations of SMIL Timesheets are already available [START_REF] Vuorimaa | Timesheets JavaScript Engine[END_REF][START_REF] Cazenave | A declarative approach for HTML Timing using SMIL/Timesheets[END_REF][START_REF] Cazenave | Timesheets.js: When SMIL meets HTML5 and CSS3[END_REF], that allow any web browser to play synchronized multimedia content represented in standard, declarative web languages. Programming skills are no longer necessary, and the same authoring techniques used for HTML+CSS applications can be used to create this content. However, additional features are required for easily manipulating time structures and time dependencies.

AXEL: a lightweight web authoring tool based on a template language

In this section we present a web-based authoring environment that bridges the gap between the separate authoring paradigms discussed in section 2. It is aimed at providing web users with the capability to produce documents, data and multimedia contents in an uniform way. It relies on XTiger XML, a template definition language that constrains, but in a user friendly way, authors to create reusable content. It is to be observed that templates are reflecting the know-how of communities of users, companies or individuals whose objective is to share and exploit content provided on the web by end users; the definition of the templates themselves is addressed by this category of persons in order to produce reusable content in a specific context. Typical use cases are illustrated in section 3.2.

Our authoring framework is implemented with AXEL (Adaptable XML Editing Library), a client-side JavaScript library1 for authoring XML template-based content on the web. A detailed technical description is available in [START_REF] Sire | Authoring XML all the time, everywhere and by everyone[END_REF].

AXEL features AXEL has been designed and implemented to fulfill two main requirements:

-Proposing a unified approach for authoring valid XML documents mixing document, data and multimedia contents; -Providing non XML-savvy developers and integrators with a lightweight framework for web based on-line editing of valid XML content as well as a user interface that accommodates end users' practices.

An unified approach

Following the observations of section 2.1, the idea behind XTiger XML is to let authors edit a HTML document and to get rid of the complexity of XML (both its syntax and its schemas) while editing. However, as the objective is to produce a well structured XML document, some constraints have to be set somewhere, and an XML structure must be created. That is the role of the XTiger XML language. It constrains the HTML document being edited by associating with it the structure of the final XML document. A XTiger XML template defines a document type, in the same sense as a XML schema, but in addition it also defines the visual aspect of the document and the user interface that are used when editing it.

A XTiger XML template is the skeleton, expressed in HTML, of a document that has a structure close to the target XML document. In addition, a template contains structural constraints expressed by XTiger XML elements. As opposed to the traditional XML approach, where a document and its schema (its structural constraints) are separate resources, the HTML document being edited with AXEL and its XTiger XML constraints are mixed in a single structure: each part of the HTML document that must follow certain structure rules is encapsulated in a XTiger XML element that expresses these rules.

The example below shows how the part that contains the abstract and the keywords of this article is represented in the template (in the example, elements prefixed by xt: are XTiger XML elements, the others are HTML elements): <div class="abstr"> <p class="heading">Abstract</p> <xt:repeat minOccurs="1" label="abstract"> <p> <xt:use types="text" label="Parag">Enter abstract</xt:use> </p> </xt:repeat> </div> <p class="keywords"> Keywords: <xt:repeat minOccurs="2" label="keywords"> <xt:use types="text" label="keyword">Enter keyword</xt:use>, </xt:repeat> </p> In a template, all HTML elements that are not within a XTiger XML element are mandatory and can not be changed by authors using this template. In the example above, there is always a single division of class abstr that contains a first paragraph with the only word "Abstract". This division is always followed by a paragraph of class keywords starting with the string "Keywords:".

HTML elements can be changed by an author using the template only when they are in a XTiger XML element, which indicates what changes are allowed. Here, the first xt:repeat element means that several paragraphs (at least one), and only paragraphs (HTML p elements), can appear after the mandatory first paragraph in the abstr division. The second xt:repeat element means that there must be at least two keyword elements after the mandatory "Keywords:" string.

Finally, the xt:use elements indicate what kind of content can be created at a given position by an author using the template. In the example above, only text (types="text") can be created in the variable parts. In this example, the content of the xt:use elements is just a prompt that the author is supposed to replace. The xt:use element also allows other media objects (audio, video) or more complex structures to be inserted at a given position, and it can propose different options for these structures (this is explained in more details in [START_REF] Sire | Authoring XML all the time, everywhere and by everyone[END_REF]).

This defines what HTML structure can be created by an author using the template, but the template also contains information about the final XML structure that will be generated from the HTML structure. This is achieved by the label attribute. This attribute indicates that an XML element must appear in the output and it specifies its name. A typical XML structure generated from the template above is: <abstract> <Parag>First paragraph of the abstract.</Parag> <Parag>Second and last paragraph.</Parag> </abstract> <keywords> <keyword>kw1</keyword> <keyword>kw2</keyword> <keyword>kw3</keyword> </keywords> XTiger XML is well suited for specifying how multimedia content can be included in structured documents, in particular with the xt:use element. Combined with the typing feature of XTiger XML, the AXEL engine can then provide document authors with a simple user interface, hiding the complexity of multimedia manipulation, while producing rich web content with media synchronization and interaction. This is achieved by using in the template the required CSS and SMIL Timesheets features for making the final documents synchronized and interactive. Only the template developer has to handle the complexity of synchronization and interaction. The document author has just to decide which of the predifined multimedia features offered by the template s/he wants to include in a document. Some templates may also allow the author to adjust a few selected parameters for fine tuning synchronization and interaction. This very short introduction to XTiger XML templates obviously does not present all the possibilities of the language. For more details, refer to [START_REF] Sire | Authoring XML all the time, everywhere and by everyone[END_REF] or [START_REF] Sire | XTiger XML language specification[END_REF]. Section 3.2 provides examples that show how these templates have been exploited to edit various types of documents in different application frameworks.

A lightweight editing framework

To edit a document, AXEL, the client-side template engine, loads a template in a browser window, and transforms it into an interactive editing application. It follows the constraints expressed by XTiger XML elements and allows the author to develop the document by creating new elements and entering content under these constraints. When the author creates a new item, in a xt:repeat element for instance, it clones that part of the template. That way, the constraints that apply to each part of the document are always available locally, thus simplifying the task of the editor. Basically, AXEL only manipulates the DOM tree; the rendering is performed by the browser rendering engine.

To enter some content in a xt:use element for text, the author has just to click and type. The editing engine creates dynamically a HTML textarea element; text editing in this element is then handled by the browser itself. The AXEL engine copies the entered text into the xt:use element in the DOM tree. For continuous content, the engine allows the author to enter the URI of some video or audio content available online.

When the author saves the document, AXEL creates the XML structure. To do so, it traverses the DOM tree, and for each XTiger XML element with a label attribute, it creates a XML element in the output structure. It also stores the content of xt:use elements of type text in leaves of the generated XML structure.

The principle behind the editing engine is to take advantage of all features offered by the browser (access to DOM tree, rendering, content editing, spell checking). Combined with a simple constraint language (XTiger XML) that provides the required information exactly where it is needed, this approach makes the editing engine both light and fast.

The user interface is directly derived from the template, in a way similar to such editors as Citrus [START_REF] Ko | Citrus: a language and toolkit for simplifying the creation of structured editors for code and data[END_REF]. User interface controls are inserted in the HTML document everywhere the templates allow authors to create, change or delete elements. Except for these controls, what the author sees is a HTML document formatted by the browser as usual (see Figures 2,4,5). The template defines the HTML elements that represent the intended XML structure. In addition, CSS style sheets may be used to customize the look of the document on which the author interacts.

With this approach, the user interface can be anything between full WYSIWYG and form-based, depending on the template and its associated style sheets. In any case, it does not show any XML syntax, which makes AXEL easily usable by everyone, while still generating well structured XML content. The whole process does not require complex schemas and transformations, but still provides useful, automatically processable XML information.

Figure 1 illustrates the overall process. An (X)HTML document embedding the template is exploited by the AXEL library for two purposes as represented by the Fig. 1 Use of template by the AXEL library two arrows: (i) providing authors with an intuitive interface (rendered through the use of CSS) to guide them while editing valid XML content and (ii) generating XML content that may be subsequently exploited by various back-end systems.

AXEL applications

The versatility of AXEL is demonstrated through examples of different authoring applications. The examples shown in this section cover the three types of web content introduced in section 2. They have been created and used during the last two years. These applications emphasize AXEL's main strength: while sharing a minimal common look and feel, all editing applications are customized to better fit the authoring task for a given XML content model.

With AXEL, the process for developing an application is split into three main activities, each one performed by people with different skills, like in any web application:

1. Software developers, with skills in JavaScript, may be required to adapt or extend the AXEL library if the application has some special requirements (for instance new widgets or plug-ins for authoring specific content). Not all applications require this step. 2. Web developers, with skills in HTML and XML, create XTiger XML templates that follow the XML structure to be generated and the HTML structure to be presented to the author. 3. Web designers develop the CSS style sheets that will define the look of the HTML pages supporting interaction with authors.

When this work is done, all web users are able to create and edit the specific content for the application. Web users become online authors, but no specific skill is expected from them. The chosen examples illustrate that through various combinations of document-, data-and multimedia-oriented contents: 1. The first example consists in writing up an article like the present one: it is obviously mainly document-oriented, but several elements (such as authors, affiliations or bibliographic references) may be considered as data-oriented. 2. The second example consists in preparing a research project proposal: even if it is mainly document-oriented, it contains more data-oriented content (a typical case is the description of tasks from which a Gantt chart is automatically generated). 3. The third example concerns the publication of company showcases on the web: it contains the three categories of content: factual data about the company such as its address, document-oriented content such as the description of products and services, and multimedia content such as a video clip. 4. The fourth example concerns the creation of a slide show: the content is well balanced between document and multimedia elements; it also contains some dataoriented information (such as the date and the details about the related event, or the coordinates of the author). The project proposal editor has also been integrated in a WebDAV application to enable collaborative work. It was used to prepare three different project submissions, and all work package leaders (an average of 8 of them for each project) have entered the description of their work packages through the tool. The document template was designed to generate a simple user interface that is halfway between a document and a form, as can be seen on Figure 2. We have written some XSLT transformations to generate an HTML version of the document that is very close in appearance to the MS-Word document distributed by the European commission as a model of what to submit.

Writing up an article

The advantage of using a custom XML model (right part of Figure 3) is that it made it possible to create transformations for automatically generating the other parts of the documents, such as the Gantt chart for the whole project (as can be seen on the left part of Figure 3), or some tables summarizing deliverables and their due date, without requiring duplicate input.

Fig. 3 A Gantt chart generated from the structured data on the right that was edited in a workpackage description These first two examples (scientific article and project proposal) are documentcentric, in that their aim is to produce standalone documents which have to be submitted or moved somewhere. For that reason they could cope with a simple WebDAV file storage. Many more applications become possible when using a native XML database for storing the document. The next section presents some more data-oriented applications realized with an XML data store.

Authoring showcases for the web

AXEL is also a convenient tool for creating data entry user interfaces for applications built with an XML database back-end. During the last year we have created entire web sites stored in XML databases, using the XRX (XML REST XQuery) paradigm. AXEL was used for data entry by the end users themselves.

A typical application is a web site presenting an association of professionals, with records or showcases associated with each member. The data model is highly dependent on the activity of the professionals, but in all cases, like the project proposal editor presented above, it combines some descriptive parts, including text, images and/or videos, with factual data such as addresses, email, web sites, and so on.

Figure 4 illustrates a showcase presenting start-up companies in a science park. This web site2 was developed with AXEL, based on a specific template. Each company (currently about one hundred) is using it to enter and update their profile directly from the browser: on the right part of the figure we can note the image upload plug-in in action to enter the company's logo. A similar web site has been recently developed for a craftsmen association in Belgium. Each professional can edit her/his own showcase directly on the web site 3 . The template for this web site was quickly derived from the science park site.

One advantage of using AXEL over a classical rich text editor for such web sites is that any page content is stored as XML data and is then fully reusable. To illustrate this we have made the XML content associated with any page available by adding a .xml prefix to its URL.

This example also uses the ability of templates to encapsulate the most complex aspects of multimedia authoring. If the template developer wishes to develop some more advanced video synchronization artifacts in the showcase, like displaying some paragraphs in sync with some video playback, s/he can create the SMIL time sheet that provides interactivity and synchronization in the resulting web pages. The availability of client-side multimedia libraries supporting SMIL time sheets, such as timesheets.js,4 makes this simple.

The showcase web site gets huge benefits from using structured content. One benefit is that it allows to layer the site search engine so that it uses the semantics of the data model to adjust its results. In the company showcase example, the search engine considers first the terms that appear in the company name, then in the company profile, and finally in the company description. Moreover, in some contexts, such as the company name, it can use a NGRAM index instead of a full text index. Another benefit that we are starting to exploit by using multimedia libraries, is that the whole content is reusable, for instance to create a rotating banner. In that case the banner gets its content directly from the latest content entered within the database and does not require duplicated input.

We have realized some other focused data-oriented templates for various applications, such as a bibliographic data template, a restaurant menu card template, or a timetable template. These templates and the relevant applications have been described in a previous publication [START_REF] Sire | Authoring XML all the time, everywhere and by everyone[END_REF].

Authoring and publishing multimedia presentations on the web

One of our latest developments is a document template representing a slide show that takes advantage of SMIL Timesheets to synchronize the show and to handle user interaction, including navigation among slides. In its current version, the slide show editor displays all the slides, in presentation order, as a scrollable document in the browser window. A menu bar at the top of the editor window contains buttons to load and save the document, and also to preview the slide show, displaying one slide at a time. Figure 5 shows a slide while editing it (with associated widgets), and while playing the slide show (on the right part).

While editing, the preview is available to allow the author to check at any time what the end user will see. Playing the slideshow as a preview during the authoring phase is done simply by generating the full multimedia document from the current state of the document. Thanks to the use of web standards, this document is an HTML document which can be loaded inside a div element in the editor window itself. Then the multimedia library is used to play the slideshow. During playback the div element containing the editor is hidden and therefore every user interface controls added for editing (widgets on the left part of Figure 5) are removed. On the playback view, the document includes navigation buttons as specified by the template for the dynamic behavior of the slide (shown on the bottom right part of the figure). We are now developing a synchronization feature between the multimedia library and the editing library to easily go back and forth between the slide show player and the editor, while keeping the focus on the current slide.

This authoring process allows the author of a slide show to focus on the content, but it can also include true multimedia features in the resulting document. For example, based on the template, the AXEL engine provides automatically the table of contents and the controls that will help the final user to navigate throughout the slides. In the time sheet associated by the template with the authored content, the web devel-oper can also define various display modes for the end user, such as automatic slide timing and incremental or progressive display. The code below5 provides a typical SMIL time sheet for this purpose.

<!--Slideshow Navigation --> <seq timeAction="none"> <item select="div.slide"> <par> <!--Outline/Accordion Lists --> <par timeAction="class:active"> <item select=".outline> li" begin="click" end="click"/> </par> <excl timeAction="class:active"> <item select=".accordion> li" begin="click" end="click"/> </excl> <!--Incremental/Progressive Display --> <seq timeAction="visibility" begin="click" next="click"> <item select=".incremental:not(ul):not(ol), .incremental li" fill="hold"/> </seq> <par timeAction="visibility"> item select=".progressive:not(ul):not(ol), .progressive li" beginInc="2s"/> </par> </par> </item> </seq> 4 Using AXEL

Results

We have developed several applications with the AXEL library, based on different templates, and in different collaborative settings. Each application is composed of (i) at least one template, (ii) some JavaScript code handling a menu bar for loading and saving the edited documents, and (iii) in some cases a backend application running on a server.

A few typical applications are presented in section 3. The article authoring application was used by the present authors to collaboratively write articles. This paper is currently the third one written using this system. The project proposal application has been used up to now to prepare 3 different research projects. In this application, each person in charge of a workpackage edits her/his own document. The science park directory has more than 200 authors. However, most of the initial version of the showcase was written by two coordinators. After this initial, centralized effort, the web site is now updated on a daily basis by each of the member companies. Thanks to the ease of use of the on-line editor, the site remains up-to-date, which was not the case with the previous, more conventional system.

In addition to the applications presented in section 3.2, we have developed (i) an application for editing a newsletter, (ii) a complete web site for a craftsmen association where most of the content is editable, and (iii) a standalone test specification authoring tool.

-The newsletter application is used by up to 5 authors who have already produced 9 newsletters to date. In this application, the backend server displays the name of the author who is currently editing a newsletter to prevent conflicts, since each newsletter is a single document. -The secretary of the craftsman association has created 42 web pages presenting the craftsmen, 17 news and 10 meeting announcements (69 documents involving 4 different templates). We have started to develop a second web site for a different group with similar needs. -The test specification authoring tool has been used to edit a lengthy specification (a 200-page document defined by 1 template) which has been created in 30 different languages using the editor. Each document was edited by one author.

In summary, as of December 2011, the concepts and technologies presented in this article have lead to the creation of at least 300 documents based on 9 templates in 6 different applications and environments. Roughly 200 authors have used AXEL to produce content for real applications. Feedback received from them highlights the ease of use provided in particular by the intuitive and non-intrusive user interface. We believe these qualities derive directly from the main options we have taken: templatedriven editing of formatted documents, and online web authoring. AXEL users have reported that they feel very comfortable to edit web content in the context in which it will be used.

Discussion

The extensibility of our approach has been demonstrated through this wide range of applications. Extensibility is primarily obtained thanks the architecture based on web technologies. Plug-ins may be added to cover new needs. The AXEL library itself may be extended. By creating new templates, new types of documents and new applications can be addressed. As the editor generates XML documents, the whole set of XML processors and languages may be used to process these documents further, thus extending applications.

This last feature is based on the ability of automatically generating an XML Schema from a XTiger XML template [START_REF] Quint | From templates to schemas: Bridging the gap between free editing and safe data processing[END_REF]. Although no schema is required by AXEL (templates play that role), it is often useful to have an XML schema that defines the structure of the XML documents created with the tool. That way all the usual XML tools may be used to process documents safely.

The architecture also provides scalability, as the largest part of processing is distributed. All the editing code is executed on the client side. This ensures high re-sponsiveness for authors without overloading servers, which are not involved in the interactive part of applications.

As compared with traditional XML web applications, AXEL can be considered as a simplified approach. An XTiger XML template mixes several aspects of documents that are usually separated in different resources (schema, document instance, transformations, presentation) expressed in different languages (XML Schema, XML, XSLT, HTML respectively). This separation of concerns still exists with AXEL, but there are much less resources involved. During editing, a single XTiger XML template plays simultaneously the role of a schema, a document instance, and its visual presentation; and when the document is saved as XML, the transformation is again guided by the template. Nevertheless, as explained in section 3.2, different professionals, each focused on a different aspect of the document, may be involved in the process of creating an application. Structure and presentation, for instance are clearly identified in a template: XTiger XML elements define the structure, HTML elements express a presentation. Mixing them in a single resource makes editing easier, by allowing every structure change to be immediately reflected in the presentation.

Merging structure information with document instances has some advantages for maintenance. If the document structure for an application has to change, a new version of the template is created. New documents are then authored with this new template. Note there is no ambiguity about which document uses what version of the document structure definition, as this definition is part of the document itself. If old documents need to be converted to become consistent with the new structure definition, we are in the same case as usual XML applications: we have the XML form of old documents, their XML Schema (automatically generated from the old template) and the new XML Schema (created from the new template). An XSLT transformation may then be developed for converting documents.

Requirements for authoring multimedia contents have been addressed with the objectives of simplifying the authoring task and reusing as far as possible synchronization and interaction patterns. These objectives have been achieved by typed templates (a feature of the XTiger XML language) and by using the well-established paradigm of content / style / behaviour separation. This works well, as soon as the classes of web contents to be created are well identified and are properly defined in templates.

Conclusion and future work

The XML mark-up approach demonstrates a number of advantages when publishing information on the web, as compared with traditional data models. XML provides a way to go beyond conventional data representation, especially with its ability to mix different types of contents in the same hierarchical structures, down to a very fine granularity level if needed. XML also brings interesting opportunities for processing and repurposing contents.

The challenge is to provide end users with web-based authoring tools to populate the web with valid XML content mixing document, data and multimedia components. The diversity of the applications we have realized during the last two years has made us confident that the template approach together with the JavaScript library for clientside authoring is powerful enough to generate a whole family of authoring tools on the web, each one being well adapted to the information to be manipulated.

We have identified several areas of development and improvement for the future. One of them is to extend the template definition language to cover the full spectrum of form design. This can be achieved by developing ad hoc primitive editors for managing usual form controls. We are planing for instance to support the XForms user interface control vocabulary directly in XTiger XML. Another direction is to extend the template language to include some constraints on the content itself, and not just on its structure, such as restricting some input to specific data types. XForms bindings is a source of inspiration in this area. Authoring multimedia content with AXEL still needs further investigation: first to experiment new templates for popular applications such as media annotation, and second to add to our library new user interface controls for editing time dependent features, for instance through a timeline.

Another area of improvement is to adapt the AXEL library to support network driven partial updates of the edited content, which is not the case currently. This would enable collaborative authoring applications with tight coupling allowing multiple authors to edit the same content at the same time. Moreover, some extensions to the XTiger XML language would allow templates to define fine grain locks and access control rules at a structure level in a descriptive way.

Fig. 2

 2 Fig. 2 Project proposal editor application and its menu bar at the top

Fig. 4

 4 Fig. 4 Showcase editing, editor view on the left and static view on the right.

Fig. 5

 5 Fig. 5 Editing a slide

https://github.com/ssire/axel

http://societes.parc-scientifique.ch/

http://www.uniondesartisansdupatrimoine.be

http://wam.inrialpes.fr/timesheets/

Thanks to F. Cazenave for this time sheet.


Energy-aware wireless networked control using radio-mode management Nicolas Cardoso de Castro, Carlos Canudas de Wit and Federica Garin Abstract-Energy efficiency is one of the main issues in wireless Networked Control Systems. The control community has already shown large interest in the topics of intermittent control and event-based control, allowing to turn off the radio of the nodes, which is the main energy consumer, on longer time intervals than in the periodic case. While the existing literature only addresses policies using two radio-modes (Tx -Transmitting, and Sleep), this paper considers intermediate radio-modes, which consume more energy than the Sleep mode but have cheaper transition costs to the Transmitting mode. We propose an event-based radio-mode switching policy to perform a trade-off between energy saving and performance of the control application. To this end, we derive a switched model taking into account control and communication. We compute the optimal switching policy using Dynamic Programming and we illustrate the results in simulations.

Index Terms-Networked Control Systems, event-based control, radio-mode management.

I. INTRODUCTION

Wireless Networked Control Systems (NCSs) are systems in which the sensors or/and the actuators communicate with the controller through a wireless network. Energy saving and robustness to data loss are major challenges in wireless networks, addressed by both communication and control communities. In this paper, we focus on the radio chip as it is admitted that the energy it consumes represents 50% to 80% of the overall consumption of a smart sensor node, see e.g. [START_REF] Joshi | Bounds on dynamic modulation scaling for wireless sensor networks[END_REF], [START_REF] Kimura | A survey on data compression in wireless sensor networks[END_REF], [START_REF] Wen | Optimal power analysis for network lifetime balance in wireless sensor networks[END_REF]. An often-quoted rule of thumb is that executing 3 million instructions is equivalent to transmitting 1000 bits at a distance of 100 meters in terms of expended energy [START_REF] Mann | Wireless sensor networks: guidelines for design and a survey of current research[END_REF]. It is then interesting to increase the computation load to decide to use the radio or not.

Deep interest has been devoted to intermittent, or eventbased, control and estimation, i.e., problems where the measurements or the control input may not be available at some undetermined time because the sensor node switches off to save energy (see e.g. [START_REF] Cogill | Event-based control using quadratic approximate value functions[END_REF], [START_REF] Gupta | On a stochastic sensor selection algorithm with applications in sensor scheduling and sensor coverage[END_REF], [START_REF] Quevedo | Energy efficient state estimation with wireless sensors through the use of predictive power control and coding[END_REF], [START_REF] Cogill | A constant factor approximation algorithm for event-based sampling[END_REF], [START_REF] Imer | Optimal estimation with limited measurements[END_REF], [START_REF] Sinopoli | Kalman filtering with intermittent observations[END_REF], [START_REF] Xu | Estimation under uncontrolled and controlled communications in networked control systems[END_REF]). Author in [START_REF] Cogill | Event-based control using quadratic approximate value functions[END_REF] derives a policy to decide when to send measurements to the controller and the optimal associated statefeedback. The event-based policy tested on an example is less efficient than a periodic policy sending more information, but more efficient than a policy sending the same amount of samples at random time instants. Different setups consider several sensor nodes where only one node can transmit at a Work supported by EU STREP project FeedNetBack FP7-ICT-2007-2. This is an authors' post-print of a paper published in the Proceedings of ACC2012, with some corrections in Section III-B.

Nicolas Cardoso de Castro and Federica Garin are with: INRIA Rhône-Alpes, NeCS Team, Grenoble, FRANCE, emails: {nicolas.cardosodecastro, federica.garin}@inria.fr, and Carlos Canudas de Wit is with: Department of Automatic Control GIPSA-Lab, CNRS, NeCS Team Grenoble, FRANCE, email: carlos.canudas-de-wit@gipsa-lab.grenoble-inp.fr. time, see e.g. [START_REF] Gupta | On a stochastic sensor selection algorithm with applications in sensor scheduling and sensor coverage[END_REF], or setups where the sensor nodes can adapt the transmission power of the radio chip to face bad channel conditions, or to save energy, see e.g. [START_REF] Quevedo | Energy efficient state estimation with wireless sensors through the use of predictive power control and coding[END_REF].

On the other hand, the communication literature investigates energy saving by switching off only some parts of the node, introducing the notion of energy mode management. While some contributions address setups where entire features of the node (computation, communication, sensing) are turned off (see e.g. [START_REF] Sinha | Dynamic power management in wireless sensor networks[END_REF]), we restrict our attention to the case where only the radio chip is switched to low consuming modes, turning off some components, such as the frequency synthesizer, the crystal oscillator, or the voltage regulator within the radio chip (see [START_REF] Brownfield | Wireless sensor network radio power management and simulation models[END_REF], [START_REF] Jurdak | Adaptive radio modes in sensor networks: How deep to sleep[END_REF]). However these works do not take into account the application, i.e., the feedback control, in order to choose the radio-mode. To the best of the authors knowledge, there is no work dealing with both a control application and several radio-modes.

The goal of this paper is to derive an event-based radiomode switching policy to save energy. The novelty of this contribution is to derive a policy jointly taking into account the performance of the feedback loop and several radiomodes. Radio-mode management is not trivial since the intermediate radio-modes consume more energy than the Sleep mode, but they have cheaper transition costs to switch to the Transmitting (Tx) mode. Also, even if intermediate modes consume less energy than the Tx mode, they do not allow data transmission, and the energy needed to switch between modes may result in more wastes than savings. The standard control approach consists in considering only the two extreme radio-modes (typically Tx and Sleep), defining a reasonable time interval to run open-loop, and switching down the radio periodically when not transmitting. This approach results in a fix energy consumption per period, based on the worst case scenario. Our approach deals with event-based (aperiodic) data transmissions depending on the current system state, with the use of several radio-modes. Not only the sensor node should decide whether to transmit or not, but also, it should decide which of the low consuming modes to switch to when not transmitting. A switched linear system taking into account several radiomodes and the control application is derived in Section II. The optimal switching policy, computed using Dynamic Programming, is presented in Section III. Simulation results are provided in Section IV and Section V concludes the paper and gives future directions.

II. PROBLEM FORMULATION

A. Setup description

For simplicity, we consider a wireless networked control problem composed of two nodes, as depicted in Fig. 1. The first node has computing capabilities and is then called the smart node. It is in charge of sensing the system output, computing the feedback law and deciding whether or not to send the control input to the second node, in charge of applying the control law to the actuator. The aim of this paper is to save energy at the smart node's radio chip level when the quality of the feedback control is good enough. The radio chip is switched to low consuming modes (e.g. Idle, Sleep) to save energy. We are not interested here in the consumption of the second node as we assume that it is co-located with the actuator, and then it has access to an unlimited energy source. This assumption is realistic in many wireless sensor network situations, as motivated in [START_REF] Bao | Encoder decoder design for event-triggered feedback control over bandlimited channels[END_REF].

We define N as the number of radio-modes. The switching decision is denoted by v k ∈ {1, 2, • • • , N }, where v k = i means that the radio-mode is switched to mode i at time k.

1) System model: The system we control is a linear unstable discrete-time controllable system with an additive zero-mean white Gaussian noise, described Eq. ( 1).

x k+1 = Ax k + Bu k + w k , (1)
where x k is the system output and u k is the control input taking values in R n and R p respectively, and w k ∼ N (0, W ) is the measurement noise. A and B have appropriate dimensions.

2) Channel model: We consider a simplified memoryless erasure channel where message u k is dropped with probability ǫ, and otherwise is correctly received. We consider a model where the dropout concerns the real-valued message u k , not single bits or packets. The transmission successes are modeled by i.i.d. Bernoulli random variables β k :

β k =
1, success with probability 1ǫ, 0, failure with probability ǫ.

Switching policy

v k x k Smart node System x k Erasure channel Radio chip m k Feedback law m k u k-1 u k Actuactor node u ′ k u k u k ûk u ′ k β k x k u ′ k Radio chip ACK ûk wk + +
Fig. 1. Block diagram of the problem setup. The smart node measures the noisy state x k from the system, it computes the feedback law u ′ k and decides whether to send it or not to the actuator node. ûk is equal to u ′ k when a transmission occurs, or to ∅ otherwise. The receiver is then able to determine if it has received an update or not. β k equals 1 when the transmission is successful or 0 when there is a dropout.

3) Feedback law: The control input applied to the system depends on the arrival of the update, which depends on the transmission success and on the decision to send an update, as described in Eq. ( 2). If an update is received, then the control law is a state feedback with gain K. This gain is chosen so that the system x k+1 = (A -BK)x k is stable. Otherwise, the control input is held to its previous value as long as no update is received from the smart node.

u k = -β k Kx k + (1 -β k )u k-1 , if v k = 1, u k-1 , otherwise. (2)
4) Radio chip model: The radio chip is characterized by the number of radio-modes, N , and the associated costs to stay in a given mode or to switch from a mode to another. The mode transition delays are assumed to be smaller than the sampling time. This implies that the smart node has enough time to switch to the desired mode (and possibly send the update) before the next sampling time.

The first radio-mode (Tx mode) is the only one allowing transmission, and the most consuming one 1 . The other modes are intermediate modes where only some components of the radio are turned off, consuming less energy than the Tx mode. The last radio-mode (called the Sleep mode) consumes no or very little energy (less than any other mode), but more energy is needed to switch to the Tx mode from the Sleep mode than from the intermediate modes. We define θ ij as the energy needed to switch from the mode i to the mode j, and θ ii as the energy to stay in the mode i.

The state of the radio chip is the mode at time k, m k :

m k ∈ M {1, 2, . . . , N } ,
where 1 ≡ Tx, and N ≡ Sleep, and we define M * {2, 3, . . . , N }. The radio-mode is updated according to the switching decision:

m k+1 = v k .
The consumption of the radio chip at each sampling time depends on the radio-mode m k and on the switching decision v k . The amount of energy E consumed since the commissioning (where E 0 = 0) can be computed as follows:

E k+1 = E k + θ m k v k = E k + θ m k m k+1 .

5) Switching policy:

The sensor node embeds a switching policy η (whose design is the goal of this paper) to assign the radio-mode. The decision to switch between modes is based on the actual system output x k , the last control input u k-1 and the current mode m k . Note that the smart sensor has a perfect knowledge of the last control input applied to the system, since it receives an acknowledgment when a transmission is successfull. The channel from the actuator to the smart sensor is considered reliable since enough energy is available at the actuator side to send the acknowledgement. Introducing ũk = u k-1 , the memory of the last control input applied to the system, the switching decision is given by

v k = η(x k , ũk , m k ).

B. Switched system formulation and optimization problem

We formulate the evolution of the system under the different choices of radio-modes as a switched linear system, with as many systems as the number of modes N . Choosing the switching policy at time k is equivalent to choosing the radio-mode. The evolution of the switched system depends on x k , the state of the system, on ũk = u k-1 , a memory keeping track of the last applied control input, and on m k the mode of the radio chip. We define z k as the system state augmented with the control memory:

z k = x k ũk ⊤ ∈ R n+p , and also ω k = w k 0 ⊤ .
Then, the state of the switched system is (z k , m k ) and the state space is denoted X R n+p × M. The evolution of the system given in Eq. ( 1) and the control law described in Eq. ( 2), together with the radio-mode update law η, give rise to the following switched system:

z k+1 = f v k (z k , ω k , β k ) m k+1 = v k = η(z k , m k ),
where the function f v k is defined as

f v k (z k , ω k , β k ) = Φ v k (β k )z k + ω k , (3)
and the matrices

Φ v k (β k ), for v k ∈ M, are as follows: 1) if v k = 1, i.e.
, if there is a transmission, then

Φ 1 (β k ) = A -β k BK (1 -β k )B -β k K (1 -β k )I (4)
=        Φ CL = A -BK 0 -K 0 if β k = 1 Φ OL = A B 0 I if β k = 0. (5)
2) if v k = j = 1, i.e., if there is no transmission, then

Φ j (β k ) = Φ OL ∀β k . ( 6
)
Our goal is to find a suitable switching policy η, in order to get a good trade-off between the control performance and the energy consumption. To this aim, we define an optimization problem on an infinite time-horizon, where the cost function takes into account the mean of these two criteria:

J η (z 0 , m 0 ) = E {β k },{ω k } ∞ k=0 λ k ℓ v k (z k , m k , β k ) ,
where

m k+1 = v k = η(z k , m k ) and z k+1 = f v k (z k , ω k , β k ).
Here, λ > 0 is a discount factor, and

ℓ v k (z k , m k , β k )
is the cost-to-go, which is by construction a random variable, designed as follows:

ℓ v k (z k , m k , β k ) = x ⊤ k Qx k performance + u ⊤ k Ru k control energy + θ m k v k transmission energy
, for some symmetric, positive definite matrices Q and R, which can be tuned to give different trade-offs between the feedback performance and energy consumption.

Recalling that the control input u k satisfies Eq. ( 2), the costto-go can be re-written in the following form, which clarifies that it depends on z k , m k , v k and β k only:

ℓ v k (z k , m k , β k ) = z ⊤ k Q v k (β k )z k + θ m k v k , (7)
where the matrices Q v k (β k ), for v k ∈ M, are as follows:

1) if v k = 1, i.e., if u k = -β k Kx k + (1 -β k )ũ k , then Q 1 (β k ) = Q + β k K ⊤ RK 0 0 (1 -β k ) R =        Q CL = Q + K ⊤ RK 0 0 0 if β k = 1 Q OL = Q 0 0 R if β k = 0. (8)
2

) if v k = j = 1, i.e., if u k = ũk , then Q j (β k ) = Q OL ∀β k . ( 9
)
The optimization problem is summarized as follows. Problem.

Find a deterministic stationary policy η

* (z k , m k ) such that J η * (z 0 , m 0 ) = min η J η (z 0 , m 0 ) ,
where the cost J η is defined as

J η (z 0 , m 0 ) = E {β k },{ω k } ∞ k=0 λ k ℓ v k (z k , m k , β k ) ,
where

m k+1 = v k =η(z k , m k ), z k+1 =f v k (z k , ω k , β k ) as defined in Eq.s (3)-(6), ℓ v k (z k , m k , β k )
is the cost-to-go described by Eq.s ( 7)-( 9) and λ∈ (0,1) is a discount factor.

Note that we are interested in solving this problem under the following non-triviality assumptions: the system described by Eq. ( 1) is not stable; the matrix A -BK is not nilpotent; and transmissions have a non-zero cost whatever the previous mode, i.e., θ m1 > 0 ∀m.

We are only searching for a stationary policy η * , because a time-dependent policy η k on an infinite time-horizon is not implementable. Fortunately, as it is explained in Section III, a stationary policy exists, which is optimal among all policies.

The discount factor λ is used to weight the importance of immediate action versus long-term decision. It is mandatory in our setup because when λ = 1, on an infinite timehorizon, the cost function is infinite for any policy. However, it has to be noticed that introducing the discount factor λ < 1 prevents from proving stability with the standard argument in LQ optimal control, using the cost-to-go as a Lyapunov function. To the authors knowledge, stability proof in discounted problems solved with Dynamic Programming is an open issue and beyond the scope of this contribution2 .

III. SOLUTION OF THE OPTIMIZATION PROBLEM BY DYNAMIC PROGRAMMING

A. The Value Iteration method

The optimization problem described in Section II-B can be solved using Dynamic Programming, which is based on Bellman's Principle of Optimality [START_REF] Bellman | Dynamic Programming[END_REF]. This methodology is composed of two parts. The first one is run offline, and it provides the optimal switching policy. This part involves heavy computations that can be carried on a computer. It gives an exact solution for every (z, m) ∈ X. The second part, run online on the smart sensor, consists in computing the optimal switching decision only for the current switched system state (z k , m k ) at time k, according to the law derived offline.

Notice that the cost-to-go satisfies the positivity assumption, i.e., ℓ v (z, m, β) ≥ 0 for all (z, m) ∈ X, v ∈ M and β. Also notice that the policy η(z, m) takes values in the finite set M. Thanks to these two facts, standard arguments in Dynamic Programming theory (see [START_REF] Bertsekas | Stochastic Optimal Control: The Discrete Time Case[END_REF]Ch. 9]) allow to prove that there exists a deterministic stationary policy η which minimizes the cost J η (z 0 , m 0 ), and which can be found by the so-called Value Iteration method, i.e., by the following iterative algorithm: after initializing V 0 (z, m) to be the all-zero function, compute

V i+1 (z, m) = min v∈M E β,ω [λV i (f v (z, ω, β), v)+ℓ v (z, m, β)] . (10)
The results in [START_REF] Bertsekas | Stochastic Optimal Control: The Discrete Time Case[END_REF]Ch. 9] guarantee that such iterations will converge to V * (z, m) = J * (z, m) min η J η (z, m) as i goes to infinity, and that

η i (z, m) arg min v∈M E β,ω [λV i (f v (z, ω, β), v)+ℓ v (z, m, β)]
converges to η * (z, m), the optimal stationary policy.

The derivation of the optimal switching policy consists in computing offline V * (z, m) and η * (z, m) for all (z, m) ∈ X. Then, the smart sensor computes online, at each sampling instant, the switching decision v k as a function of (z k , m k ), according to the law η * .

B. Computation of the Value Function iterations

In theory, the Value Iteration Method gives us an iterative algorithm, converging to the solution of our optimization problem. A caveat is that, at each iteration, we need to compute a function of (z, m), where (z, m) takes values in an uncountable space X.

A first way to implement such iterations in practice, is to partition (a portion of) X in a grid, then compute the Value Function V i+1 (z, m) at the grid points only, by using interpolation to find V i (f v (z, ω, β), v) when f v (z, ω, β) is not on the grid. This approach has been taken e.g. in [START_REF] Sundström | On implementation of dynamic programming for optimal control problems with final state constraints[END_REF] and provides a look-up table for η i (z, m) at all grid points. Computationally, it is very heavy, although this is not a major issue since the long computations are done offline, while online the control is chosen by accessing the lookup table. Some minor drawbacks of this approach are that the solution is limited to a finite domain, and that the numerical approximations and interpolation might introduce some errors giving a sub-optimal solution.

A second approach, inspired both by the results in classic Linear Quadratic (LQ) optimal control and by the work in [START_REF] Lincoln | Dynamic Programming and Time-Varying Delay Systems[END_REF], is to try to compute the functions V i (z, m) by exploiting some structure that they might have, if any structure exists that is preserved along iterations. For example, in LQ control, for any i the Value Function is a quadratic function of z, i.e., V i (z) = z ⊤ Π i z. For our problem, at least in the case without noise and packet drops, it is possible to find a structure, although more involved than the classical LQ case, as described below. In the remainder of this subsection, we focus on the simplified problem where there is neither noise (ω = 0) nor packet drops (β = 1), and we use the following notation: [START_REF] Bao | Encoder decoder design for event-triggered feedback control over bandlimited channels[END_REF]. With these assumptions and notation, the following expressions hold true.

f v (z) f v (z, 0, 1), ℓ v (z, m) ℓ v (z, m, 1), Φ v Φ v
1) Structure of the Value Function: If V 0 (z, m) ≡ 0 ∀(z, m), then the iterations [START_REF] Imer | Optimal estimation with limited measurements[END_REF] give value functions

V i (z, m) such that V i (z, m) = min (Π, - → π )∈Pi z ⊤ Πz + π m , (11)
where the set P i is composed of elements (Π, -→ π ), where Π is a symmetric matrix and -→ π = π 1 , π 2 , . . . , π N ∈ R N is a vector of non-negative scalars, and π m represents the m th component of -→ π . Indeed, assuming that Eq. ( 11) holds, Eq. ( 10) yields

V i+1 (z, m) = min v∈M {λV i (f v (z), v) + ℓ v (z, m)} = min v∈M λ min (Π, - → π )∈Pi z ⊤ Φ ⊤ v ΠΦ v z + π v + z ⊤ Q v z + θ mv = min v∈M, (Π, - → π )∈Pi z ⊤ λΦ ⊤ v ΠΦ v +Q v z + λπ v + θ mv = min (Π ′ , - → π ′ )∈Pi+1 z ⊤ Π ′ z + π ′ m .
2) Iterations of the Value Function: The computation of V i+1 (z, m) at iteration i + 1 consists in computing the set P i+1 , from the set P i : P 0 = 0, 0, 0, . . . , 0

P i+1 = P 1 i+1 ∪ P 2 i+1
, where:

P 1 i+1 λΦ ⊤ CL ΠΦ CL + Q CL , [λπ 1 +θ 11 , λπ 1 +θ 21 , . . . , λπ 1 +θ N 1 ] such that (Π, -→ π ) ∈ P i , P 2 i+1 λΦ ⊤ OL ΠΦ OL + Q OL , min v∈M * {λπ v +θ 1v } , min v∈M * {λπ v +θ 2v } , . . . , min v∈M * {λπ v +θ N v } such that (Π, -→ π ) ∈ P i . (12)
The switching policy at iteration i is given by: 3) Convergence of the Value Function: The Value Function iterations guarantee that the optimal cost J * and the optimal switching policy η * are attained as the number of iterations goes to infinity. This is guaranteed besides having the cardinality of the set P i doubled at each iteration (as it can be seen from Eq. ( 12)). When running the offline computation, the stopping criterion of the iterations is then a trade-off between the complexity of the computations (increasing with the iterations) and the distance to optimality (decreasing with the iterations). One proposition to observe the convergence of the scheme is to define a grid on a finite domain of interest of the state space X on which, at each iteration, the value function V i (z, m) is evaluated. The value function evaluated on the grid converges at a rate depending on the precision of the grid, and this is therefore only an indicator.

η i (z, m) 1 if (Π i , -→ π i ) ∈ P 1 i , arg min v∈M * {λπ v +θ mv } else, where (Π i , -→ π i ) = arg min (Π, - → π )∈Pi z ⊤ Πz + π m .

IV. SIMULATION RESULTS

To illustrate the proposed method, we present here an example of a first order unstable system, with the following parameters:

x k+1 = 1.074x k -1.

A. Offline results

The offline computation provides the switching policy v = η * (x, ũ, m). This means that, at any time k, η * gives the optimal switching decision v * ∈ M for the current measurement x k , the last control input applied to the system u k-1 = ũk and the current radio-mode m k . This is depicted in Fig. 2 with a subfigure per each current mode m k .

We observe that the regions where the radio is switched to low consuming modes (colors dark gray and black in Fig. 2) are finite sets around the equilibrium point (x k , ũk ) = (0, 0), and follow the direction ũk = -Kx k (K < 0 in our example). Outside of these regions, a transmission is forced. This means that when the last control input applied to the system is close to what the state-feedback law would have decided, then the switching policy does not send an update.

Note that we obtain an event-based radio-mode switching policy. Indeed, a switching occurs only when the state of the system crosses one of the regions in Fig. 2.

B. Online results

After deriving the switching policy, we run online temporal simulations to observe the behaviour of the system. In Fig. 3 we compare our event-based switching policy with some periodical ones using the same state feedback law u = -Kx, where the radio is alternatively switched to Tx and low consuming modes. We consider various periodic patterns for the radio mode: we will denote by periodic i-j a sequence with period i + j where the mode is Tx for i consecutive sampling intervals and then is Sleep for j intervals. We will then denote by periodic i-j min a sequence with the same period and the same Tx intervals (so that the control performance is unchanged), but where the mode for the nontransmitting intervals is chosen in M * so as to minimize the energy consumption. The online simulations include channel dropouts and additive output noise on the system. Fig. 3(a) shows that the system is stabilized in a set around the equilibrium in both cases. In Fig. 3(b), one can see the switching decisions for both cases. The green triangles indicate time instants where a transmission was intended but a dropout occured. When an update is dropped, the eventbased scheme holds the Tx mode to actually transmit a new control update, while the periodic scheme is not taking dropouts into account. Moreover, the event-based scheme may hold the Sleep mode for a long time interval when transmissions cost more than the deviation observed on the state.

Finally Fig. 3(c) compares the event-based scheme to several periodic patterns. In this figure, the performance of the closed loop system is computed from the cost function ( Tmax i=0 (x ⊤ i Qx i + u ⊤ i Ru i ) where Tmax=4s) and normalized such that 100% and 0% are the best and the worst performance, respectively. The event-based scheme is very close to the best, although not exactly the best, but it offers the least energy consumption, and especially the best trade-off. V. CONCLUSION

In this paper we have studied the optimal management of the radio-chip modes of a wireless smart sensor in a networked control problem. The novelty of this paper is to introduce the use of more than two radio-modes in a control problem, whereas previous related control-theoretic literature was focused on the choice between two options (Tx/Sleep). We have considered a networked control problem with an unstable linear system to be stabilized, and with a single smart sensor whose transmissions to the actuator are performed with an optimal choice of the radio-mode.

For this problem, we have defined a suitable cost function, which describes a trade-off between the control performance and the energy consumption, and whose minimum can be computed with an iterative Dynamic Programming algorithm (Value Iteration method). We obtained an event-based policy to switch between radio-modes. Limiting the amount of communication to save energy naturally decreases the closedloop performance, but we show on an example that an eventbased approach permits to keep the performance good and save larger amount of energy than a periodic approach.

A natural extension of this work is to consider an optimization that involves not only the radio-mode, but also the feedback control law for those times where the sensor is transmitting. Moreover, we are currently exploring another approach to this same problem, where the optimization is performed over a finite receding horizon. This MPC framework has the advantage to provide tools to prove stability in the practical-Input-to-State stability sense.

Fig. 2 .

 2 Fig. 2. Optimal switching policy derived from the offline computation, light gray ⇔ switch to Tx (v k = 1), dark gray ⇔ switch to Idle (v k = 2) and black ⇔ switch to Sleep (v k = 3), the control memory ũk = u k-1 is on the x-axis and the system output x k on the y-axis.

  4808u k +w k ; T s = 0.05s; W = 0.02; K = -0.23; Q = 0.01; R = 0.1; Three radio-modes are considered (Tx, Idle, Sleep), the values of the transition costs are given in the θ matrix in [mJ] and are computed from the datasheet of the radio chip Texas Instrument CC1100.

  (a) State of the system x k . (b) Switching decision v k . (c) Performance vs. energy consumption E Tmax for several periodic schemes.

Fig. 3 .

 3 Fig. 3. Online simulations comparing our event-based switching policy with periodic ones. Additive zero-mean white Gaussian noise and channel dropouts are considered. The green triangles in Fig (b) indicate time instants where a transmission was intended but a dropout occured.

The smart node is not receiving any other information than the acknowledgements from the actuator, taken into account in θ 11 , so we do not consider any receiving mode in this setup.

Authors in[START_REF] Görges | Optimal control and scheduling of switched systems[END_REF],[START_REF] Bertsekas | Dynamic programming and suboptimal control: A survey from ADP to MPC[END_REF] discuss about stability of control laws derived using Dynamic Programming based approaches.

VI. ACKNOWLEDGMENTS

The authors would like to thank Daniel Quevedo for interesting discussions.