µLAN Protocol Data Exchange in Home Control Application
Process Data Connection Channels in uLan Network for Home Automation and Other Distributed Applications Pavel P´ıˇsa –
[email protected] Petr Smol´ık –
[email protected] Frantiˇsek Vacek –
[email protected] Martin Boh´aˇcek –
[email protected] ˇ Jan Stefan –
[email protected] Pavel Nˇemeˇcek –
[email protected] Czech Technical University in Prague Faculty of Electrical Engineering
13th Real-Time Linux Workshop – October 20 2011
Pavel P´ıˇsa –
[email protected] Petr Smol´ık –
[email protected] Process Frantiˇ Data sek Vacek Connections –
[email protected] in uLan Network Martin Boh´ aˇ cek –
µLAN Protocol Data Exchange in Home Control Application
Presentation Contents
1
µLAN Protocol Origin and Initial Target Applications uLAN Protocol Overview Higher Level Protocol Layers
2
Data Exchange in Home Control Application Is uLAN Protocol an Option? uLan Connection Network (uLCN) Devices Designed for DAMIC Home Automation System
institution-logo
Pavel P´ıˇsa –
[email protected] Petr Smol´ık –
[email protected] Process Frantiˇ Data sek Vacek Connections –
[email protected] in uLan Network Martin Boh´ aˇ cek –
µLAN Protocol Data Exchange in Home Control Application
Origin and Initial Target Applications uLAN Protocol Overview Higher Level Protocol Layers
HPLC Project by PiKRON Ltd. next generation of High Pressure Liquid Chromatography (HPLC) design in 1992 need of control and data acquisition solution for instrument sets instruments do not require so fast command/data exchange for basic setups data types – simple one scalar variable setup (wavelength, flow rate) but even gradient time program and detector data stream (25 Hz in our case) sampled data grouping possible examination of instrument type and available properties/variables
institution-logo
Pavel P´ıˇsa –
[email protected] Petr Smol´ık –
[email protected] Process Frantiˇ Data sek Vacek Connections –
[email protected] in uLan Network Martin Boh´ aˇ cek –
µLAN Protocol Data Exchange in Home Control Application
Origin and Initial Target Applications uLAN Protocol Overview Higher Level Protocol Layers
Requirements on the Protocol Selection connection to data acquisition/chromatography system on PC multimaster/direct device to device communication/coordination direct analysis start mark distribution forming high pressure gradient by two pumps etc.
simple design without need to collect list of next devices to pass token possibly deterministic media access physical link layer well known and much spread RS-485 no mo vendor lock-in or lawyers intentionally introduced minefield
option to have open implementation and “standard” definitioninstitution-logo
Pavel P´ıˇsa –
[email protected] Petr Smol´ık –
[email protected] Process Frantiˇ Data sek Vacek Connections –
[email protected] in uLan Network Martin Boh´ aˇ cek –
µLAN Protocol Data Exchange in Home Control Application
Origin and Initial Target Applications uLAN Protocol Overview Higher Level Protocol Layers
The First Generation Design Limitations Intel-8051 based controllers due to its availability and price only single UART hardware for communication low computational power but offer multi-drop (9-bit per character) – Intel µLAN net (see i82C510 UART) allows to interrupt only only on address characters if not selected Transfered character D0 D1 D2 D3 D4 D5 D6 D7 D8 start bit
stop bit
char begin
Figure: 9-bit Character Format
institution-logo
character transfer takes 11 bit times
Pavel P´ıˇsa –
[email protected] Petr Smol´ık –
[email protected] Process Frantiˇ Data sek Vacek Connections –
[email protected] in uLan Network Martin Boh´ aˇ cek –
µLAN Protocol Data Exchange in Home Control Application
Origin and Initial Target Applications uLAN Protocol Overview Higher Level Protocol Layers
Character Values Mapping
data characters (address bit clear / bit 8 = 0) address and control characters (bit 8 = 1) 0 · · · 0x64 to address target module/device/instrument 0 broadcast/general address
0x75 · · · 0x7F range have control and data delimiters above 0x80 used used by master to inform about bus control release
institution-logo
Pavel P´ıˇsa –
[email protected] Petr Smol´ık –
[email protected] Process Frantiˇ Data sek Vacek Connections –
[email protected] in uLan Network Martin Boh´ aˇ cek –
µLAN Protocol Data Exchange in Home Control Application
Origin and Initial Target Applications uLAN Protocol Overview Higher Level Protocol Layers
µLAN Frame Format Data frame format DAdr or uL_Beg
SAdr
Com
0 to MaxBlock of data bytes
uL_End, uL_Arq, uL_Prq or uL_Aap
XorSum
Figure: µLAN Frame Format
initial frame send by master after media allocation but one or more frames can directly follow
allows immediate “slave” device reply without media arbitration special control and synchronization sequence frame can request single character acknowledge institution-logo
Pavel P´ıˇsa –
[email protected] Petr Smol´ık –
[email protected] Process Frantiˇ Data sek Vacek Connections –
[email protected] in uLan Network Martin Boh´ aˇ cek –
µLAN Protocol Data Exchange in Home Control Application
Origin and Initial Target Applications uLAN Protocol Overview Higher Level Protocol Layers
More Detailed Control Characters Codes
Name DAdr DAdr uL Beg uL END uL ARQ uL PRQ uL AAP uL ERR LAdr uL ERR
Value 100h 101h .. 164h 175h 17Ch 17Ah 179h 176h 17Fh 181h .. 1E4 1FFh
Description General address Destination node address Begin of unaddressed frame End of frame End with acknowledge request End with proceed request End with acknowledge and proceed request Error without release of bus Release of bus by node Error, abort and release bus
institution-logo
Pavel P´ıˇsa –
[email protected] Petr Smol´ık –
[email protected] Process Frantiˇ Data sek Vacek Connections –
[email protected] in uLan Network Martin Boh´ aˇ cek –
µLAN Protocol Data Exchange in Home Control Application
Origin and Initial Target Applications uLAN Protocol Overview Higher Level Protocol Layers
Media Access Arbitration determinism required, distributed arbitration RS-485 does not allow dominant-recessive based solution at full bit rate intended at least partial bandwidth distribution influence by Philips/NXP IIC solution but in arbitration phase only Bus request and release
LAdr
delay first (LAdr-Adr-1) connect mod 16 + 4 mark
delay Adr and 3 +1
delay (Adr shr 2) and 3 +1
delay (Adr shr 4) and 3 +1
transfer of data release frames beginning of bus by with DAdr of LAdr=Adr first frame or 80h
Figure: uLan Media Access Arbitration
institution-logo
Pavel P´ıˇsa –
[email protected] Petr Smol´ık –
[email protected] Process Frantiˇ Data sek Vacek Connections –
[email protected] in uLan Network Martin Boh´ aˇ cek –
µLAN Protocol Data Exchange in Home Control Application
Origin and Initial Target Applications uLAN Protocol Overview Higher Level Protocol Layers
The Protocol Overhead
10 nodes with addresses 1 · · · 11 considered full Tx saturation from all nodes supposed message length of 256 B and communication speed of 19200 Bd 1.6122 s to send 10 messages (one from each station) arbitration and control characters overhead 10 % (50 % if start, B8 and stop bit counted) but for 8 byte messages overhead is 300 % (550 %) but could provide advantage to can for data bitrate/bus length
institution-logo
Pavel P´ıˇsa –
[email protected] Petr Smol´ık –
[email protected] Process Frantiˇ Data sek Vacek Connections –
[email protected] in uLan Network Martin Boh´ aˇ cek –
µLAN Protocol Data Exchange in Home Control Application
Origin and Initial Target Applications uLAN Protocol Overview Higher Level Protocol Layers
Overview of uLAN Higher Level Protocols
Network Control Messages (uLNCS) – check and change module/node assigned network address, identification and production serial number Dynamic Address Assignment (uLDY) the mechanism to unveil newly attached nodes from new serial product number appearance, assign them free network address and detect node disconnection or switching off uLan Object Interface Layer (uLOI) the mechanism to retrieve list of device supported readable and writable variables/properties, their names and data types
institution-logo
Pavel P´ıˇsa –
[email protected] Petr Smol´ık –
[email protected] Process Frantiˇ Data sek Vacek Connections –
[email protected] in uLan Network Martin Boh´ aˇ cek –
µLAN Protocol Data Exchange in Home Control Application
Origin and Initial Target Applications uLAN Protocol Overview Higher Level Protocol Layers
uLan Object Interface serialize objects (properties/variables) identification and their values in transferred messages asynchronous reply to request as further master transfer multiple queries and set commands for objects values and/or their description in a single message length limited by buffers size – max. message 1000 B for actual products 16 bit Object Identification Number no type, name nor data length for plain types is included in regular data transfers but full device model can be build from descriptive objects reply allows to identify which objects data it contains from OIDs and metadata
institution-logo
Pavel P´ıˇsa –
[email protected] Petr Smol´ık –
[email protected] Process Frantiˇ Data sek Vacek Connections –
[email protected] in uLan Network Martin Boh´ aˇ cek –
µLAN Protocol Data Exchange in Home Control Application
Origin and Initial Target Applications uLAN Protocol Overview Higher Level Protocol Layers
The List of Product Utilizing the Protocol
HPLC devices developed by PiKRON company team CHROMuLAN HPLC control system developed by Jindrich Jindrich and PiKRON Ltd Agrosoft T´abor FASTOP and FASTOS systems automatic batch distribution of feed to pigs, cows cow milking data collection
institution-logo
Pavel P´ıˇsa –
[email protected] Petr Smol´ık –
[email protected] Process Frantiˇ Data sek Vacek Connections –
[email protected] in uLan Network Martin Boh´ aˇ cek –
µLAN Protocol Data Exchange in Home Control Application
Origin and Initial Target Applications uLAN Protocol Overview Higher Level Protocol Layers
Our Second Generation Instruments Setup Example The instruments are designed as independent units which for chromatographic apparatus for given analysis after interconnection – by wires and tubes
LCS 5040 autosampler LCP 5020 pump LCT 5100 column oven/cooler LCD 5000 detector institution-logo
Pavel P´ıˇsa –
[email protected] Petr Smol´ık –
[email protected] Process Frantiˇ Data sek Vacek Connections –
[email protected] in uLan Network Martin Boh´ aˇ cek –
µLAN Protocol Data Exchange in Home Control Application
Origin and Initial Target Applications uLAN Protocol Overview Higher Level Protocol Layers
CHROMuLAN System and Devices Model Reflection Control System
Device 1
CHROMuLAN User scripts Control logic Graphic parameters and User acquired data IFPS interpretter Interface Object tree browser and handler Object tree of branches, properties and process variables Persistent storage Temp. ULF, ULC storage ULD files (mem)
Dev 1 model
Dev 2 model
uLan net. model
uLan API Operating System Linux/Windows DOS Control Computer Hardware (PC)
uLan driver UART chip
RS485 buffer
Local display keyboard and UI Device function appli− cation
Device 2 Local display keyboard, UI and time program
uLan object interface
Device logic and application comunicating over uLan objects Process variables and device uLan para− object interface meters
uLan API and MCU support libraries
uLan API and Contro− MCU llers support sensors libraries etc.
UART RS485
UART RS485
more HW
Figure: CHROMuLAN System Architecture and Properties of Connected institution-logo Instruments
Pavel P´ıˇsa –
[email protected] Petr Smol´ık –
[email protected] Process Frantiˇ Data sek Vacek Connections –
[email protected] in uLan Network Martin Boh´ aˇ cek –
µLAN Protocol Data Exchange in Home Control Application
Origin and Initial Target Applications uLAN Protocol Overview Higher Level Protocol Layers
The Third Generation Development ARM based but price constrains require to use single chip solution – i.e. pump based on LPC1768
institution-logo
Pavel P´ıˇsa –
[email protected] Petr Smol´ık –
[email protected] Process Frantiˇ Data sek Vacek Connections –
[email protected] in uLan Network Martin Boh´ aˇ cek –
µLAN Protocol Data Exchange in Home Control Application
Origin and Initial Target Applications uLAN Protocol Overview Higher Level Protocol Layers
Agrosoft T´abor Cow Milking System
ˇ Figure: Milking Data Collection at Cerven´ e Janovice
institution-logo
Pavel P´ıˇsa –
[email protected] Petr Smol´ık –
[email protected] Process Frantiˇ Data sek Vacek Connections –
[email protected] in uLan Network Martin Boh´ aˇ cek –
µLAN Protocol Data Exchange in Home Control Application
Origin and Initial Target Applications uLAN Protocol Overview Higher Level Protocol Layers
Agrosoft T´abor Pig Feeding System
Figure: Automatic Feeding Boxes
institution-logo
Pavel P´ıˇsa –
[email protected] Petr Smol´ık –
[email protected] Process Frantiˇ Data sek Vacek Connections –
[email protected] in uLan Network Martin Boh´ aˇ cek –
µLAN Protocol Data Exchange in Home Control Application
Origin and Initial Target Applications uLAN Protocol Overview Higher Level Protocol Layers
TheµLan Project Code Base Growth
Figure: Ohloh Lines Count of µLan Core Project without Companies Applications
The protocol is used from 1992, the driver code has been reimplemented in “C” in 1996 but systematic code visioning starts at 2004. The 2008 displays growth caused by unification and publishing of many embedded system support routines developed institution-logo by PiKRON and Agrosoft T´abor
Pavel P´ıˇsa –
[email protected] Petr Smol´ık –
[email protected] Process Frantiˇ Data sek Vacek Connections –
[email protected] in uLan Network Martin Boh´ aˇ cek –
µLAN Protocol Data Exchange in Home Control Application
Is uLAN Protocol an Option? uLan Connection Network (uLCN) Devices Designed for DAMIC Home Automation System
The Advantages to Use uLAN multi-master capability of uLan very low cost interconnection with use of a phone line grade cables free bus topology support for more low cost microcontrollers and stable drivers for PC operating systems not for high speed communication or hard real-time data exchange – but enough for heating monitoring and control (HVAC), lights switching and ring-bells selected by group around DAMIC project at Department of Control Engineering.
institution-logo
Pavel P´ıˇsa –
[email protected] Petr Smol´ık –
[email protected] Process Frantiˇ Data sek Vacek Connections –
[email protected] in uLan Network Martin Boh´ aˇ cek –
µLAN Protocol Data Exchange in Home Control Application
Is uLAN Protocol an Option? uLan Connection Network (uLCN) Devices Designed for DAMIC Home Automation System
Need of the Direct Process Data Connection
uLOI layer for devices configuration and their state monitoring by higher level systems but use of polling cycle by higher level system is significant disadvantage for home automation define way how to configure state and command delivery between devices without need to build full model in each device
institution-logo
Pavel P´ıˇsa –
[email protected] Petr Smol´ık –
[email protected] Process Frantiˇ Data sek Vacek Connections –
[email protected] in uLan Network Martin Boh´ aˇ cek –
µLAN Protocol Data Exchange in Home Control Application
Is uLAN Protocol an Option? uLan Connection Network (uLCN) Devices Designed for DAMIC Home Automation System
The PDO Message Format Format of process data (PDO) messages defined no information about OIDs – their values are mapped to device dictionary independent CIDs - channels IDs Res Lo
Res Hi
Ext len (el)
Ext
CID
data len (dl)
data
1 byte
1 byte
1 byte
0..el bytes
2 bytes LE
1 (2) byte
dl bytes
CID ...
mapping tables to connect Rx and Tx CIDs to properties defined by OIDs and metadata in PDO incoming CID to OID(s) mapping table (PICO) PDO outgoing CID to OID(s) mapping table (PICO) PDO incoming/outgoing extended length (> 4)metadata table (PIOM) PDO by event triggering table (PEV2C)
institution-logo
Pavel P´ıˇsa –
[email protected] Petr Smol´ık –
[email protected] Process Frantiˇ Data sek Vacek Connections –
[email protected] in uLan Network Martin Boh´ aˇ cek –
µLAN Protocol Data Exchange in Home Control Application
Is uLAN Protocol an Option? uLan Connection Network (uLCN) Devices Designed for DAMIC Home Automation System
uLAN PDO Connection Channels
Demonstration on virtual devices
institution-logo
Pavel P´ıˇsa –
[email protected] Petr Smol´ık –
[email protected] Process Frantiˇ Data sek Vacek Connections –
[email protected] in uLan Network Martin Boh´ aˇ cek –
µLAN Protocol Data Exchange in Home Control Application
Is uLAN Protocol an Option? uLan Connection Network (uLCN) Devices Designed for DAMIC Home Automation System
uACT (010) actuator and temperature sensor available in more variants of output and input channels count and power stages
institution-logo
Pavel P´ıˇsa –
[email protected] Petr Smol´ık –
[email protected] Process Frantiˇ Data sek Vacek Connections –
[email protected] in uLan Network Martin Boh´ aˇ cek –
µLAN Protocol Data Exchange in Home Control Application
Is uLAN Protocol an Option? uLan Connection Network (uLCN) Devices Designed for DAMIC Home Automation System
uLSW (010) not an only light wall switch which allows to map four contacts (left, right x up, down), their combinations and pres duration and “double click” to different events
institution-logo
Pavel P´ıˇsa –
[email protected] Petr Smol´ık –
[email protected] Process Frantiˇ Data sek Vacek Connections –
[email protected] in uLan Network Martin Boh´ aˇ cek –
µLAN Protocol Data Exchange in Home Control Application
Is uLAN Protocol an Option? uLan Connection Network (uLCN) Devices Designed for DAMIC Home Automation System
uDIM 010 multiple channels dimming controller for 8-230 VAC lights control
institution-logo
Pavel P´ıˇsa –
[email protected] Petr Smol´ık –
[email protected] Process Frantiˇ Data sek Vacek Connections –
[email protected] in uLan Network Martin Boh´ aˇ cek –
µLAN Protocol Data Exchange in Home Control Application
Is uLAN Protocol an Option? uLan Connection Network (uLCN) Devices Designed for DAMIC Home Automation System
uLTH 010 room temperature controller equipped by local multi-setpoint week program and user interface logic for program visualization and editing
institution-logo
Pavel P´ıˇsa –
[email protected] Petr Smol´ık –
[email protected] Process Frantiˇ Data sek Vacek Connections –
[email protected] in uLan Network Martin Boh´ aˇ cek –