System Overview

NutDAC ("Nut/OS based Data Acquisition and Control") provides a framework to create real time embedded data acquisition and control applications that can be remotely controlled from a computer. It contains tools that are of common use in such systems and help to reduce the time required for its development, usage and maintenance.

In the following figure we can see a simplified scheme of the software architecture (for more details see the documentation).


Figure 1: Simplified SW architecture

We have added two software layers between the OS/Microcontroller and the User Application: NutDAC itself and the I/O drivers. NutDAC comes as a set of two libraries, one written in C for creating applications running in a microcontroller (NutDAC_Micro) and its counterpart written in Java for creating complementary applications running in a PC (NutDAC_GUI).

NutDAC_Micro defines a simple I/O channel abstraction layer separating the low level I/O routines (I/O Drivers layer) of the upper level use of the data (User Application layer). This way channel access is unified for all channels independently of their nature and hardware that they are/(might be) associated to. This allows the construction and use of standardized tools on top of the channel abstraction for higher level operations.
NutDAC_Micro uses the NutOS RTOS and currently runs (have been tested) on the Ethernut2 and Ethernut3 boards, all from the Ethernut project.

NutDAC_GUI provides a class for objects representing the abstract channels defined in NutDAC_Micro. They work as remote representations of the channels in the microcontroller, and both sides, channels in the microcontroller and their representation in the PC, can be kept synchronized automatically. This means that changes in a channel in the microcontroller are updated in the PC and vice versa without explicit user intervention. This allows the creation of control applications with logic in both sides, microcontroller and PC. NutDAC_GUI also provides many other useful classes, including widgets and panels for creating GUIs to control/monitor the system. Moreover, the user application of the PC side can be programmed as an applet that can be embedded into a web page downloadable from the web server of the microcontroller. Thus the whole user application can be kept in the microcontroller and any computer with a java enabled browser can download and execute the PC part. The following picture is an example of a GUI that can be created with NutDAC_GUI (click to view a higher resolution picture)


GUI for the pp16 project


In general the developer of a NutDAC based application will have to program the yellow blocks in the upper figure, although in some cases channel drivers might be ready available. Note that the user application on the PC side is optional.

Key Features

NutDAC provides complementary libraries for the Microcontroller and PC, so that building embedded real time control applications with some degree of remote interaction from a PC (with or without GUI) is made easy.

  • The logic of the application can be on both sides, it is up to the programmer to decide what goes where, but typically the microcontroller keeps the low level control (filtering, state machines, controllers) and the PC the high level controls (start and stop sequences, etc.). It is also possible for example to gather input data from the microcontroller, do some heavy computations in a PC and return the result to the microcontroller as an output.
  • As NutDAC takes care of keeping both sides synchronized, you can program your application in a PC thinking about what you want to do with the I/O channels, forgetting about the fact that they are attached to a small microcontroller located somewhere on the Internet. Of course this has the limitations imposed by the network itself, and dictates what parts of the logic goes where depending on each particular case.

The layered software architecture enforces a clean separation between low level I/O routines (Hardware access, etc.) and the User application. This results in

  • A more reusable and flexible software
    • Your user applications can be used with different hardware (sensors, actuators, etc.)
    • Your channel drivers (whether they are for actual HW devices or other type) can be used for different applications.
  • A more reusable hardware: once that you have drivers for your hardware, it can be easily used for many different applications.
    Note:NutDAC_Micro provides drivers for a few integrated circuits (ADCs, DACs, expanders). They can be used to easily build drivers for custom instrumentation boards (see Supported Hardware).

Some useful ready available tools :

  • Real time Uc<->PC channel synchronization.
  • Automatic data acquisition and storage (in microcontroller and PC)
  • Real time data visualization in PC
  • Command line interfaces in the microcontroller (serial and telnet) for system control
  • Events in the microcontroller (system and user defined) can be handled in the PC (by registered callback functions)
  • System Logs (stored local and remotely)
  • Emulation of measurements (useful for testing and debugging)
  • Channel calibration facilities (through command line and GUI)
  • Web server in the microcontroller (provided by NutOS) from where the GUI can be downloaded

Other important features

  • All those inherited from NutOS
  • Flexibility:
    • Although born within the context of fuel cell research projects, the libraries have been designed for general purpose applications.
    • Flexible channel driver. Channel drivers can be HW drivers or not (You could get data for your channel e.g. from Internet, or another Ethernut, etc.)
  • Modularity: the libraries contain modules that will be loaded only when they are needed, keeping unnecessary code out and thus saving program space when required.
  • Scalability:
    • Hardware-wise the Ethernut project provides several boards with different features. Although only Ethernut2 and Ethernut3 have been tested, it should be fairly easy to port it to other NutOS compatible boards (see Supported Hardware).
    • Software-wise the maximum number of channels is limited only by the memory available in the microcontroller. As an example, we have been using 188 channels in the control system for the 16kW hybrid Power Source
  • Expandability: it is easy to create new modules with new functionality.
  • Everything (source code, hardware, development tools) is Open Source!

Applications

Typical applications that may benefit by using NutDAC are in general any embedded control applications, and specially if you need a GUI to (remotely)control or supervise your system, and/or your system has a large number of channels. Some examples:

  • Data acquisition: data can be acquired, visualized and stored locally and in a remote computer on real time.
  • Remotely controlled embedded control applications from fully featured GUIs: (Home Automation, etc.)
  • Retrofitting control applications running in a PC (Control system running in a computer that have to be transferred to an embedded system)
  • ...

NutDAC has been used to build the control system of 4 fuel cell power sources (see History, and pp8 and pp16 projects for examples).

Limitations

  • Those inherited from the use of small microcontrollers. In particular, do not expect sampling rates of an oscilloscope.
  • NutDAC_Micro inherits NutOS's features and limitations. Notably, NutOS provides cooperative threading, as opposed to preemptive. For many applications this is an advantage, because (straight from NutOS web pages) "... cooperative threading guarantees, that a thread yields control at well-defined points only. In most cases access to shared resources does not require any locking. This finally results in small and simple application code and significantly reduces the risk of race conditions and deadlocks." For some others, this might be an issue to consider.
  • The time stamps are generated using the NutGetMillis function from NutOS, which measures the time since bootup with a resolution of 1ms. The variable used by NutOS to store this time is 32bits, and so it will overflow every about 49.7 days.
  • This software has been created for research purposes in a laboratory, and should not be considered as a production software. We have been running full experiments (with the fuel cells) of up to a couple of hours, and selected tests over night. Use it at your own risk!