Please use this identifier to cite or link to this item: http://hdl.handle.net/10773/2010
Title: Sincronização de relógio em CAN assistida por hardware
Author: Madail, Samuel Rocha
Advisor: Oliveira, Arnaldo Silva Rodrigues de
Pedreiras, Paulo Bacelar Reis
Keywords: Engenharia electrónica
Controlo automático
Sincronização
Relógios
Protocolos de redes
Defense Date: 2008
Publisher: Universidade de Aveiro
Abstract: O tempo tem sido tema de estudo desde o início da civilização até aos dias de hoje. O que mais tem mudado nesse aspecto é o rigor com que conseguimos medir o tempo. Enquanto antigamente as pessoas viviam segundo os ciclos da natureza, hoje em dia as pessoas já necessitam de utilizar relógios para se sincronizarem com outras pessoas ou procedimentos. Este rigor é muito mais apertado em sistemas de medida e controlo presentes nas mais diversas àreas aplicacionais, tais como a automação e controlo industrial, robótica, sistemas x-by-wire na aviónica e indústria automóvel, entre outros. Muitas destas classes de aplicação exibem requisitos temporais estritos, requerendo um elevado rigor nos instantes de activação das tarefas desempenhadas pelo sistema bem como na medida dos instantes em que certos eventos ocorrem. Muitos destes sistemas assentam em arquitecturas distribuídas, ou seja, são sistemas compostos por diferentes nodos "inteligentes"e autónomos que usam serviços disponibilizados por uma infra-estrutura de comunicação comum. O seu uso é hoje em dia cada vez mais frequente em detrimento das tradicionais arquitecturas centralizadas, devido ao seu custo, escalabilidade (do sistema) e em termos de partilha dos recursos do sistema. Contudo, a manutenção de um relógio comum em soluções distribuídas apresenta desafios adicionais. Estando os diversos nodos dos sistemas distribuídos geralmente dispersos geograficamente, existe a necessidade de cada nodo do sistema possuir o seu próprio relógio local. Este facto só por si não é suficiente, dado que se não forem corrigidos, os valores dos vários relógios vão divergir uns dos outros, perdendo-se a coerência temporal do sistema. Torna-se então necessário sincronizar periodicamente os relógios para que estes se mantenham tão sincronizados quanto possível e/ou desejável. Em consequ^encia disso têm vindo a ser propostos diversos protocolos de sin- cronização de relógio especificamente concebidos para satisfazer os requisi- tos de sistemas deste tipo. Um destes protocolos é o IEEE 1588 (IEEE 1588- 2002 Standard for a Precision Clock Synchronization Protocol for Networked Measurement and Control Systems). A possibilidade de aplicar em diversas tecnologias de rede, a simplicidade e administração mínima, bem como os baixos requisitos em termos de recursos (CPU, memória, rede), são algumas das principais vantagens deste protocolo. O IEEE 1588 pode ser implementado quer em hardware quer em software, sendo que o grau de precisão obtido dependente do tipo de implementação. Nesta âmbito desta dissertação foi implementado um protocolo baseado no IEEE 1588 sobre redes CAN (Controller Area Network), designado por 1588Light. Esta adaptação surgiu da necessidade de simplificar o protocolo, dado que a rede CAN oferece relativamente pouca largura de banda e em muitos casos é utilizada em sistemas embutidos baseados em microcontro- ladores com baixa capacidade de processamento. Primeiramente, o protocolo foi implementado ao nível de software, usando como nodos do sistema distribuído placas DETPIC com processadores PIC18F258 da Microchip. Seguidamente foi feita uma implementação do protocolo em hardware, usando para isso o controlador CAN designado por CLAN, disponibilizado na forma de núcleo de propriedade intelectual mo- delado em VHDL, sintetizável e implementável em FPGAs da Xilinx. A placa base de desenvolvimento da implementação em hardware foi a RC10 da Celoxica contendo uma FPGA Spartan-3. Na implementação em software conseguiram-se precisões de algumas deze- nas de microsegundos ao nível do timer dos microcontroladores. Ao nível da aplicação os resultados de offset obtidos estavam na ordem das deze- nas/centenas de microsegundos. Verificou-se um bom comportamento do protocolo quando sujeito a diferentes cargas no barramento bem como pela adição de nodos Slaves na rede. Também se introduziu um kernel tempo- real, tendo-se verificado neste caso que os tempos de bloqueio impostos por este degradavam significativamente o offset, sendo este de algumas centenas de microsegundos. Na implementação em hardware os resultados obtidos encontram-se na gama das unidades de microsegundo. Os valores de offset mantiveram- se constantes mesmo com a introdução de carga no barramento, bem como com a adição de outros nodos Slave na rede. Devido à possibilidade de exe- cutar múltiplas tarefas em simultâneo numa FPGA, o problema dos tempos de bloqueio na afectação do rigor do relógio não se levanta. Conclui-se assim que para sistemas com necessidade de sincronização de relógio elevada, na casa das unidades de microsegundo, torna-se necessária uma implementação assistida por hardware. ABSTRACT: Time has been a subject of study since the beginning of civilisation. What has changed the most in relation to this issue is the rigor with which we measure time. In the past people kept to the cycles of nature, but nowadays they need clocks to synchronise themselves with others people or processes. This rigor is very tight in most measurement and control systems present in a range of diverse application areas such as industrial control and automation, robotics, systems x-by-wire avionics and the automotive industry, among others. Many of these application groups display strict time requirements, where a high level of accuracy is required in the activation of the tasks performed by the system as well as the measurement of instances at which certain events occur. Many of these systems are based on distributed architectures, in other words systems composed of different "intelligent"and autonomous nodes that use services provided by a common communication infrastructure. Its use today is increasingly common in detriment of the traditional centralised architec- tures, due to its cost, scalability (of the system) and in terms of sharing the system's resources. However, the maintenance of a common clock in distributed solutions presents additional challenges. As the various nodes of the distributed systems are usually spread geographi- cally, there is a need for each node to have its own local clock. This fact alone is not enough, because if they are not corrected, the values of the vari- ous clocks will differ from each other and the time consistency of the system will be lost. It is therefore necessary to synchronise the clocks periodically in order for them to be as synchronized as possible and/or desirable. As a result, various protocols for clock synchronisation specifically desig- ned to meet the requirements of such systems have been proposed. One of these protocols is the IEEE 1588 (IEEE 1588-2002 Standard for the Precision Clock Synchronization Protocol for Networked Measurement and Control Systems). The possibility of applying this protocol to a range of network technologies, simplicity and minimal administration, as well as low requirements in terms of resources (CPU, memory, network), are some of the main advantages of this protocol. The IEEE 1588 can be implemented either in hardware or in software, howe- ver, the degree of accuracy obtained is dependant upon which type of im- plementation is used. This dissertation involves the implementation of a protocol based on the IEEE 1588 on CAN (Controller Area Network) networks, referred to as 1588Light. This adjustment resulted from the need to simplify the protocol, since the CAN network offers relatively little bandwidth and is often used in embedded systems or microcontrollers with low resource (ex. processing, memory) capacity. Firstly, the protocol was implemented at the software level, using as the distributed system nodes DETPIC boards with Microchip PIC18F258 pro- cessors. Following on from that, the implementation of the protocol in hardware was carried out, with the use of the CAN controller, referred to as CLAN, and available in the form of core intellectual property modelled in VHDL, synthesisable and implementable in the Xilinx FPGAs. The develop- ment board for the implementation in hardware was the RC10 of Celoxica, containing an FPGA Spartan-3. Through the implementation in software it was possible to obtain precision to within a few tens of microseconds at the level of the microcontroller timer. In relation to the application layer, the offset results obtained were in the order of tens/hundreds of microseconds. Protocol performance was good when subjected to different bus loads as well as the addition of slave nodes in the network. When a kernel was introduced the findings showed that the blocking times imposed by the kernel are responsible for the signi¯cant degradation of the offset, increasing it to a few hundred microseconds. In the hardware implementation, the results were in the range of few micro- seconds. The offset results remained constant even with the introduction of the bus load and with the addition of other slave nodes in the network. Due to the possibility of performing multiple tasks simultaneously in a FPGA, the problem of blocking times affecting the accuracy of the clock does not arise.
Description: Mestrado em Engenharia Electrónica e Telecomunicações
URI: http://hdl.handle.net/10773/2010
Appears in Collections:UA - Dissertações de mestrado
DETI - Dissertações de mestrado

Files in This Item:
File Description SizeFormat 
2009000848.pdf3.16 MBAdobe PDFView/Open


FacebookTwitterLinkedIn
Formato BibTex MendeleyEndnote Degois 

Items in DSpace are protected by copyright, with all rights reserved, unless otherwise indicated.