Implementação de um sistema de iluminação dianteiro adaptativo a
Transcrição
Implementação de um sistema de iluminação dianteiro adaptativo a
Implementação de um sistema de iluminação dianteiro adaptativo a LEDs para caminhões pesados dimensionado para o mercado Brasileiro Luciano P. Lukacs TESE SUBMETIDA AO CORPO DOCENTE DA COORDENAÇÃO DO PROGRAMA DE PÓS-GRADUAÇÃO DE ENGENHARIA INDUSTRIAL DA UNIVERSIDADE FEDERAL DA BAHIA COMO PARTE DOS REQUISITOS NECESSÁRIOS PARA A OBTENÇÃO DO GRAU DE DOUTOR EM CIÊNCIAS EM ENGENHARIA INDUSTRIAL. Aprovada por: ________________________________________________ Prof. Marcelo Embiruçu, D.Sc. ________________________________________________ Prof. Iuri Muniz Pepe, D.Sc. ________________________________________________ Prof. Ednildo Andrade Torres, D.Sc. ________________________________________________ Prof. Carlos Arthur Teixeira Cavalcante, D.Sc. ________________________________________________ Prof. José Maria Campos Dos Santos, D.Sc. ________________________________________________ Prof. Paulo César Machado de Abreu Farias, D.Sc. ________________________________________________ Celso Duarte, PhD SALVADOR, BA - BRASIL DEZEMBRO DE 2009 LUKACS, LUCIANO Implementação de um sistema de iluminação dianteiro adaptativo a LEDs para caminhões dimensionado para pesados o mercado Brasileiro [Salvador] 2009. XII, 196 p. 29,7 cm (PEI/UFBA, D.Sc., Engenharia Industrial, 2009). Tese - Universidade Federal da Bahia, PEI 1. Fuzzy, 2. LED, 3. AFS, 4. Controle I. UFBA. Título (série) Agradecimentos À minha família por tudo, especialmente nos momentos mais difíceis Aos meus orientadores, Iuri e Marcelo por terem não só me orientado, mas também me agüentado neste período À CAPES, em especial ao Programa PROCAD, pelo suporte ao desenvolvimento do trabalho Ao Mahendra Dassanayake, pelo apoio ao longo de todo processo e de sempre estar disposto a discutir novas idéias À Ford pelo apoio na aquisição de dados e informações À UFBA/LAPO pelo apoio recebido, oportunidades proporcionadas e ensinamentos passados Aos colegas do LAPO pelo apoio recebido, em especial ao Luiz, João, Itã, Valmara, Cafu, Vitor, Kelly e Fróes A todos aqueles que contribuíram de uma forma ou de outra para a elaboração deste trabalho, em especial aos colegas, alunos e professores Ao meu irmão Leonardo, pela ajuda nos momentos de maior tensão Ao afilhado, o pequeno Luciano, pela alegria que me trás todo dia A Raquel e Tiffany por sempre me apoiarem e insistirem que eu deveria ir até o fim A Aline, por tudo que passamos juntos iii Dedicatória To Grandpa, needless to say, I miss you everyday… iv Índice Capítulo 1. Introdução 1 Opening Statement 1 Apresentação 2 1.1. Os objetivos e a importância do estudo e do desenvolvimento de 4 um sistema auxiliar de iluminação automotiva 1.2. As Etapas e a organização do trabalho realizado 9 Nomenclatura 12 Referências 13 Capítulo 2. Estudo comparativo entre os LEDs: Golden Dragon 14 (Osram), K1 e K2 (Lumileds) Apresentação 14 Resumo 14 Conclusão 15 Opening statement 17 Abstract 17 2.1. Introduction 19 2.2. Experimental study 21 2.3. Method and materials 22 2.4. Results 24 2.5. Conclusion 32 References 33 Capítulo 3. Benefícios e desafios de controlar um AFS (Adaptive 34 Front-lighting System, sistema adaptativo de iluminação veicular) a LEDs adotando a lógica Fuzzy Apresentação 34 Resumo 36 Conclusão 37 Opening statement 39 Abstract 40 v 3.1. Introduction 42 3.2. Fuzzy knowledge base and membership functions 46 3.3. The lighting device and hardware proposed 50 3.4. Methodology 54 3.5. Results and discussion 61 3.6. Conclusion 67 Nomenclature 68 References 69 Capítulo 4. Desenvolvimento de um modelo AFS (sistema 75 adaptativo de iluminação veicular) para assegurar as necessidades do motorista de caminhão durante o período noturno e vislumbrando sua utilização para o mercado Brasileiro Apresentação 75 Resumo 76 Conclusão 77 Opening statement 79 Abstract 80 4.1. Introduction 81 4.2. Road conditions and environment 82 4.3. Data from the driver survey 88 4.4. Test track measurements 94 4.5. Modeling and results 95 4.6. Conclusion 106 Nomenclature 107 References 107 Capítulo 5. Desenvolvimento do protótipo do AFS baseado em 111 LEDs Apresentação 111 Resumo 111 Conclusão 112 Opening statement 114 vi Abstract 114 5.1. Introduction 115 5.2. Looking for a product 115 5.2.1 LED 116 5.2.2 Optics 120 5.2.3 The selected LED 121 5.2.4 Heat sinking 122 5.2.5 The power electronics 123 5.2.5.1 Connectors 126 5.2.6 Microcontroller 129 5.2.7 The controlling software 130 5.2.8 The sensor definition 131 5.3. Experimental 5.3.1 Test setup 132 134 5.4. Appearance 135 5.5. System integration and application 136 5.5.1 Sensor definition 137 5.5.2 Control strategy and benefits 137 5.6. Simulation and experimental comparison 138 5.7. Conclusion 145 Nomenclature 146 References 146 Capítulo 6. Conclusões e sugestões para trabalhos futuros 147 Opening statement 148 Apresentação 148 6.1. Comentários finais 149 6.2. Sugestões para trabalhos futuros 153 Apêndice A. Anteprojeto do relatório descritivo da patente de 155 invenção: farol auxiliar e processos relacionados Apêndice B. Código computacional no MATLAB 163 vii Apêndice C. Código computacional do protótipo 172 Apêndice D. Carta de intenção do desenvolvimento do produto 190 vii Resumo da Tese apresentada ao PEI/UFBA como parte dos requisitos necessários para a obtenção do grau de Doutor em Ciências (D.Sc.) Implementação de um sistema de iluminação dianteiro adaptativo a LEDs para caminhões pesados dimensionado para o mercado Brasileiro Luciano P. Lukacs Dezembro/2009 Orientadores: Iuri Muniz Pepe Marcelo Embiruçu Programa: Engenharia Industrial Recentemente, o sistema de iluminação veicular tem tido grandes avanços tecnológicos tais como a utilização de um sistema dianteiro adaptativo de iluminação (AFS), o qual representa um avanço industrial de tecnologia referente a iluminação. Este trabalho apresenta uma solução viável técnica e economicamente, desenvolvida especificamente para o mercado Brasileiro, para implementar esta tecnologia em caminhões pesados. O trabalho também discute o impacto e os benefícios para o consumidor, sendo que este sistema tem por principio adicionar luz, fazendo com que a direção noturna se torne mais segura. Três pontos são levados em consideração e analisados: o produto, a integração dos seus componentes e a aplicação do sistema e sua aceitação pelo critério do motorista. ix Abstract of Thesis presented to PEI/UFBA as a partial fulfillment of the requirements for the degree of Doctor of Science (D.Sc.) Implementation an AFS led system on heavy trucks tailored for the Brazilian market Luciano P. Lukacs December/2009 Advisors: Iuri Muniz Pepe Marcelo Embiruçu Programme: Industrial Engineering Recently, the vehicular illumination system has had huge technological advances such as the use of an adaptive front-lighting system (AFS), which represents an industry breakthrough in lighting technology. This work presents a feasible and affordable solution, tailored for the Brazilian market, to implement this system on heavy trucks. It also discusses the impact and benefits for the costumer, since the main goals is to add light, making night time driving safer. Three key aspects are analyzed and taken into account: product, system integration and application, and customer acceptance criteria. x Lista de publicações Apresentações em congressos e conferências • Lukacs, L. Desenvolvimento de um sistema auxiliar de iluminação automotiva a LEDs servo assistida, VIII Seminário de Pesquisa e PósGraduação (VIII SEMPPG), 08 de novembro, 2007. • Lukacs, L. Impact of adopting LED Advanced Font Lighting Systems (AFS) on Heavy Trucks in the South American Region, 3rd Annual Automotive Lighting Design & Technologies conference, Frankfurt, Germany, Jan 28- 30, 2008. • Lukacs, L. Explore Benefits and Implications of LED Advanced Font Lighting Systems (AFS) on Heavy Trucks in the South American Region, th 4 Annual Automotive Lighting & Design Conference, The Dearborn Inn in Dearborn, USA, April 21 - 23, 2008. Trabalhos completos em congressos • Lukacs, L.; Reis, M; Silva, K; Pepe, I.; Embirucu, M. Comparison among white high power LEDs, CONEM, 2008. • Lukacs, L., Magalhães, R, Pepe, I., Embiruçu, M., Fontes, C. Implications and outcomes of controlling a LED AFS using Fuzzy logic for the South American Markets, 8th International Lighting Symposium, 2009. Artigos completos em periódicos indexados • Lukacs, L., Simões, L., Pepe, I., Embiruçu, M. Impact of adopting Fuzzy logic to control an LED AFS (adaptive front-lighting system), SAE Technical Paper Series, No. 2007-01-2784, 2007. • Lukacs, L., Rodriguez, P. A., Pepe, I., Simões, L., Embiruçu, M. Benefits and Implications of the LED AFS on Heavy Trucks in the South American Region, SAE Technical Paper Series, No. 2008-36-0014, 2008. • Lukacs, L., Pepe, I., Embiruçu, M., Fontes, C. Implications and outcomes of controlling a LED AFS (Adaptive Front-Lighting System) using fuzzy xi logic for the South American Markets, SAE Technical Paper Series, No. 2009-36-0027, 2009. • Lukacs, L., Magalhães, R., Dassanayake, M., Fontes, C., Pepe, I., Embiruçu, M. Benefits and Challenges of Controlling a LED AFS (Adaptive Front-lighting System) using Fuzzy Logic, The International Journal of Automotive Technology, submitted, 2009. • Lukacs, L., Magalhães, R., Dassanayake, M., Fontes, C., Pepe, I., Embiruçu, M. Design of a fuzzy-based AFS (Advanced Front Lighting System) model to meet truck driver's needs during nighttime driving: foreseeing its use in the Brazilian market. Journal of Intelligent Transportation Systems: Technology, Planning, and Operations, submitted, 2009. xii Chapter 1 Introduction Opening statement This study embraces a significant technological contribution to the automotive industry. This has been accomplished through the development of specific techniques regarding the use of a Light Emitting Diode (LED) Adaptive Front Lighting System (AFS) on heavy trucks, especially in the South American market and focusing in Brazil, without masking their core scientific content. Also, a feasible proposal for an efficient vehicle light intensity automatic control has been well defined and successful to implement. It is important to highlight that the truck driver in Brazil needs a better light distribution to make the nighttime driving safer due mainly to the road conditions and environment. The LED AFS system is an enhancement regarding safety due to its functionality and to the fact that it incorporates more light to the driver beam pattern. The following chapters are arranged in a systemic sequence displaying the methodological development adopted. The results achieved in each phase of this study are shown highlighting their individual significance to characterize the problems that were discussed and to validate the techniques and methods which led to the evolution of the final technological product. Keywords: LED, fuzzy, control, AFS 1 Capítulo 1 Introdução Apresentação Este trabalho possui notadamente uma significativa contribuição tecnológica, sem prejuízos para o seu conteúdo científico, também presente de forma importante ao longo das aplicações e técnicas desenvolvidas. O impacto tecnológico desta tese de doutoramento reside, sobretudo, em sua singularidade, o que comprovadamente pode ser constatado, mediante pesquisa na literatura aberta, pela inexistência de desenvolvimentos ou avanços relacionados à aplicação de um sistema de AFS com LEDs para caminhões no mercado da América do Sul (mais especificamente, no Brasil), e também pela proposta, aplicada e bem sucedida, de uma estratégia eficiente de controle automático para a intensidade de iluminação veicular. É importante ressaltar que o motorista de caminhão no Brasil necessita de uma melhor distribuição de luz a fim de tornar a direção noturna mais segura, devido principalmente às condições das pistas e do ambiente. O sistema de AFS com LEDs é um reforço em relação à segurança devido à sua funcionalidade e principalmente devido ao fato que ele incorpora mais luminosidade ao feixe de luz do farol. Os capítulos que seguem mostram de forma sequenciada e sistemática o desenvolvimento metodológico adotado e os resultados obtidos em cada etapa do trabalho, ressaltando-se a importância de cada uma destas fases para 2 a caracterização dos problemas envolvidos, aplicação e validação das técnicas e metodologias propostas, e evolução no sentido do produto tecnológico final. Palavras-chave: LED, fuzzy, controle, AFS 3 1.1 Os objetivos e a importância do estudo e do desenvolvimento de um sistema auxiliar de iluminação automotiva Esta tese de doutoramento tem por objetivo o desenvolvimento de um sistema auxiliar de iluminação automotiva para caminhões pesados usando LED (Light-Emitting-Diodes, diodo emissor de luz) como fonte de luz branca, controlado por um sistema decisório com inteligência artificial embarcada, baseada em diferentes estruturas alternativas da lógica fuzzy. O sistema proposto possui como meta fundamental aumentar a quantidade de luz nas laterais e cercanias do veículo, proporcionando maior segurança para o seu condutor, em especial nas tomadas de curva. O sistema oferece ainda segurança ativa, redução de energia através do uso de LEDs, controle automático de intensidade de iluminação e liderança em design. Para tanto, foram desenvolvidos protótipos de bancada e uma proposta veicular para validar e testar este conceito. O conceito busca expandir as alternativas de fontes de energia e principalmente o benefício de adicionar iluminação ao facho principal do farol dianteiro, gerando incremento gradual de luz ao motorista, dependendo das condições das estradas e do meio ambiente durante o período noturno. Os resultados obtidos através do estudo buscaram também a validação da simulação através do protótipo, bem como a validação do conceito exposto na proposta. Como análise adicional, foi feito um comparativo entre os tipos de LEDs a fim de aperfeiçoar o ganho de iluminação e, consequentemente, o incremento da segurança veicular. Segundo Neunamm (2006), o desempenho dos sistemas de iluminação tem tido um grande avanço tecnológico com destaque para o AFS (Adaptive Front lighting System, sistema dianteiro adaptativo de iluminação) que é uma 4 das tendências atuais do mercado automotivo. Neste contexto, reside um dos pilares do pioneirismo deste trabalho (Lukacs, 2006, 2007) e de sua contribuição tecnológica tornando-o, inclusive, passível de depósito e concessão de propriedade industrial. A concessão de propriedade industrial está fundamentada no fato de que o atual estado da técnica não possui uma solução ou uma alternativa para a adição gradual de iluminação de forma a aumentar o campo de visão do motorista sem gerar ofuscamento ao tráfego de veículos no sentido contrário. Atualmente existem no mercado sistemas que possuem um motor elétrico para acionar o refletor ou modulo elíptico, se por ventura o condutor encontrar um pedestre. Na maioria das vezes, este pedestre estará no acostamento ou nas laterais das estradas, sendo de suma importância que possa ser visto e identificado, para evitar um atropelamento. A Figura 1.1 mostra a diferença na iluminação de uma pessoa na beira de uma estrada no campo de provas do fornecedor “Hella” na Alemanha, em uma curva, com e sem o AFS. Figura 1.1: Comparativo entre iluminação nas laterais sem e com o AFS. Atualmente, existem três famílias de faróis na indústria automobilística: • Lâmpadas com filamento: são as mais comuns devido ao preço relativamente baixo, sendo a maioria do tipo halogênio; 5 • Lâmpadas de xenônio: requerem eletrônica adicional de alto custo; • LEDs: ainda precisam atingir uma luminância mais alta, suficiente para serem aplicados em faróis. A Figura 1.2, a seguir, mostra faróis que utilizam iluminação por meio de LEDs. Figura 1.2: Exemplos de faróis que utilizam LEDs. Um resumo comparando estes três tipos de faróis é mostrado na Tabela 1, na qual os valores de fluxo luminoso são dados em lumens (lm) e a máxima luminosidade é expressa em milicandelas por metro quadrado (mcd/m2). Observa-se que há um aumento significativo no fluxo luminoso para as fontes de luz com LEDs, porém os valores ainda encontram-se abaixo daqueles das lâmpadas de halogênio usualmente utilizadas. 6 Tabela 1.1: Comparação das características de diferentes tipos de faróis Máxima Fluxo Eficiência Geometria Fonte de luz luminosidade luminoso [lm/W] [mm] [lm] [mcd/m2] ~ 1.4 x 4.1 Lâmpada de Halogênio H7 1100 26 ~ 30 (cilindro) ~ 1.2 x 4.2 Lâmpada de xenônio HID D2S 3200 ~ 90 (toróide) 65 (2004) Diodo Emissor de Luz (LED) 91 ~ 27 (2004) ~ 12 (2004) ~ 1.2 x 1.2 80 (2005) ~ 33 (2005) ~ 15 (2005) (quadrado) 122 (2006) ~ 51 (2006) ~ 13 (2006) Nota: Se uma fonte luminosa emite uma candela de intensidade luminosa num ângulo sólido de 1 esferorradiano, o fluxo luminoso total emitido dentro daquele ângulo sólido é de um lúmen (lm). Alternativamente, uma fonte luminosa isotrópica de uma candela emite um fluxo luminoso total de exatamente 4π lumens. Assim, por exemplo, uma lâmpada de halogênio emite em todas as direções um total de 1100 lm. Com o contínuo desenvolvimento tecnológico dos LEDs, existe uma tendência para um maior uso destes componentes nos sistemas de iluminação automotiva. Estima-se que nos próximos anos sejam obtidos fluxos luminosos acima das atuais lâmpadas de halogênio. A Figura 1.3 mostra esta tendência de desenvolvimento segundo um dos principais fornecedores de LEDs da indústria atual, a “Lumileds”. 7 Figura 1.3: Previsão de desempenho de iluminação de LED segundo a Lumileds . De forma geral, este trabalho compreende o desenvolvimento de um sistema auxiliar de iluminação automotiva a LED, adotando um modelo baseado em lógica fuzzy como estratégia de controle da intensidade de iluminação. Este modelo atua na tomada de decisão de energização da iluminação auxiliar, resultando na assistência automática ao motorista para conduzir o veículo em trechos de mudança de direção do feixe de luz dos faróis dianteiros, considerando-se também a velocidade empregada. A Figura 1.4 demonstra este ganho de iluminação progressivo e gradual, cujo posicionamento dinâmico não requer a necessidade de um motor, ou conjunto de motores, para deslocar o facho de luz proveniente do farol. Esta figura é relativa a um farol atual de produção da Ford, do fornecedor “Automotive Lighting”. 8 Ganho adicional de iluminação Figura 1.4: Farol baixo na estrada com o incremento do AFS. Sendo que o objetivo principal é a aplicação do produto em caminhões, um modelo baseado em lógica fuzzy para caminhões, e também um modelo para carros foram desenvolvidos (Lukacs et al, 2007). Neste sentido, a realização de um estudo comparando os hábitos dos motoristas de carro e de caminhão foi decisiva na construção do modelo para caminhões, cuja heurística, portanto, tomou como base o comportamento e as características do consumidor brasileiro. O sistema desenvolvido atende à norma brasileira do CONTRAN 294/08 (Denatran, 2008), que é similar à norma europeia ECE 48 (UNECE, 2008). Esta norma é utilizada principalmente nos mercados Sul-Americano, Europeu e Asiático. 1.2 As Etapas e a organização do trabalho realizado Este trabalho encontra-se dividido em 6 capítulos organizados de tal forma que os assuntos são apresentados com um aprofundamento gradativo no tema. Por outro lado, os capítulos são auto-consistentes, contendo os seus próprios resumos, objetivos específicos e referências bibliográficas, podendo, 9 desta forma, serem lidos em separado. Não obstante, a fim de reforçar a continuidade do texto como um todo, um item de contextualização (apresentação) foi acrescido em cada capítulo, com o objetivo de ressaltar a inserção de cada capítulo no contexto da tese. Em consonância com a prática de uso intensivo e difundido da língua inglesa como meio de comunicação e divulgação, usual na comunidade científica das áreas de engenharia e tecnologia, e respeitadas as normas do PEI-UFBA, os capítulos que apresentam os principais resultados e contribuições novos são apresentados em língua inglesa, a fim de que se possa permitir um maior impacto e um acesso mais amplo à comunidade científica internacional. Por outro lado, a fim de garantir um entendimento mínimo em língua portuguesa, todos os itens chave de cada capítulo, quais sejam, apresentação, resumo e conclusões, são também exibidos em língua portuguesa. Procedimento análogo, em relação à língua inglesa, foi adotado nos capítulos cujos textos principais estão escritos em língua portuguesa. Além disso, também buscando aderência com as normas científicas internacionais, é adotada a convenção de utilização do ponto como separador decimal, ao invés da vírgula. Cada capítulo descreve e representa uma etapa do trabalho, seja esta mais voltada ao desenvolvimento e aplicação de uma proposta ou simplesmente à consolidação preliminar de conceitos e conclusões, tendo-se necessariamente o cuidado de destacar a devida integração entre todas estas etapas. O capítulo 2 apresenta a definição do tipo de LED a ser escolhido para a aplicação desejada, com base na análise de suas características. Esta análise crítica foi importante para o entendimento do potencial da tecnologia que está sendo adotada e das vantagens e desvantagens dos produtos disponíveis no 10 mercado durante a análise. Vale salientar que o mercado dos LEDs está em crescimento constante, inclusive com o desenvolvimento de novos produtos. O capítulo 3 exemplifica, como um primeiro desenvolvimento, a utilização da lógica fuzzy para controlar o AFS. Esta etapa foi importante para a constatação do potencial de aplicação da lógica fuzzy sobre o sistema em estudo, verificando-se, inclusive, a importância do conhecimento das necessidades do especialista (motorista) para o desenvolvimento de um modelo. Os primeiros testes mostraram a possibilidade de um ganho de luz significativo tornando a locomoção à noite mais segura para o motorista e para o passageiro. Neste capítulo foram também levantados dados e informações que estabeleceram uma primeira heurística ou conjunto de regras para caracterizar quantitativamente os efeitos da velocidade e do raio de curvatura sobre a luminosidade total necessária para os LEDs. O conjunto de regras proposto foi modelado segundo estruturas fuzzy dos tipos 1 e 2. Os parâmetros no conseqüente das regras para os diversos modelos propostos foram estimados a partir dos dados coletados na pista de testes e alternativas de otimização incluindo restrições na intensidade mínima de luz fornecida pelo modelo foram testadas, aproximando o comportamento dos modelos ao desempenho de iluminação desejado. O capítulo 4 é uma extensão lógica do capítulo 3 e apresenta um comparativo entre os comportamentos dos motoristas de carros e caminhões. Uma pesquisa quantitativa sobre as necessidades de ambos os motoristas foi feita e, na mesma pista de testes, foram medidos os dados de um carro e de um caminhão com um equipamento chamado VBOX, que adquire a posição e a velocidade do veículo em cada segundo. Neste capítulo é ressaltada e 11 comprovada a necessidade de um modelo específico para o controle da iluminação veicular no caminhão. A pesquisa foi importante para destacar pontos importantes em relação à iluminação veicular, como as necessidades dos motoristas de caminhão e a falta de visibilidade nas estradas brasileiras. O capítulo 5 apresenta a parte experimental do trabalho, que utilizou dados, informações e resultados contidos nos capítulos anteriores, sobretudo com relação aos modelos fuzzy desenvolvidos. Neste sentido, foi desenvolvido um protótipo adotando o melhor LED de alta potência para esta aplicação, e código em VB (Visual Basic) para simular o conjunto de regras fuzzy em teste de bancada. Por fim, o capítulo 6 destaca os resultados obtidos ao longo do trabalho e as oportunidades que foram geradas para futuros trabalhos nesta linha de pesquisa. O apêndice A detalha o depósito de patente e as suas reivindicações, referentes ao trabalho desenvolvido. Nomenclatura AFS sistema dianteiro adaptativo de iluminação ECE Comissão Econômica Européia LED diodo emissor de luz SAE sociedade de engenheiros automotivos CONTRAN Conselho Nacional de Trânsito DENATRAN Departamento Nacional de Transito UNECE Comissão Econômica das Nações Unidas para a Europa 12 Referências Denatran, 2008. http://www.denatran.gov.br/resolucoes.htm. Lukacs, L., 2006. The Impact of automotive design in the performance of exterior vehicle lighting, SAE Technical Paper Series, No. 2006-01-2789. Lukacs, L., 2007. The impact of adopting lighting technologies on emerging markets, ISAL 2007 proceedings, Darmstadt, Germany. Lukacs, L., Simões, L., Pepe, I., Embiruçu, M., 2007. Impact of adopting Fuzzy logic to control an LED AFS (adaptive front-lighting system), SAE Technical Paper Series, No. 2007-01-2784. Neumann, R., 2006. LED front lighting – optical concepts, styling opportunities and consumer expectations, SAE Technical Paper Series, No. 2006-010100. UNECE, 2008. http://www.unece.org/trans/main/wp29/wp29regs41-60.html. 13 Capítulo 2 Estudo comparativo entre os LEDs: Golden Dragon (Osram), K1 e K2 (Lumileds) Apresentação Este capítulo tem por objetivo definir qual o LED de alta potência e alta eficiência que será utilizado como fonte de energia pra o modelo do AFS a ser desenvolvido. Será feito um comparativo entre os três LEDs escolhidos a fim de determinar o comportamento deste dispositivo e a sua adequação à aplicação objetivada, ou seja, responder às demandas e exigências do sistema adaptativo de iluminação veicular (AFS). No capítulo anterior foram feitas a introdução e a definição do trabalho a ser desenvolvido. O capítulo 3 será a continuação do desenvolvimento, partindo para o entendimento do modelo que será adotado para controlar os LEDs do sistema AFS. Ainda neste capítulo será demonstrada a melhor alternativa de lógica funcional a ser adotada, nomeadas tipo 1 ou tipo 2, com base nos dados que foram obtidos durante as simulações realizadas no MATLAB. Resumo O processo de emissão de luz, numa pastilha de semicondutor, pela aplicação de uma corrente elétrica é chamado eletroluminescência. A eletroluminescência nos diodos emissores de luz (LEDs) tem lugar quando, em uma junção P-N diretamente polarizada, ocorrem recombinações entre os elétrons do lado N, que acabaram de ultrapassar a junção, com as lacunas do 14 lado P. Até o inicio dos anos 90, LEDs eram considerados fontes de energia de baixo rendimento. Atualmente, aplicações automotivas com LEDs brancos baseados em fluoróforos, com alto brilho, alta potencia e alta eficiência energética, são extremamente promissoras, em especial em veículos e em maquinários. A união entre geração eficiente de luz, longa vida útil e o fato de que estes dispositivos continuam tendo o seu desempenho melhorado a cada dia, faz do LED a fonte de luz do futuro. Neste capítulo, três tipos de LEDs, de dois fabricantes diferentes, foram estudados: "Luxeon" e "K2" da Lumileds e o "Golden Dragon" da Osram. Palavras-chave: LEDs de alta potência, automotivo, LEDs, desempenho Conclusão No estudo comparativo entre os LEDs de alta eficiência, alta potencia da OSRAM e Lumileds foram observadas algumas diferenças no comportamento destes dispositivos. Os primeiros LEDs estudados foram: Golden Dragon, K1 e K2. Para o K2 a curva de acomodação entre o regime transiente e o regime estacionário só pode ser ajustada por duas exponenciais (dois tempos de vida), enquanto a resposta do Golden Dragon pode ser ajustada por uma única exponencial decrescente. Tanto o LED Golden Dragon quanto o K1 seguem apenas uma exponencial da intensidade em função do tempo. É importante salientar que o aparecimento de um decaimento da intensidade na forma de uma dupla exponencial em função do tempo cria certas restrições para o uso do K2 em regime contínuo. Entretanto, uma análise mais detalhada da situação mostra que isso não impossibilita o uso deste dispositivo em outras aplicações automotivas. Para um sistema dianteiro 15 adaptativo de iluminação (AFS, Adaptive Front lighting System) com LEDs, a melhor alternativa é o Golden Dragon. Esta escolha justifica-se inclusive pelo fato de que em muitas arquiteturas o controle de potência dos LEDs é feito por modulação de largura de pulso, com pulsos muito mais curtos do que o tempo de vida do decaimento mais rápido. 16 Chapter 2 Comparison study among LEDs: Golden Dragon (Osram), K1 e K2 (Lumileds) Opening statement This chapter highlights which high power LED (high efficient) should be chosen as the light source for the AFS model to be developed. A study will be performed to compare 3 LEDs to define which one has the best performance to this application and fulfills all needs for an adaptive front lighting system (AFS). On the previous chapter, the opening statements and the definition of the work that will be developed were presented. Chapter 3 will be the continuation of this work, seeking the understanding of which model will be adopted to control the LED AFS system. Chapter 3 will also show the best functional logic alternative to be chosen, called type 1 or type 2, based on the data that was obtained during the simulations held with MATLAB. Abstract The electroluminescence, a process where light is emitted by the recombination of electrically accelerating charges (electrons and holes) on a solid state chip, is the basis of light-emitting-diodes (LEDs) technology. Until the early 90s, LEDs were considered light sources of low efficiency. Nowadays, white high power, high efficiency LED’s, based upon fluorophores are extremely promising for both vehicular / automotive and machinery usages. Associate with 17 its high efficient light production, the long life capability of these devices keep improving their performance. In this study, three models of LEDs, from two manufacturers were used: "Luxeon" and "K2" from Lumileds and "Golden Dragon" from Osram. Keywords: high power leds, automotive, LEDs, performance 18 2.1 Introduction The lighting emission process, on a solid state semiconductor, using an electric current (from an electrical power supply) is called electroluminescence. The electroluminescence in the light emitting diode (LEDs) occurs when through a P-N junction directly polarized, recombination between the electrons from the N side takes place, from those electrons which surpassed the junction, with the holes available in the P side. This recombination demands that the energy acquired by the accelerated charges (electron and hole) needs to be lost again. This energy loss can occur in two ways: through a non radioactive process by phonons emission; heating the crystal semiconductor or through photons relaxation by light emissions (Resende, 1996). In silicon and germanium LEDs, the larger amount of energy is dissipated through heat, the amount of light being emitted is insignificant and that is why in the mid 50’s it was not possible describe the LEDs as an efficient light source. However, in other materials that were either discovered or combined in the mid 90’s, such as the gallium arsenide (GaAs), gallium phosphorus (GaP), gallium nitride (GaN), indium gallium nitride (InGaN) among others, the electroluminescence process is very efficient and the amount of photons emitted is sufficient for LEDs to become an excellent light source (Levinshtein et al, 2001). During almost three decades, LEDs were associated with lightning pilot bulbs, assembled on the instrument panels serving as status displaying, limited to red, yellow and green. In 1993, a Japanese company, Nichia Chemical, started the production of blue LEDs, combining red, green and blue to produce 19 white light. This was a breakthrough discovery, and started a complete new field of research regarding this technology (Nakamura, 1996). In parallel to the Nichia technology, there were also developments regarding blue and violet LEDs, which allowed the production on white light, based upon the insertion of a fluorescent substance. These devices are based on the Sttokes shift, where the substances absorb small wavelengths (blue and violet) and emit light in longer wavelengths such as green, yellow and/or red. Regarding this, it is strategic to highlight that it is different from fluorescent materials that are bright in the dark. Fluorescent materials will not emit when the light is no longer available (Kittel, 2004). The white light LED application, based upon fluorophores, seems to be promising regarding not only the public and residential applications, but also vehicle illumination and equipment in general (Nakamura, 1996; Zukauskas et al, 2002; Takahashi et al, 2007). The benefits of high performance linked with a long life span (at least 25 times more than a conventional bulb and 10 times more than a discharge gas lamp) make this an excellent alternative for future developments. In addition, there is also a consensus regarding the new semiconductor materials, which through the improvements on the internal structures of this high power LEDs, will cause a huge growth in this technology in the next decade, particularly in the light output of the device (Wördenweber et al, 2007). In this study, there will be a comparison of the light output through time among three commercial LEDs. 20 2.2 Experimental study Figure 2.1 presents the experimental device developed to measure the light intensity from commercial LEDs. To ensure the robustness and repeatability to this set up, an optic rail (granite & aluminum) was used, that served as the base to attach the different elements used during measuring. In this rail there are three different apparatus attached: the LED that will be tested, the aluminum LED heat sinker and a MLM 1332 photometer from Minipa, with an analogical output that supplies a tension proportional to the light intensity. Connected to the photometer output there is a digital multimeter with an RS232 port, allowing connection and automatically data taking by a personal computer (PC). Figure 2.1: Experimental device: 1) LED under analysis, 2) heat sinker, 3a and 3b) photometer, 4) aluminum and granite optic rail, 5) constant current supply, 6) multimeter with serial output, 7) PC. 21 2.3 Method and materials The measurements were performed with 3 different LEDs from 1.5 to 3.5 W, K1 and K2 from Lumileds and Golden Dragon from OSRAM were the chosen ones. Initially, the LED to be measured was already assembled to the heat sinker; is precisely positioned in a pre-determined position in the granite rail. The distance between the LED external surface and the photometer is 60 mm. This distance was kept constant through the entire process of data acquiring. The axis that crosses the center of the LED and the center of the photometer is defined as Z, while the perpendicular axis which is tangent to the external LED surface is called Y (Figure 2.2). The alignment in relation to the Y axis is done manually, pursuing the maximum photometer illumination. The next step, once the LED is already positioned related to Z, is to light it and move it parallel to the Y axis in order to maximize the light collection. This procedure was necessary due to the fact that glueing the LED to the heat sinker ensures a perfect centralization of this element. That is why the aluminum dissipator cannot be used as a reference during the LED positioning phase, as well as the LED external package. 22 Figure 2.2: Details from the set up: 1) aluminum rail, 2) positioning platform, 3) LED assembled to the aluminum heat dissipater, 4) photometer. The distance d is 60 mm. The LED light emission intensity data was acquired adopting the following methodology: • A PC based program acquires the data, with three measurements per second rate, from a digital multimeter connected to its serial port. RS232 protocol is used as the communication link between the PC and multimeter. This program was written using BASIC (Russo e Echols, 1999); • Initially the LED is off, the program is initiated and only after 15 seconds the current power supply is turned on, which ignites the LED. Following this procedure, two operational details must be guaranteed: first, the acquiring system must be stable, when the LED is on; and second, a synchronizing circuit (trigger) must not be necessary to ensure that the 23 LED has been turned on. The sequence of how the data was obtained can be seen in Figure 2.2. This photodiode light observation procedure enables the study, not only of the LED stationary regime, but also of the initial part of the process, characterizing the transient. 2.4 Results Emitted light intensity data from three different LEDs ((K1) and (K2) from Lumileds; (Golden Dragon from Osram) as a function of time is presented on Figure 2.3. It shows that, in all cases, the transient regime is well defined, which is more perceived in the K2 LED. 35000 Light Intensity (arb. units) 30000 K2 Osram 25000 K1 20000 15000 10000 5000 0 0 15 30 45 60 75 90 105 120 135 150 Time (s) Figure 2.3: Emitted light intensity generated by 3 different LEDs ((K1) and (K2) Lumileds; (Golden Dragon from Osram) over time. 24 In order to better analyze the accommodation period of the light output, the initial part of the data acquired (first 15 s) was not taken into consideration. In this stage, the LEDs are off. Removing the initial instants from the curves on Figure 2.3 and subtracting a constant value of 10 from the offset (Figures 2.4, 2.5 and 2.7), one can view the output intensity behavior of each LED. The first LEDs studied were the Golden Dragon and K2, as shown on Figures 2.4 and 2.5. The curve for the Golden Dragon data can be adjusted by one decreasing exponential, while the K2 needs two exponentials, with two accommodation lifetimes. Table 2.1 presents the fitting parameter for the three LEDs accommodation lifetimes. Particularly, on the K1 case, this device was compared with the K2 since both of them have the same internal construction and belong to the same manufacturer. Table 2.1: Emitted light intensity accommodation period from a high Power LED Accommodation period t1 (s) Accommodation period t2 (s) Osram Golden Dragon 3.414 +/- 0.025 Lumileds K2 Lumileds K1 4.661 +/- 0.059 5.020 +/- 0.090 - 42.991 +/- 0.498 45.400 +/- 1.900 25 0.250 Osram Golden Dragon Intensity (arb. units) 0.248 0.246 0.244 0.242 t1 =(3,4136 +/- 0,02478) (s) 0.240 0.238 0 20 40 60 80 100 120 140 160 Tim e (s) Figure 2.4: Emitted light intensity response curve time related (OSRAM Golden Dragon). In red, the experimental point adjustment through a single decreasing exponential. 0.34 K2 t1 = 4,66064 +/- 0,05934 (s) intensity (arb. units) 0.32 0.30 0.28 t2 = 42,99084 +/- 0,49795 (s) 0.26 0.24 0 20 40 60 80 100 120 140 Time (s) Figure 2.5: Emitted light intensity response curve time related (Lumileds K2). In blue, the experimental point adjustment through a double decreasing exponential. 26 When comparing the curves on Figures 2.4 and 2.5, the conclusion is that the OSRAM Golden Dragon LED has a simpler stabilization profile through time, with a first order system behavior. Soon after the overshoot in the signal, during the LED polarization, the system shows certain stability (3.414 s) and stays permanent on regime. On the other hand, the Lumileds K2 LED presents a more complex light output profile through time, since after a quick accommodation (4.661s), which is slower than the Golden Dragon, this device continues to lose its light intensity progressively. Formally speaking, K2 will only have one light output, considerably stable, after approximately 7 lifetimes (300 seconds). It is important to highlight that the K2 was presented to the market as a high power light output, with innumerous potential applications. With the domestic public and even automotive application, the K2 (LXK2-PW12-S00) is driven up by 1 A (ampere) and promises a 100-lumen flux output. This is compared to the 350 mA applied to the OSRAM Golden Dragon (ZW W5SGJZ), which generates 70 lumens of light. On the present study, the comparison to be taken into consideration is that almost 33,000 lux are generated by the K2 at 60 mm from the photometer surface in relation to the 25,000 lux that are generated by the Golden Dragon at the same distance. However, this 35% difference between them only lasts some milliseconds, changing right after the polarization period for both devices. After this initial period, this difference decreases, as shown in Figure 2.6. In this figure, the experimental points were obtained through the ratio of the light output through time from K2 and Golden Dragon as well. In less than 150 seconds of functionally, the difference is reduced to 5 %, while the energy 27 balance remains at the 300% level, very much in disfavor of the Lumileds product. Relative Intsnsity K2/GoldenDragon 1.35 1.30 1.25 1.20 1.15 1.10 1.05 0 20 40 60 80 100 120 140 Time (s) Figure 2.6: Ratio between light supplied by LED K2 in relation to the light supplied by LED Golden Dragon over time. 28 0.227 t1 = (5.02 +/- 0.09) s Intensity (arb. units) 0.226 0.225 0.224 t2 = (45.4 +/- 1.9) s 0.223 K1 0.222 0 50 100 150 200 250 Time (s) Figure 2.7: Light intensity curve as a function of the time related (Lumileds K1). In blue, the experimental point adjustment through a double decreasing exponential. Figure 2.8, supplied by the K2 manufacturer (Lumileds, 2007), presents the interdependence between the junction temperature and light output generated by the LED. Adopting as a temperature reference 22 0C, and a constant temperature inside the laboratory where the measurements were taken, a 30% loss of performance could only be explained if the junction temperature would be higher than 150 0C in less than 2.5 minutes, the total time used to acquire the data. 29 Figure 2.8: Lumileds LED relative light output versus junction temperature (Lumileds,2007). Regarding the heat evacuation ceramics in which the LEDs are assembled and associated with the aluminum heat sinker weight of approximately 100 g, the total energy (E) given to the ensemble is equal to the electric power multiplied by time Q= 490 Joule. As the aluminum specific heat is Cal = 0.9 J/g 0C, in a system without losses, where all the energy would be converted into heat, the ensemble temperature should be Tf = (Q+ Cal·m·Ti) / (Cal·m) 0C, which results in Tf = 30.4 0C when evaluated. It is hard to assume, under reasonable thermodynamic conditions, that the junction temperature can be 140 0C, since the heat sinker stays at 40 0C. The rise of the junction temperature explanation is more unlikely when compared with the K1 data results. This device works with one third of the K2 power consumption, but presents the same behavior regarding the two exponentials. In addition to that, its second life time component is compatible within less than one sigma from the results found on the K2. 30 Still, while trying to decipher the K2 behavior, there were additional measurements done with different polarized currents, which in principle should determine different temperatures on the LED junction. In Figure 2.9 one can see that the behavior is similar, and despite different polarization currents applied, the K2 accommodation profile is still the same. 0.35 Light Intensity (arb. units) 0.30 1000mA 0.25 700mA 0.20 500mA 0.15 350mA 300mA 250mA 0.10 0.05 K2 0.00 -0.05 -20 0 20 40 60 80 100 120 140 160 Time (s) Figure 2.9: K2 light intensity over time with different polarized current. Applying the same kind of analysis on the data in Figure 2.9, adjusting the experimental points to two decreasing exponentials; it is possible to establish a second life time accommodation light output profile from the K2 LED in relation to the polarization current. Figure 2.10 shows results of this analysis. 31 45 40 Stabilization time (s) 35 30 25 20 15 10 5 0 200 400 600 800 1000 K2 foward current (mA) Figure 2.10: Second life cycle for K2 LED light output profile accommodation timing in relation to the polarization current of the device. 2.5 Conclusion In this chapter, the comparison among high power, high efficiency LEDs from OSRAM and Lumileds has shown some differences between the behaviors of the devices. Three LEDs were tested: Golden Dragon, K1 and K2. The major difference is perceived on the K2, since the Golden Dragon light output versus time curve can be adjusted by a single decreasing exponential and K2 can only be described by a double exponential decay with two accommodation periods. Both K1 and Golden Dragon have only one exponential through time. It is of utmost importance to highlight that this singular behavior can be the deciding factor not to adopt this LED for continuous powering application, but the K2 remains a possible candidate for other automotive applications. For an AFS application, the Golden Dragon is the best alternative. This is justified 32 since for many architectures the power LED control is done through pulse width modulation, with a pulse width shorter than the most short decay time. References Kittel, C., 2004. Introduction to Solid State Physics, 8th Edition. Ed Wiley Interscience, NY, USA. Levinshtein, M., Rumyantsev, S., Shur, M., 2001. Properties of Advanced Semiconductor Materials: GaN, AIN, InN, BN, SiC, SiGe, Wiley-Interscience, USA. Lumileds datasheet, 2007. -- http://www.lumileds.com/pdfs/DS51.pdf. Nakamura, S., 1996. High-brightness blue/green LEDs and first III-V nitridebased laser diodes, Proc. SPIE Physics and Simulation of Optoelectronic Devices 2693, 43-56. Resende, S.,1996. A Física de Materiais e Dispositivos Eletrônicos, UPFE, Editora da UFPE. Russo, M., Echols, M. 1999. Automating Science and Engineering Laboratories with Visual Basic. Wiley Interscience, NY, USA. Takahashi, K., Yoshikawa, A., Sandhu, A., 2007. Wide Bandgap Semiconductors: Fundamental Properties and Modern Photonic and Electronic Devices. Ed. Wiley, New York. Wördenweber, B., Wallaschek, J., Boyce, P., Donald D. Hoffman, D., 2007. Automotive Lighting and Human Vision, Springer Verlag, USA. Zukauskas, A., Shur, M., Caska, R., 2002. Introduction to Solid-State Lighting, Wiley Interscience, NY, USA. 33 Capítulo 3 Benefícios e desafios de controlar um AFS (Adaptive Front-lighting System, sistema adaptativo de iluminação veicular) a LEDs adotando a lógica fuzzy Apresentação Com base na definição e nas características do tipo de LED adotado neste trabalho, e discutido no capítulo anterior, neste capítulo são desenvolvidos e analisados modelos baseados em lógica fuzzy para o controle de um sistema adaptativo de iluminação veicular dianteira a LEDs. É importante salientar que o termo adaptativo é aplicado aqui ao fato do modelo se adaptar às necessidades do motorista, e não de ser um modelo que sofre uma mutação ou alteração conforme o seu aprendizado. O conjunto de regras, as condições de contorno (pista de testes), o conhecimento do especialista, a estrutura fuzzy adotada (tipos 1 e 2), as variáveis de entrada e as respectivas funções de pertinência são apresentados e discutidos juntamente com os resultados, evidenciando-se o desempenho dos modelos desenvolvidos no controle da intensidade de iluminação dos LEDs, de acordo com a velocidade do veículo e o raio de curvatura da rodovia. O problema de controle compreende a determinação de um valor satisfatório de quantidade de iluminação, a ser promovida através dos LEDs, que deverá ser determinado continuamente em função das medições do raio da curvatura e da velocidade do veículo. Neste sentido, foram desenvolvidos modelos 34 ou sistemas de inferência fuzzy segundo Takagi-Sugeno (Liang and Mendel, 2000; Mendel, 2001), tendo-se o raio da curvatura da pista e a velocidade do veículo como entradas (nos antecedentes das regras) e a corrente elétrica total para os LEDs como saída, com o consequente aumento do número de LEDs acesos, e portanto do nível de iluminação. Foram testados diferentes estruturas para os conseqüentes no âmbito das alternativas oferecidas pelas lógicas fuzzy dos tipos 1 e 2. Um conjunto de regras original foi gerado com base no conhecimento de um especialista e este conjunto serviu como estimativa inicial para o ajuste dos parâmetros dos modelos fuzzy propostos através de um procedimento de minimização dos erros entre a predição do modelo e a resposta do especialista. Os resultados demonstraram o potencial da metodologia proposta e a sua viabilidade para o controle da iluminação, proporcionado uma direção noturna com mais segurança de acordo com as necessidades do motorista e do mercado. Este capítulo está plenamente contextualizado neste trabalho de tese. Em primeiro lugar, o desenvolvimento e os resultados contribuíram para definir o modelo adequado para controlar os LEDs do sistema AFS, demonstrando, neste caso, qual a melhor alternativa de lógica fuzzy a ser implementada (tipo 1 ou tipo 2). Em segundo lugar, este capítulo representa uma extensão racional do anterior onde foi apresentada a definição e a caracterização do tipo de LED de alta potência. Além disso, este capítulo oferece as bases metodológicas para o desenvolvimento de modelos semelhantes para aplicação na iluminação veicular de caminhões, assunto este abordado no próximo capítulo onde são também discutidos e apresentados os resultados e a análise de uma pesquisa quantitativa que auxilia na caracterização do comportamento e das necessidades de 35 motoristas (carro e caminhão) em relação aos efeitos do meio ambiente e das estradas sobre a definição da melhor condição de iluminação noturna. Resumo A iluminação veicular tem tido, nas ultimas décadas, avanços tecnológicos expressivos como o uso de diodos emissores de luz (LED, Light Emitting Diode) em sistemas adaptativos de iluminação veicular dianteira (AFS, Adaptive Frontlighting System), que representam uma grande inovação tecnológica na indústria mundial no viés da iluminação veicular. Este capítulo apresenta alternativas de controlar um sistema AFS utilizando modelos fuzzy (tipos 1 e 2) para determinar os parâmetros de trabalho, levando em consideração não só as necessidades do motorista, mas também as condições das estradas no estado de São Paulo (Brasil). A lógica fuzzy é uma conhecida extensão da lógica booleana que permite o tratamento de incertezas na informação através da definição de funções de pertinência com valores entre "totalmente verdadeiro" e "totalmente falso". Esta técnica, ou estratégia de modelação, é particularmente importante quando uma decisão de vários parâmetros necessita ser feita ou quando as decisões são baseadas no conhecimento humano. Os resultados demonstram o potencial da metodologia proposta e sua pertinência para o controle de iluminação, proporcionado uma direção noturna com mais segurança, de acordo com as necessidades do motorista e do mercado. Palavras-chave: lógica fuzzy, AFS, LED, controle, iluminação 36 Conclusão Este capítulo descreve o desenvolvimento da aplicação do sistema baseado nas regras fuzzy, para modelar e prever a quantidade de luz a ser adicionada ao motorista durante o período de direção noturna. O modelo proposto engloba uma combinação entre a experiência do especialista e o processo de estipulação dos dados que permitem o ajuste do modelo final de cada regra, considerando as diferentes estruturas para fuzzy do tipo 1 e do tipo 2. Mais especificamente, o julgamento do especialista pode ser apropriadamente incorporado à base de regras fuzzy de acordo com o seu conhecimento em relação à direção noturna e às condições do meio ambiente. Este modelo, apesar de ter sido desenvolvido com dados retirados de uma pista de testes, pode ser adotado para quaisquer condições de rua e meio ambiente, como avenidas, estradas e o trânsito nas cidades, para mencionar alguns exemplos. A Figura 3.8(b) demonstra a superfície modelada que apresenta o aumento de corrente quando as curvas e velocidades diminuem e a diminuição de corrente quando as curvas e velocidade aumentam. Também destaca uma superfície mais suave quando esta é comparada ao modelo 2, especialmente perto do raio de 60 metros de curvatura, onde observa-se uma ruptura abrupta criada pela flutuação do modelo. Nesta área em especifico, perto dos 60 metros, é muito importante existir uma superfície suave, devido ao fato que a percepção visual é obtida nas extremidades das curvas, ajudando o motorista à noite. Alguns modelos são adequados para a aplicação prática, entretanto a melhor alternativa é o modelo 4 que considera uma restrição que garante o conhecimento do especialista da melhor forma. Estes modelos têm respostas de 37 saída similares ás do especialista, realçando e reiterando a importância de oferecer uma dirigibilidade noturna mais segura, fornecendo mais luz para o motorista. Apesar destas soluções não fornecerem o menor erro quadrático, elas permitem que o motorista enxergue mais à noite, devido ao fato de oferecerem praticamente a mesma quantidade de corrente que o especialista preconiza. A idéia é que o especialista tem um profundo entendimento das necessidades do motorista devido ao seu conhecimento e à sua experiência. Finalmente, é importante destacar que o uso dos LEDs é justificado devido a certas vantagens que eles têm quando comparado com o sistema halogeno. Não apenas em relação a uma vida útil maior, um consumo de energia menor e uma temperatura de cor melhor, para mencionar algumas, mas também em relação às tendências de projeto e aparência em torno deste conceito. Investigações adicionais no futuro serão perseguidas para melhorar o algoritmo e o sistema. Além disso, demonstra-se que as novas tecnologias podem melhorar não só a aparência veicular, mas também o desempenho geral do sistema de iluminação. 38 Chapter 3 Benefits and challenges of controlling a LED AFS (Adaptive Front-lighting System) using fuzzy logic Opening Statement Based on the definition and characteristics of the chosen LEDs in this study, and already discussed in previous chapter, this chapter develops and analyzes the models based on fuzzy logic to control an LED AFS system. The rules, road conditions (test track), specialist knowledge, fuzzy type-1 and type-2 structures, input data and the pertinence functions associated are presented and discussed with the results, highlighting the model performance taking into consideration the lighting intensity of the LEDs according to the vehicle’s speed and road curvature. The controlling issue embraces the definition of a suitable value of the amount of light to be provided by the LEDs in which should be determined in a continuous pattern taking the functions that correspond to the measured radius and vehicle speed. In order to achieve this, models or fuzzy systems were developed according to Takagi-Sugeno (Liang and Mendel, 2000; Mendel, 2001) adopting the track curvature’s radius and vehicle’s speed as inputs (antecedents rules) and the total LED current as the output, as a result the number of lit LEDs and the increase of illumination. Different structures were tested regarding the consequents within the available alternatives for fuzzy type-1 and type-2. An original set of rules was created based upon the specialist’ knowledge and this set was adopted as a starting point to adjust the proposed fuzzy models according to a procedure which 39 seeks the small quadratic error between the calculated model and the specialist’s response. The results have shown the potential of the proposed methodology and its viability to control the illumination, providing a safer nighttime driving fulfilling the driver and market needs. This chapter is fully aligned with the thesis’ work. First, the development and results obtained contributed to define the more adequate model to control the LED AFS system, showing, in particular, the best alternative for the fuzzy logic to be implemented (type-1 or type-2). Also, this chapter embraces a rational extension of the previous chapter in which the high power LED definition and characterization was presented. Moreover, this chapter also presents the basis of the methodology to develop similar models which will be applicable to heavy trucks lighting developments. This subject will be discussed in the next chapter together with the analysis of a quantitative survey which supports the characterization of the driver’s behavior (car and truck) taking into consideration the environmental and road conditions to define the best night time driving scenario. Abstract The vehicular illumination system has had, in the past decades, expressive technological advances such as the use of a Light Emitting Diode (LED) Adaptive Front-lighting System (AFS), which represents an industry breakthrough in lighting technology and is rapidly becoming one of the most important innovative technologies around the world in the lighting community. This chapter presents 40 AFS control alternatives using fuzzy logic (types 1 and 2) to determine its operating parameters taking into consideration both the driver’s and road conditions from the state of São Paulo (Brazil). Fuzzy logic is a well-known extension of the conventional (Boolean) logic that enables the treatment of uncertainty presented in the information through the definition of intermediary membership values between the "completely true" and the "completely false". This technique or modeling strategy is particularly important when a multi-parameter decision must be taken or the decisions are based on the human knowledge. The results show the potentiality of the methodology proposed and its suitability for light control, providing a safer nighttime drive more safe according to the driver’s and market needs. Keywords: fuzzy logic, AFS, LED, control, lighting 41 3.1 Introduction The car lighting system of the car market today is still based on the halogen system as shown in Table 3.1, which also foresees that halogen will predominate for the next 5 years (Stern, 2008). Table 3.1: Global market prevalence of halogen headlamps, 2007-2013 (fleet percentage) Prevalence 2007 2008 2009 2010 2011 2012 2013 84 84 83 83 80 79 77 Source: just-auto, industry estimates (Just Auto, 2007) Despite the appearance of steerable auxiliary headlamps in the 1940s and steerable main headlamps in the 1960s, regulations worldwide have for many years required that all vehicle headlamps have to remain laterally rigidly mounted. This is no longer the case, as AFSs have changed that paradigm radically and are being developed and deployed globally at an unprecedentedly rapid pace (Neumann, 2004). All low-beam light distributions have long been asymmetrically biased to control glare, at the expense of seeing distance through curves and turns. The basic AFS function, called bending light, swivels the headlamp beams (or optically shifts light within the beam) in response to the driver’s steering wheel movements and/or input from an onboard gyroscope. Bending light significantly increases the 42 distance reach of the low beam in curves, without increased glare to oncoming traffic (Ishiguro and Yamada, 2004). The AFS approach that has gathered the most commercial interest is curve lighting. It involves, in some embodiments, only horizontal or vertical displacements of a given base beam pattern. Specifically, in these embodiments, curve lighting (also called bending or swiveling light) involves controlling the horizontal aim of the beam pattern (or a part of it), depending on variables such as the radius of the curve and the speed of the vehicle. There are several possible strategies for implementing curved lighting, including moving both lamps in tandem, moving both lamps but each to a different extent, moving only one of the lamps, moving lamps differentially on left and right curves, or energizing additional lamps (Hamm, 2002; Hogrefe, 2000; Reich and Rummel, 2001). Globally there is a huge increase for the introduction of LEDs due to the fact of low current consumption and long mean time between failures (high MTBF). A HID (high-intensity discharge) headlamp burners produce between 2,800 and 3,500 lumens from between 35 and 38 watts of electrical power, while halogen filament headlamp bulbs produce between 700 and 2,100 lumens from between 40 and 72 watts at 12.8 V (UNECE, 2008). The first series-production LED headlamps were factory-installed on the Lexus LS 600h / LS 600h L starting with the 2008 models. Low beam, front position light and sidemarker are performed by LEDs; high beam and turn signal functions use filament bulbs. The headlamp is supplied by Koito. Full-LED headlamps supplied by AL-Automotive Lighting were fitted on the 2008 V10 Audi R8 sports car except in North America. The Hella headlamps on the 2009 Cadillac Escalade Platinum became the first U.S. market all-LED 43 headlamps. Present designs give performance between halogen and HID headlamps (Hella, 2009), with system power consumption slightly lower than other headlamps, longer life spans and more flexible design possibilities (Hella, 2009; AL, 2009). As LED technology continues to evolve, the performance of LED headlamps is predicted to improve to approach, meet, and perhaps one day surpass that of HID headlamps. The application of LED technology significantly contributes to the avoidance of CO2 emission and the reduction of fuel consumption. This aspect especially gains importance with the implementation of daytime running light (DRL). DRL with LED needs 14W of energy, whereas the use of conventional vehicle lighting at day (low beam, rear lights, position lights) consumes 300W (AL, 2009). Table 3.2 presents the trend for the LED implementation in some regions and it is important to mention that the emerging markets will grow in the next 5 years as well (Zukauskas et al., 2002; Stern, 2008). Table 3.2: Global market value by region for automotive LEDs, 2007-2013 (US$m) Region 2007 2008 2009 2010 2011 2012 2013 North America 123.7 126.6 128.7 130.1 134.3 136.6 137.5 Europe 116.0 119.7 122.6 126.3 128.2 134.7 143.1 Japan 75.6 76.9 78.3 79.2 81.0 81.2 83.2 Rest of world 7.7 7.7 7.9 8.0 8.2 8.3 8.4 Source: just-auto, industry estimates (Just Auto, 2007) 44 This table also shows a huge progress regarding the effectiveness and performance of white LEDs which is the state of the art for this application. In addition, being able to handle the thermal management is definitely one of the key challenges in automotive application due to its high temperature (Kittel, 2004; Levinshtein et al., 2001). The main purpose of this chapter is the development and application of a fuzzy algorithm system based upon the specialist expertise to control an array of LEDs. Simulation tests using real data of speed and curvature radius (geometric features of the track) show that the model provides an increase of light on the curves according to the road and driver’s need making nighttime driving safer (Gotoh and Aoki, 1996). This system adds light to the beam pattern which is different from the bending light approach which does not add light to the night drive, but swivels it. The aspects associated to the fuzzy modeling and its purpose are presented (section 3.2) as well as the device decision and controlling template (section 3.3). Some models based on the fuzzy logic (types 1 and 2) were developed and applied to the LED control. The rules were defined according to the specialist knowledge (section 3.4). The specialist, who is an expert in the automotive lighting field with more than 15 years of experience developing lighting systems in the auto industry, understands the environment (city, motorway and rural) and road conditions such as pedestrians, fog and rain, for example, in the region which is used in the model. As a reference, Schmocker et al. (2008) did a study regarding the fuzzy impact of traffic control on an urban area, as the expert knowledge will have a huge impact in this process of modeling the rules in order to optimize the traffic around the city. Here, the specialist will have the impact on 45 determining the initial model. Further in section 3.4, the model parameters (i.e., membership function parameters associated to the consequents of each rule) were estimated through the comparison between the specialist responses (desired responses) and the model results, using an amount of data related to the driver’s and road conditions of the South American target customer (Wördenweber et al., 2007). This procedure allowed the selection of parameter values that can provide optimized solutions, considering that the expert’s knowledge may not always involve practical rule-of-thumb guidelines concerning the appropriate estimation of these parameters. In sections 3.5 and 3.6 results and concluding remarks are presented and discussed, respectively. 3.2 Fuzzy knowledge base and membership functions Fuzzy logic is a superset of conventional (Boolean) logic that has been extended to handle the concept of partial truth - truth values between "completely true" and "completely false", particularly important when a multi-parameter decision must be taken (Bellman and Zadeh, 1970). The most important feature of fuzzy control is that its internal mathematical model is built-up directly through expertise from human reasoning which can be expressed by a set of heuristic rules which are quantified according to fuzzy set theory. In this sense, fuzzy control algorithms and fuzzy inference systems present many advantages (Altinten et al., 2003) such as simplicity, robustness, no need to find transfer functions, nonlinear behavior and adaptability. A type-1 fuzzy set is a generalization of a crisp set or zero-one membership function (Mendel, 2001). A crisp set A, denoted by µA(x), is such that: 46 1 if x ∈ A A = µ A (x ) = 0 if x ∉ A (1) A type-1 fuzzy set F is defined on a universe of discourse X (the range of possible values for the variable x) and its membership function, denoted by µF(x), takes on values in the interval [0, 1]. A membership function provides a measure of degree of similarity of an element in X to the fuzzy set F. The rules of a linguistic fuzzy model have the general form: If x is A then y is B (2) The proposition “x is A” is the antecedent of the rule, and the proposition “y is B” is the consequent. Variables x and y are linguistic ones defined as fuzzy sets on domains (universe of discourses) X and Y, respectively. Constants A and B are linguistic terms usually associated with meanings for the linguistic variables, such as “low temperature”, “high velocity”, etc. The rule base together with the database forms the knowledge base of the fuzzy system (Babuška and Verbruggen, 1996; Chen and Liu, 2004). The input-output mapping is accomplished by the fuzzy inference mechanism. The main approaches in this case are the Mamdani and Takagi-Sugeno-Kang (TSK) models (Liang and Mendel, 2000). The Mamdani model has fuzzy sets in the consequents, while in the TSK model the consequents are parametric models of the inputs (Mendel, 2001). The type-2 fuzzy logic was introduced by Zadeh (1975) as an extension of traditional fuzzy logic. Subsequently, several researchers presented and developed important contributions such as the works of Mizumoto and Tanaka (1976, 1981), Dubois and Prade (1978, 1979), Hisdal (1981) and Karnik and Mendel (1998, 2000). The origin of the type-2 fuzzy logic is related to the inability of the traditional 47 fuzzy logic to treat completely the uncertainty associated to the information (Mendel, 2003). In a type-1 fuzzy set, the membership grade of a variable x (x ∈ X, where X is the universe of discourse), is represented by µA(x), which is only a crisp number in [0, 1]. A type-2 fuzzy set à has a membership grade of x (x ∈ X) in à represented as µÃ(x) which is a type-1 fuzzy set in [0, 1]. Therefore, in a type-2 fuzzy set, an element of its domain does not have a single value as membership degree. The element is associated with another membership function (Karnik and Mendel, 1998) that represents the uncertainty related to the definition of the membership degree associated to a specific value of the linguistic variable x. A generic rule in a type-2 fuzzy model has the same form presented in (2). The differences between these techniques are centralized in the fuzzy sets definition. For the specific case of TSK model, the general structure for a type-2 fuzzy model comprises the use of type-2 fuzzy sets in the antecedents together with type-1 fuzzy sets to represent the consequent parameter. Therefore, these rules simultaneously account for uncertainty about antecedent membership functions and consequent parameter values (Mendel, 2001). Specifically, the first is usually associated with the situation on which more than one specialists suggest different membership functions for each one of the inputs (Hagras, 2004; Tahayori et al., 2006). Moreover, special cases occur when the antecedents are type-2 fuzzy sets but the consequents are crisp numbers and when both antecedents and consequents are type-1 fuzzy sets (Mendel, 2001). Despite the fact that type-1 fuzzy logic has been used in several production processes since the 1970s (Østergaard, 1977; King and Mamdani, 1977) and that 48 the fuzzy systems are universal function approximations (Sala et al., 2005), many areas of human knowledge have also used type-2 fuzzy inference systems (Li et al., 2006; Pareek and Kar, 2006; Ren et al., 2007; Mendoza et al., 2007; Thovutikul et al., 2007; Du and Zhu, 2006). As examples to be highlighted, there are several applications for fuzzy logic, in particular, fuzzy logic has been adopted to control traffic in the cities (Anderson et al., 1998; Niittymäki and Turunen, 2003; Kosonen, 2003). Anderson et al., describe the investigation made into the feasibility of optimizing a prototype fuzzy logic signal controller with respect to several criteria simultaneously. The controller's sensitivity to changes in the membership function parameters was demonstrated and it was not possible to minimize simultaneously even the limited set of performance measurements explored (travel times and emissions). These results indicated that a multiobjective genetic algorithm optimization technique is appropriate for further research. On the other hand, Niittymäki and Turunen (2003) main intention in their study is to tie fuzzy reasoning to many-valued logic framework. A Lukasiewicz many-valued logic similarity based fuzzy control algorithm is introduced and tested in three realistic traffic signal control systems. The results are compared to fuzzy control systems where the inference is based on standard Matlab Fuzzy Logic toobox's Mamdani-style system. The compared traffic signal control modes are signalized pedestrian crossing and multi-phase signal control with phase selection. As per Kosonen’s approach, a traffic signal control system based on real-time simulation, multi-agent control scheme, and fuzzy inference is presented. This system called HUTSIG is closely related to the microscopic traffic simulator HUTSIM, both have been developed by the Helsinki University of Technology. The HUTSIM simulation model 49 is used both for off-line evaluation of the signal control scheme and for on-line modeling of traffic situations during actual control. Indicators are derived from the simulation model as input to the control scheme. In the presented control technique, each signal operates individually as an agent, negotiating with other signals about the control strategy. Here the decision making of the agents is based on fuzzy inference that allows a combination of various aspects like fluency, economy, environment and safety. Nevertheless, it is important to highlight that so far, no one has adopted this fuzzy approach (type-1 or type-2) to control a LED AFS system. The examples mentioned adopt different approaches to the fuzzy implementation. 3.3 The lighting device and hardware proposed Throughout the entire automotive industry the lighting system has always had a very important role to play during its long history. In the past 50 years, vehicular lighting has achieved an important status due to its close relationship with enhancing passenger and vehicle security. Naturally, this interwoven scenario affects both the design studio and how the best technical solution can be aptly translated into the vehicle's "eyes", while maintaining the brand identity, a key aspect of every vehicle. Several technological advances have been introduced over the years, such as double beam systems (one for low and one for high beam displacements in the 1950s) and the introduction of xenon headlights in the 1970s. Although the xenon technology has been available for more than 20 years, it does not represent 20% 50 of the entire worldwide market because of its high cost and regulatory implications on Economic Commission for Europe (ECE) markets (auto leveling and washer system). In the late 1990s, the use of infrared technology, along with state-of-theart reflectors, has allowed the driver to experience a better night drive than he ever could before. Lately, many changes inside the lighting community have been implemented due to relatively cheaper technology, specific customer requests and higher market expectations. LEDs have been the "trend" pushed forward by design studios around the world, among others because it allows the studio to create a design trend around this concept (Nakamura, 1996). However, due to cost and heat management issues its overall performance has not yet reached the xenon headlights level (Neumann, 2006). When examining the actual trend within the technology and design perspective, it is very important to highlight the next generation of adaptive front lighting system (AFS), which features sequential LED lighting. The fashion in which the optics in this system has been designed to function together has not yet been seen or appreciated in the exterior lighting world. In addition to being a beautifully designed optical arrangement, the system also helps drivers take corners and curves more safely and consumes less energy while doing so due to the LED usage (Sivak et al., 2005). The system senses when the vehicle is approaching a curve and directs the row of LEDs to switch on sequentially. As the vehicle turns, the LEDs illuminate at a rate and intensity determined by the degree and speed of the turn. Electronic sensors analyze inputs from the steering wheel and the vehicle speed to determine how and when to illuminate the LEDs. The LEDs automatically switch off when the 51 road straightens out, but the main beam continues to illuminate the overall road. The system functionality is shown of Figure 3.1. The total amount of luminous flux is linearly correlated with the total current established by the fuzzy model. Each increment of 350 mA on the current lights totally one LED and a sequential pattern from one to five LEDs is followed comprising the LED array proposed. Regarding the algorithm, the TSK model was adopted and two variables are considered in the antecedents: the curve radius and the vehicle speed. The output of the fuzzy inference model establishes the light intensity (total electrical current) to be added to the array of LEDs. Assuming that the light intensity is distributed progressively through the LEDs, the definition of which LED will be lit is directly related to the total current value calculated by the model. Le d 5 400 Le d 4 320 Le d 3 240 Le d 2 160 Speed Fuzzy model Total electrical current Le d 1 80 350 700 Radius of the curve 1050 1400 1750 Total electrical current (mA) Figure 3.1: System block definition. 52 The Birdseye view is a great tool to highlight the improvement that can be obtained with the AFS. It shows the light distribution (width, length and intensity) on the road from the top view. On Figure 3.2, the light distribution is shown with its aperture and range. This is an existing headlamp low beam distribution with the incremental of light shown in yellow. The range is almost 150 meters and the aperture is 40 meters. Also the light intensity varies from red (more intense) to blue (less intense) and the homogeneity of this light distribution can be perceived through the color shift from red to blue. The result with AFS is more light, accurately placed, and, more importantly, light is being added (Figure 3.2) for more visibility during night time driving, not taken from one spot on the road and having it moved to another, as today's cornering systems do (Hara et al., 2001). Figure 3.2: Birdseye view and the improvement obtained with the AFS: the light (yellow) is added to the beam pattern. The concept that will be investigated in this study incorporates five LEDs which will be lit according to the fuzzy model incorporated in the device. 53 3.4 Methodology According to the previous section, the strategy adopted was to measure two signals, namely, the road curvature and vehicle speed, measured directly from the vehicle to determine the lighting level of each LED. For a vehicle with AFS, there is a strong relationship between these inputs and the luminous flux ratio (Hogrefe, 2000; Ishiguro and Yamada, 2004). On Table 3.3 one can find the measured data where there is a relation between these input variables with the luminous flux ratio. It shows that there is a significant interaction between low speed and wide curvatures. This data was acquired from a series of vehicle level evaluations at the Ford test track in Dearborn, Michigan. Particularly in these conditions, there is an improvement in the luminous flux ratio obtained in a vehicle when the comparison is made between the system with AFS and without AFS. Table 3.3: Improved illumination by AFS Road scenario and speed conditions Speed (km/h) Road curvature Luminous flux ratio Without AFS With AFS radius (m) 40 50 1 3.9 70 150 1 2.8 90 280 1 1.6 54 This study will analyze the impact of the implementation of fuzzy type 1 or 2 to control the AFS and compare with the specialist criteria. There are several methods to investigate the luminance and measurements on the road. For example, the quantity and the quality of road lighting can be analyzed and controlled with road surface luminance measurements. As a reference, the European standard for road lighting calculations EN 13201-3 (EN, 2003) describes methods for luminance calculations and measurements (Ekriasa et al., 2008). The evaluation of the fuzzy inference system was accomplished through the comparison between its prediction and the specialist response, using the measurements raised on the test track presented in Figure 3.3 (São Paulo, Brazil). This track reproduces several different driving conditions, varying speed and curves simulating the highway and city driving conditions. This test track represents the road condition and driver’s behavior. This data acquisition was possible due to the VBOX III device installed inside the vehicle. It features a powerful engine capable of providing 100 Hz update rate of all positioning parameters including velocity, heading and position (latitude and longitude). Velocity and heading data are calculated from Doppler shift in the positioning carrier signal to provide high accuracy. It allows the acquisition of fifty measurements per second, with each measurement comprising both speed and position (longitude and latitude). This approach enables precise information about the driver’s behavior before, during and after the curve entrance. The data was acquired from the test track during a 4 period lap, which represents approximately 1,000 seconds. 55 Figure 3.3: Test track. The fuzzy inference system comprises the vehicle’s speed (km/h) and curvature radius (m) as inputs and the output is the electric current applied to drive the array of LEDs. The universes of discourse adopted for the speed and the curvature radius were [0; 1000] and [0; 140], respectively, which incorporates all possible environment and velocity. In the simulation, a comprehensible representation of the system structure is adopted to investigate the model performance. Each input variable (linguistic variable) is featured by three fuzzy sets that represent three meanings or linguistic terms: small, medium and high. All the membership functions considered to represent these fuzzy sets are showed in Figure 4 and were proposed by the specialist. This is an initial approach that can be updated and increased or reduced if necessary, after the data analysis. Also, this model, although developed with data from a test track, is suitable for all road and environment circumstances, such as, freeways, highways and city traffic, to mention a few. 56 (a) (b) Figure 3.4: membership functions related to the radius (a) and to the speed (b). This work comprises the development and test of some models, structured according to type-1 and type-2 fuzzy logic, based on human specialist knowledge. This knowledge base is presented in Table 3.4 that shows a value for the electrical current to the LEDs, according to the specialist, for each possible combination between the input ranges also defined by the specialist. The combination between high speed (speed > 90 km/h) and small radius (radius < 50 m) was not considered due to the fact that this situation would imply in the crash of the vehicle. Figure 3.5 57 presents the output (current to LED), according to Table 3.4, for each input-output pair collected and showed in the Figure 3.4. The rules of Table 3.4 comprise a model that presents discontinuity in the output (current value) and does not have a parallel processing (only one rule will be active and will be considered for each set of values of speed and radius). The rules and values suggested by the specialist represent an effort to identify or quantify the ideal visual comfort for each situation. Figure 3.5: Surface generated from Table 4.4 data. The modeling of this problem using a fuzzy structure enables the obtainment of a model that provides continuous values for the electrical current and is also capable to consider the uncertainty associated to the definition of the membership grade of radius and speed values with relation to each range (set) defined by the specialist. 58 Table 4.4: Antecedents combination and desired output (specialist) # Rules for the antecedents Current to LEDs (mA) (specialist) 1 If speed < 40 km/h and radius < 50 m 1,750 2 If speed < 40 km/h and 50 m < radius < 280 m 1,400 3 If speed < 40 km/h and radius > 280 m 1,050 4 If 40 km/h < speed < 90 km/h and radius < 50 m 1,350 5 If 40 km/h < speed < 90 km/h and 50 m < radius < 280 m 1,000 6 If 40 km/h < speed < 90 km/h and radius > 280 m 700 7 If speed > 90 km/h and radius > 280 m 350 8 If speed > 90 km/h and 50 m < radius < 280 m 0 Figure 3.6: Current values according to the specialist. 59 All the model structures considered in this work were based on the TSK inference model in such a way that the electric current value in each rule is related directly with the input values through a linear parametric model. In order to adjust the fuzzy model performance, some parameters presented in the rule consequents were estimated through the solution of an optimization problem that minimizes the deviations between the model predictions and the desired current value defined by the specialist. This parameter estimation procedure keeps the intrinsic features of the fuzzy models tested and enables that these models can be adherent or close to the specialist knowledge. The type-2 TSK model proposed in this work comprised type-1 fuzzy sets in the antecedents according to the membership functions presented in the Figure 3.6 and type-1 fuzzy sets were adopted to represent some consequent parameters. Two aspects supported the choice of this approach in the type-2 fuzzy modeling. First, the membership functions of radius and speed were defined by only one specialist according to the Figure 3.4 and uncertainties about these sets are not meaningful to justify the adoption of type-2 fuzzy sets in the antecedents (inputs). Second, possible uncertainties in the model definition are concentrated in the output of each rule and type-1 fuzzy sets were adopted in the consequent parameters in order to represent this uncertainty inherent to the definition of the light intensity (total electrical current) in each rule. The MATLAB program developed is available in Appendix B. 60 3.5 Results and discussion The simulation tests comprised the performance analysis of five fuzzy model structures that differ among themselves only with relation to the consequent model considered. Table 3.5 presents the output models tested the sum of squared errors (SSE) between the model results and the specialist responses in all data set, the standard deviation, the percentage of average standard deviation error and percentage of the average quadratic error for each case. Model 1 is a zero order TSK model of type-1 that not considers the direct effect of the velocity and radius in the consequent value. Model 2 is type-1 first order linear model that considers the velocity as input variable. Model 3 is similar to model 2 except for the fact that the radius was adopted as input. An additional test comprised the inclusion of a hard constraint in the parameter estimation problem, in order to avoid model predictions below 10% (model 4) of the specialist decision. This constraint was proposed to ensure that the simulation results would not change more than 10% from the specialist assessment, even if the sum of squared errors could increase. This approach imposes that the fuzzy model must guarantee the amount of light on the road. Despite the type-2 fuzzy model structure adopted in this work, the use of interval type-1 sets to represent the consequent parameters in a type-2 TSK model (with type-1 sets in the antecedents) would not be a suitable choice since it provides the same output of a type-1 TSK model whose consequent parameters are the centers of the consequent sets of the interval type-2 TSK model (Mendel, 2001). In order to obtain a model better than all type-1 structures to control the hardware proposed (LEDs AFS), the type-2 fuzzy model considered in this work 61 comprised the inclusion of an additional uncertainty level in the consequent of each rule (model output) through the adoption of parameters represented Gaussian (represented by a0 ± σ ) (model 5) type-1 fuzzy sets. In this case, the mean and deviation of sets in all rules were considered in the model adjustment procedure. However, the results presented in Table 3.4 show that in this case the type-2 structure proposed did not provided meaningful improvements in the model performance compared with the type-1 structure (model 2) and the model 5 was rejected as alternative to the LED control. This decision is also based on the higher simplicity of model 2 (type-1) in comparison with model 4 (type-2), mainly featured by a small number of parameters (deviations of type-1 Gaussian fuzzy sets in the consequents are not considered). All fuzzy models listed in Table 3.5 comprise 8 rules (Table 3.4) and the output model parameters have specific values for each rule. For example, the number of parameters to be estimated in the model 1 will be, at the most, equal to 8, and the specialist values presented in Table 3.4 were used as initial guess in the parameter estimation algorithm. In all cases the intersection operation (type-1 fuzzy models) was performed applying the product operator (Mendel, 2001). The operations used in the type-2 fuzzy model (meet and generalized centroid) were performed according to the extension principle (Karnik and Mendel, 2000). 62 Table 3.5: Output models adopted and results Model Fuzzy Output model Type % Avg. Quadratic Std % Avg. Quad Error Error Deviation Std Deviation 1 1 y = a0 34.76 6,975.80 437.65 86.18 2 1 y = a0 + a1 ⋅ V 25.18 5,054.43 317.07 62.44 3 1 y = a0 + a1 ⋅ R 34.01 6,826.66 427.63 84.21 4 (*) 1 y = a0 + a1 ⋅ V 27.23 5,061.11 322.33 65.14 5 2 y = (a0 ± σ ) + a1 ⋅ V 25.18 5,054.42 317.07 62.44 (*) - Parameter estimation problem with hard constraint. Figure 3.7 shows the best result of type-1 fuzzy models, with the lowest squared error (model 2). Although model 2 presents better results among all others, it still presents a high degree of variability which can be considered high and could lead some kind of discomfort to the driver. In addition, another aspect to be mentioned is the light output. Despite the fact that the model presents a good overall performance, in some cases it suggests current values below the specialist recommendation. This could result in more one discomfort element for the driver also considering the transport security. This feature suggests an opportunity to improvement in order to allow the driver to have more light on the road. One alternative to cope with these is to consider the adoption of hard constraints in the parameters estimation procedure. This approach was effectively implemented through model 4 that incorporates a hard constraint in which the values of current output should not vary more than 10% from the specialist’s recommendation. The surface highlights the circumstances on which the LEDs will operate. Confirming 63 the coherence of the model, Figure 3.7(b) presents a ramp showing that the current increases when the radius and speed decrease. The existence of a non uniform surface, with some abrupt drops in the current is expected and is associated to the nonlinearity of the fuzzy model and its intrinsic ability to interpolate different operational ranges. Figure 3.7: Comparison between specialist and model 2 (a) and surface generated from model 2 (b). Figure 3.8 shows the results obtained with model 4 (constraint of 10% in the parameters estimation procedure with fuzzy type-1). In this model there is more 64 light in the road due to the fact that the restriction give a light distribution with more comfort to the customer. Lower constraints were also tested, but a 10% restriction showed a better performance due to the fact that it provided reduced fluctuations (small variance) and ensured the best outcome within the smaller quadratic error. Considering the global performance, model 4 would provide the better behavior according to the best expertise knowledge. In order to confirm that model 4 is also coherent according to its fuzzy surface, Figure 3.8(b) shows this surface which presents the increase of current when the curves and speed decrease and the decrease of current when the speed and radius increase. Also it shows a smoother surface when compared to model 2, specially around 60 m of radius where model 2 has an abrupt rupture generated by the fluctuation of the model. Figure 3.8(b) shows model surface which presents the increase of current when the curves and speed decrease and the decrease of current when the speed and radius increase. Also it shows a smoother surface when compared to model 2, specially around 60 m of radius where model 2 has an abrupt rupture generated by the fluctuation of the model. In this specific area, around 60 m, it is very important to have a smooth distribution due to the fact that visual perception is noticeable on curvature corners helping the driver at night. 65 (a) (b) Figure 3.8: Comparison between specialist and model 4 (a) and surface generated from model 4 (b). Both models 2 and 4 have a better surface accommodation when compared to the surface generated from Table 3.4 (Figure 3.5) which is not only more abrupt but has a lot of steps and imperfections on its surface. The surfaces of Figures 3.7 and 3.8 comprise a more continuous behavior than the surface on Figure 3.5 (specialist surface) and also present a homogenous feature that contributes to reduce the risk of possible distractions (or mistakes) of the truck driver during 66 nighttime driving. The comparison between Figures 3.7-3.8 and 3.5 is enough to justify the adoption of a modeling procedure, suitable for the reality described, instead of the specialist rules itself. 3.6 Conclusions This chapter describes the development and application of a fuzzy rulebased system, for modeling and predicting the amount of light to be added to the driver during night time driving. The proposed modeling framework comprised a suitable combination between expert’s knowledge and a parameter estimation procedure that enabled the adjustment of the output models of each rule, considering different type-1 and type-2 fuzzy structures. More specifically, a specialist’s engineering judgment could be appropriately incorporated in the fuzzy rule base according to the knowledge and experience on night time and environmental conditions. Figure 3.8(b) shows model surface which presents the increase of current when the curves and speed decrease and the decrease of current when the speed and radius increase. Also it shows a smoother surface when compared to model 2, specially around 60 m of radius where model 2 has an abrupt rupture generated by the fluctuation of the model. In this specific area, around 60 m, it is very important to have a smooth distribution due to the fact that visual perception is noticeable on curvature corners helping the driver at night. Some of the models are quite adequate, but the best alternative would be model 4, which considers the restriction that guarantees the specialist knowledge 67 in the best way. These models have output responses similar to the specialist, highlighting and reinstating the importance of making nighttime driving safer, while providing more light to the driver as well. Although the solutions do not give the minimum quadratic error, they allow the driver to see more at night due to the fact that they generate almost the same current output as the specialist’s model. The idea is that the specialist understands the customer needs due to his knowledge. Finally, it is important to highlight that the use of LEDs is due to certain advantages versus halogen lighting, not only regarding long life, power consumption and color temperature (to mention a few), but also regarding design trends around this concept. Further investigation will be sought to improve the system and its algorithms. Moreover, it shows that new technologies can improve not only the appearance but also the overall performance of the lighting system. Nomenclature a0, a1 output model parameters; ∆ deviation of type-1 interval fuzzy set; σ standard deviation of type-1 Gaussian fuzzy set; y current to LEDs (mA); V velocity of the vehicle velocity (km/h); R radius of the curve (m). HID high-intensity discharge 68 References AL, 2009. Automotive Lighting website. http://www.al-lighting.de. Altinten, A., Erdŏgan, S., Hapŏglu, H., Alpbaz, M., 2003. Control of a polymerization reactor by fuzzy control method with genetic algorithm, Comput. Chem. Eng. 27, 1031–1040. Anderson, T., Sawyers, T., Bell, M, 1998. Optimization of a Fuzzy Logic Traffic Signal controller by a multiobjective genetic algorithm, Transport Research Laboratory, 186-190. Babuška, R., Verbruggen, H. B., 1996. An overview of fuzzy modeling for control, Control Eng. Practice 4, 1593–1606. Bellman, R. E., Zadeh, L. A., 1970. Decision-making in a fuzzy environment, Management Science 17, 141–164. Chen, B., Liu, X., 2004. Reliable control design of fuzzy dynamic systems with time-varying delay, Fuzzy Sets and Systems 146, 349–374. Du, G.-N. Zhu, Z.-Y., 2006. Modeling Spatial Vagueness Based on Type-2 Fuzzy Set, Journal of Zhejiang University SCIENCE A 1, 250-256. Dubois, D., Prade, H., 1978. Operations on Fuzzy Numbers, Int. J. Systems Science 9, 613-626. Dubois, D., Prade, H., 1979. Operations in a Fuzzy-Valued Logic, Information and Control 43, 224-240. Ekriasa, A., Eloholma, M., Halonen, L., Song, X., Zhang, X., Wen, Y., 2008. Road lighting and headlights: Luminance measurements and automobile lighting simulations, Building and Environment 43, 530–536. 69 EN, 2003. Road lighting—Part 3: Calculation of performance, European standard EN 13201-3, Publication 270-2003, Ref. No. EN 13201-3: 2003 E. Gotoh, S., Aoki, T., 1996. Development of active headlight, 15th International Conference on the Enhanced Safety of Vehicles, Melbourne, Australia. Hagras, H. A., 2004. A Hierarchical Type-2 Fuzzy Logic Control Architecture for Autonomous Mobile Robots, IEEE Transactions on Fuzzy Systems 12, 524-539. Hamm, M., 2002. Adaptive lighting functions history and future-Performance investigations and field test of user acceptance, SAE Technical Paper Series, No. 2002-01-0526. Hara, T., Kuramochi, T., Ayama, M., Kojima, S., Sato, T., 2001. Evaluation of AFS from driver’s point of view, Progress in Automobile Lighting, Darmstadt, Germany’ Technical University of Darmstadt, 397-402. Hisdal, E., 1981. The IF-THEN ELSE Statement and Interval-Values Fuzzy Sets of Higher Type, Int’l J. Man-Machine Studies 15, 385-455. Hogrefe, H., 2000. Adaptive front lighting systems for optimum illumination of curved roads, highway lanes and other driving situations, SAE Technical Paper Series, No. 2000-01-0431. Ishiguro, K., Yamada, Y., 2004. Control technology for bending mode AFS, SAE Technical Paper Series, No. 2004-01-0441. Just Auto, 2007. Annual just-auto’s review of 2007 - Management briefing, Just Auto, Aroq Limited, UK. Karnik, N. N., Mendel, J. M., 1998. Introduction to Type-2 Fuzzy Logic Systems, Fuzzy Systems Proceedings, IEEE World Congress on Computational Intelligence, The 1998 IEEE International Conference 2, 915-920. 70 Karnik, N. N., Mendel, J. M., 2000. Operations on Type-2 Fuzzy Sets, Int’l. J. on Fuzzy Sets and Systems 1, 327–348. King, P. J., Mamdani, E. H., 1977. The application of fuzzy control systems to industrial processes, Automatica 13, 235–242. Kittel, C., 2004. Introduction to Solid State Physics, 8th Edition, Wiley, USA. Kosonen, L., 2003. Multi-agent fuzzy signal control based on real-time simulation. World Congress on Intelligent Transport System, October, Transportation Research Part C: Emerging Technologies 11, 389-403. Hella, 2009. Hella website. www.hella.de. Levinshtein, M., Rumyantsev, S., Shur, M., 2001. Properties of Advanced Semiconductor Materials: GaN, AIN, InN, BN, SiC, SiGe, Wiley-Interscience, USA. Li, L., Lin, W.-H., Liu, H., 2006. Type-2 Fuzzy Logic Approach for Short-term Traffic Forecasting, Intelligent Transport Systems, IEEE Proceedings 153, 33-40. Liang, Q., Karnik, N. N., Mendel, J. M., 2000. Connection Admission Control in ATM Networks Using Survey-based Type-2 Fuzzy Logic Systems, IEEE Transactions on Systems, Man and Cybernetics, Part C 30, 329-339. Liang, Q., Mendel, J. M., 2000. Interval Type-2 Fuzzy Logic Systems: Theory and Design, IEEE Transactions on Fuzzy Systems 8, 535-550. Mendel, J. M., 2001. Uncertain Rule-based Fuzzy Logic Systems: Introduction and New Directions, Prentice-Hall P. T. R., London, UK. Mendel, J. M., 2003. Fuzzy Sets for Words: a New Beginning, The IEEE International Conference on Fuzzy Systems, 37-42. 71 Mendoza, O., Licea, G., Melin, P., 2007. Modular Neural Networks and Type-2 Fuzzy Logic for Face Recognition, Annual Meeting of the North American Fuzzy Information Processing Society, NAFIPS '07, 622-627. Mizumoto, M., Tanaka, K., 1976. Some Properties of Fuzzy Sets of Type-2, Information and Control 31, 312-340. Mizumoto, M., Tanaka, K., 1981. Fuzzy Sets of Type-2 Under Algebraic Product and Algebraic Sum, Fuzzy Sets and Systems 5, 277-290. Nakamura, S., 1996. High-brightness blue/green LEDs and first III-V nitride-based laser diodes, Proc. SPIE Physics and Simulation of Optoelectronic Devices 2693, 43-56. Neumann, R., 2004. AFS halogen headlamp system: Experimental study and first field results, SAE Technical Paper Series, No. 2004-01-0439. Neumann, R., 2006. LED Front Lighting – Optical Concepts, Styling Opportunities and Consumer Expectations, SAE Technical Paper Series, No. 2006-01-0100. Niittymäki, J., Turunen, E., 2003. Traffic signal control n similarity logic reasoning. Fuzzy Sets and Systems 133, 109-131. ∅stergaard, J.-J., 1977. Fuzzy logic control of heat exchange process, in: M. M. Gupta, G. N. Saridis, B. R. Gaines (Eds.), Fuzzy Automata and Decision Process, North-Holland, Amsterdam, 285-320. Pareek, U., Kar, I. N., 2006. Estimating Compressor Discharge Pressure of Gas Turbine Power Plant Using Type-2 Fuzzy Logic Systems, IEEE International Conference on Fuzzy Systems, 649-654. 72 Ren, Q., Qin, Z., Baron, L., Birglen, L., Balazinski, M., 2007. Identification of RigidBody Dynamics of Robotic Manipulators Using Type-2 Fuzzy Logic Filter, Annual Meeting of the North American Fuzzy Information Processing Society, NAFIPS '07, 387-392. Sala, A., Guerra, T. M., Babuška, R., 2005. Perspectives of fuzzy systems and control, Fuzzy Sets and Systems 156, 432-444. Schmocker, J.; Ahuja, S.; Bell, M., 2008. Multi-objective signal control of urban junctions – Framework and a London case study, Transportation Research Part C 16, 454-470. Sivak, M., Schoettle, B., Flannagan, M., Minoda, T., 2005. Optimal strategies for adaptive curve lighting, Journal of Safety Research 36, 281-288. Stern, D., 2008. Global market review of automotive lighting –forecasts to 2013, 2008 edition, Just Auto, Aroq Limited, UK. Tahayori, H., Tettamanzi, A. G. B., Degli Antoni, G., 2006. Approximated Type-2 Fuzzy Set Operations, IEEE International Conference on Fuzzy Systems, 19101917. Thovutikul, S., Auephanwiriyakul, S., Theera-Umpon, N., 2007. Microcalcification Detection in Mammograms Using Interval Type-2 Fuzzy Logic System, IEEE International Fuzzy Systems Conference, FUZZ-IEEE 2007, 1-5. UNECE, 2008. UNECE website. http://www.unece.org/trans/main/wp29/ wp29regs41-60.html Wördenweber, B., Wallaschek, J., Boyce, P., Donald D. Hoffman, D., 2007. Automotive Lighting and Human Vision, Springer Verlag, USA. 73 Zadeh, L. A., 1975. The Concept of A Linguistic Variable and Its Application to Approximate Reasoning – 1, Information Sciences 8, 199-249. Zukauskas, A., Shur, M., Caska, R., 2002. Introduction to Solid-State Lighting, Wiley Interscience, USA. 74 Capítulo 4 Desenvolvimento de um modelo AFS (sistema adaptativo de iluminação veicular) para assegurar as necessidades do motorista de caminhão durante o período noturno e vislumbrando sua utilização para o mercado Brasileiro Apresentação No capítulo anterior foram desenvolvidos e analisados modelos baseados em lógica fuzzy para o controle de um sistema adaptativo de iluminação veicular dianteira a LEDs para carros. O conjunto de regras, as condições de contorno (pista de testes), o conhecimento do especialista, a estrutura de modelo fuzzy adotada, as variáveis de entrada e as respectivas funções de pertinência foram apresentados e discutidos juntamente com os resultados, evidenciando-se o desempenho dos modelos desenvolvidos no controle da intensidade de iluminação dos LEDs de acordo com a velocidade do veículo e o raio de curvatura da rodovia. Este capítulo tem por objetivo definir qual o modelo fuzzy mais adequado para assegurar as necessidades do motorista de caminhão levando em consideração as condições das estradas, da pista de testes e o meio ambiente do mercado brasileiro, bem como uma pesquisa específica para entender as necessidades e comparar as diferenças entre os motoristas de carro e caminhão. Portanto, este capítulo representa uma continuação lógica do trabalho desenvolvido no capítulo anterior. Este último, conforme explicitado, foi importante para consolidar uma metodologia de modelagem para o problema, evidenciando a potencialidade das estruturas testadas. Aqui, a partir das informações relacionadas ao caminhão, entre elas a 75 pesquisa de campo realizada, o levantamento das condições de pista e os experimentos na pista de testes, foi detectada a necessidade de um modelo específico para caminhões, e as estruturas de modelo foram então estendidas para este caso. Os desenvolvimentos feitos neste capítulo e nos anteriores fornecem a base conceitual e de modelagem para o desenvolvimento de um protótipo para validar este modelo, havendo um grande potencial para que o sistema desenvolvido se torne um item de série opcional da montadora ou um acessório. Resumo O comportamento de dirigir à noite é diferente do comportamento diurno devido aos diferentes cenários apresentados ao campo de visão do motorista. À noite os motoristas têm de depender no sistema de iluminação dos veículos para enxergar o meio ambiente e as condições das estradas à sua frente. Nas décadas recentes, o sistema de iluminação tem tido expressivos desenvolvimentos tecnológicos, como o uso de LEDs em sistemas adaptativos de iluminação veicular (AFS), o que representa uma inovação para a indústria de iluminação automotiva. Isto tem se tornado rapidamente uma das mais inovadoras tecnologias no mundo dentro da comunidade de iluminação veicular. Este capítulo discute as necessidades do motorista (carro e caminhão) dado o meio ambiente e as estradas do estado de São Paulo, no Brasil, levando em conta uma pesquisa comparativa entre as necessidades de ambos motoristas, carro e caminhão, sob condições diferentes das ruas. A discussão do controle do sistema de AFS com LEDs adotando lógica fuzzy 1 e 2, de acordo com as necessidades do motorista de caminhão, também faz parte 76 deste capitulo, bem como a análise da importância da estratégia do modelo, quando adotando decisões que são baseadas no conhecimento humano. Os resultados demonstram uma potencial proposta de metodologia para controlar os sistemas de iluminação. Palavras-chave: comportamento, lógica fuzzy, AFS, LED, caminhão, iluminação Conclusão Este capítulo descreve as necessidades e comportamento de ambos os motoristas, de carro e caminhão, levando em consideração a iluminação das ruas de São Paulo, no Brasil. O estudo gerou uma vasta quantidade de dados que podem suportar o desenvolvimento de um sistema específico de AFS a LEDs, levando em conta não só os dados da pesquisa, mas também as condições das estradas e dos resultados das simulações feitas no MATLAB. As informações dadas ao especialista ajudaram a definir a intensidade e a distribuição de luz requerida quando o sistema AFS estiver disponível. É de vital importância destacar a necessidade de um modelo específico para o motorista de caminhão. O modelo proposto confirma que o modelo de carro não pode ser adotado pelo motorista de caminhão, pois não atende as suas necessidades. Este estudo deixa claro que as necessidades dos motoristas de caminhão e de carro são diferentes, não somente pelo campo de visão e pelo tempo de resposta, mas também pelos anseios em relação à iluminação veicular, que são diferentes, conforme destacado na seção 4.3. Até o presente momento, não existem estudos neste campo e este capítulo mostra que 77 existem muitos aspectos que devem ser estudados posteriormente. Além disso, os dados coletados neste estudo permitem o desenvolvimento de um sistema específico para o Mercado brasileiro para os faróis baixo e alto, para ambos carros e caminhões. O modelo de AFS a LEDs para caminhões (conjunto de LEDs com ótica, sistema de alimentação elétrica, micro-controlador com lógica fuzzy embarcada) para melhorar a dirigibilidade noturna foi desenvolvido levando em consideração o conhecimento do especialista e a estimação dos parâmetros que permitiu o ajuste do modelo de saída de cada regra, levando em consideração diferentes estruturas fuzzy tipo 1 e tipo 2. Mais especificamente, o julgamento do especialista pode ser incorporado na formação das regras fuzzy de acordo com as condições das estradas e do meio ambiente. É necessário enfatizar que a solução para o segmento de caminhões foi a número 1, que demonstra uma superfície com menor variabilidade e utiliza fuzzy do tipo 1, o que simplifica o modelo de saída. O modelo escolhido confirma o conhecimento do especialista e claramente reduz a complexidade do mecanismo global de controle para esta aplicação. Finalmente, são necessários estudos adicionais neste campo de pesquisa, mais especificamente para desenvolver um sistema de AFS a LEDs para ser incorporado no segmento de caminhões, como um acessório ou um item opcional da montadora. A patente para este modelo proposto está sendo requisitada, devido à sua inovação no mercado brasileiro. Esta seria a primeira vez de aplicação na indústria automotiva e iria gerar um grande avanço tecnológico no segmento de caminhões. 78 Chapter 4 Design of a fuzzy-based AFS (Advanced Front Lighting System) model to meet truck driver’s needs during nighttime driving: foreseeing its use in the Brazilian market Opening statement In the previous chapter, models were developed and analyzed adopting fuzzy logic to control an adaptive front lighting system with LEDs for cars. The set of rules, surroundings (test track) specialist expertise, fuzzy models adopted, input variables and the pertinence functions were presented and discussed together with the results, highlighting the models performance developed to control the current LED output, according to the speed and road curvature. This chapter main goal is not only to determine which is the most adequate fuzzy model to ensure the truck driver’s needs taking into consideration the roads, test track, environment of the Brazilian market, but also a detailed survey to understand the driver’s needs and compare the differences between the truck and car driver. So, this chapter represents the logic continuation of the work developed in the previous chapter. The last one, as highlighted, was very important to consolidate the methodology to face the problem, confirming the outstanding results of the tested structures. In fact, after the summarization of the truck related data, among them, the field survey, the road conditions and the tests performed at the test track, the real need for a specific algorithm for the truck driver’s need was confirmed, and the related structure were extended to the truck model. 79 The development that was done in this chapter and in the previous ones, where the conceptual basis to develop a bench prototype and validate this model, there being a huge potential for the development of the component, either as an accessory or an end item at the assembly line at the OEM (Original Equipment Manufacturer). Abstract Nighttime driving behavior differs from that during the day because of unique scenarios presented in a driver's field of vision. At night drivers have to rely on their vehicle headlamps to illuminate the road as it is essential that the driver is able to see the environment and road conditions in front of him. In recent decades the vehicular illumination system has undergone expressive technological advances such as the use of a Light Emitting Diode (LED) Adaptive Front-lighting Systems (AFS), which represents an industry breakthrough in lighting technology. This is rapidly becoming one of the most important innovative technologies around the world within the lighting community. This paper discusses driver’s (car and truck) needs given the environment and road conditions in the state of São Paulo (Brazil) using a survey applied to compare the needs of both truck and car drivers under different road conditions. A discussion of LED AFS control alternatives using fuzzy logic according to truck drivers’ needs is also part of this paper, as is the analysis of the importance of such a modeling strategy, when decisions are based on human knowledge. The results show the potential and suitability of the methodology proposed for controlling truck-related lighting. Keywords: behavior, fuzzy logic, AFS, LED, truck, lighting 80 4.1 Introduction In nighttime driving it is important to enhance safety for truck drivers due to the fact that the time of response of a truck and its driver is much longer when compared to that of a car and its driver. There have been a series of papers describing the differences between the behavior of drivers at nighttime when comparing gender, eye movement, road signs and age factors (Liu et al., 1998; Gish, 2001; Burg, 1967; Egberink et al., 1996; Okombi-Diba et al., 2007). However, up until now, truck drivers have not been considered candidates for this kind of comparison, even though their driving needs are clearly as important (if not more so) as those of a car driver. The primary aim of innovative headlamp systems is to increase traffic safety especially at night. In order to achieve this, optimum light distribution depending on driving and environmental conditions must be available to better illuminate the road and its surroundings. Brightness conditions, weather, road conditions, traffic conditions, type of road, vehicle speed and acceleration behavior must all be taken into account by an Adaptive Front-lighting System (AFS) (Neumann, 2004). The LED AFS model proposed here consists of a LED array with optics, electronic power driving system, onboard micro-controller and fuzzy logic built-in software controller for which a patent is being requested for use in the Brazilian market. Lukacs et al. (2009) developed AFS control alternatives using fuzzy logic models (types 1 and 2) taking into consideration both driver and road conditions in the state of São Paulo (Brazil). These models were developed and applied to a LED (Light Emitting Diode) control algorithm and the rules were defined according to specialist knowledge (section 4.4). The 81 survey data presented in this paper together with the data collected at the test track (section 4.4) identified the need to develop specific models for the LED AFS control in trucks, adjusted for each target customer. A survey was applied to a population of 200 experienced car and truck drivers in order to understand the needs of truck and car drivers, the road conditions and environment (highlighted in section 4.2). This survey is discussed in section 4.3, and the data collected also generated key elements for future developments regarding not only AFS configuration, but also the entire beam pattern distribution for low and hi beams applications. Section 4.4 describes the test track measurements and in section 4.5 results are presented and discussed. This last section presents the structure of fuzzy models proposed and its features (i.e. membership function parameters associated to the consequents of each rule), an estimation procedure that comprises the comparison between specialist responses (desired responses) and ideal model results using data related to the truck driver’s needs and road conditions of the Brazilian target customer (Wördenweber et al., 2007). This parameter estimation procedure enabled the selection of parameter values that could provide optimized solutions, considering that expert knowledge may not always involve practical rule-of-thumb guidelines concerning the appropriate estimation of these parameters. In section 4.6, concluding remarks are presented. 4.2 Road conditions and environment This study focuses on the road conditions in São Paulo, Brazil, because it has the largest vehicular fleet in the country. This state has a total of 34,600 km of paved highways of which 22,000 km are state-operated roads, 1,050 km 82 are federal-operated roads and 11,600 km are county roads. According to Annual Research (Fenabrave, 2008) from the Brazilian National Transport Confederation (CNT), São Paulo has the best road scenario in the country as regards overall illumination, surfacing and signs. In 2004, 59.4% of the highways were classified as excellent by CNT standards. DER (Brazilian Road Department) has 28 web linked cameras available 24 hours a day with direct information on road conditions. In Figure 4.1 there is a map displaying the roads in the state of São Paulo (SP). Figure 4.1: Map displaying roads in SP. In Figures 4.2 and 4.3 some examples and a comparison between night and daytime scenarios can be found. It is important to compare these in order to properly understand the complete analysis. Figure 4.2a shows a 180 degree angle curvature which may cause accidents due to the negative angle. Through comparison with the night scenario in Figure 4.2b, this light distribution does not 83 follow the road and might cause glare to the oncoming traffic in the other direction. When heavy truck usage is brought into this scenario, it becomes even worse given their time response. Figure 4.3a illustrates a rescue / road assistance area during the daytime with a truck. Figure 4.3b shows the same environment at night without any signs, a situation which may lead to an accident during the maneuvering, the entry or the exit of a vehicle. (a) (b) Figure 4.2: (a) Daytime and (b) nighttime scenarios on SP99 Km 72. (a) (b) Figure 4.3: (a) Daytime and (b) nighttime scenarios on SP99 Km 34. These are some examples of the environment that characterizes the highways in São Paulo: Figures 4.4, 4.5 and 4.6 are actual shots of these 84 scenarios. It is of utmost importance to highlight that there are pedestrians and cyclists on the sides of these highways (Figure 4.4) creating numerous potential accidents due to the lack of signs or proper illumination. In Figure 4.5a, there is an example of a lack of traffic signs on the crossroads and zero artificial illumination/retro reflective devices to indicate the possibility of incoming traffic through the lanes and also zero illumination coming off or into the tunnels. This might lead to visual discomfort for both truck and car drivers during day and night time driving. Figure 4.5b describes the morning fog which can also generate some discomfort and lack of seeing distance for the driver. In these conditions, both car and truck drivers have stated the need to improve the quality of their lighting system to enhance their field of vision during not only early morning fog but also during night time driving. Furthermore, Figure 6a describes the changes in the road scenarios on the SP99 highway. In a short distance, the driver will shift from a bridge to a road lined with trees and a small forest. This will lead to lack of visibility ahead reducing the driver’s time of response. On the other hand, Figure 4.6b shows the sinuous contour of the SP123 which might lead to glare from the oncoming traffic and also indicates a lack of visibility ahead. 85 (a) (b) Figure 4.4: (a) Cyclist and (b) pedestrian in red on SP55 Km 211 and SP270 km 17 respectively. (a) (b) Figure 4.5: (a) Lack of traffic signs on the crossroads on SP099 and (b) daytime fog on SP55 Km 292. 86 (a) (b) Figure 4.6: (a) Environmental conditions of the highways SP99 and (b) SP123 km 31. In addition, there are important data from the highways showing road curvature. These images were taken from MapLink program (MapLink, 2008). Two examples (Figure 4.7, a and b) are taken from the Regis Bittencourt road (BR-116) which is one of the most dangerous highways in Brazil. The road curvature does not help, particularly due to the fact that there are mountains and continuous curves in the vicinity increasing the highlight effect. Moreover, there are several 90 degree curves which under certain weather conditions may cause severe accidents. (a) (b) Figure 4.7: Two aerial views (a) and (b) of BR116. 87 The circumstances presented in this section allow the specialist, who is an expert in the automotive lighting field with more than 15 years of experience developing lighting systems in the auto industry, to understand the environment (city, motorway and rural) and road conditions such as pedestrians, fog and rain, for example, in the region which is used in the car and truck driver models. 4.3 Data from the driver survey In order to understand the needs of the truck and car drivers, a thorough survey was developed by the authors and applied to a population of 200 experienced car and truck drivers in the state of São Paulo in 2008. It is crucial to draw attention to the fact that during nighttime the number of accidents in the state of São Paulo represents more than 47% of the total amount of accidents according to Intervias (2000). This survey data helped to understand the needs of both truck and car drivers. Furthermore, it highlights important aspects such as low and high light beam usage in different scenarios, average speed and incoming glare for both car and truck drivers. The issues addressed in the survey and its results are presented on Table 4.1. The main purpose of this questionnaire was to understand the needs and behavior of the drivers when driving at night. Some elements were worthy of discussion, such as: low beam and high beam usage under different road conditions; influence of noise factors, such as rain, fog, pedestrians, animals, cyclists; also in different scenarios; 88 driver perception of the beam pattern regarding the light distribution, near side illumination, road visibility ahead and also the impact of glare and average speed. 89 Table 4.1: Questionnaire to understand driver needs while driving at nighttime in the Brazil and survey results Questions Categories Unit (car: c (%) / truck: t (%)) 1 What is your overall front lighting perception? TOWN 2 What is your low beam usage under different road conditions? MOTORWAY RURAL TOWN 3 What is your hi beam usage under MOTORWAY different road conditions? RURAL What is the degree of visibility do 4 you have ahead of you under different road scenarios? 5 What is the visualization of a crossroads ahead of you? MOTORWAY RURAL MOTORWAY RURAL TOWN What is your average speed while 6 driving on the roads of the MOTORWAY following types? RURAL What is the near side illumination that can be 7 observed on the left and right side from your point of view? TOWN What is the beam pattern lighting 8 distribution in front of the vehicle (field of view)? MOTORWAY RURAL TOWN What is your visualization of 9 pedestrians / bicycle / animals under different road conditions? MOTORWAY RURAL 10 What is the discomforting impact of the glare generated from oncoming traffic? TOWN 11 What is the perception of driving under severe rain conditions? MOTORWAY RURAL TOWN 12 What is the perception of driving under severe fog conditions? MOTORWAY RURAL Good (c: 65 / t: 30) 50 (c: 51 / t: 39) 50 (c: 29 / t: 19) 50 (c: 28 / t: 25) 10 (c: 60 / t: 48) 10 (c: 30 / t: 22) 10 (c: 10 / t: 19) Low (c: 10 / t: 11) Low (c: 20 / t: 18) Small (c: 26 / t: 14) Small (c: 27 / t: 19) 50 (c: 40 / t: 70) 50 (c: 00 / t: 00) 50 (c: 28 / t: 55) Average (c: 22 / t: 55) 70 (c: 37 / t: 48) 70 (c: 61 / t: 56) 70 (c: 52 / t: 43) 30 (c: 30 / t: 27) 30 (c: 50 / t: 39) 30 (c: 60 / t: 45) Medium (c: 55 / t: 57) Medium (c: 60 / t: 57) Medium (c: 53 / t: 52) Medium (c: 49 / t: 51) 70 (c: 50 / t: 23) 70 (c: 20 / t: 39) 70 (c: 62 / t: 40) Poor (c: 13 / t: 15) 90 (c: 12 / t: 13) (% of time 90 (c: 10 / t: 25) used) 90 (c: 20 / t: 32) 50 (c: 10 / t: 25) (% of time 50 (c: 20 / t: 39) used) 50 (c: 30 / t: 36) High (c: 35 / t: 32) High (c: 20 / t: 25) High (c: 21 / t: 34) High (c: 24 / t: 30) 80 (c: 10 / t: 07) 80 km/h (c: 80 / t: 61) 80 (c: 10 / t: 05) Small Medium High (c: 35 / t: 25) (c: 45 / t: 45) (c: 20 / t: 30) Small (c: 40 / t: 27) Small (c: 50 / t: 25) Small (c: 45 / t: 32) Small (c: 40 / t: 23) Small (c: 43 / t: 34) Small (c: 44 / t: 38) Small (c: 20 / t: 16) Acceptable (c: 40 / t: 27) Acceptable (c: 29 / t: 14) Acceptable (c: 32 / t: 25) Acceptable (c: 25 / t: 16) Acceptable (c: 17 / t: 16) Acceptable (c: 15 / t: 11) Medium (c: 50 / t: 64) Medium (c: 30 / t: 48) Medium (c: 40 / t: 50) Medium (c: 38 / t: 61) Medium (c: 36 / t: 34) Medium (c: 46 / t: 48) Medium (c: 30 / t: 29) Poor (c: 40 / t: 48) Poor (c: 60 / t: 50) Poor (c: 50 / t: 38) Poor (c: 35 / t: 50) Poor (c: 24 / t: 23) Poor (c: 35 / t: 34) - High (c: 10 / t: 09) High (c: 20 / t: 27) High (c: 15 / t: 18) High (c: 22 / t: 16) High (c: 21 / t: 32) High (c: 10 / t: 14) High (c: 50 / t: 55) Very poor (c: 20 / t: 25) Very poor (c: 11 / t: 36) Very poor (c: 18 / t: 37) Very poor (c: 30 / t: 34) Very poor (c: 59 / t: 61) Very poor (c: 50 / t: 55) - - - - - 90 These questions pursue an understanding the needs and the perceived behavior of drivers during nighttime driving. The results presented on Table 4.1 highlights the comparison between the survey results carried out with car (c) and truck (t) drivers in various road conditions. The road conditions in which there are substantial differences in behavior are: town, motorway and rural. Each one of these conditions will be explained in detail below. The criteria which were developed to compare the driver’s behavior under these circumstances are those described on the field categories on Table 4.1. The overall lighting perception during nighttime driving differs from truck to car drivers mainly due to the fact that more than 70% of the truck drivers recommend a change in the current scenario due to the current system performance to improve its visibility. On the turning aspect (crossroads, question 5, for example), the truck driver is more concerned than the car driver (86% versus 74% in town scenario) due to the size of his vehicle and time of response. On the other hand, regarding the road visibility ahead the car driver understands that it is more critical for him due to the limited field of view when compared to that of the truck driver mainly due to the size of the windshield and the driver´s height when seated. The usage of the low beam is similar for both car and truck driver on all different scenarios. However, when discussing the high beam usage the truck driver is more concerned if any event in front of the driver happens due to its longer time of response and also uses it more frequently than the car driver in all scenarios. In some cases, the driver has both the low and high beams on, so 91 that is why under some circumstances the usage surpasses the 100%. Unfortunately, we can also observe usage below 100%, mainly in town driving, indicating that under some circumstances no beam is used at all. Also, the average speed is quite different from the car and truck drivers, especially on rural and motorways. The average speed is almost 25% less in a truck than a car and the truck driver seldom surpasses 80 km/h when driving with cargo. On motorways, already shown in section 4.2, road conditions are key operational factors for the truck driver, whose time of response is longer and therefore he should certainly be able to “see more” and thus be able to avoid potential accidents. In the town scenario, both car and truck drivers have the same needs, i.e. city lighting is inadequate and they have to cope with conditions as presented. Furthermore, the speed is reduced due to the limits imposed in the city. In the rural scenario, considering that there is almost no light from the environment, both types of drivers need to rely on their beam patterns. This is the reason why, in this scenario, the usage of high beam is greater than in the other scenarios. On the beam pattern light distribution, for instance, the car driver has the technology and design to help his perception. Due to the vehicle’s design, the headlamp shape on cars allows the light distribution to have a greater aperture making the road visibility under different scenarios better than that of the truck driver due to the limitation on the design and shape of the truck’s headlamps. Glare also impacts both types of drivers severely by creating huge discomfort. It is worse for the truck driver due to the time of response and the size of the truck involved. 92 Under different weather conditions, such as rain and fog, the car driver has an edge due to the fact that not only do cars have more fog lamps available as standard items or aftermarket accessories, but also because the driver’s visibility is better due to front and rear wipers. From the survey results, more than 84% of truck and 83% of car drivers consider that road conditions are very poor in fog when driving on motorways, which is the worst scenario for the driver due to the lack of road visibility ahead and natural light. In addition to this, 86% of the truck drivers have concerns in rainy conditions, especially when driving on motorways. More than 75% of the interviewed drivers in the survey complained about the lack of foreground and near side illumination in front of the vehicle. This foreground (20 meters in front of the vehicle) allows the driver to understand and foresee the road conditions and environment. The near side lighting on both sides is a key factor in turning, parking and on crossroads. It helps the driver to see more, aiding these maneuvers. When there are pedestrians, cyclists or animals on the road, the truck driver has more difficulty in handling them due to his reduced front field of vision linked with his longer time of response. In rural areas, the number of animals is huge and can potentially cause accidents due to the fact that they can appear from the side of the roads and highways. Pedestrians and cyclists in the city and on the highways may also create awkward situations which could lead to accidents. More than 77% of the truck drivers consider cyclists and motorcycle drivers to be contributors to accidents, especially at nighttime in towns when their field of vision and visibility are reduced. It must be highlighted that São Paulo has a huge fleet, more than 750,000 motorcycles, and the largest in 93 Brazil. This could also generate noise factors or additional distractions to the drivers (Fenabrave, 2008). The truck segment of the market currently lacks the attention of lighting specialists although there is huge potential for improvement and the fleet size is growing. Nowadays, fleet owners are looking for improvements to their vehicles to secure the safe transportation of road freight. The critical analysis of the data collected from this survey has enabled the development of a beam pattern (light distribution) for both low and high beam which meets the needs identified by the truck driver. Moreover, an understanding of both car and truck driver needs and behavior during day and night time driving in varying road and environment conditions enables the specialist to incorporate this knowledge into the definition of the entire lighting system. These aspects may assist the optical engineer in beam definition to address the needs, beam pattern, LED usage and AFS system parameters. The impact of glare from oncoming traffic as well as the average speed, low and high beam usage linked with the noise factors such as rain and fog are very helpful to describe the needs for each specific driver. The usage in different scenarios is absolutely critical to define the characteristics of each driver when exposed to different scenarios. Furthermore, the analysis of the road conditions and environment helps the specialist to generate a model with the data from this survey. 4.4 Test track measurements The final source of information included measurements carried out on the test track shown in Figure 4.8 (São Paulo, Brazil). This test track represents standard road conditions and driver behavior. Data acquisition was possible due 94 to the VBOX III device, which features a powerful new Global Positioning System (GPS) engine capable of providing 100 Hz update rate of all GPS parameters including speed, direction and position. Velocity and heading data are calculated from Doppler shift in the GPS carrier signal to provide high accuracy. It allows the acquisition of fifty measurements per second, with each measurement comprised of both speed and position (longitude and latitude). This provides precise information about the driver’s behavior before, during and after the curve entrance. In addition, during the data acquisition four laps were done with a car and a truck in order to compare different speeds and scenarios to gather different responses in an attempt to understand the driver’s behavior when approaching and leaving different curves. Figure 8: Test track. 4.5 Modeling and simulation results After the acquisition of the test track data together with the road scenario and the survey data, the specialist had sufficient information to generate the 95 model and simulate it with trucks and cars to compare the two kinds of vehicles. Thus, the development of the model used to control the LED AFS was based on the following aspects: the road scenario and environment, the survey with drivers and the data gathered at the test track. The data was then used in the parameter estimation procedure with a fuzzy model structure. Fuzzy logic is a superset of conventional (Boolean) logic that has been extended to handle the concept of partial truth (values between "completely true" and "completely false"), particularly important when a multi-parameter decision must be taken (Bellman and Zadeh, 1970). The most important feature of fuzzy control is that its internal mathematical model is built-up directly through expertise from human reasoning which can be expressed by a set of heuristic rules which are quantified according to fuzzy set theory (Mendel, 2001). The traditional fuzzy inference system (type-1) comprises the use of type-1 fuzzy sets that is a generalization of a crisp set or zero-one membership function (Mendel, 2001). A crisp set A, denoted by µA(x), is such that: 1 if x ∈ A A = µ A (x ) = 0 if x ∉ A (1) A type-1 fuzzy set F is defined on a universe of discourse X (the range of possible values for the variable x) and its membership function, denoted by µF(x), takes on values in the interval [0, 1]. A membership function provides a measure of degree of similarity of an element in X to the fuzzy set F. The rules of a linguistic fuzzy model have the general form: If x is A then y is B (2) The proposition “x is A” is the antecedent of the rule, and the proposition “y is B” is the consequent. Variables x and y are linguistic ones defined as fuzzy 96 sets on domains (universe of discourses) X and Y, respectively. Constants A and B are linguistic terms usually associated with meanings for the linguistic variables, such as “low temperature”, “high velocity”, etc. Based on Lukacs et al. (2009) a type-1 fuzzy approach was adopted to develop a model that describes the relationship between the inputs vehicle speed (km/h) and curvature radius (m) and the output (electric current applied to drive the LED array). The model structure considered in this work was based on the TSK (Takagi-Sugeno-Kang) approach inference model (Liang et al., 2000; Mendel, 2001; Lukacs et al., 2009) in such a way that the electric current value in each rule is directly related to the input values through a linear parametric model. In order to showcase this functionality, the strategy adopted was to measure two signals, the road curvature and the vehicle speed measured directly from the vehicle, determining the lighting level of each LED. Figure 4.9 describes the hardware adopted. The total amount of luminous flux is linearly correlated with the total current established by the fuzzy model. Each increment of 350 mA on the current lights totally one LED and a sequential pattern from one to five LEDs is followed comprising the LED array proposed. There are several methods to investigate the luminance and measurements on the road. For example, the quantity and the quality of road lighting can be analyzed and controlled with road surface luminance measurements. As a reference, the European standard for road lighting calculations EN 13201-3 (EN, 2003) describes methods for luminance calculations and measurements (Ekriasa et al., 2008). Light distribution is represented in terms of luminous intensity and illuminance patterns. In accordance with the legal requirements, the values for illuminance are measured at a distance of 25 m (with the exception of Japan and the United 97 States). The illuminance distribution is assessed on a wall at a distance of 10 meters in front of the headlamp as an additional aid to the discussion and interpretation of the characteristics of light functions (Wördenweber et al., 2007). The evaluation of the fuzzy inference in the AFS truck control system was carried out through the comparison between model prediction and the specialist response, using the data obtained from test track measurements (Figure 4.8). The general procedure comprises a comprehensible representation of the system structure to investigate the model performance and each input variable (linguistic variable) is featured by three fuzzy sets that represent three meanings or linguistic terms: small/low, medium and large/high. As expected, the fuzzy models identified and adjusted for cars (Lukacs et al., 2009) based on membership functions and specialist rules proposed for this case did not present satisfactory results for trucks due to the inherent different speeds and driving conditions. The predominant flat surface presented in Figure 4.10 shows that the car developed model do not reach the full output current and when applied to trucks does not provide suitable luminosity, according to the current LED values. There is almost no correlation with responses due to small-radius curves and reduced speed variants. 98 Le d 5 400 Le d 4 320 Le d 3 240 Le d 2 160 Fuzzy model Le Total electrical current d 1 80 Speed 350 700 Radius of the curve 1050 1400 1750 Total electrical current (mA) Figure 4.9: System block diagram. Figure 4.10: Velocity/radius/LED-current surface generated for trucks using the fuzzy logic car model proposed by Lukacs et al. (2009). In order to tailor the model to incorporate the needs of the truck driver, Figure 4.11 presents the membership functions specifically proposed for trucks. Moreover, the specialist rules based on actual knowledge had to be revised and 99 are presented in Table 4.2. Comparing them with the rules used for a car (Table 4.3) by Lukacs et al. (2009), Table 4.2 shows adjustments for the speed and radius, which are mainly based on truck driver needs. It reflects the survey data which clearly shows that the average speed in all three conditions, rural, city and motorway is reduced. (a) (b) Figure 4.11: Membership functions related to the radius (a) and to the speed (b). Table 4.2: Antecedents combination and desired output (set by human specialist) – revised for truck driver needs # Rules for the antecedents Current to LEDs (mA) (set by human specialist) 1 If speed < 45 km/h and radius < 40 m 1,750 2 If speed < 45 km/h and 40 m < radius < 250 m 1,400 3 If speed < 45 km/h and radius > 250 m 1,050 4 If 45 km/h < speed < 65 km/h and radius < 40 m 1,350 5 If 45 km/h < speed < 65 km/h and 40 m < radius < 250 m 1,000 6 If 45 km/h < speed < 65 km/h and radius > 250 m 700 7 If speed > 65 km/h and radius > 250 m 350 8 If speed > 65 km/h and 40 m < radius < 250 m 0 100 Table 4.3: Antecedent combination and desired output (set by human specialist) – based on car driver needs # Rules for the antecedents Current to LEDs (mA) (set by human specialist) 1 If speed < 40 km/h and radius < 50 m 1,750 2 If speed < 40 km/h and 50 m < radius < 280 m 1,400 3 If speed < 40 km/h and radius > 280 m 1,050 4 If 40 km/h < speed < 90 km/h and radius < 50 m 1,350 5 If 40 km/h < speed < 90 km/h and 50 m < radius < 280 m 1,000 6 If 40 km/h < speed < 90 km/h and radius > 280 m 700 7 If speed > 90 km/h and radius > 280 m 350 8 If speed > 90 km/h and 50 m < radius < 280 m 0 The best fuzzy model structure obtained for a car was selected to be fitted for truck AFS control model. This structure (TSK model) is presented in Table 4.4. The rules were directly proposed from the knowledge presented in Table 4.2 joining the membership functions of Figure 4.11 also defined for trucks according to the specialist. The modeling of this problem using a fuzzy structure enables the obtainment of a model that provides continuous values for the electrical current and is also capable to consider the uncertainty associated to the definition of the membership grade of radius and speed values with relation to each range (set) defined by the specialist. The preliminary study carried out by Lukacs et al. (2009) identified that speed was the main contributor in the output model. The analysis confirmed that the radius had an insignificant influence on the output. The results captured with the radius as the main contribution on the output model presented the 101 worst results and had one of the highest quadratic errors. In addition, this inference supported the fact that the speed was not only more sensitive to the driver approaching the curves but it was also confirmed by the data collected from the test track. In order to adjust the fuzzy model performance, the parameters presented in the rule consequents were estimated through the solution of an optimization problem that minimizes the deviations between the model predictions and the desired current value defined by the specialist. This parameter estimation procedure keeps the intrinsic features of the fuzzy model, capable of providing continuous values for the electrical current, and enables the model to be adherent or close to the specialist knowledge. It is important to emphasize that that model was constrained in order to provide an output at greatest 10% lower than the specialist guess, which provides a more comfortable light distribution for the driver. The 10% restriction produced better results because it presented reduced fluctuations (small variance) and ensured the best outcome with a smaller quadratic error. 102 Table 4.4: The fuzzy model – truck AFS control (parameters a0 j and a1 j , j = 1,… ,8 ) Rule base 1. If speed is low and Radius is large then y = a01 + a11 ⋅ V 2. If speed is low and Radius is medium then y = a02 + a12 ⋅V 3. If speed is low and Radius is small then y = a03 + a13 ⋅ V 4. If speed is medium and Radius is large then y = a04 + a14 ⋅ V 5. If speed is medium and Radius is medium then y = a05 + a15 ⋅ V 6. If speed is medium and Radius is small then y = a06 + a16 ⋅V 7. If speed is high and Radius is large then y = a07 + a17 ⋅V 8. If speed is high and Radius is medium then y = a08 + a18 ⋅ V The mean quadratic error (between model predictions and specialist response) obtained for the model 1 adjusted was 10,935.96. Although this value is higher than the model created for the car (model 2), the surface that was generated to the truck driver is smoother when compared to the one generated with the car model adopting the truck needs. Table 4.5 shows the best solution for the car and truck driver adopting type-1 fuzzy. 103 Table 4.5: Best output models adopted for car and truck driver Model Fuzzy Output model Type Quadratic Std Error Deviation 1 1 y = a0 + a1 ⋅ V 10,935.96 474.63 2 1 y = a0 + a1 ⋅ V 5,061.11 322.33 Figure 4.12a shows the comparison between the results predicted by the model and the specialist suggestion. Figure 4.12b shows the surfaces generated by the model highlighting that the revisions in the rules solved the discrepancies observed when the car model was applied to trucks (Figure 4.10). The revised truck model with fuzzy structure describes a smoother surface, highlighting the circumstances in which the LEDs will operate and showing a good correlation between the radius and speed under small curves and radius. Confirming the coherence of the model, Figure 4.12b presents a ramp showing that current increases when radius and speed decrease and that there is a decrease in current when speed and radius increase. These circumstances are critical for the truck driver due to the lack of illumination on the roads and in the environments described earlier. The existence of a non-uniform surface with some abrupt drops in the current is expected and is associated to the nonlinearity of the fuzzy model and its intrinsic ability to interpolate different operational ranges. As stated earlier, a 10% restriction was suggested by the specialist to ensure that the model will not show a discrepancy within 10% of its best knowledge keeping the required amount of light on the road. The comparison of the surfaces allowed the specialist to confirm that this restriction is necessary to guarantee the correct amount of light for the driver, since the driver will have a safer night time whenever there is sufficient illumination on the 104 road ahead. Due to Brazilian road and environment conditions, this restriction is mandatory in order to guarantee the additional amount of light generated by the LED AFS system. (a) (b) Figure 4.12: (a) Comparison between the LED array current set by the specialist and the same parameter determined by model 1. (b) Velocity/radius/LEDcurrent surface generated by the revised truck model 1. The surface of Figure 4.12b comprises a more continuous behavior than the surface on Figure 4.13 (specialist surface). Furthermore, the surface of 105 Figure 4.12b presents a homogenous feature that also contributes to reduce the risk of possible distractions (or mistakes) of the truck driver during the nighttime driving. The comparison between Figures 4.12b and 4.13 is enough to justify the adoption of a modeling procedure, suitable for the reality described, instead of the specialist rules itself. Figure 4.13: Surface generated by the Table 2 (specialist rules for the truck driver). It is important to highlight that the surface in figure 4.13 is flat when the speed is greater than 60 km/h reassuring that the surface in figure 4.12b gives a better light output to the driver and generating a better nighttime vision, without abrupt ruptures in the surface. 4.6 Conclusions This paper describes the needs and behaviors of both truck and car drivers concerning road illumination in São Paulo, Brazil. The study has generated considerable data which provides information that can enhance the development of a tailored LED AFS system taking into account not only the 106 survey data but also the road conditions and the results from the simulations analyzed. The input given to the specialist helped define the intensity and distribution of light required for a driver when an AFS system is available. It is of utmost importance to highlight that a specific a fuzzy model is needed to address the needs of truck drivers. The proposed model confirms that the car model cannot be used to address truck driver needs. This study showed that the truck driver needs are different from those of the car driver, not only because of the field of vision and time of response, but also because the truck driver’s expectations of illumination are different, as highlighted in section 4.3. So far, there have been no studies in this field and this paper acknowledges that there are many aspects yet to be investigated. Furthermore, the data collected in this study enables the development of a tailored light distribution for low and high beams for both car and truck drivers in the Brazilian market. The proposed truck AFS LED system (five LED array with optics, electronic power driving system, onboard micro-controller and fuzzy logic builtin software controller) to enhance night time driving has been developed embracing a modeling framework which comprises a combination of expert knowledge and a parameter estimation procedure that enables the adjustment of the output models of each rule. More specifically, specialist engineering judgment can be incorporated into the fuzzy rule base according to knowledge and experience of night time and environmental driving conditions. Finally, there should be additional research in this field in particular to develop this AFS LED system to be incorporated into the truck segment of the market, either as an accessory or as an optional feature from the OEM. A patent for this proposed system is being requested due to its innovative 107 approach in the Brazilian market. It would be an Industry First and would raise the technology bar to the next level in the truck segment. Nomenclature aij model parameter y current to LEDs (mA) V velocity of the vehicle (km/h) OEM Original Equipment Manufacturer References Bellman, R. E., Zadeh, L. A., 1970. Decision-making in a fuzzy environment, Management Science 17, 141–164. Burg, A., 1967. Light sensitivity as related to age and sex. Perceptual and Motor Skills, 24 (3), 1279-1288. Egberink, H. O., Lourens, P. F., van der Molen, H. H., 1986. Driving strategies among younger and older drivers when encountering children. Accident Analysis and Prevention, 18 (4), 315-324. Ekriasa, A., Eloholma, M., Halonen, L., Song, X., Zhang, X., Wen, Y., 2008. Road lighting and headlights: Luminance measurements and automobile lighting simulations, Building and Environment 43, 530–536. EN, 2003. Road lighting—Part 3: Calculation of performance, European standard EN 13201-3, Publication 270-2003, Ref. No. EN 13201-3: 2003 E. Fenabrave, 2008. Anuário da Distribuição de Veículos Automotores do Brasil 2008, Fenabrave – Federação Nacional da Distribuição de Veículos Automotores. website: www.denatran.gov.br. 108 Gish, K. V., 2001. Driver behavior and performance using an infrared night vision enhancement system. Technical Report, DTHN22-95-D-07019. National Highway Traffic Safety Administration. Intervias, 2000. Research Regarding the Accidents of the Highways of the State of São Paulo (http://www.intervias.com.br). Karnik, N. N., Mendel, J. M., 1998. Introduction to Type-2 Fuzzy Logic Systems, Liang, Q., Karnik, N. N., Mendel, J. M., 2000. Connection Admission Control in ATM Networks Using Survey-based Type-2 Fuzzy Logic Systems, IEEE Transactions on Systems, Man and Cybernetics, Part C 30, 329-339. Liu, A., Veltri, L., Pentland, A. P., 1998. Modelling changes in eye fixation patterns while driving. Vision in Vehicles, 6, 13-20. Elsevier, Amsterdam. Lukacs, L., Fontes, C., Embiruçu, M., Pepe, I., 2009. Implications and outcomes of controlling a LED AFS (Adaptive Front-Lighting System) using fuzzy logic for the South American markets, SAE Technical Paper Series, No. 2009-360027. MapLink, web program based with worldwide maps, 2008. Website: http://maplink.uol.com.br. Copyright 2008. MATLAB software, version 7, fuzzy application toolbox, 2005. The Mathworks, Inc, Natick, Mass. Mendel, J. M., 2001. Uncertain Rule-based Fuzzy Logic Systems: Introduction and New Directions, Prentice-Hall P. T. R., London, UK. Neumann, R., 2004. AFS halogen headlamp system: Experimental study and first field results, SAE Technical Paper Series, No. 2004-01-0439. 109 Okombi-Diba, B. R., Okuwa, M., Uchiyama, Y., Kozato, A., Hongo, T., 2007. Evaluation of a night driver support system: Driver eye movement behavior. Journal of Computing in Civil Engineering 21(3), 200-210. Wördenweber, B., Wallaschek, J., Boyce, P., Donald D. Hoffman, D., 2007. Automotive Lighting and Human Vision, Springer Verlag, USA. 110 Capítulo 5 Desenvolvimento do protótipo do AFS baseado em LEDs Apresentação Este capítulo apresenta o desenvolvimento do protótipo pelo viés experimental. É uma continuação dos capítulos anteriores, onde as definições de qual LED deveria ser adotado e de qual lógica fuzzy deveria der adotada, em função das condições das estradas, do meio ambiente e dos resultados da pesquisa, ajudaram o especialista a desenvolver o modelo. Todos estes aspectos tratados anteriormente permitiram o desenvolvimento do protótipo físico (teste de bancada). Resumo Este capítulo discute o processo de prototipagem experimental, iniciando com o projeto do AFS com LED, incluindo o desenvolvimento do componente até a definição do produto e de sua funcionalidade. Depois disso, o foco é no impacto e no beneficio para o consumidor final, já que o objetivo principal deste estudo é criar uma condição de dirigibilidade noturna mais segura. Três aspectos chaves serão analisados e levados em consideração: o produto, a integração do sistema e as implicações futuras. Palavras-chave: AFS, LED, iluminação, lógica fuzzy, controle 111 Conclusão Este capítulo apresenta o desenvolvimento bem sucedido do protótipo, controlado pelo modelo proposto, que utiliza o conhecimento do especialista, que foi construído e desenvolvido em etapas anteriores. O protótipo é consistente com o conceito desenvolvido do sensor angular da direção e da velocidade do veículo. Tanto o LED como a ótica da lente foram escolhidos para serem incluídos no protótipo veicular. Além disso, a posição e o ângulo da posição dos LEDs também foram definidos. O software para controlar este sistema, adotando Visual Basic, foi desenvolvido e funcionou perfeitamente com o protótipo de bancada e com o protótipo veicular. No campo da eletrônica, destacam-se algumas realizações, tais como: o conceito inicial da eletrônica de potência, o micro controlador e a unidade de controle. Este desenvolvimento foi muito importante para poder integrar os sistemas elétrico e mecânico. Este integração mostra o desenvolvimento mecatrônico alcançado. Portanto, os resultados e o desempenho do protótipo comprovam uma contribuição tecnológica expressiva neste estudo, mostrando a viabilidade de um sistema AFS com LEDs e desafiando a equipe de trabalho a perseguir desenvolvimentos futuros a fim de desenvolver a aplicação veicular. Além disso, existem estudos em desenvolvimento com duas companhias, uma nos Estados Unidos e outra no Brasil. O apêndice C exibe uma carta da “De Ameretek Corporation”, localizada em Chicago, e também o esquema inicial para uma primeira proposta do produto. No Brasil, discussões técnicas com a “Rontan do Brasil” também já se iniciaram. Este é um feito importante, devido 112 ao fato de que existem companhias interessadas em desenvolver este produto para a indústria automotiva aqui no Brasil e também nos Estados Unidos. 113 Chapter 5 Developing the LED based AFS prototype Opening statement This chapter presents the prototype development process from the experimental point of view. It is a continuation from the previous chapters where the definitions regarding which LEDs should be chosen, which fuzzy logic should be adopted and which road conditions, environment and the survey results helped the specialist develop the model. The prior treatment of these aspects allowed the development of the physical prototype (workbench test). Abstract This chapter discusses the experimental prototyping process, starting with the LED AFS design, including the device development until the definition of the product and its functionality. The focus which will be adopted will be on the impact and benefits for the customer, since the main goal of the proposal is to make night time driving safer by adding light. Three key aspects will be analyzed and taken into account: product, system integration and further applications. Keywords: AFS, LED, lighting, fuzzy logic, control 114 5.1 Introduction There are three main aspects in this work: product, system integration & application and the customer acceptance criteria. The Brazilian automotive market is still very much an “emerging” market, with regards to widespread “new” technology uses, given its initial cost. Therefore, there will be a detailed explanation on customer needs and how this directly impacts on the system’s choice and definition, as well as a discussion on the suitability of commercial applications suited for AFS. There have been a series of publications such as technical papers that highlight the advantages of incorporating an AFS system to a passenger car (Hogrefe, 2000; Ishiguro et al., 2004; Neumann 2004). However, up until now, the heavy trucks market has not been considered a candidate for its use. AFS is designed to incorporate two independent light sources: a highoutput halogen projector for the main beam and a secondary row of light emitting diodes (LEDs) that illuminates almost instantaneously. This combination distributes the light beam evenly and consumes less power than conventional lights. The technical challenge comprises the effective control of its use. 5.2 Looking for a product As mentioned earlier, the first major aspect is to properly define the product and its components. As an initial approach (as if from a blank sheet of paper), the first on-vehicle AFS prototype developed for this research could be divided into the following components: light source, optics, heat sink and 115 connectors. The light source that was chosen for this project is a diode commonly known as light emitting diode (LED). 5.2.1 LEDs A LED is a semiconductor device that emits visible light when an electric current passes through it. From the early seventies up to mid nineties, the LED light output was not particularly bright, and most LEDs were monochromatic light sources, with light emission occurring around a single wavelength. The output light from those diodes goes from red (approximately 700 nanometers) to blue-violet (around 400 nanometers). Some LEDs, usually used for communication applications, can emit at infrared (IR) mode, typically 830 nm and 1200 nm. A LED consists of two elements of processed material called “P-type” and “N-type semiconductors”. These two elements or materials are grown in direct contact forming a region called the “P-N junction”, where a depletion zone (deprived of a free electric charge) is formed. In this respect, the LED resembles other diode types, but there are some important differences. The junction is formed mostly on the middle of the thin N and P layers and the whole LED has a transparent package. The thin material and the special package allow for visible or IR photons which are generated on the vicinity of the depletion zone around the junction and pass through it, coming out from the device. Also, the LED has a large P-N junction area whose shape is tailored to improve its light source quality. During almost three decades, LEDs were related only as a marker or reference light on equipment panels and displays. In 1993, Nichia Chemical 116 from Japan started the production of blue LEDs (Nakamura, 1996). When blue diode was combined with red and green LEDs, the outcome was white (RGB, Red Green Blue) light. This was a breakthrough in technology and has opened a series of debates as well as new developments. The principle of RGB white composition is sketched in Figures 5.1 and 5.2. Figure 5.1: Composition of white light through RGB. Blue Peak Red Peak Green Peak 470 525 590 630 (nm) Figure 5.2: Example of light spectrum for white light source composed by RGB technique. On the other hand, companies like OSRAM (Germany) and Lumileds (a division of Philips) dedicated resources to LED development and adopted other technologies to obtain white light. The following concept was used: the addition 117 of a phosphorophore composite, capable of emitting from green to red, placed on the top of the blue LED, used as driver, generating white light. In Figures 5.3 and 5.4 the light composition and spectrum for this kind of white LED is shown. Phosphorophore composite layer Blue LED chip & Phosphorescence Light drive White Light output Figure 5.3: Composition of white light through blue led adding a phosphorophore composite. Combined spectrum Blue-white Yellow phosphor InGaN Blue LED 470 nm Blue 525 nm 590 nm 630 nm Amber Red Green Figure 5.4: White phosphorophore LED spectrum. Some benefits of LEDs, when compared with incandescent and fluorescent illuminating devices, include: • Low power requirement (less then 5 W per LED); 118 • High efficiency; • Long life; • Instant response. In order to choose which LED was the most appropriate to adopt, a series of laboratory experiments have been performed. There were three samples to be evaluated. Two samples from Lumileds and one from OSRAM. From OSRAM, the team evaluated the Golden Dragon from 50 to 100 lumens, and the Lumileds LUXEON I and K2 varying in the same range as well. The main difference is that the electric current to power up Lumileds is 1000 mA and the OSRAM´s need 350 mA instead. As an example, Figure 5.5 describes the construction of a LUXEON®K2 Power LED with the details and its components. Figure 5.5: Construction of a LUXEON®K2 Power LED (Thermal Heatsink extracts heat from the LED chip). As a result of the AFS developing process, two bench prototypes were created to evaluate the samples. The block diagram for one LED channel, used on composing the AFS system, is presented in Figure 5.6. 119 Microcontroller LED Optics Heat Sink Power electronics AFS controlling software Sensor system Figure 5.6: Block diagram for one LED channel. 5.2.2 Optics In order to define the optics, three different lenses with different aperture angles were used. The samples (KEPL197XX Series) were provided by the Italian company Khatod (Khatod, 2009), its datasheet can be found on the Khatod's website. The samples that are shown in Figure 5.7 had 10, 25 and 40 degrees of aperture, respectively. The best solution for the proposed AFS application was the 10-degree aperture due to the sharp light cone edges. 120 Figure 5.7: Lens with holder with 10, 25 and 40 degrees of aperture (left to right). 5.2.3 The selected LED On chapter 2, the comparison among high power LEDs showed the best results towards the OSRAM Golden Dragon for this application. However, silicone is a soft material and prone to attracting dust. These properties make proper handling imperative to avoid damage to the emitters. In Figures 5.8 and 5.9 there are examples on the K2 LED (Philips, 2009) associated to the Khatod lens. Lifetime for solid state lighting devices (LEDs) is typically defined in terms of lumen maintenance: the percentage of initial light output remaining after a specified period of time. Philips Lumileds projects that white LUXEON K2 products will deliver, on average, 70% lumen maintenance at 50,000 hours of operation at a forward current of 1000 mA. This projection is based on constant current operation with junction temperature maintained at or below 120 °C. Figure 5.8: LUXEON®K2 Power LED from Lumileds. 121 Figure 5.9: LUXEON®K2 Power LED with Khatod holder and lens. 5.2.4 Heat sinking As already stated, lumen maintenance is directly associated to the internal blue LED wafer (chip) operation temperature. When on rush operation or polarized by its quiescent current, it is imperative to have a way to evacuate calories from the LED. The heat sinking system adopted for the first bench prototype was chosen from standard catalog of HS Dissipadores (HS, 2009), a Brazilian company. Figure 5.10 shows the “HS3542” profile chosen and used on the prototype. The datasheet with all the technical data is available on the HS's website. Figure 5.10: HS3542 profile dimensions in mm. 122 5.2.5 The power electronics The power electronic block in Figure 5.11 is based on the IRFZ46N, a HEXFET® power MOSFETs produced by International Rectifier. Figure 5.11: Basic HEXFET structure. The option on power up the AFS LED array using an FET transistor resides on the fact that the power management efficiency of those devices is much better than the bi-polar transistors. Figure 5.12 shows the basic electronic circuit for one LED AFS channel. 123 LED ARRAY Figure 5.12: Basic one channel LED AFS power circuit. International Rectifier has provided rugged Power MOSFET semiconductor devices for almost 20 years. To better understand and utilize IR HEXFET Power MOSFETs, it is important to explore the rugged MOSFETs design. All semiconductor devices are rated for a certain max reverse voltage (BVDSS for Power MOSFETs). Operation above this threshold will cause high electric fields in reversed biased P-N junctions. Due to impact ionization, the high electric fields create electron-hole pairs that undergo a multiplication effect leading to increased current. The reverse current flow through the device causes high power dissipation, associated temperature rise and potential device destruction. Despite the fact that MOSFETS are more efficient on energy management, all semiconductor devices contain parasitic components intrinsic to its physical structure. In Power MOSFETs, these components include capacitors due to displaced charge in the junction between P and N regions, resistors associated with material resistivity (for example RB), a body diode formed where the P+ body diffusion is made into the N- epi-layer, and a virtual 124 NPN parasite bi-polar junction transistor (BJT) formed where the N+ source contact is diffused. First introduced in the mid-1980’s, Avalanche Rugged MOSFETs and HEXFET are designed to avoid turning on the parasitic BJT until very high temperatures and/or if a very high avalanche current occurs. This is achieved by: • Reducing the P+ region resistance with higher doping diffusion; • Optimizing cell/line layout to minimize the “length” of RB. The net effect is a reduction of RB, and thus the voltage drop necessary to forward bias the parasitic BJT will only occur at higher current and temperature. Avalanche Rugged MOSFETs are designed to contain no single consistently weak spot, so avalanche occurs uniformly across the device surface until failure occurs randomly in the active area. Utilizing the parallel design of cells, avalanche current is shared among many cells and failure will occur at a higher current than for designs with a single weak spot. Figure 5.12 shows the basic device structure. A Power MOSFET which is well designed for ruggedness will only fail when the temperature substantially exceeds rated TJMAX. The voltage and current regulation is done by the National Semiconductors LM317, a 3–terminal floating regulator. In operation, the LM317 develops and maintains a nominal 1.25 V reference voltage (Vref) between its output and adjustment terminals. This reference voltage passing through a 125 resistor (R1) is converted into a programming current (IPROG) (see Figure 5.13), and this constant current flows through R2 to the ground. The regulated output voltage is given by: (1) Figure 5.13: LM317 semiconductor application. Since the LM317 is a floating regulator, it is only the differential voltage across the circuit which is important to performance, and operation at high voltages with respect to ground is possible. 5.2.5.1 Connectors The connector which was adopted for both the vehicle and bench prototypes was from Yazaki and is an industry standard sealed connector (Yazaki, 2009). It is already used within the OEMs. This connector contains 8 outputs which are used to control the LEDs independently. 126 Sealed connectors have evolved from decades of intensive design refinement. Their main characteristic is their protection from both moisture and other contaminants. Terminal blade sizes from Yazaki samples are in accordance with USCAR and ISO standards. In Figure 5.14 there is an example from a sealed connector. Figure 5.14: Example of a sealed connector. Moreover, the Terminal Position Assurance Device is available frontloaded and preset to the connector housing. The connector cannot be mated if preset terminal spacer is not in the full-lock position. The Connector Position Assurance Device is available preset to the female terminal connector housing. Yazaki series is compatible with a wide range of wire sizes and current gauge requirements. In Figure 5.15 there is an exploded view of a sealed connector (Yazaki, 2009). 127 Figure 5.15: Exploded view of a sealed connector. With the increasing demands of performance and system functionality, new header connectors are designed to be a robust automotive interconnection solution. In Figure 5.16 there is a connector drawing that was adopted for this study, which is an industry standard. Figure 5.16: Sealed connector side view. In Figure 5.17 the header is shown with the technical details from the supplier. 128 (a) (b) Figure 5.17: (a) Sealed connector technical datasheet from header; (b) Detail X. 5.2.6 The microcontroller A Microcontroller (µC) is a small digital computer on a single integrated circuit. It is usually based on two architectures: von Neumann or Harvard. The von Neumann architecture is a design model for a stored-program computing single system that uses a processing unit and a single separate storage structure (memory) to hold both instructions and data. Despite the fact that the original plan was to use a microcontroller device to drive the proposed AFS system, in this stage a PC will be used to simulate the microcontroller on the 129 bench prototype development. As a future development, a microcontroller will be defined for the vehicle level study. 5.2.7 The controlling software As the primary goal of this research is the embedded software (AFS controlling routines) and hardware (AFS microcontroller and power circuitry) in vehicles, the development used a PC and a high level code writing programming language. The programming template adopted to implement the controlling software was Visual Basic (VB). Visual Basic is a Microsoft environment allowing object-oriented programming capable to produce a graphical user interface. On that human-machine interface (HMI) the user can interact on choosing and modifying pre-selected sections and parameters, redefining the way routines and subroutines will run. Since Visual Basic is easy to learn and fast to write code with, it was used during prototyping and test. Codes will later be written in a lower level language, more difficult and hermetic, but more efficient. Visual Basic is also widely used to write working and commercial programming codes. Microsoft reports that there are at least 3 million developers using Visual Basic nowadays. Since its launch in 1990, the Visual Basic approach has become the standard for programming languages. Now there are visual environments for many programming languages, including C, C++, Pascal, and Java. Visual Basic is sometimes called a Rapid Application Development (RAD) system because it enables programmers to quickly build prototype applications. 130 The program was written to incorporate the fuzzy logic rules translated to the steering angle and speed. The computer code developed at the laboratory is added in Appendix B. 5.2.8 The sensor system definition The definition regarding the steering wheel angle sensor will be divided in two stages. In the first stage, the strategy adopted was the use of a video game joystick (featuring a steering wheel) to be able to simulate, in a laboratory, a car- driving situation. The digital environment used to run the LED AFS controlling routines was a PC, where a high level language program was developed with Visual Basic software. The interface to the sensor was already incorporated to the joystick and will be discussed later on section 5.3. Although there are some sensors already available in the market, there are some studies underway to define the sensor that will be adopted for the final product. Some wireless proposals have been done but the implementation is not yet completed in order to be adopted in a vehicle. In recent years, the introduction of Light Emitting Diode (LEDs) and Adaptive Front-lighting Systems (AFS), which directs the light beam according to the driver’s needs have been studied. These intelligent systems acquire data from vehicle sensors to determine the direction of the light beam and its distribution. One of the main barriers on the development of these systems is to create and install sensors inside the vehicle without interfering with the other piece of equipments. LaPO team is developing a wireless sensor to be adopted in any vehicle that can capture the signal and transfer it to controller as one of the system input. According to Ribeiro et al. (2008), the use of wireless communication 131 technology in the sensor’s data transmission on the interior of the vehicle is a feasible proposal. A steering sensor was developed to be adaptable to any vehicle without the need of interfering with the car’s project. It is the objective of LaPO team to add another vehicle security item without interfering on the productivity or cost of automotive assembly line. In Figure 5.20, there is an example of a steering wheel angle sensor which is part of the whole vehicle prototype development. Battery 12V Figure 5.20: Sensor schematics for steering wheel. 5.3 Experimental In order to develop the first bench prototype, an initial assumption was developed from the sketch shown in Figure 5.21. It demonstrates the LEDs with optic lens glued to heat sink. 132 Figure 5.21: LED with optics glued to heat sink. Assuming that this design is a first prototype assembled with LED OSRAM Golden Dragon, in Figure 5.22 one can see those LEDs glued to the heat sinker. Figure 5.22: LED OSRAM Golden Dragon with heat sink. In order to evaluate both LEDs, this experiment was developed considering the OSRAM Golden Dragon LEDs on both sides of the AFS. The used TYCO connectors, an industry standard, were mounted in the way to allows interconnection and/or swapping during the tests. 133 5.3.1 Test setup This is the proposed layout for the first bench prototype test. It is important to mention that improving and developing optics were not the main goal at this stage. It was imperative to achieve control of the system’s performance according to the model that was developed. In Figure 5.23 there is a scheme of the proposed prototype. 2 1 3 5 4 Figure 5.23: First bench prototype layout: 1) LEDs LHS; 2) LEDs RHS; 3) Control and power unit; 4) PC; 5) Joystick with wheel and pedals. 134 The prototype is divided into 5 components: LEDs left array, LEDs right array, control and power unit, the personal computer PC, and the joystick featuring a steering wheel and pedals (acceleration and breaks). After the theoretical and numerical simulations using MATLAB software (MathWorks, Inc.), the algorithm to control the prototype has been implemented on a Visual Basic programming code. This prototype allowed the algorithm to be both tested and continuously improved. Results will be presented comparing the simulation with the prototype. 5.4 Appearance When examining the actual trend within the available technology and design perspectives for a given item, it is needless to mention that functionality is not the only important factor on the market today. It is crucial to highlight that the next generation of adaptive front lighting system (AFS) features sequential LED lighting in any case, discarding most of the technological development done on the past as mechanical solutions. For example, for the prototype developed as a initial study to add the LEDs in a production lamp, the Ford Ranger was the chosen part (Figure 5.24). The fashion in which the system’s optics has been designed to function together has not yet been seen or appreciated by the exterior lighting world. In addition to being a beautifully designed optical arrangement, the system also helps drivers take corners and curves more safely and consumes less energy while doing so due to the LED usage. 135 Figure 5.24: Ranger headlamp prototype with AFS LED incorporated. The system senses when the vehicle is approaching a curve and directs the row of LEDs to switch on sequentially. As the vehicle turns, the LEDs illuminate at a rate and intensity determined by the degree and speed of the turn. Electronic sensors analyze inputs from the steering wheel and the vehicle speed to determine how and when to illuminate the LEDs. The LEDs automatically switch off when the road straightens out, but the main beam continues to illuminate the overall road. The result is more light, accurately placed, and more importantly, light is being added for more visibility during night time driving, not taken from one spot on the road and having it moved to another, as today's cornering systems do. The concept that was investigated in this study contains five LEDs which are lit according to a certain logic incorporated on the algorithm. 5.5 System integration and application In order to validate the development proposed so far, a bench prototype was mounted using a PC as the onboard intelligent unit and a joystick as the car steering wheel. All the details will be presented in the following sections. 136 5.5.1 Sensor definition On the bench prototype, the steering sensor is a potentiometer fixed to the joystick steering wheel; on the other hand the speeding and the breaking signals are obtained from two proportional displacement sensors coupled to the joystick pedals. The PC joystick treats the analog signals converting it to digital format; the peripheral–computer communication is made through an USB port, using a proprietary protocol. 5.5.2 Control strategy and benefits The fuzzy models developed in the chapters 3 and 4 were used to control the lighting intensity of the LEDs according to the vehicle’s speed and road’s curvature. As discussed before, fuzzy logic is derived from fuzzy set theory and copes with the uncertainty of the information. Uncertainties are present in many human tasks such as decision making where uncertain, vague, ambiguous or contradictory terms must be evaluated to reach a decision. Fuzzy logic has been used widely to model systems providing non usual procedures in order to obtain information related to the interaction between variables or systematic approaches to support the decision making required in some operational tasks. The variables considered in the workbench test, using the physical prototype described, were two inputs (road curvature and vehicle speed) and one output signal (LEDs been lit) according to the model and fuzzy rules presented in chapters 3 and 4. 137 The final product not only incorporates the state of the art in the technology in the market but also launch a product that is Hg free. This product incorporates all the LEDs advantages, such as long life, more efficient than an incandescent bulb, lower maintenance costs and better resistance to impact and vibration. Moreover, it is of utmost importance to highlight that there is a substantial increase in safety. There is an opportunity to reduce accidents giving the customer more comfort. In Figure 5.25 the “real gain” in lighting when adopting this system is shown. Here is key to highlight that the system below uses the step motor to shift the light instead of adding the light. There are several limitations to the range as well, since this system can only shift the light 15 degrees to the right and 5 degrees to the left, mainly due to the regulatory aspect since there are several photometric points to be met and the light still needs to meet those regulatory points. Figure 5.25: Real gain (blue zone) versus regular beam pattern (green). 5.6 Simulation and experimental comparison In order to compare the simulation generated from chapters 3 and 4 from the fuzzy algorithm, the specialist expertise and the bench prototype, here is the proposed method to analyze the data acquired from the prototype. As 138 previously mentioned, the fuzzy algorithm created on chapter 4 was already tailored for the truck driver in order to enhance the night vision taking into consideration not only the driver needs according to the survey but also the road and environmental conditions. For the data collection a test track was used and the acquisition was done in real time with the VBOX equipment. To allow the comparison between the simulated and the specialist, a collection of data points was done every 2 seconds. At this point a very important consideration must be done. All simulation using fuzzy logic (see chapter 3 and 4) was done using MATLAB as operational template, running in a robust and well configured (hardware and operational system) personal computer. This numerical machine is more powerful, on numerical calculation terms, then any (affordable) microcontroller, imposing that the onboard car system will be simpler then the simulation laboratory system and the results with one system and another will reflect that limitation. In order to validate the bench prototype model, the proposed comparison analyzed the 237 data points which where simulated on the bench prototype reproducing the same speed and curve radius that were acquired at the test track and the specialist expertise. Figure 5.26 shows the results when comparing the outcome theoretical (simulated) current that must be supplied to the LEDs, the actual sent current decided by the onboard system and the specialist’s direction. The black curve is the simulated data from the MATLAB calculated algorithm, the blue one is the specialist input and the red one is the current sent to the LED by the bench prototype. These results will allow not only understanding the system's functionality but also go ahead for the development of the vehicle on board prototype, specifically for the heavy truck segment. 139 Figure 5.26: Comparison among prototype, simulation and specialist data. In order to compare the three results a correlation was done among the three output signals, specialist, prototype and simulated. In order to compare the three results, the correlation among the three output signals, two by two, has been investigated. In the first case, presented in Figure 5.27, there is the comparison between the simulated and the prototype. After that, the comparison in Figure 5.28 is between the simulated and specialist data, and in Figure 5.29 the prototype and simulated data is compared. The correlation is calculated upon the division of one signal versus the other one. Table 5.1 presents the results with the standard deviation from the data collected. 140 Table 5.1: Correlation among specialist, prototype and simulation Simulated vs. Simulated vs. Prototype vs. Prototype Specialist Specialist Average 1.06 1.11 1.04 Std Deviation 0.15 0.19 0.10 It is clear that there is a strong correlation among the data presented. The result from the simulation and the prototype indicates that there are some adjustments to be perceived in the algorithm and in the Visual Basic program in order to improve this correlation. 141 (a) (b) Figure 5.27: Behavior of the correlation between simulated and prototype (a) and the data comparison (b). 142 (a) (b) Figure 5.28: Behavior of the correlation between simulated and specialist (a) and the data comparison (b). 143 (a) (b) Figure 5.29: Behavior of the correlation between specialist and prototype (a) and the data comparison (b). If the local high frequency fluctuation is disregarded, it is noticeable that in all three cases (specialist and prototype, specialist and simulation, simulation and prototype), the general behavior is the same for those curves. The system shows a systematic behavior when the current sent to the LED is mostly bigger than the actual simulated value. This seems to indicate that the control system has a tendency to over react sending more light to the AFS. It is important to highlight that there are improvements to be done in both the simulation and the prototype in order to improve this correlation. However, 144 this is already a confirmation that the prototype system is prepared to be taken to the vehicle level test. 5.7 Conclusions This chapter presents a prototype successfully developed and controlled according to the model and specialist knowledge developed and raised in previous steps. The prototype is also consistent with the concept associated to the steering wheel angle sensor and speed. Both LED and the optics of the lens were chosen to be included on the vehicular prototype. Moreover, the position and angle where the LEDs should be positioned was also defined. The software to control this system, adopting Visual Basic, was developed and successfully worked on both the workbench and vehicle’s prototype. Therefore, the results and the prototype performance attest to the expressive technological contribution of the whole work, showing the feasibility for the LED AFS system application and encouraging the work team to generate further studies and developments within this subject to seek the vehicle application. Also, it is important to describe that there are adjustment to the algorithm and also it confirms that the prototype still supplies more light to the driver however it does reinforce the fact that the next step will be to evaluate this on the road where the visual perception will determine the system’s functionality and a jury evaluation should be held to confirm the improvements that can be obtained with this system. There are studies under development with two companies, one in the United States and one in Brazil. On appendix C, there is a letter from “De Ameretek 145 Corporation” located in Chicago and also the initial scheme and first product proposal. In Brazil, technical discussions with “Rontan do Brasil” have already started. This is a huge accomplishment due to the fact that there are companies interested in developing this product for the automotive industry here in Brazil and in the United States as well. Nomenclature USCAR The United States Council for Automotive Research ISO International Standard Organization LaPO Laboratory of Optical Proprieties References Hogrefe, H., 2000. Adaptive front lighting systems for optimum illumination of curved roads, highway lanes and other driving situations, SAE Technical Paper Series, No. 2000-01-0431. HS, 2009. HS Dissipadores, http://www.hsdissipadores.com.br. Ishiguro, K., Yamada, Y., 2004. Control technology for bending mode AFS, SAE Technical Paper Series, No. 2004-01-0441. Khatod, 2009. www.khatod.com. Lexikon, 2002. History of Computing, Lexikon Services, ISBN 0-944601-78-2. Nakamura, S., 1996. High-brightness blue/green LEDs and first III-V nitridebased laser diodes, Proc. SPIE Physics and Simulation of Optoelectronic Devices 2693, 43-56. Neumann, R., 2004. AFS halogen headlamp system: Experimental study and first field results, SAE Technical Paper Series, No. 2004-01-0439. 146 Philips, 2009. http://www.philipslumileds.com. Ribeiro, M., Simoes, L., Lukacs, L., Pepe, I. M., 2008. Adopting wireless communication sensor to apply with AFS system. V National Congress of Mechanical Engineering (CONEM), Bahia, Brazil. Yazaki, Yazaki datasheet, 2009. http://www.yazaki-na.com. 147 Chapter 6 Conclusions and suggestions for future studies Opening statement This chapter presents the final comments on the LED AFS theory and application, while reviewing the methodology used and results obtained. This includes the different approaches which were applied to both car and truck models and a discussion of further alternatives to continue this research. In addition, a thorough discussion on the depth of the work performed is presented. Keywords: LED, fuzzy, control, truck 147 Capítulo 6 Conclusões e sugestões para trabalhos futuros Apresentação Neste capítulo são feitos alguns comentários finais, fornecendo uma visão geral de todo o trabalho realizado, incluindo um paralelo entre as diferentes abordagens feitas ao modelo proposto, tanto para os carros como para os caminhões. Além disso, é feita uma lista de sugestões para a continuação dos estudos e pesquisas desenvolvidos ao longo do trabalho, envolvendo a exploração de novos aspectos relacionados ao processo, bem como a investigação mais aprofundada de aspectos já explorados. Palavras-chave: LED, fuzzy, controle, caminhão 148 6.1 Comentários finais Primeiramente é importante destacar a inovação apresentada neste trabalho. O sistema proposto neste trabalho de AFS com LEDs para caminhões pesados é inovador e possui uma série de vantagens em relação ao estado da técnica atual. É possível destacar 4 pontos: • Campo de visão: o campo de visão do sistema incremental, em comparação ao sistema com motor de passo, possibilita uma maior amplitude no campo visual, da ordem de 30 graus para a direita e para a esquerda, enquanto que o sistema com o motor de passo tem a limitação de 15 graus para a direita e de 5 graus para esquerda quando o tráfego é na mão direita. Nos mercados que trabalham com a mão esquerda, os valores são invertidos; • Confiabilidade do sistema: devido ao fato do sistema eliminar a parte móvel e conseqüentemente eliminar o motor acoplado ao refletor, a probabilidade de mal funcionamento ou falha do componente dentro do farol é reduzida. O sistema proposto possui a vantagem de ser independente do farol principal, sem afetar o funcionamento do componente; • Consumo elétrico: o modelo proposto, devido ao fato de adotar os LEDs, possui um consumo menor em relação ao sistema com motor de passo, pelo fato de possuir toda a eletrônica adicional para não só controlar o mesmo, mas também para acionar o sistema quando necessário; • Aparência: a vantagem do modelo proposto permite uma aparência diferenciada, criando uma diferenciação mercadológica e, além disso, 149 não necessita de espaços adicionais ao redor do refletor nas proximidades da moldura interna do farol para permitir a movimentação do mesmo. Para o departamento de estilo de uma montadora, e também para o consumidor final, não ser necessário a adição desse espaço permite a criação de um design mais limpo e também inovador. Além dos quatro pontos destacados acima, o trabalho desenvolvido sugere a real necessidade de um modelo específico para controlar o AFS com LEDs para o motorista de caminhão, a fim de proporcionar uma melhor dirigibilidade noturna para o mesmo. Foi visto, ao longo do trabalho, que as etapas da escolha da fonte luminosa, da lógica a ser adotada, das condições de contorno, do meio ambiente e dos dados da pesquisa, foram, sem dúvida, as peças-chaves para o surgimento deste modelo ajustado para o mercado brasileiro. No estudo comparativo entre os LEDs de alta eficiência e alta potência da OSRAM e da Lumileds, levantado no capítulo 2, foram observadas algumas diferenças no comportamento destes dispositivos. Os primeiros LEDs estudados foram: Golden Dragon, K1 e K2. Para o K2 a curva de acomodação entre o regime transiente e o regime estacionário só pode ser ajustada por duas exponenciais (dois tempos de vida), enquanto as respostas do Golden Dragon e do K1 podem ser ajustadas por uma única exponencial decrescente para cada um dos LEDs. O Golden Dragon foi escolhido para esta aplicação. Já o capítulo 3 descreveu o desenvolvimento e a aplicação de um sistema baseado nas regras fuzzy que prescrevem e determinam a quantidade de luz a ser adicionada ao farol durante o período de direção noturna. O 150 modelo proposto apresenta a combinação entre o conhecimento do especialista e um procedimento de estimação de parâmetros que permite o ajuste de cada uma das regras de saída do modelo, considerando estruturas diferentes de modelos fuzzy tipo 1 e tipo 2. Mais especificamente, o julgamento no viés técnico do especialista pode ser apropriadamente incorporado ao modelo de regras fuzzy de acordo com o seu conhecimento e a sua experiência do período noturno e das condições do meio ambiente. Alguns dos modelos são adequados, mas as duas melhores alternativas são os modelos 7 e 8, que consideram a restrição que suporta a utilização do conhecimento do especialista da melhor forma possível. Estes modelos têm uma resposta similar ao especialista, devendo ser destacada a importância de se criar uma direção noturna mais segura, provendo mais iluminação para o motorista. O capítulo 4 descreve as necessidades e o comportamento de ambos os motoristas, de carro e caminhão, levando em consideração a iluminação das ruas de São Paulo, no Brasil. O estudo gerou uma vasta quantidade de dados que podem suportar o desenvolvimento de um sistema específico de AFS a LEDs, levando em conta não só os dados da pesquisa, mas também as condições das estradas e os resultados das simulações realizadas. As informações dadas ao especialista ajudaram a definir a intensidade e a distribuição de luz requerida quando o sistema AFS estiver disponível. É importante destacar a necessidade de um modelo específico para o motorista de caminhão. O modelo proposto confirma que o modelo de carro não pode ser adotado pelo motorista de caminhão, pois não atende as suas necessidades. Este estudo deixa claro que as necessidades dos motoristas de caminhão e de 151 carro são diferentes, não somente pelo campo de visão e pelo tempo de resposta, mas também pelos anseios em relação à iluminação veicular, que são diferentes, conforme destacado na seção 4.3. Até o presente momento, não existem estudos neste campo e este capítulo mostra que existem muitos aspectos que podem ser aprofundados. Além disso, os dados coletados neste estudo permitem o desenvolvimento de um sistema específico para os faróis baixo e alto para o mercado brasileiro, para ambos carros e caminhões. O modelo de AFS a LEDs para caminhões (conjunto de LEDs com ótica, sistema de alimentação elétrica, um computador pessoal com lógica fuzzy embarcada) para melhorar a dirigibilidade noturna foi desenvolvido levando em consideração o conhecimento do especialista e a estimação dos parâmetros que permitiu o ajuste do modelo de saída de cada regra, levando em consideração diferentes estruturas fuzzy tipo 1 e tipo 2. Mais especificamente, o julgamento do especialista pode ser incorporado na formação das regras fuzzy de acordo com as condições das estradas e do meio ambiente. É necessário enfatizar que a solução para o segmento de caminhões foi a número 1, que demonstra uma superfície com menor variabilidade e utiliza fuzzy do tipo 1, o que simplifica o modelo de saída. O modelo escolhido confirma o conhecimento do especialista e claramente reduz a complexidade do mecanismo global de controle para esta aplicação. O capitulo 5 descreveu a parte experimental e a validação do protótipo de bancada adotando o programa em VB (Visual Basic) e utilizou um PC para simular o micro controlador. Um joystick com um sensor simulou o volante e o sensor de posição do mesmo. 152 Finalmente, como visto acima, destaca-se o fato de que cada capítulo teve uma discussão que foi complementada pelo capítulo seguinte chegando à geração do protótipo de bancada. O comparativo do modelo simulado versus o modelo do protótipo validou o estudo e permitiu avançar para o estudo com os dois fornecedores brasileiro e americano para desenvolver o produto veicular. A patente para este modelo proposto está sendo requisitada, devido à sua inovação no mercado brasileiro, já que esta seria a primeira vez desta aplicação (AFS baseado em LEDs para caminhões) na indústria automotiva, e iria gerar um grande avanço tecnológico no segmento de caminhões visto que o estado da técnica atual adota apenas o sistema com motor de passo. 6.2 Sugestões para trabalhos futuros São necessários estudos adicionais na parte experimental desta pesquisa, mais especificamente para desenvolver o protótipo veicular do AFS a LEDs com o modelo proposto neste trabalho para ser incorporado ao segmento de caminhões, como um acessório ou um item opcional da montadora. Assim, existe uma grande oportunidade de aprofundar o estudo no viés da aplicação do modelo e validar o mesmo no campo através de um protótipo veicular. Desta forma, será viável aperfeiçoar, ou não, o modelo que foi proposto, tanto para o carro como para o caminhão. Isto já foi iniciado com discussões com os fornecedores nos Estados Unidos e no Brasil. Existem também oportunidades para desenvolvimentos adicionais em relação ao sensor de posição, o que já esta sendo trabalhado pela equipe do Laboratório de Propriedades Ópticas (LaPO). 153 O recorte neste estudo também poderá ser ampliado na busca de uma nova fonte de luminosidade (LED) com um rendimento melhor e um desempenho superior em iluminação, visto que este mercado está em grande ascensão. 154 Apêndice A Anteprojeto do relatório descritivo da patente de invenção: farol auxiliar e processos relacionados 155 Appendix A Draft of invention patent description report: headlight help and related processes 156 A.1. Campo da invenção A matéria aqui descrita pertence aos campos dos dispositivos de iluminação veicular frontal. A.2. Fundamentos da invenção Dispositivos de iluminação veiculares frontais conhecidos atualmente são faróis, faróis auxiliares, faróis de neblina, faróis de longo alcance, entre outros. Os dispositivos conhecidos não possibilitam o incremento de iluminação veicular gradativo, o que impede, por exemplo, um aumento no campo de visão do motorista. Documentos do estado da técnica definem sistema adaptativo de iluminação veicular frontal como um dispositivo de iluminação que atua nas luzes dianteiras de veículos, direcionando seu facho de luz, visando aumentar a visibilidade dos motoristas em viagens noturnas, iluminando as faixas divisórias das pistas e acostamentos, aumentando a probabilidade de evitar acidentes. O funcionamento do sistema ocorre através de um motor de passo que direciona a luz do farol para a direita e para a esquerda, num campo de 15 graus para a direita e 5 graus para esquerda em veículos que trafegam na mão direita, auxiliando o motorista. Este sistema foi somente aplicado em veículos de passeio. Atualmente a fonte de energia utilizada para este tipo de aplicação são lâmpadas halogenas ou de descarga de luz de gás xenônio. Assim, é desejável que seja desenvolvido um dispositivo adaptativo de iluminação veicular frontal que possa permitir o incremento de iluminação veicular gradual, adicionando iluminação para o condutor do veiculo adotando o uso de LEDs (diodos emissores de luz) como a fonte de energia para esta aplicação. A.3. Breve descrição da invenção A matéria descrita no presente documento compreende um dispositivo adaptativo de iluminação veicular frontal a LEDs que compreende um algoritmo baseado em lógica fuzzy para controlar o acendimento gradual dos LEDs, de 157 acordo com as condições da via de rodagem. A invenção tem como objetivo: 1. Processo de desenvolvimento do algoritmo fuzzy para controlar o sistema adaptativo de iluminação veicular dianteira a LEDs; 2. Meios para adaptar o algoritmo para qualquer mercado (brasileiro, americano, europeu, asiático, entre outros); 3. Adotar este sistema em veículos pesados. A.4. Breve descrição das figuras A Figura A.1 mostra o diagrama esquemático de funcionamento do sistema adaptativo de iluminação veicular a LEDs. A Figura A.2 mostra a pesquisa de campo que foi realizada para compreender as necessidades dos motoristas brasileiros tanto de carros como de veículos pesados. A Figura A.3 mostra uma alternativa para o farol auxiliar adaptativo com o sistema de LEDs já incorporado ao farol principal de um veículo. A Figura A.4 mostra a pista de testes que foi utilizada. A.5. Descrição detalhada Os exemplos aqui descritos são independentes entre si, e constituem apenas exemplos possíveis de concretização sem contudo, limitar a matéria aqui descrita. Para efeitos desta invenção, considera-se como sistema adaptativo de iluminação veicular auxiliar qualquer objeto que compreenda um dispositivo nas luzes dianteiras de veículos direcionando seu facho de luz, visando aumentar a visibilidade dos motoristas. Como exemplo, podem-se citar sistemas com motor de passo em veículos de passeio que deslocam o bloco interno do farol para a direita e para a esquerda, dependendo das condições de contorno. A.5.1 Diagrama do sistema O diagrama do sistema demonstra o funcionamento do sistema, que tem 158 por principio a aquisição dos dados da velocidade e do raio da curvatura como as variáveis de entrada do sistema para o controlador fuzzy. Este controlador consiste em um modelo que determina a corrente de saída total que irá alimentar os LEDs do sistema (Figura A.1). Figura A.1: Diagrama de blocos do sistema. A.5.2 Pesquisa de campo Uma pesquisa de campo foi feita pra levantar as necessidades do motorista levando em consideração uma série de fatores, como velocidade empregada nas estradas, nas ruas ou no campo, o campo de visão, o alcance desejável, entre outros. Isto serve de base para alimentar o algoritmo de lógica fuzzy no que diz respeito às leis de pertinência do modelo. A Figura A.2 descreve em detalhes o questionário aplicado para coletar os dados em questão. 159 Figura A.2: Detalhes do questionário aplicado para a coleta de dados. 160 A.5.3 Proposta do produto Uma alternativa para a aplicação do sistema adaptativo de iluminação veicular a LEDs pode ser apresentado na Figura A.3, onde existe um sistema halogeno com o incremento dos LEDs de maneira sequencial. Figura A.3: Sistema halogeno com o incremento dos LEDs de maneira seqüencial. A.5.4 Pista de testes A Figura A.4 descreve em detalhes o campo de provas que foi utilizado para levantar os dados de velocidade e raio de curvatura em diferentes condições de dirigibilidade. Figure A.4: Pista de testes. 161 A.6. Reivindicações 1. Unidade de farol veicular dianteiro auxiliar adaptativo alimentado por LEDs de maneira sequencial controlado por um sistema de inferência fuzzy, ficando acoplado ou não ao farol principal do veiculo de ambos os lados do mesmo; 2. Unidade de farol veicular dianteiro auxiliar adaptativo alimentado por LEDs de maneira sequencial controlado por um sistema de inferência fuzzy, de acordo com a reivindicação 1, sendo este aplicado a veículos pesados e de passeio; 3. Unidade de farol veicular dianteiro auxiliar adaptativo alimentado por LEDs de maneira sequencial controlado por um sistema de inferência fuzzy, de acordo com a reivindicação 1, seguindo o conceito de identificação do modelo fuzzy através da coleta de informações com pesquisa de campo (Figura A.2) e de dados de uma pista de testes (Figura A.4); 4. Unidade de farol veicular dianteiro auxiliar adaptativo alimentado por LEDs de maneira sequencial controlado por um sistema de inferência fuzzy, de acordo com qualquer reivindicação de 1 a 3, que compreende: um sequenciamento de LEDs em qualquer parte do farol principal dianteiro que adiciona ao facho principal uma quantidade de luz que abrange a abertura lateral de 30 graus para ambos os lados. 162 Apêndice B Código computacional no MATLAB 163 Appendix B MATLAB computer code File “simu_tsk_pelo_principal.m” function y_s_la=simul_tsk_pelo_principal(Entrada,Saida,X_final,P1,P2,P3,P4,m,p,ind_mod,t_morto,val_pass,n_conjuntos_ent rada,n_conjuntos_saida); %FORMANDO AS MATRIZES C e S para CÁLCULO DA PREDIÇÃO SEGUNDO O %MODELO TSK DO TIPO 2 k=1; for i=1:m for j=1:p+1 C(i,j)=X_final(k); k=k+1; end end for i=1:m for j=1:p+1 S(i,j)=X_final(k); %S(j)=X_final(k); % inserteza na entradae saida k=k+1; end end md_dados=[Entrada Saida]; %FAZENDO A JANELA DE TEMPO [pdad,tdad]=pddin(t_morto,val_pass,md_dados); %DEFININDO A MATRIZ DE DADOS PARA IDENTIFICACAO FUZZY %A PRIMEIRA COLUNA CONTEM OS VALORES DA SAIDA DO MODELO FUZZY (y no %instante k). A segunda coluna CONTEM OS VALORES DE y(k-1) e a terceira %coluna em diante contem valores passados da entrada u. mdados=[tdad']; tam_pdad=size(pdad); for t_pdad=tam_pdad(1):-1:1 mdados=[mdados pdad(t_pdad,:)']; end ndad=size(mdados,1); ncol=size(mdados,2); %SIMULAÇÃO DO MODELO %PRIMEIRO VETOR DE ENTRADAS p_val=max(max(max(t_morto,val_pass(length(val_pass)))),max(val_pass(1:length(val_pass)-1))); p_valores=max(max(max(t_morto,val_pass(length(val_pass)))),max(val_pass(1:length(val_pass)-1))-1); if p_valores==0 y_mod=md_dados(1,size(md_dados,2)); y_s_pf(1)=y_mod; y_aux=0; y_s_la(1)=y_aux; p_valores=1; 164 else for i=1:p_valores y_mod=md_dados(i,size(md_dados,2));%PRIMEIROS VALORES DA SAIDA MEDIDA (UNICOS VALORES DISPONÍVEIS PARA MODELO PREDITIVO) y_aux=0;% PRIMEIROS VALORES DA SAIDA SIMULADA DESCONHECIDO (=ZERO) y_s_la(i)=y_aux; y_s_pf(i)=y_mod; end end for i=1:ndad %PREDIÇÃO DE LONGO ALCANCE % VETOR COM AS ENTRADAS DO MODELO PARA PREDIÇÃO LONGO ALCANCE x1=[y_s_la(i+p_valores-val_pass(length(val_pass)):i-1+p_valores) mdados(i,(2+val_pass(length(val_pass))):ncol) 1]; if x1==0 x1=x1+eps; end %SIMULANDO O TSK PARA PREDIÇÃO LONGO ALCANCE [y_L,y_R,y_mod]=tsk_2(x1,P1,P2,P3,P4,C,S,ind_mod); %GUARDANDO O VALOR PREDITO y_s_la(i+p_val)=y_mod; %ATUALIZANDO O VALOR DA SAIDA, PARA A PRÓXIMA ENTRADA, %ATRIBUINDO A ÚLTIMA PREDIÇÃO DO MODELO (IDENTIFICACAO C/ LONGO ALCANCE) y_aux=y_mod; end if size(y_s_la)==[1 length(y_s_la )] y_s_la=y_s_la'; end Erro_Fuzzy=var(y_s_la(p_valores:length(y_s_la)) - Saida(p_valores:length(Saida))); load('dados_caminhao.mat', 'amperagem','velocidade','raio','tempo','latitude','longitude') figure(3) plot(latitude,longitude); title('Simulation Test Track','FontWeight','bold','FontSize',18); xlabel('Latitude','FontWeight','bold',... 'FontSize',12,... 'FontName','Arial'); ylabel('Longitude','FontWeight','bold',... 'FontSize',12,... 'FontName','Arial'); n_dec=200; amperagem=amperagem(1:n_dec:length(amperagem)); velocidade=velocidade(1:n_dec:length(velocidade)); raio=raio(1:n_dec:length(raio)); tempo=tempo(1:n_dec:length(tempo)); figure(2); plot(tempo,amperagem,'Marker','.','LineStyle','none',... 'Color','k');hold on; plot(tempo(1:length(y_s_la)),y_s_la,'Marker','.','LineStyle','none',... 'Color','r'); % plot(tempo,raio,'Color',[0.6 0.6 0.6],'Marker','x','LineStyle','none');hold on; % plot(tempo,velocidade,'b') % set(gca,'YLim',[0 140]) set(gca,'XLim',[0 1000]) title('Specialist vs Model Simulation Data','FontWeight','bold','FontSize',18); xlabel('Time[seconds]') ax1 = gca; % ylabel('Velocity [Km/h] ... Radius [m]','FontWeight','bold',... % 'FontSize',12,... % 'FontName','Arial'); 165 % ax2 = axes('Position',get(ax1,'Position'),... % 'YAxisLocation','right',... % 'Color','none',... % 'YColor','k'); % set(gca,'XLim',[0 1000]) % hl2 = line(tempo,amperagem,'Marker','.','LineStyle','none',... % 'Color','k','Parent',ax2);hold on; % hl3 = line(tempo(1:length(y_s_la)),y_s_la,'Marker','.','LineStyle','none',... % 'Color','r','Parent',ax2); % legend(ax1,'Radius [m]','Velocity [Km/h]','Location','South') legend(ax1,'Specialist',['Model Fuzzy - Quadratic Error: ' num2str(Erro_Fuzzy,'%9.2f')],'Location','North') set(get(ax1,'Ylabel'),'String','Current [mA]','VerticalAlignment','cap','FontWeight','bold',... 'FontSize',12,... 'FontName','Arial',... 'Color','k'); clear ax1 n_dec figure(1) n_disc=40; malha=zeros(n_disc,1); Teste1=linspace(0,200,n_disc)'; % velocidade Teste2=linspace(0,200,n_disc)'; % raio [xc,yc] = ndgrid(Teste1,Teste2); for n_malha=1:n_disc md_dados=[[xc(:,n_malha) yc(:,n_malha)] zeros(n_disc,1)]; %FAZENDO A JANELA DE TEMPO [pdad,tdad]=pddin(t_morto,val_pass,md_dados); %DEFININDO A MATRIZ DE DADOS PARA IDENTIFICACAO FUZZY %A PRIMEIRA COLUNA CONTEM OS VALORES DA SAIDA DO MODELO FUZZY (y no %instante k). A segunda coluna CONTEM OS VALORES DE y(k-1) e a terceira %coluna em diante contem valores passados da entrada u. mdados=[tdad']; tam_pdad=size(pdad); for t_pdad=tam_pdad(1):-1:1 mdados=[mdados pdad(t_pdad,:)']; end ndad=size(mdados,1); ncol=size(mdados,2); %SIMULAÇÃO DO MODELO %PRIMEIRO VETOR DE ENTRADAS p_val=max(max(max(t_morto,val_pass(length(val_pass)))),max(val_pass(1:length(val_pass)-1))); p_valores=max(max(max(t_morto,val_pass(length(val_pass)))),max(val_pass(1:length(val_pass)-1))-1); if p_valores==0 y_mod=md_dados(1,size(md_dados,2)); y_s_pf(1)=y_mod; y_aux=0; y_s_la_m(1)=y_aux; p_valores=1; else for i=1:p_valores y_mod=md_dados(i,size(md_dados,2));%PRIMEIROS VALORES DA SAIDA MEDIDA (UNICOS VALORES DISPONÍVEIS PARA MODELO PREDITIVO) y_aux=0;% PRIMEIROS VALORES DA SAIDA SIMULADA DESCONHECIDO (=ZERO) y_s_la_m(i)=y_aux; y_s_pf(i)=y_mod; end 166 end for i=1:ndad %PREDIÇÃO DE LONGO ALCANCE % VETOR COM AS ENTRADAS DO MODELO PARA PREDIÇÃO LONGO ALCANCE x1=[y_s_la_m(i+p_valores-val_pass(length(val_pass)):i-1+p_valores) mdados(i,(2+val_pass(length(val_pass))):ncol) 1]; if x1==0 x1=x1+eps; end %SIMULANDO O TSK PARA PREDIÇÃO LONGO ALCANCE [y_L,y_R,y_mod]=tsk_2(x1,P1,P2,P3,P4,C,S,ind_mod); %GUARDANDO O VALOR PREDITO y_s_la_m(i+p_val)=y_mod; %ATUALIZANDO O VALOR DA SAIDA, PARA A PRÓXIMA ENTRADA, %ATRIBUINDO A ÚLTIMA PREDIÇÃO DO MODELO (IDENTIFICACAO C/ LONGO ALCANCE) y_aux=y_mod; end if size(y_s_la_m)==[1 length(y_s_la_m )] y_s_la_m=y_s_la_m'; end y_s_la_m(1)=y_s_la_m(2); if malha(:,1)==zeros(n_disc,1) malha=y_s_la_m; else malha=[malha y_s_la_m]; end end surf(xc,yc,malha,'FaceColor','interp','FaceLighting','phong') camlight right view([-60 80]); %view([-45 80]); set(gca,'Zlim',[0 2000],'CLim',[0 2000]) ylabel(' Radius [m]','FontWeight','bold',... 'FontSize',12,... 'FontName','Arial'); xlabel(' Velocity [Km/h] ','FontWeight','bold',... 'FontSize',12,... 'FontName','Arial'); return 167 File “GRAF_ESP.m” load('dados_caminhao.mat', 'amperagem','velocidade','raio','tempo','latitude','longitude') n_dec=200; % amperagem=decimate(amperagem,n_dec,'fir'); % velocidade=decimate(velocidade,n_dec,'fir'); % raio=decimate(raio,n_dec,'fir'); % tempo=decimate(tempo,n_dec,'fir'); amperagem=amperagem(1:n_dec:length(amperagem)); velocidade=velocidade(1:n_dec:length(velocidade)); raio=raio(1:n_dec:length(raio)); tempo=tempo(1:n_dec:length(tempo)); figure(2); plot(tempo,raio,'Color',[0.6 0.6 0.6],'Marker','x','LineStyle','none');hold on; plot(tempo,velocidade,'b') set(gca,'YLim',[0 140]) set(gca,'XLim',[0 1000]) title('Specialist Simulation Data','FontWeight','bold','FontSize',18); xlabel('Time[seconds]') ax1 = gca; ylabel('Velocity [Km/h] ... Radius [m]','FontWeight','bold',... 'FontSize',12,... 'FontName','Arial'); ax2 = axes('Position',get(ax1,'Position'),... 'YAxisLocation','right',... 'Color','none',... 'YColor','k'); set(gca,'XLim',[0 1000]) hl2 = line(tempo,amperagem,'Marker','.','LineStyle','none',... 'Color','k','Parent',ax2); legend(ax1,'Radius [m]','Velocity [Km/h]','Location','South') set(get(ax2,'Ylabel'),'String','Current [mA]','VerticalAlignment','cap','FontWeight','bold',... 'FontSize',12,... 'FontName','Arial',... 'Color','k'); clear ax1 ax2 hl2 n_dec 168 File “func_ob.m” %FUNCTION PARA DEFINIÇÃO DA FUNÇÃO OBJETIVO % function fob=func_ob(xp) global alfa ind_mod ind_otim t_morto val_pass md_dados% Definidas na função tsk_po_t2 global P1 P2 P3 P4 m p % Definidas na função define_conj_fuzzy global xp0 n_par ind_par mdados m_faixa n_par_f X_final % Definidas na função aprox_inicial %DESNORMALIZANDO OS PARAMETROS A SEREM ESTIMADOS for i=1:n_par_f xpar(i)=(m_faixa(i,2)-m_faixa(i,1))*xp(i)+m_faixa(i,1); end %ATUALIZANDO VETOR COM TODOS OS PARÂMETROS (AJUSTADOS E FIXOS) kk=1;jj=1; for i=1:n_par % n_par é o número máximo de parâmetros que podem ser ajustados. if ind_par(i)==0 %0-> Indica parâmetro fixo durante todo o problema de otimização. x_full(i)=xp0(jj);%coloca cond. iniciais jj=jj+1; else x_full(i)=xpar(kk); %coloca valores atualizados. kk=kk+1; jj=jj+1; end end x_full' %[x_full(3) x_full(15);x_full(6) x_full(18);x_full(9) x_full(21);x_full(12) x_full(24);] %ind_otim=ind_otim+1 %FORMANDO AS MATRIZES C e S para CÁLCULO DA PREDIÇÃO SEGUNDO O %MODELO TSK DO TIPO 2 k=1; for i=1:m for j=1:p+1 C(i,j)=x_full(k); k=k+1; end end for i=1:m for j=1:p+1 S(i,j)=x_full(k); % S(j)=x_full(k); % incerteza na entradae saida k=k+1; end end % %FAZENDO A SIMULAÇÃO PARA A AMOSTRA DE DADOS ndad=size(mdados,1); ncol=size(mdados,2); %PRIMEIRO VETOR DE ENTRADAS p_val=max(max(max(t_morto,val_pass(length(val_pass)))),max(val_pass(1:length(val_pass)-1))); p_valores=max(max(max(t_morto,val_pass(length(val_pass)))),max(val_pass(1:length(val_pass)-1))-1); if p_valores==0 y_mod=md_dados(1,size(md_dados,2)); y_s_pf(1)=y_mod; y_aux=0; y_s_la(1)=y_aux; 169 p_valores=1; else for i=1:p_valores y_mod=md_dados(i,size(md_dados,2));%PRIMEIROS VALORES DA SAIDA MEDIDA (UNICOS VALORES DISPONÍVEIS PARA MODELO PREDITIVO) y_aux=0;% PRIMEIROS VALORES DA SAIDA SIMULADA DESCONHECIDO (=ZERO) y_s_la(i)=y_aux; y_s_pf(i)=y_mod; end end for i=1:ndad if alfa~=0 %PREDIÇÃO DE LONGO ALCANCE % VETOR COM AS ENTRADAS DO MODELO PARA PREDIÇÃO LONGO ALCANCE x1=[y_s_la(i+p_valores-val_pass(length(val_pass)):i-1+p_valores) mdados(i,(2+val_pass(length(val_pass))):ncol) 1]; %SIMULANDO O TSK PARA PREDIÇÃO LONGO ALCANCE if x1==0 x1=x1+eps; end [y_L,y_R,y_mod]=tsk_2(x1,P1,P2,P3,P4,C,S,ind_mod); %GUARDANDO O VALOR PREDITO y_s_la(i+p_val)=y_mod; %ATUALIZANDO O VALOR DA SAIDA, PARA A PRÓXIMA ENTRADA, %ATRIBUINDO A ÚLTIMA PREDIÇÃO DO MODELO (IDENTIFICACAO C/ LONGO ALCANCE) y_aux=y_mod; end %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%% %PREDIÇÃO UM PASSO A FRENTE % VETOR COM AS ENTRADAS DO MODELO PARA PREDIÇÃO UM PASSO A FRENTE if alfa~=1 x2=[mdados(i,2:ncol) 1]; %SIMULANDO O TSK PARA PREDIÇÃO UM PASSO A FRENTE if x2==0 x2=x2+eps; end [y_L,y_R,y_mod]=tsk_2(x2,P1,P2,P3,P4,C,S,ind_mod); %GUARDANDO O VALOR PREDITO y_s_pf(i+p_valores)=y_mod; end end if alfa~=0 y_s_la=y_s_la'; end if alfa~=1 y_s_pf=y_s_pf'; end %CALCULANDO A FUNÇÃO OBJETIVO if (alfa>0)&(alfa<1) 170 fob=alfa*sum((y_s_l-[md_dados(1:p_val,size(md_dados,2));mdados(:,1)]).^2)+(1-alfa)*sum((y_s_pf[md_dados(1:p_val,size(md_dados,2));mdados(:,1)]).^2); if isnan(fob) fob=1E100; end if fob>1E200 fob=1E100; end elseif alfa~=0 limite=0.90;fob=0.1*norm(y_s_lalimite*[md_dados(1:p_val,size(md_dados,2));mdados(:,1)])+0.9*norm(abs(y_s_lalimite*[md_dados(1:p_val,size(md_dados,2));mdados(:,1)])-(y_s_lalimite*[md_dados(1:p_val,size(md_dados,2));mdados(:,1)])) %fob=norm(y_s_la-[md_dados(1:p_val,size(md_dados,2));mdados(:,1)]) if isnan(fob) fob=1E100; end if fob>1E200 fob=1E100; end else % fob=norm(y_s_pf-[md_dados(1:p_val,size(md_dados,2));mdados(:,1)]) if isnan(fob) fob=1E100; end if fob>1E200 fob=1E100; end end %PLOTANDO O RESULTADO (PREDIÇÃO DE LONGO ALCANCE) A CADA ITERAÇAO if alfa~=0 figure(1) plot([y_s_la [md_dados(1:p_val,size(md_dados,2));mdados(:,1)]]); drawnow %salva= ['saveas(gcf,''simula' num2str(ind_otim) '.jpg'', ''jpg'')']; %eval(salva); %salva= ['saveas(gcf,''simula' num2str(ind_otim) '.fig'', ''fig'')']; %eval(salva); %salva= ['save INTERACAO' num2str(ind_otim)]; %eval(salva); end if alfa~=1 figure(1) plot([y_s_pf [md_dados(1:p_val,size(md_dados,2));mdados(:,1)]]); drawnow %salva= ['saveas(gcf,''simula' num2str(ind_otim) '.jpg'', ''jpg'')']; %eval(salva); %salva= ['saveas(gcf,''simula' num2str(ind_otim) '.fig'', ''fig'')']; %eval(salva); %salva= ['save INTERACAO' num2str(ind_otim)]; %eval(salva); end 171 Apêndice C Código computacional do protótipo 172 Appendix A Prototype computer code File “Project1.vbp” Type=Exe Form=Form1.frm Reference=*\G{00020430-0000-0000-C000000000000046}#2.0#0#E:\WINDOWS\system32\stdole2.tlb#OLE Automation Module=P_comunicacao; WinIo.Bas Module=modInput; Joystick\modInput.bas Module=C_interface; C_interface.bas Module=fuzzy; fuzzy.bas IconForm="Form1" Startup="Form1" ExeName32="Lukacs.exe" Path32="C:\Documents and Settings\Lapo-06\Desktop" Command32="" Name="Project1" HelpContextID="0" CompatibleMode="0" MajorVer=1 MinorVer=0 RevisionVer=0 173 AutoIncrementVer=0 ServerSupportFiles=0 VersionCompanyName="lapo" CompilationType=0 OptimizationType=0 FavorPentiumPro(tm)=0 CodeViewDebugInfo=0 NoAliasing=0 BoundsCheck=0 OverflowCheck=0 FlPointCheck=0 FDIVCheck=0 UnroundedFP=0 StartMode=0 Unattended=0 Retained=0 ThreadPerObject=0 MaxNumberOfThreads=1 [MS Transaction Server] AutoRefresh=1 174 File “Form1.frm” Dim Ang As Long Dim Vel As Long Private Sub Sair_Click() End End Sub Private Sub Form_Load() Timer1.Interval = 1 End Sub Private Sub regras() led = 0 If Ang > 33000 Then ld = calc_fuzzy((Ang - 32767) * 400 / 32768, (32767 - Vel) * 152 / 32767) acender_leds (Direito + 2 ^ (ld - 1)) End If If Ang < 32000 Then ld = calc_fuzzy((32767 - Ang) * 400 / 32768, (32767 - Vel) * 152 / 32767) acender_leds (Esquerdo + 2 ^ (ld - 1)) End If If Ang < 33000 And Ang > 32000 Then acender_leds (31) End Sub Private Sub acender_leds(led As Integer) 175 ' acender circulos na tela d_led1.BackStyle = 0 d_led2.BackStyle = 0 d_led3.BackStyle = 0 d_led4.BackStyle = 0 d_led5.BackStyle = 0 e_led1.BackStyle = 0 e_led2.BackStyle = 0 e_led3.BackStyle = 0 e_led4.BackStyle = 0 e_led5.BackStyle = 0 ' lado direito If led = Direito + D0 Then d_led1.BackStyle = 1: d_led2.BackStyle = 0: d_led3.BackStyle = 0 d_led4.BackStyle = 0: d_led5.BackStyle = 0 End If If led = Direito + D1 + D0 Then d_led1.BackStyle = 1: d_led2.BackStyle = 1: d_led3.BackStyle = 0 d_led4.BackStyle = 0: d_led5.BackStyle = 0 End If If led = Direito + D2 + D1 + D0 Then d_led1.BackStyle = 1: d_led2.BackStyle = 1: d_led3.BackStyle = 1 176 d_led4.BackStyle = 0: d_led5.BackStyle = 0 End If If led = Direito + D3 + D2 + D1 + D0 Then d_led1.BackStyle = 1: d_led2.BackStyle = 1: d_led3.BackStyle = 1 d_led4.BackStyle = 1: d_led5.BackStyle = 0 End If If led = Direito + D4 + D3 + D2 + D1 + D0 Then d_led1.BackStyle = 1: d_led2.BackStyle = 1: d_led3.BackStyle = 1 d_led4.BackStyle = 1: d_led5.BackStyle = 1 End If ' lado esquedo If led = Esquerdo + D0 Then d_led1.BackStyle = 1: d_led2.BackStyle = 0: d_led3.BackStyle = 0 d_led4.BackStyle = 0: d_led5.BackStyle = 0 End If If led = Esquerdo + D1 + D0 Then d_led1.BackStyle = 1: d_led2.BackStyle = 1: d_led3.BackStyle = 0 d_led4.BackStyle = 0: d_led5.BackStyle = 0 End If If led = Esquerdo + D2 + D1 + D0 Then d_led1.BackStyle = 1: d_led2.BackStyle = 1: d_led3.BackStyle = 1 d_led4.BackStyle = 0: d_led5.BackStyle = 0 End If If led = Esquerdo + D3 + D2 + D1 + D0 Then 177 d_led1.BackStyle = 1: d_led2.BackStyle = 1: d_led3.BackStyle = 1 d_led4.BackStyle = 1: d_led5.BackStyle = 0 End If If led = Esquerdo + D4 + D3 + D2 + D1 + D0 Then d_led1.BackStyle = 1: d_led2.BackStyle = 1: d_led3.BackStyle = 1 d_led4.BackStyle = 1: d_led5.BackStyle = 1 End If PortOut 888, led End Sub Private Sub Timer1_Timer() ' Carregando o estado do Joystick PollJoystick Text2 = CurrentJoyX Ang = CurrentJoyX Text3 = CurrentJoyY Vel = CurrentJoyY regras Text2.Refresh Text3.Refresh End Sub 178 File “C_interface.bas” Public Const D0 = 1 Public Const D1 = 2 Public Const D2 = 4 Public Const D3 = 8 Public Const D4 = 16 Public Const Direito = 32 Public Const Esquerdo = 64 179 File “fuzzy.bas” Dim pnt(5000, 2) As Double Private Function max_trimf(valo, a1, a2, a3) If valo = a2 Then max_trimf = 1 If valo >= a1 And valo < a2 Then max_trimf = (1 / (a2 - a1) * valo + (1 - 1 / (a2 - a1) * a2)) If valo > a2 And valo <= a3 Then max_trimf = (1 / (a2 - a3) * valo + (1 - 1 / (a2 - a3) * a2)) End Function Private Function max_trapmf(valo, a1, a2, a3, a4) If valo >= a2 And valo <= a3 Then max_trapmf = 1 If valo >= a1 And valo < a2 Then max_trapmf = (1 / (a2 - a1) * valo + (1 - 1 / (a2 - a1) * a2)) If valo > a3 And valo <= a4 Then max_trapmf = (1 / (a3 - a4) * valo + (1 - 1 / (a3 - a4) * a3)) End Function Private Function pnt_trapmf(valo, a1, a2, a3, a4, dis_xo, dis_xf) ' valo é o valoor maximo de y For x = a1 To a4 If x >= a2 And x <= a3 Then fxi = 1 If x >= a1 And x < a2 Then fxi = (1 / (a2 - a1) * x + (1 - 1 / (a2 - a1) * a2)) If x > a3 And x <= a4 Then fxi = (1 / (a3 - a4) * x + (1 - 1 / (a3 - a4) * a2)) If fxi > valo Then fxi = valo 180 pnt(x - dis_xo, 1) = x ' valoor x da função If pnt(x - dis_xo, 2) < fxi Then pnt(x - dis_xo, 2) = fxi 'valoor y da função 'vs = vs + x * fxi 'vd = vd + fxi Next x 'cen_trimf = vs / vd End Function Private Function pnt_trimf(valo, a1, a2, a3, dis_xo, dis_xf) ' valo é o valoor maximo de y For x = a1 To a3 If x = a2 Then fxi = 1 If x >= a1 And x < a2 Then fxi = (1 / (a2 - a1) * x + (1 - 1 / (a2 - a1) * a2)) If x > a2 And x <= a3 Then fxi = (1 / (a2 - a3) * x + (1 - 1 / (a2 - a3) * a2)) If fxi > valo Then fxi = valo pnt(x - dis_xo, 1) = x ' valoor x da função If pnt(x - dis_xo, 2) < fxi Then pnt(x - dis_xo, 2) = fxi 'valoor y da função 'vs = vs + x * fxi 'vd = vd + fxi Next x 'cen_trimf = vs / vd End Function Private Sub salvar() Open "D:\dado.csv" For Output As #1 For i = 1 To 5000 Print #1, pnt(i, 1), ";", pnt(i, 2) 181 Next i Close #1 End Sub Private Function cal_centroide(dis_xo, dis_xf) As Double For i = 1 To dis_xf ca = ca + pnt(i, 1) * pnt(i, 2) cb = cb + pnt(i, 2) Next i cal_centroide = ca / cb End Function Public Function calc_fuzzy(raio, velocidade) Dim valo(10, 3) As Double Dim calc(10) As Double valor1 = raio ' raio valor2 = velocidade ' velocidade ' calculo da pertinencia para a primeira função ' raio pequeno valo(1, 1) = max_trimf(valor1, 0, 20, 100) ' raio medio valo(1, 2) = max_trapmf(valor1, 50, 120, 180, 280) ' raio grande valo(1, 3) = max_trimf(valor1, 200, 395, 400) ' calculo da pertinencia para a segunda função ' velocidade baixa valo(2, 1) = max_trimf(valor2, 0, 10, 50) 182 ' velocidade media valo(2, 2) = max_trapmf(valor2, 40, 50, 70, 90) ' velocidade alta valo(2, 3) = max_trimf(valor2, 71, 118, 152) ' apricando às funções de saida '1 calc(1) = lowmodel(valo(1, 3), valo(2, 3)) pnt_trapmf calc(1), 6, 7, 13, 14, 0, 60 '2 calc(2) = lowmodel(valo(1, 3), valo(2, 2)) pnt_trapmf calc(2), 16, 17, 23, 24, 0, 60 calc(3) = lowmodel(valo(1, 2), valo(2, 3)) pnt_trapmf calc(3), 16, 17, 23, 24, 0, 60 '3 calc(4) = lowmodel(valo(1, 3), valo(2, 1)) pnt_trapmf calc(4), 26, 27, 23, 34, 0, 60 calc(5) = lowmodel(valo(1, 2), valo(2, 2)) pnt_trapmf calc(5), 26, 27, 23, 34, 0, 60 calc(6) = lowmodel(valo(1, 1), valo(2, 3)) pnt_trapmf calc(6), 26, 27, 23, 34, 0, 60 '4 calc(7) = lowmodel(valo(1, 2), valo(2, 1)) pnt_trapmf calc(7), 36, 37, 43, 44, 0, 60 calc(8) = lowmodel(valo(1, 1), valo(2, 2)) pnt_trapmf calc(8), 36, 37, 43, 44, 0, 60 183 ' Debug.Print calc(7), calc(8) '5 calc(9) = lowmodel(valo(1, 1), valo(2, 1)) pnt_trapmf calc(9), 46, 47, 53, 54, 0, 60 calc_fuzzy = cal_centroide(0, 60) / 10 'salvar End Function Private Function lowmodel(val1, val2) As Double lowmodel = val1 If val1 > val2 Then lowmodel = val2 End Function 184 File “modInput.bas” Option Explicit Public Declare Function joyGetPosEx Lib "winmm.dll" (ByVal uJoyID As Long, pji As JOYINFOEX) As Long Public Declare Function joyGetDevCapsA Lib "winmm.dll" (ByVal uJoyID As Long, pjc As JOYCAPS, ByVal cjc As Long) As Long Public Type JOYCAPS wMid As Integer wPid As Integer szPname As String * 32 wXmin As Long wXmax As Long wYmin As Long wYmax As Long wZmin As Long wZmax As Long wNumButtons As Long wPeriodMin As Long wPeriodMax As Long wRmin As Long wRmax As Long wUmin As Long 185 wUmax As Long wVmin As Long wVmax As Long wCaps As Long wMaxAxes As Long wNumAxes As Long wMaxButtons As Long szRegKey As String * 32 szOEMVxD As String * 260 End Type Public Type JOYINFOEX dwSize As Long dwFlags As Long dwXpos As Long dwYpos As Long dwZpos As Long dwRpos As Long dwUpos As Long dwVpos As Long dwButtons As Long dwButtonNumber As Long dwPOV As Long dwReserved1 As Long dwReserved2 As Long 186 End Type Public JoyNum As Long Public MYJOYEX As JOYINFOEX Public MYJOYCAPS As JOYCAPS Public CenterX As Long Public CenterY As Long Public JoyButtons(15) As Boolean Public CurrentJoyX As Long Public CurrentJoyY As Long Public Function StartJoystick(Optional ByVal JoystickNumber As Long = 0) As Boolean JoyNum = JoystickNumber If joyGetDevCapsA(JoyNum, MYJOYCAPS, 404) <> 0 Then 'Get joystick info StartJoystick = False Else MYJOYEX.dwSize = 64 MYJOYEX.dwFlags = 255 Call joyGetPosEx(JoyNum, MYJOYEX) CenterX = MYJOYEX.dwXpos CenterY = MYJOYEX.dwYpos StartJoystick = True End If End Function 187 Public Sub PollJoystick() Dim i As Long Dim t As Long MYJOYEX.dwSize = 64 MYJOYEX.dwFlags = 255 ' Get the joystick information Call joyGetPosEx(JoyNum, MYJOYEX) t = MYJOYEX.dwButtons For i = 15 To 0 Step -1 JoyButtons(i) = False If (2 ^ i) <= t Then t = t - (2 ^ i) JoyButtons(i) = True End If Next i CurrentJoyX = MYJOYEX.dwXpos CurrentJoyY = MYJOYEX.dwYpos End Sub 188 File “P_comunicacao.bas” Public Declare Sub PortOut Lib "io.dll" (ByVal Port As Integer, ByVal Value As Byte) Public Declare Function PortIn Lib "io.dll" (ByVal Port As Integer) As Byte Public Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long) Sub vbOut(ByVal Port As Integer, ByVal Value As Byte) PortOut Port, Value End Sub Function vbIn(ByVal Port As Integer) vbIn = PortIn(Port) End Function 189 Apêndice D Carta de intenção do desenvolvimento do produto 190 Appendix D Intention letter to develop the product 191 D.1. Carta da “De Ameretek Corporation” 192 D.2. Images of the proposed vehicle level prototype Figure D.1: Prototype construction view. 193 Figure D.2: Prototype top view. 194 Figure D.3: Prototype front view. 195 Figure D.4: Prototype side view. 196