Evaluation and Optimisation of Communication Performance in a
Hybrid Measurement and Control System
Jacek AUGUSTYN, Andrzej TUTAJ
AGH University of Science and Technology
al. A. Mickiewicza 30, 30 059 Krakow, Poland
Abstract: In a modern hybrid measurement and control system a high speed data acquisition/execution module communicates with a master management and control unit. A typical solution may involve a System on Chip (SoC) device, like ARM Cortex M core based microcontroller, linked via USB bus with a Commercial Off The Shelf (COTS) appliance, such as a tablet, a smartphone, or a PDA. During prototyping stage the COTS is usually temporarily substituted with a PC computer running a rapid prototyping tool such as MATLAB. The paper presents software design considerations and discusses the results of extensive experiments conducted in order to assess if such a prototyping configuration is able to provide a kind of real time communication performance comparable to that expected in the target system. An optimisation technique is proposed that considerably improves statistics of throughput, round trip time and packet exchanged frequency and that utilises standard operating system software components.
Keywords: soft real time, embedded system, microcontroller, USB interface, MATLAB.
CITE THIS PAPER AS:
Jacek AUGUSTYN, Andrzej TUTAJ, Evaluation and Optimisation of Communication Performance in a Hybrid Measurement and Control System, Studies in Informatics and Control, ISSN 1220-1766, vol. 23 (4), pp. 341-351, 2014.
The design of modern embedded measurement and control systems is moving towards hybrid solutions . They typically involve two main modules: i) a fast acquisition/execution or measurement and control module, the name depending on the application field, and ii) a master module comprising user interfaces, logging subsystem, and external data exchange links. The former module is connected directly to the controlled or monitored system (plant), measures signals from sensors and feeds signals to actuators. The latter gathers process data, performs its registration, interacts with the user and interfaces with other devices. The control algorithm may be implemented, depending on the adopted methodology, either in the measurement and control module or in the master module. It may be also distributed between them with time critical direct control realised by measurement and control device and computationally intensive supervisory control delegated to the master module, as it usually runs on a more powerful processor .
This study proposes an acquisition/execution module based on a 32 bit microcontroller (e.g. with an ARM/Cortex-M core) to handle analogue to digital converters, binary inputs, outputs, PWM generators, and DAC converters. This module could also perform filtering, parameter estimation, or control tasks. The solution ensures short and stable response times in the order of 1-100 μs .
A commercial off the shelf (COTS) device, such as a PDA, a tablet or a smartphone is proposed in the literature for the module , [4-8]. CTOS devices are typically equipped with data exchange interfaces, such as Wi Fi, Ethernet, Bluetooth, GSM/EDGE/LTE and interact with a user via a touch sensitive GUI. A discussion supporting the use of COTS hardware can be found in  while a review of designing methodologies is presented in . Software/hardware COTS solutions are even proposed for the demanding military  and marine  applications.
However, a COTS device, typically a closed hardware solution, imposes a serious difficulty in using RS232 and SPI interfaces often necessary to integrate with sensors or other automation equipment. For this reason a Universal Serial Bus (USB) interface is proposed to link the acquisition/execution and the master modules [1,3].
Rapid prototyping environments, such as MATLABâ„¢ or LabVIEWâ„¢, are suggested at subsequent steps of the development of the acquisition/execution module (prototyping, testing and validation of application algorithms). Both environments provide extensive sets of functionalities, including signal processing, identification, and control synthesis packages. They also have versatile capabilities in graphical data presentation, which is an important advantage at the testing stage . Both tools can also be used for measurement results recording.
A question arises whether the Matlab environment is able to ensure the kind of real time performance and provide data throughput between the acquisition/execution and master modules, similar to that expected in the target solution. Such compatibility between the performance levels at the development and production stages is necessary for the portability reason. Details of the connection performance in target solutions implemented with native language can be found in , , where a throughput in the range of 600-700 kB/s has been obtained. The use of interpreted scripted languages (e.g. Matlab) at the prototyping stage means that properties thus obtained may differ from these based on a native compiled code.
As the USB communication involves some device drivers, one can expect that the best results can be achieved with dedicated custom ones. However implementation of such drivers is a very difficult and time consuming task that requires profound knowledge of the operating system. Therefore, the reasonable solution is to use standard components and bundled hardware drivers and to optimise their performance.
The literature presents a wide range of applications of microcontrollers communicating with master computers, used in measurement and control systems. Typically these are 8 bit designs using USB UART converters . However, these full-speed class converters provide lower throughput than potentially achievable from a USB bus, such as 3 Mbit/s in the cases of , which is a limiting factor on the solution.
In a detailed study of the properties of a direct USB connection between a PIC 18Fx550 microcontroller and a PC computer various software variants yield throughputs in the order of 32 kB/s .
An analysis of USB induced delays of various transaction types shows results in the order of 30-50 ms . Descriptions of solutions based on an ARM core with external USB UART converters can be found in . A data logging application presented in these articles achieve sampling frequency of 14 kHz for 16 bit data samples, that is not very high result either. Other researchers propose a solution involving implementation of a programme in VB.NET language and subsequent exporting of recorded sensor data into Matlab .
The objective of this study is to implement a USB connection using Matlab rapid prototyping tool and standard USB components available in the operating system and to test real time performance and data throughput properties of such a solution. Another important contribution of the paper is a proposition of an optimisation technique substantially improving the performance of the USB connection. The optimisation aim is to achieve with a rapid prototyping configuration the performance close to this required in a target production system, despite the fact that Matlab uses M file scripts while a production system is usually coded in C/C++ language.
The paper presents experimental results concerning closed loop time delay and data throughput achievable for communication between the acquisition/execution module and the Matlab environment. Tests have been conducted using hardware based on 32 bit ARM/Cortex M microcontroller. Efficiency of the proposed optimisation is demonstrated. Results of statistical analyses are presented for various data exchange parameters.
The article is organised as follows. Section 2 presents the proposed structure of the data exchange test system implemented by the authors. Results of extensive experiments conducted for different configurations of the system are gathered, compared and discussed in Section 3. An optimisation of the data exchange scenario, considerably improving the system performance, is proposed in Section 4. Results of experiments are provided and compared to those presented in the previous section. Final remarks and plans for future research are given in section 5.
- AUGUSTYN, J., New Methodology of Designing Inexpensive Hybrid Control acquisition Systems for Mechatronic Construction, Sensors, vol. 13(12), 2013, pp. 17222 17240.
- HAIKAL, A. Y., M. A. ELHOSSEINI, A Smart Robot Arm Design for Industrial Application, Studies in Informatics and Control, vol. 23 (1), 2014, pp. 107-116.
- AUGUSTYN, J., Design of embedded systems with application to SAM7S family with ARM7TDMI core, IGSMiE PAN, Kraków, 2007, p. 302.
- AUGUSTYN, J., A. BIEΝ, Rapid prototyping methodology of embedded control acquisition system, Metrology and Measurement Systems, vol. 19, iss. 4, 2012, pp. 777 786.
- SALAH, K., M. HAMAWI, Impact of CPU bound Processes on IP Forwarding of Linux and Windows XP, Journal of Universal Computer Science, vol. 16, iss. 21, 2010, pp. 3299 3313.
- GARCIA, J. Q., A Study on PDAs for Onboard Applications and Technologies and Methodologies, Journal Personal and Ubiquitous Computing, vol. 15, iss. 5, 2011, pp. 457-478.
- WOOLLEY, A., D. DUFF, Using COTS Technologies for Battlefield Applications, 2011 Military Communications Confer., Baltimore, 2011, pp. 1506-1510.
- SHANG, M., X. AIQUIANG, Z. XIULI, Y. CHUNYING, L. TINGJUN, COST-based Design PMA for Certain Navigation Radar, 2011 International Conference on Power Electronics and Engineering Application, vol. 23, 2011, pp. 235 240.
- GUPTA, R., J.N. BERA, M. MITRA, Development of an Embedded System and MATLAB based GUI for Online Acquisition and Analysis of ECG Signal, Measurement, vol. 43, iss. 9, 2010, pp. 1119 1126.
- AUGUSTYN, J., A. BIEN, Real Time Performance of USB Interface in Embedded Control and Measurement Systems, Przeglad Elektrotechniczny, vol. 85, iss. 7, 2009, pp. 1 7.
- AHMAD, M.A., A.N.K. NASIR, N.S. PAKHERI, N.M. GHANI, at. el., Microcontroller Based Input Shaping for Vibration Control of Flexible Manipulator System, Australian Journal of Basic and Applied Sciences, vol. 5, iss. 6, 2011, pp. 597 610.
- AN232B 04 Data Throughput, Latency and Handshaking, AN232B 03 Optimizing D2XX Data Throughput, FTDI Ltd., www.ftdi.com, 2006.
- POSADA GOMEZ, R., J. JORGE ENRIQUEZ-RODRIGUEZ, G. ALOR-HERNANDEZ, A. MARTINEZ-SIBAJA, USB bulk Transfers Between a PC and a PIC Microcontroller for Embedded Applications, Electronics, Robotics and Automotive Mechanics Conference, Morelos, 2008, pp. 559 564.
- RAMADOSS, L., J.Y. HUNG, A Study on Universal Serial Bus Latency in a Real time Control System, 34th Annual Conference of IEEE Industrial Electronics, IECON 2008, Orlando, 2008, pp. 67 72.
- TAN, B., S. QUAN, A High speed Data Acquisition Card Based on USB Bus, International Conference on Machine Vision and Human machine Interface, Kaifeng, 2010, pp. 357 360.
- AREFIN, M.M.N., M.N. AMBIA, T. AHAMMAD, A.S.M SHIHAVUDDIN, Low Cost Design of a PC Based Integrated System for Signal Measu-rement and Generation using Micro-controller, 2nd International Conference on Signal Processing Systems (ICSPS), Dalian, 2010, pp. V3 747 V3 751.
- AT91SAM ARM based FLASH MCU SAM3S Series. Doc. 6500C, Atmel, 2011.
- Universal Serial Bus Class Definitions for Communications Devices. Rev. 1.2, November 16, 2007, www.usb.org.
- Universal Serial Bus Specification, Rev. 2.0, April 27, 2000, www.usb.org.
- Universal Host Controller Interface (UHCI) Design Guide. Rev 1.1, March 1996, Intel, http://download.intel.com/ technology/usb/UHCI11D.pdf, 1996.
- Enhanced Host Controller Interface Specification for USB, Rev. 1.0, March 12, 2002, www.intel.com, 2002.