MEJORA DE LA SEGURIDAD VIAL MEDIANTE COMUNICACIÓN INALÁMBRICA ENTRE VEHÍCULOS Autor: Lestón Cadavieco, Daniel. Director: Tufvesson, Fredrik. Entidad Colaboradora: Lunds Tekniska Högskola - Lund University. RESUMEN DEL PROYECTO 1 Introducción El transporte del mañana tendrá la particularidad de comunicarse cooperativamente entre sus distintos elementos con el fin de prevenir colisiones y facilitar información que sirva de utilidad. Sin embargo, para que esta cooperación sea posible, todos los vehículos deben estar equipados con módulos inalámbricos 802.11p. A lo largo de la implantación de este sistema, coexistirán vehículos con y sin esta tecnología. Este proyecto fin de carrera afronta este problema desarrollando el hardware y software de un sistema que es capaz de detectar vehículos con un radar, y emite vectores de posición y velocidad a los vehículos inteligentes circundantes usando un módulo 802.11p, evitando posibles accidentes y salvando vidas humanas. En el ejemplo de la Figura 1, el coche gris (inteligente), llega a una intersección conocida por su alta peligrosidad, dada la baja visibilidad de los coches que se aproximan desde el este. Drive ITS, el producto desarrollado a lo largo de este PFC, es capaz de informar a los vehículos cercanos sobre la posición y velocidad del vehículo azul (no inteligente) que se aproxima, emulando la comunicación que tendría lugar si el vehículo azul sí tuviese un dispositivo 802.11p. Figure 1: Ejemplo del sistema Drive ITS 1
El presente proyecto fin de carrera (PFC) consta de dos partes, hardware y software. El hardware debe ser capaz de comunicarse con un radar universal de medio rango y un módem 802.11p. Dado que el radar fue diseñado para ser montado en vehículos, está preparado para ser acoplado a un bus CAN, el cual usaremos para comunicarnos con este radar. El módem, por otra parte, fue diseñado para ser usado con un ordenador, por lo lo que usa una implementación de ethernet sobre la capa física de USB. El software debe ser capaz de recibir el flujo de información que proporciona el radar, procesarlo de manera que se filtren los datos irrelevantes, y transmitirlos a otros vehículos usando el módem 802.11p. Dado que el radar usa protocolo CAN, será necesario implementar una librería CAN. El software también deberá implementar la versión más actual del estándar ITS-G5 para empaquetar la información de los vehículos. Además debe comunicarse con el módem 802.11p a través de Ethernet sobre USB. 2 Metodología 2.1 Hardware El dispositivo ha sido dividido en trés módulos, el intérprete CAN-bus, la interfaz microcontrolador- RaspberryPi y la interfaz Ethernet sobre USB, integrada en la Raspberry Pi, que permite la conexión al módem 802.11p. La figura 2 muestra estos módulos. UMRR Radar Unit 802.11p Modem CAN Shield CDC ECM CAN-bus Interpreter Raspberry Pi Level SERIAL 5V SERIAL 3.3V Shifter Drive ITS Figure 2: Diagrama de bloques del sistema. 2.1.1 Intérprete CAN-bus Para poder conectarnos con la conexión CAN-bus del radar se ha diseñado, implementado y fabricado una tarjeta adicional de hardware para la Raspberry Pi. Esta tarjeta consiste 2
en un transceptor CAN (PCA82C251 o MCP 2551), un controlador CAN (MCP2515) y un microcontrolador (AVR ATMEGA328P-PU) el cual programa el controlador y se encarga de las comunicaciones serie con la Raspberry Pi. Además incluye un adaptador de tensión entre ambos. La Figura 3 muestra la disposición de los elementos en la tarjeta, que incluye el intérprete CAN-bus. Figure 3: Diagrama de bloques de la tarjeta. Figure 4: Diagrama de bloques del adaptador de tensión. 2.1.2 Interfaz microcontrolador - Raspberry Pi La comunicación entre el microcontrolador AVR y la Raspberry Pi se realiza mediante el puerto serie incluido en ambos dispositivos. En una configuración normal, simplemente se requeriría conectar entre sí los puertos TX y RX de ambos sistemas. Sin embargo en este caso al trabajar a tensiones distintas se necesita un adaptador de tensión. La Figura 4 muestra el diagrama de bloques de este sistema. 2.1.3 Interfaz Ethernet sobre USB La especificación de este PFC requiere el uso de un módem 802.11p que originalmente se diseñó para ser conectado a un ordenador personal sin necesidad de drivers del fabricante. ES por ello que el fabricante del módem decidió incorporar conectividad Ethernet sobre USB como única interfaz. Esto implica que se usa la capa física de USB con capas TCP/IP sobre ella. Si se conecta a un anfitrión USB con esta capacidad, tal y como la de un ordenador, ambos dispositivos estarán listos para comunicarse. Dado que no hay soluciones Ethernet sobre USB con microcontroladores AVR, se optó por usar una Raspberry Pi, capaz de ejecutar este protocolo directamente. 3
2.2 Software La parte de software de este PFC son objeto de mi compañero de proyecto Dimitrios Vlastaras. Dado que todo el trabajo desarrollado es resultado de nuestra colaboración interdisciplinar, no sería capaz de presentar mis resultados sin incluir la parte de mi compañero, que puede encontrarse de manera original en la tesis de fin de máster de título homólogo [1]. El software que se ejecuta en este producto está dividido en dos partes principales. La primera parte es el código que se ejecuta en el microcontrolador AVR, escrito en C++ con la ventaja de usar el SDK de Arduino para las comunicaciones SPI y RS-232. La segunda parte consiste en el software que se ejecuta en la Raspberry Pi. El código de esta parte está escrito en Java y es donde la mayoría de algoritmos se ejecutan. 2.3 Caja de protección Se decidió diseñar y fabricar una caja protectora para el producto final, dado que se daría a mostrar en diversos eventos del sector ITS. Los requisitos fueron la conservación del formato reducido y robusto, añadiendo protección contra pequeños impactos. La caja ha sido diseñada íntegramente en SolidWorks 2013, y fabricada mediante deposición de hilo fundido (FDM), una técnica de prototipado rápido. 3 Resultados Se llevaron a cabo dos pruebas en la sede de Volvo Cars en Gotemburgo. El primer test, de comunicación, consistió en comprobar si nuestro módem de Kapsch 1 podía conectarse correctamente con un equipo Drive C2X 2. El segundo test, de verificación, consistió en comprobar si nuestra implementación de mensajes de alerta cooperativos (CAM) era consecuente con la especificación CAM [2]. Para ellos se compararon paquetes de un vehículo Drive C2X con los generados por nuestro sistema. Ambos test fueron satisfactorios, con ligeras diferencias entre los paquetes enviados por el vehículo Drive C2X y los generados por Drive ITS, las cuales fueron solventadas mediante una ligera reprogramación. Las Figuras 5 y 6 muestran el prototipo Drive ITS fuera y dentro de la caja protectora. 4 Conclusiones A lo largo del proyecto fin de carrera, el dispositivo Drive ITS ha sido exitosamente desarrollado. Es capaz de emular la comunicación vehículo-vehículo de coches no inteligentes en 1 KAPSCH 2 http://www.drive-c2x.eu/project 4
Figure 5: Prototipo Drive ITS. Figure 6: Drive ITS en la caja protectora. el rango de visión del radar, proporcionando una integración del sistema de cooperación en el transporte mucho más efectiva. Mediante esta tecnología, el transporte inteligente será real incluso en etapas tempranas, donde sólo una minoría de coches disfrutarán del sistema de cooperación entre vehículos. Y es por supuesto una solución a largo plazo, dado que el parque automovilístico es muy longevo. Implementando nuestro sistema en puntos negros localizados, los vehículos inteligentes se podrán beneficiar de una especial seguridad activa al ser alertados acerca de vehículos próximos. 5
IMPROVED TRAFFIC SAFETY BY WIRELESS VEHICULAR COMMUNICATION 1 Introduction In tomorrow s vehicle industry vehicles will have the ability to communicate and cooperate with each other in order to avoid collisions and provide useful information to each other. However, for this cooperation to be possible all vehicles will have to be equipped with compatible wireless 802.11p modules. In an early stage of the system there will be plenty of older vehicles without such equipment. This thesis addresses this problem by developing the hardware and software for a system that detects older vehicles using a radar and forwards their position and speed vectors to newer vehicles using a compatible 802.11p module, avoiding potential accidents and saving human lives. In the example portrayed in Figure 1, the intelligent car (grey in the example) reaches an intersection where there is known risk of colliding with other vehicles due to the low visibility of the cars that approach from the east. Drive ITS, the product developed in the present master s thesis, is able to inform about the approaching blue vehicle, non intelligent, emulating the communication that would take place if the blue vehicle featured a car-to-car communication system. Figure 1: Example of the Drive ITS system The present master s thesis will be divided into two main parts, hardware and software. The hardware must be able to communicate with both the UMRR radar and the 802.11p modem. Since the radar was designed to be an on-board unit for vehicles, it provides a Controller Area Network (CAN) bus interface for communicating with it. The modem on 6
the other hand was designed to be used together with personal computers, and therefore provides an Ethernet implementation over the USB protocol. The software must be able to receive the stream of information provided by the UMRR radar, process it in such a way that it filters out irrelevant data and transmit it to other nearby vehicles using the 801.11p modem. Since the radar uses the CAN protocol a CAN library will have to be implemented. The software also must be able to implement the most current version of the standard ITS-G5 to encode the vehicle information. It must also be able to communicate with the 801.11p modem using Ethernet over USB. 2 Methodology 2.1 Hardware The device is divided into three modules, the CAN-bus interface, the microcontroller to Raspberry Pi interface, and the Ethernet over USB interface, integrated in the Raspberry Pi, which allows its connection to a 802.11p modem. Figure 2 depicts these modules. UMRR Radar Unit 802.11p Modem CAN Shield CDC ECM CAN-bus Interpreter Raspberry Pi Level SERIAL 5V SERIAL 3.3V Shifter Drive ITS Figure 2: Block diagram of the system 2.1.1 CAN-bus Interpreter In order to interface with the CAN-bus connection of the radar, we designed, implemented and produced a hardware shield for the Raspberry Pi. This shield consists on a CAN transceiver (PCA82C251 or MCP2551), a CAN controller (MCP2515) and a microcontroller (AVR ATMEGA328P-PU) for programmability and serial communications with the Raspberry Pi, featuring a transceiver that acts as a voltage level shifter. Figure 3 portrays the disposition of the elements in the shield, which includes the CAN-bus Interpreter, subject of this section. 7
Figure 3: Block diagram of the shield. Figure 4: shifter. Block diagram of the level 2.1.2 Microcontroller to Raspberry Pi Interface The communication between the AVR microcontroller and the Raspberry Pi is achieved with the serial port included in both devices. In a normal setup, this would require to connect the TX of the AVR with the RX in the Raspberry Pi and vice versa, in this case a transceiver is needed. Figure 4 depicts the block diagram of the level shifter. 2.1.3 Ethernet over USB interface The specification of the present master s thesis required the usage of a 802.11p modem which was originally designed to be connected to a personal computer without the needs of manufacturer s drivers. Therefore, the modem manufacturer decided to incorporate a Ethernet over USB connectivity as the only interface in their device. This means that it uses the physical layer of USB, with TCP/IP layers on top. If it is plugged to a Ethernet over USB host, such as a personal computer, both devices will be connected and ready to communicate. Since there are no available solutions for Ethernet over USB hosting in AVR microcontrollers, it was opted to use a Raspberry Pi, that is capable of running this protocol out of the box. 2.2 Software The software part of the device was the scope of my thesis partner Dimitrios Vlastaras. As the present Master Thesis is a result of an interdisciplinary team, I would not be able to present the finished result without including the software part, which is original to D. Vlastaras and D. Leston s work [1]. 8
The software running on the product is divided in two main parts. The first part is the code running on the AVR microcontroller, which is written in C++ taking advantage of the Arduino SDK for SPI and Serial (RS-232) communications. The second part is the software running on the Raspberry Pi. That part of the code is written in Java and this is were the main algorithms are running. 2.3 Case Enclosure It was decided to design and produce a case enclosure for the final product, given that it would be displayed in several events. The requirements were that it should keep the neat feeling of the hardware package and provide protection against small impacts. The case has been entirely designed in SolidWorks 2013, and produced using Fused Deposition Modeling, a rapid prototyping technique. 3 Results Two different tests were performed at Volvo Cars in Gothenburg. The first test, communication test, was to see whether our Kapsch Modem 3 could successfully communicate with Drive C2X 4 equipment or not. The second test, a verification test, was to see whether our own CAM (Cooperative Awareness Message) implementation followed the CAM specification [2] by comparing packets from another CAM source, i.e. a Drive C2X car, to packets generated by our system. Both tests were satisfactory, with just minor differences between the packets sent by the Drive C2X car and those sent by Drive ITS, that were solved by small adjustments in the software. Figure 5 shows the Drive ITS product. Figure 6 shows the case enclosure containing the Drive ITS prototype. 4 Conclusions Throughout the present master s thesis, a device named Drive ITS has been successfully developed. It is able to emulate the car-to-car communication of non-intelligent vehicles within the sight of the radar, thus providing a better integration of the ITS vehicle cooperation in the future. With this technology, intelligent transportation will be real even at early stages, where just a small part of the vehicles in the roads feature a cooperative communication system. And it is of course a long-term solution, since old vehicles will continue in the roads for a long time. By implementing the system in black points, intelligent vehicles will benefit from extra active safety as they will be warned about surrounding vehicles. 3 KAPSCH 4 http://www.drive-c2x.eu/project 9
Figure 5: Drive ITS prototype. Figure 6: Drive ITS inside the case. References [1] D. Vlastaras, D. Leston (2013), Improved Traffic Safety By Wireless Vehicular Communication. Lund University, Sweden. [2] European Telecommunications Standards Institute (2011), Final draft ETSI TS 102 637-2. ETSI, France. 10