外文原文-基于嵌入式 Linux 的数控雕刻机的软件架构设计.pdf_第1页
外文原文-基于嵌入式 Linux 的数控雕刻机的软件架构设计.pdf_第2页
外文原文-基于嵌入式 Linux 的数控雕刻机的软件架构设计.pdf_第3页
外文原文-基于嵌入式 Linux 的数控雕刻机的软件架构设计.pdf_第4页
外文原文-基于嵌入式 Linux 的数控雕刻机的软件架构设计.pdf_第5页
已阅读5页,还剩1页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

Proceedingsofthe 2009 IEEE International Conference on Mechatronics and Automation August 9 - 12, Changchun, China DesignofSoftware Architecture for NC Engraving Machine Based on Embedded Linux Junqi Zhao InstituteofAstronauticsandAeronautics UniversityofElectronic ScienceandTechnologyofChina Chengdu, Sichuan Province 610054, China zhao-junqi Abstract -Embeddedsystem hasalready beenapplied widely inindustrycontrolandmanyotherfields. As the sizeand complexity of embedded applicationsystemincreasing, the embeddedsoftwaresystemisbecomingmoreandmore complexity.Itisespeciallyimportanttodesignsuitable embedded softwarearchitecturefor a special control object. At thesametime,variousfunctionalandnon-functional requirements of NC (numerical control) engravingaredemanded continually. At present, most of the software architectures for NC engraving machinearewithout operating systemsupportand notbeabletomeetthoserequirements.Althoughafew engraving control system with commercial operating system support, it is expensiveandnot good for enterprise developing software with independent intellectualpropertyrights. Inorder to solve the above problems, the new softwarearchitecturefor NC engraving machine was designed based on embedded Linux andDARTS method in thispaper.The systemdataflow was analyzed bydataflow diagram,andthen the system was divided into various tasks by the HGommaprinciple.Furthermore,the softwarearchitecturewasputforward.Theinter-task synchronizationandcommunication was also analyzed. Finally, thereal timeanalysiswasmade.Byusingthissoftware architecture, the software system become simpleandclear,and different control component based on different time granularities can beintegratedseamlessly.Throughpractical application, it was proventhatvarious requirements of NC engraving system can be realized with low cost. The flexibilityandadaptability of the systemarealso improved greatly. Index Terms - ARM. Embedded Linux. Engraving. FPGA. Software Architecture. 1.INTRODUCTION As the size and complexityofembedded software system increasing,the importanceofsoftwarearchitecturegoes beyond the algorithms and data structuresofthe computation. Designing and specifying the overall system structure emerges as a new kind of problem 1. A good architecture can help ensure that a system will satisfy key requirements in such areas as performance, reliability, portability, scalability, and interoperability.Abadarchitecturecanbedisastrous. Architecture design is high-level design for overall system from the system pointofview. Different experts will define software architecture on their own. After all, it is a tool to solve practical problems in various domains and contexts, thus various architectural models or definitions have been released. Although various definitions are somewhat different, we can Hui Li and Longfei Peng InstituteofAstronauticsandAeronautics UniversityofElectronic ScienceandTechnologyofChina Chengdu, Sichuan Province 610054, China kelly.li see a large degreeofcommonality at the coreofallofthem witch is the notion that the architecture of a system describes its gross structure. This structure illuminates the top level design decisions, including things such as how the system is composedofinteracting parts, where are the main pathwaysof interaction, what are the key properties of the parts. The key stepofarchitecture design is to divide system into some manageable subsystems and design interfaces between the subsystems. Software architecture design should not only consider how to meet the systems functional and performance requirements, but also the non-function, such as reliability, scalability, portability and availability. There is not a unified approach for software architecture, especially in the embedded system. Embedded Linux is referred to tailor standard Linux through the miniaturization treatment and can be stored on non-volatile storage or microcontroller which capacity is only a few hundred KB or a few MB.Itis a special Linux operating system that is applied to special embedded system 2. Linux has emerged as a mature, high-performance, stable and reliable alternative to traditional proprietary embedded operatingsystem3.Linuxnotonlypossessesthe adaptability, flexibility, and stability but also possesses strong network functions. Moreover Linux is a sortoffree software with open source codes 4. At present, most of the software architectures for NC engraving machine are without operating system support and not be able to meet various requirements. Those architectures have a simple structure, but the software development cycle is long, the development cost is expensive, the software quality is not guaranteed as well as the portability and scalability is poor. Although a few with commercial embedded operating system such as Windows CE in NC engraving system, the cost ofproduction is high due to expensive royalties. So, it is not good for enterprise developing software with independent intellectualpropertyrights.ButifanembeddedLinux operating system with open source is used, cost of production can be reduced because no licensing fee is needed and the cross development tool chain is also free. In addition, there are many other advantages such as reduced development time becauseofopensourcedevicedriversandreusable applications,convenientdevelopmentenvironment configuration using module function, file system management andeasyresolutionofaproblemfromopensource communities and so on 5. On the basisofabove, enterprises 978-1-4244-2693-5/09/$25.00 2009 IEEE2894 can developNCsoftwarewithindependentintellectual property rights and other various requirements can also be satisfied. Embedded Linux has recently become a current research focus in embedded system. II.MODELOFHARDWARE Model is the abstractionofreality which can make clear descriptionofthe reality. In order to get the engraving control system model, the main hardware partsofthe system are abstracted as shown in Fig.I. Fig. ) Modelofhardware The hardware of the NC engraving controller is provided with the architectureofARM and FPGA (Field Programmable Gate Array). The master control chipofthe controller adopts 32-bit RISC(ReducedInstructionSet Computer)ARM microprocessor chip S3C2440 of Samsung Company which based on ARM920T structure. It has high work efficiency up to 400MHz and many kindsofgeneral interfaces, such as integrated UART for serial port, integrated USB, CEMERA, LCD, VGA and Ethernet controllers etc. Furthermore, it provides on chip memory manage unit (MMU) which is used to realize virtual memory management, so as Linux can be easily ported to ARM. The Cyclone FPGAEPlC6of Altera Company was adopted as the slave chip to lighten the burdenofthe master control chip. NAND Flash memory is used for non-volatile program and data storage. Main memory is synchronous dynamic random-access memory (SDRAM) and might contain anywhere from a few megabytes to hundredsofmegabytes depending on the application. The main processing flowofthe system is described as follow: keying informationofcontrol panel is sent to ARM through serial port. ARM then process and send the corresponding control data to FPGA or display panel. FPGA is mainly doing front-end processing work of sensor and control information 6. The signals sent by FPGA are transformed and isolated by the adapter panel, and then are sent to the driver which will drive the stepping motorofthe engraving machine so as to control the cutting tool path. To realize the functionsofhomingof engravingand tool changing, the sensor signal of engraving machine will be feed back to FPGA through adapter panel. Information is displayed on display panel which is LCD or VGA. In all, the controller built on embedded technology can reducethe systemhardwarescale,facilitate application 2895 development, cut down the cost and enhance the systems reliability and real-time performance. III.TASKPARTITION Data flow diagram (DFD) is an important design aid tool in system development, which allows the developerofa system to graphically show the flow of data in the system. DFD describe and analyze system more precisely than any other artifact, specifically in modelingofreal time embedded system 7. The ultimate data flow diagramofthe engraving machine system is shown as Fig. 2. A task represents the executionofa sequential program or a sequential component in a concurrent program. Each task deals with one sequential thread of execution; hence no concurrency is allowed within a task. However, overall system concurrency is obtained by having multiple tasks that execute in parallel. The system decomposition by DFD has already been preliminarily analyzed. The dataflowofthe system is clearly revealed, thus functionsofthe system and dataflow between them can be able to recognize conveniently. The next step is how to identify the concurrent tasks in the system by applying the task structuring criteria and the DFD. Here, the DARTS (Design Approach for Real Time System) method was used to decompose the system into smaller and more manageable units with well defined interfaces between them. Its central theme is to address the key aspectsofstructuring the system into concurrent tasks and define the interfaces between them. DARTS uses a setoftask structuring criteria, which be called H Gomma principles for identifying the concurrent tasks in the system as well as a setofguidelines for defining the communicationandsynchronizationinterfacesbetween various tasks. ,.- - - - - - - -.I I I I Fig. 2 The DFDofengraving machine The task structuring criteria are a setofheuristics derived from experience that obtained in the designofconcurrent system. The main consideration in identifying tasks is the asynchronous natureofthe functions within the system. The HGommaprinciplesaregroupedintothreeseparate categories based on how they are used to assist in the task structuring activity. The first is event dependency criteria. The event dependency criteria address how and when a task is activated, including device I/O dependency, periodic event, control function and user interface dependency et al. The second is task cohesion criteria. The cohesion criteria provide a means of assessing the asynchronous natureofthe functions and hence a basis for determining whether and/or how functions should be combined into concurrent tasks, including sequentialcohesion,temporalcohesionandfunctional cohesion. The third is task priority criteria including time critical and computationally intensive 8. Toachievethegoalofstructuringasysteminto concurrent tasks, the task structuring criteriaofH Gamma principle arc applied to the functions shown in the data flow diagram. Based on these criteria, the engraving software system can be divided into seven parts which arc shown as follows (i.e. the dashed line frame in Fig. 2). (a)UserInterfaceTask: todisplaytheinteraction information with the user such as coordinate, part origin and process progress as well as other state information etc. (b) Keyboard Processing Task: to receive the control command from the control panel such as selecting file, system setting or parameter setting, manual movement etc, then make the corresponding treatment. (c)File Processing Task: to read file from U disk, then interpret the G-code or HPGL-code processing file. The result will be stored in buffer. (d) Data Processing Task: to read data from the buffer and process it through the control algorithm, such as treatment ofsmalllineblocks(JudgebigS),accelerationand deceleration control, interpolation processing. (e) Interrupt Service Task: to send control pulsesofthe stepping motors to FPGAwhen ARM received interrupt signal from FPGA. (f) Extended Functions Task: to realize some extended functions. Thesefunctions, includingupdatethecontrol program, remote control, network management and simulation ofthe movementofthe tool etc, can be added according to different requirement. (g)FPGAProcessing Task: to implement real time functions, such as send control pulses to the stepping motors real-timely, receive and process sensor signal etc. Tasks (a) - (f) are implemented in the ARM becauseof its powerful computing ability. Task (g) is implemented in the FPGA due to its real-time processing ability. IV.ARCHITECTURE D ESIGN A.Software Architecture Software architecture typically plays a key role as a bridgebetweenrequirementsandimplementation.The software architecture for NC engraving machine controller based on embedded Linux is shown in Fig. 3 and each partof the architecture is also described below. SoftwareArchitecture .unction Modules I User lru erfaceIIKeyboard ProcessingIIrileProcessing I I Interrupt ServiceIIData Proce.ingIIblendedFunctionsI IRoot FileSystemI IGCII ISystem ManagementI (YAFFS)(Qt/EmbeddedjInterface I EmbeddedLinuxKernel I I BSP (Flash. SDRA M, t.:Sll. l CD.CS900.Serial. Camera. etc) I Hardware Fig. 3 Software architecture BSP (Board Support Packet) is a software developing package between the hardware layer and the software layer. It is usedto cover the differencesofhardware, bootthe operating systemand provide device driver. It is a key interface between hardware and embedded operating system. The version of embedded Linux kernel is 2.6, which many new features have been added to support the wide applicationofembedded system. It can be customized and ported based on ARM to meet our special requirements of the NC engraving system. At the same time, using embedded Linuxcan simplifysystem design. Complex application program can be divided into some simple tasks which are managed by the embedded Linux. Based on the embedded Linux kernel, root file system and embedded graphical user interface (GUI) were selected with the requirementsofthe system. System management interface is also supported by embedded Linux. The YAFFS (yet another flash file system) is adopted for root file system, which is also a kindofLog-structured file system like JFFS/JFFS2. It is specially designed for NAND Flash and suitable for mass-storage devices. YAFFS is thus designed not only to adapt to the features of NAND Flash, but also to better use the advantages of NAND Flash to reach best performance. It uses log structure, error checking correction and technique to improve NAND Flash s robustness. The adventofYAFFS makes the low cost NAND chip effective and robust. YAFFS is highly portable and can run on Linux. Qt/Embedded is a famous commercial embedded GUI tool, has great cross-platform ability, can be conveniently applied in present popular OS, such as embedded Linux.QUE can directly communicate with I/O devices. Furthermore, its systemarchitectureorientedforobjectmakesitscode structuralized, reusable and run fast.QUEsupports frame buffer driver and can directly write frame buffer without X- server or X-lib support. In this way, it saves memory cost and improvesapplication running efficiency9. Considering advantages mentioned above, this paper adopts it as embedded lightweightGUIcomponentlibrary basicconstruct tool oriented to industry monitoring. 2896 ReceiveMessage r - - -,1 Output data selector unit Message Queue message mess3ge Fig. 6 Message queue Input data selector unit 2 -IUX I Send Message r - - - - -,1 and, rather than a binary semaphore, a mutex lock will be used to represent mutex. The producer and consumer - running as separate threads - will move items to and from a buffer that is synchronized with these empty, full, and mutex structures. FIFOallowsthemoduleswithinadesigntobe decoupled. The FIFO interface is simple, reducing design time. FIFO is seldom bottlenecks, since the width and depth can be adjusted and is well suited for connecting custom hardware directly to the embedded processors, and is simple to implement with a short design cycle and small code size 12.Theping-pangoperationisintroducedintothe asynchronous FIFO design to make FPGA and ARM to realize seamless buffering and processing for high speed data streams, as well as to ensure the pipeliningofFPGA processing. The typical ping-pang operation method is shown as Fig. 5 13. Fig. 5 Ping-pang operation The processing flowofping-pang operationofFPGA is followed as: the input data from ARM is firstly allocated to Data buffer module I through Input data selector unit, and then at next switching time, the input data will be buffered in Data buffer module 2. At the same time, the data buffered in Data buffer module I last time is sent to Data Processing Module for processing through Output data sciector unit. At the third time, the input and output data will be exchanged to the two data buffer modules again. The steps mentioned above will be repeated and repeated. The data buffer module is FIFO in our system. The switching signal for data selector unit is the interrupt signal which sent by FPGA when it needs data. That means when the data buffered in oneofthe two data buffer modules has been processed, then FPGA will send an external interrupt signal to ARM. So ARM will send data to FPGA in interrupt service routine. FPGA will buffer the data in this data buffer module when it has received. Meanwhile, the Data Processing Module can still process the data in the other data buffer module. Ping-pang operation promotes the concurrency of the system. Another way used to achieve the same effect for other tasks is via a message-queue, which is for the operating system to provide the meansofcooperating processes to communicate with each other as shown in Fig.6. Consumer Producer Fig. 4 Producer-Consumer problem To allowproducerand consumerprocessesto run concurrently, we must have an available bounded buffer of items that can be filled by the producer and emptied by the consumer. This buffer

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

最新文档

评论

0/150

提交评论