060626 a new control protocol for home appliances-lncp

Upload: pradeep-jw

Post on 07-Apr-2018

220 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/6/2019 060626 a New Control Protocol for Home Appliances-lncp

    1/6

    A NEW CONTROL PROTOCOL FO R HOME APPLIANCES - LnCPKoon-Seok Lee*, Hoan-Jong C hoi*, Chang-Ho Kim **, Seung-Myun B aek*

    *Digital Appliance Compan y Research Lab.,**Digital Appliance Research Lab.,LG Electronics Inc.ABSTRACT

    This paper proposes a new control protocol,LnCP(Living network Control Protocol), targeting at lowimplementation cost networking system in homeenvironment. The protocol is based on multi-mastersystem and uses a peer-to-peer communication model.The protocol assumes single bus therefore the appliancescan be attached to the bus anyw here if the power lines areemployed as network bus. Hom e appliances linked viaLnCP are controlled and monitored at remote place.Every device com municates with each other in packet unit,which has variable length so that the protocol can dealwith the devices having the diverse room of RAMresource. The bytes number of packet header is alsovariable in order that new function can be added in thefuture.The minimum hardware requirements to implement theprotocol are 8-bit processing microcomputer includingbuilt-in UA RT, 17 bytes of volatile memory and few bytesof non-volatile memory. Therefore it may be embeddedin low-cost microcontrollers that are employed in thewhite goods such as refrigerator, washing machine, microoven range and even light switch.

    1. INTRODUCTIONThere are so many attempts to maintain some degree of

    standardization for home automation applications. Forexample the X10, LonTalk and CEBus standards definethe communication protocols, interface standards andother technical aspects. Although the X I0 [2] has beenaround since the 1970's it is typically suited for simpleontoff control that is a misconception about what the homeautomation actually is. The CE Bus[ l] have beendeveloped with the purposes of home automationapplicable to all home appliances such as TV, Audio,Video, refrigerator and even light lamp. As the result thegenerality is guaranteed in parts and it gives manufacturersthe chance to make network devices without developingany application protocols. LonTalk[3] was designed forcommunication in control network so that the it ischaracterized by short message and low speed. However

    0-78037090-2/01/$10.000 001IEEE. 286

    the standardizations that many companies have pursueduntil now m ay cause following two basic problems.Heavyweight level application in viewpoint ofmicrocontroller employed by white goods.High implementation cost because of additionalcommunication module.These problems are explained as follows. Hom eappliances can be classified into three subnets according to

    the communication speed and the amounts of transmittingdata. The first subnet is consists of multimedia applianceslike TV, Video and Audio, which deal with mainly imagedata. The second subnet is structured with PC andperipheral devices such as printer, fax, and scanne r.. +Thethird subnet is made up of white goods, which need to'control, monitor the state of appliance and load small sizeof data. We call those by AV-net, PC-net and living-netfor convenience respectively. The appliances belongingto each subnet have broad spectrum in the cost andfunction aspects. Existing protocols support the servicesand maintenance not only on specific subnet but also onhome network integrating all subnets. And "also theprotocols do not consider implementation withmicrocontroller of appliance but requires the additionalcommunication module. Therefore these lead toheavyweight protocol because there must be networkingand routing mechanism, and that there must be interpreterof common language like CAL in CEBu s. Therefore inthe viewpoint of controller's capab ility it is d ifficult- toimplement for white goods that employ 8-bit processingmicrocomputer at most. As far as the white goods uselow-speed microcomputer because of the limitation ofacceptable price the end-user must possess additionalcommunication module where most layers of the protocolare implemented for each ap pliance.To overcome above problems cost-effective andappliance-oriented protocol, LnCP(Living networkControl Protocol), is proposed. The proposed protocol issimple and it is sufficiently implemented in existing whitegoods without additional communication module if theyoperate with 8-bit processing microcontroller. This paperfocuses on the concepts of L nCP as a low cost solution forhome networking and therefore the detail specificationsare not described.

    ISIE 2001, Pusan, KOREA

  • 8/6/2019 060626 a New Control Protocol for Home Appliances-lncp

    2/6

    Section 2 introduces how to construct network via LnCP,and section 3 for the concepts and layering. In section 4the packet structure is presented, while the communicationarchitecture using this packet is described in section 5.Section 6 deals with the message that is a language tocontrol appliances. Finally, summarize the features ofLnCP in section 7.2. OVERVIEW OF LnCP

    2.1. Living Network and its conceptsThe network is constructed by linking appliances, whichimplement the LnCP on their microcontroller, via anetworking bus. Some appliances that do not havemcorocontroller are combined with a module, whichcontains LnCP and enables them to be networked, asshown in Figure I . Single wire or power lines are thecandidates for the medium as networking bus. If powerline is used as medium then each appliance must connectto power line transceiver, whose encoding method is notdefined in LnCP. Any appliance or the combination ofappliance and a module, which is attached to the bus onthe network, is referred to as a node. Th e networkinterface must ensure that each node has half duplexcommunications, a nd can sense activity on the network./==~ashing Machrn Module Network ManagerRefrigerator Air ConditionerNetwork Bu s

    Figure 1 : Network StructureThe LnCP allows any node on the bus to communicatewith and control any other node in living network. Eventhe LnCP introduce the network management device tointerface with user through keyboard and screen, there isno central control device. Consequently there is nohierarchy on product-to-product communications. LnCPcovers only the node communication protocol; theprotocol intended for home appliances in living network.It does not cover the R outer communications protocol.Since LnCP allows communication of a variety of data

    types, from simple control commands, to more complexinformation such as image data and program code, thenetworked appliances can provide the user the followingfunctions:Control :Control the appliances on/off or variable power.Monitoring : Monitor the operating state and sensor ofappliances.

    Automation : Automatic control between devices withoutuser operating.Download : Upgrade the software in microcontroller toenhance the basic functions or add new functions.2.2. Protocol Layers

    The protocol is based on the I S 0 Open SystemsInterconnect(OS1) seven layers network protocol model.LnCP layering consists of the Physical Layer, Data LinkLayer and Application Layer. Each layer follows thedivisions established by the OS1 standard for protocoltasks. The layering is described below.Physical Layer is responsible for data encoding anddecoding. Although LnCP does not define this layer theLnCP use UART as a default encoding method for thesimplicity of implementation because manymicrocontrollers have the built-in UART adapter and PCalso provide that service. Data Link Layer(DLL) isdivided into MAC(Medium Access Control) layer andLink layer. MA C employs collision avoidance algorithm.Link layer handles reception of packets over the attachedmedium, address recognition, error detection, packettiming, packet retransmission and detection of theduplicate message. Application Layer is responsible formessage generation, message reception, messageexecution and messag e fragmentation.

    3. KEY FEATURES O F LnCPThe LnCP is based on the multi-master system.Accordingly e v e j product can be classified into twocategories, master and slave. Master is that sends slave amessage to begin conversation when any event isgenerated by user or some algorithm and has total controlover the network for the duration of that communication.It is noted that the master is not in the state of listeningif he did not make a conversation with other devices.Slave responds to the masters request. If there is no anyrequest from other devices the slave has to listen tonetwork bus. According to definitions product-to-productcommunication is only enabled by master and is onlyaccomplished between master and slave. Th ecommunication between masters cannot be accom plished.

    Master Slave.............. ....................

    Slave MasterFigure 2. Structure of P2P device

    287 ISIE 2001, Pusan, KOREA

  • 8/6/2019 060626 a New Control Protocol for Home Appliances-lncp

    3/6

  • 8/6/2019 060626 a New Control Protocol for Home Appliances-lncp

    4/6

    Figure 5. Product codesis useful for differentiating the house from neighborswhen many houses share the same medium like the powerline. RX and TX identify the addresses of the recipientand transmitting devices, respectively. The first byte inthe address field is product code, which is assigned with aunique value identifying the basic function of residentialproducts and has nothing to do with the vender. Eventhere is a little difference in ,functions between two types

    of product, for example washing machines operating withpulsator and drum, the products have the same codes.This code is predefined by LnCP and stored in ROM andhence physical address, which differs from serial numberin Ethemet card in that all refrigerators over the worldhave the same value. The second byte is the logicaladdress to classify the devices having the same productcode. The logical address may be device address or areacode. Device address is used for addressing theappliances having the same name. Area code is allocatedaccording to the installed area in home. Hom e code andlogical address are stored in non-volatile memory such asEEPROM and flash ROM.Group address is assigned as all bits in each subfield areset to 1. For example, OxOlXX indicates the groupaddress of refrigerators, where XX means dont care.Ox3FXX is a group address indicating all appliances thathav e the same area code. Because the grouping logic inLnCP is oriented to home environment it is very powerfulfor home automation.

    5.2. Transport ProtocolThe transport protocol use PT and RC values. LnCPdefines three types of packet, that is, request packet,response packet and notification packet. Request packet istransmitted from master to control or get the information

    of slave. Response packet is transmitted fiom slave torespond to the masters request. And response packet isdivided into successful response packet, which includ esMaster Slave Master Slave Mas er Slave Master Slave

    Figure 6. Protocol diagram fo r retransmissionSolid line : Normal transmission, Dotted line : bit error, Circle : waiting(a)Normal conversation(b)Retransmission w hen bit error in request packet(c)Retransmission when bit error in response packet(d)Retransmission when no response packet.

    ACK message or NAK message, and failed responsepacket, which must include NA K message. When themaster receives the failed response packet it can retransmitthe original packet three times at maximum. If there isany bit error with received request packet then the slavetransmits the failed response packet. Otherwise the slavetransmits the successfd response packet even though themessage is not executed successfully because of an errorwith arguments in message, duplicate message receptionand so on. Notification packet is transmitted from masterand the recipients do not respond to that.

    Using the above packets the protocol makes three typesof conversation in point of master view a s follows.1-request and 1-response : it is a normalconversation between 1 master and 1 slave. Masterterminates the conversation when it receives asuccessful response packet or when there is no responsewithin maximum waiting time.1-request and multiple-response : it is the case ofusing group a ddress as the recipient. Master continuesto receive the response until the maximum waiting timeelapse. The re is no retransmission.1-notification : t is an one-sided conversation.

    To control these conversations master uses RC value.The master increments the RC value by 1 whenever itretransmits the original packet. The initial value is 1 an dthe maximum value is 3. For the slave cannot control theconversation it always sets RC value to 1. Th e masterretransmits the packet when it is elapsed the maximumwaiting time after sending a request packet as well as whenhe received a failed response packet. T o keep theprotocol performance in network environment the slavediscards the reception of response packet.

    5.3. Error DetectionEach layer has its own error detection mechanism tominimize the probability of malfunction. Th e Link Layerutilizes a 16 bit cyclic redundancy check(CRC). Th e 16bit CRC can detect all single/double bit errors, all errorsw t h odd bits, and burst errors of length

  • 8/6/2019 060626 a New Control Protocol for Home Appliances-lncp

    5/6

    available memory in range of 17 to 255. PHL is thelength of packet header form HC to PN. Its value is in therange of from 9 to 32 bytes such that the new functionscan be added to upgrade the compatible protocol with thelower version. PV mean s the protocol version.PI is the packet identification and the sender incrementsits value by 1 whenever it transmits a new packet exceptthat it retransmits. Th e value is reset to 0 when the deviceis rebooted or when the transaction count has reached itsmaximum value. The PN fields are combined to RCvalue to investigate the duplicate packet and hence thesame bit length with the RC field.

    AP controls the priority of access to the medium and isassigned to each transmitted packet. It is used todetermine how soon it can contend for medium accessafter the last packet in MAC layer.ML6. APPLICATION LAYER MH L PN I Commandcode copy. I AC K I Returnarguments

    As described in previous section there is no theinformation about the message segmentation into severalshorter messages and message reassembly. The LnCPassigns that task to the Application Layer because of thefollowing reason. It is due to sharing the bufferingmemory by Data Link Layer and Application Layer. Tw olayers support packet payload up to the same bytes inlength, which depends on the size of m emory available forthe messaging buffer. Eventually the tasks dealing withlong message is performed in Application Layer bydefining the variable-sized message.

    ML MH L PN Command codeco py

    6.1. Message

    NAK Errorcode

    A message in this paper is defined as a set of elementsthat have information to control the communicationprocess and analyze the results of that in the point ofmaster view. Message is divided into two categoriesaccording to the type of device who makes a message,request and response messages.Request message includes the command and thearguments to execute it. There are two kinds of responsemessage, ACK and NA K messages. The responsemessages include the copy of command code, ACKNAKand retum arguments generated after execution ofcommand code. The bytes number of the each argumentis fixed definitely to each command code.Message =: { { Request message}, {Response message} }Command code Input arguments },

    { Com mand code co pj ACK, Return arguments},{ Command code co pj NAK, Error code }

    Message field is characterized by message header thatcontains the message length(ML), message headerlength(MHL) and port number(PN). ML is the valueMHL plus the bytes number of message field.MHL is the bytes number from ML field to the byte justbefore message field. Owing to variable PHL and MH Lfields the message header defined above is extensible.For example, the Application layer can specify whetherdata should be transmitted with or without security addingthat field in message header. PN allows the variousapplication languages for Application Layer in spite ofLnCP has its own language.

    Message Header MessageA r A \I MLI MHL I PN I Commandcode I lnputarmments I

    290 ISIE 2001, Pusan, KOREA

  • 8/6/2019 060626 a New Control Protocol for Home Appliances-lncp

    6/6

    Start addressByte no.Data unitData

    unsigned longunsigned charunsigned charunsigned char [ ]

    reassemble for this message provided that themicrocontroller has the sufficient memory to buffer suchmessage data. Figure 8 is an example of fixed-lengthmessage of power control in C language expression. Inthis case the length of message field is 2.Contrary to fixed-length message variable-lengthmessage handles long message such as image data andprogramm ing code. This message is segmented into

    enough shorter messages to store in the available memory,accordingly it has to contain the variable implying thepacket number as input arguments. Figure 9 is theexamples of the variable-length message. In this case themaximum length(N) of data fragmented is given as follows.

    Return argumentsComments

    N = PL -PH L - M H L - 3 - 11,

    IMemory type is EEPROM(O), 8-bitrnemory(1) or 16-bit memory(2).

    where 11 means the bytes number of input argumentsexcept data array.Owing to calculation of the argument values with eachsegmented message it seems to be somewhat complex tohandle the variable-length message but not for the fixed-length message. Furthermore the variable-length messageis used for upgrading the contents of memory such asimage file or new program codes. It is therefore definitethat only the high-end device like PC uses the variable-length message in request packet, while most appliances,which do not have convenient user interface sufficient tohandle the above tasks, only use the fixed-length messageeven if it act as master. In other word, there is nonecessity to deal with long message and hence very simpleto implemen t the protocol in case of white goods. This ison e of the key concepts of the LnCP focusing onimplementation in existing microccontroller with low cost.Error code in Figure 7 is also similar in classification tothe message set. While the common error codes includethe bit error in packet, bad comm and and illegal arguments,the appliance specific error codes are relate to faults ortroubles during operation. The detail specification is outof scop e to touch in this paper.

    7. SUMMARY AND COMM ENTS

    The protocol is simple and easy-to-use for developer,while there is no limitation to construct home network.The minimum requ irements for the system are listed below.8-bit processing microcomputerBuilt-in UART(half-duplex or full-duplex)17bytes of RAMFew bytes of non-volatile memoryUnder 2 Kbytes of ROM

    Some parts of the protocol developed has been tested andapplied to mass-production. Work is now continuing onthe development of network management protocol,encryption algorithm, and on the development of softwareconnecting to extemal network such as Intemet.

    8. REFERENCES[11 The CEB us stadard Users Guide[2] http://www3.edgenet.net/lingling/[3] LonTalk Protocol Specification Version 3.0[4] P. Waniner and K. Z. Karan, NLJDAN-A multi-functional Home Automation Network, IEEETransactions on Consumer Electronics, Vol 44. No. 2,pp360-369, May 1998[5] William Stallings, Data and ComputerCommunications, Third Edition Maxwell MacmillanIntemational Editions, 1991

    A new control protocol for home appliances has beenproposed. The main advantage of the proposed protocolis to build a network at very low cost in home environment.

    29 1 ISIE 2001, Pusan, KOREA

    http://www3/http://www3/http://www3/