Ticari araç koltuk test düzeneği kontrol ve veri toplama sistemi
Control and data acquisition system for commercial   vehicle seats test mechanism
Yazar: ONAT TAŞKIN
Danışman: YRD. DOÇ. DR. ALİ FUAT ERGENÇ
İstanbul Teknik Üniversitesi / Fen Bilimleri Enstitüsü / Kontrol ve Otomasyon Mühendisliği Ana Bilim Dalı / Kontrol ve Otomasyon Mühendisliği Bilim Dalı
Derece: Yüksek Lisans, 2017
Konu: Bilgisayar Mühendisliği Bilimleri-Bilgisayar ve Kontrol = Computer Engineering and Computer Science and Control ; Elektrik ve Elektronik Mühendisliği = Electrical and Electronics Engineering
Dizin: PLC = Programmable logic controller ; Veri toplama ve kontrol sistemleri = Data acquisition and control systems

Özet:
Dünyada ulaşım ve lojistik ihtiyacı insanoğlunun varoluşundan beri yüksek öncelikli olmuş ve önceleri hayvanların desteğiyle karşılanan bu ihtiyaç, teknolojinin de gelişmesiyle birlikte motorlu araçlarla sağlanmaya başlanmıştır. Ulaşım araçlarının amacı insanları ve eşyaları bir yerden başka bir yere taşımaktır ve taşıma esnasında can güvenliğinin sağlanması en önemli husustur. Araçlardaki güvenlik önlemlerinin başında emniyet kemerleri gelmektedir. Emniyet kemerleri ve bağlı olduğu koltukların oluşabilecek kaza anındaki dayanımları ve tepkileri çeşitli şekillerde testlere tabi tutulmaktadır. Bu testler çeşitli kurumlar tarafından standart hale getirilmiştir ve tüm dünyada kabul görmüştür. 
Bu çalışmada ticari araç koltuklarının dayanım testlerinin verilen standartlar çerçevesinde yapıldığı test düzeneğinin kontrol ve veri toplama programı tasarlanmıştır. 
Tezde ilk olarak koltuk test düzeneği tanıtılmış, mekanik yapının ve bağlantıların nasıl yapıldığı anlatılmıştır. Mekanik bölümlerin tanıtılmasının ardından kullanılan elektriksel donanım ve kontrolcü hakkında bilgiler verilmiştir. Elektrik şemasının ve elektrik bağlantılarının yapıldığı görsel teze ilave edilmiş böylece sistemin yapısı hakkında genel fikir sunulmuştur. 
Mekanik ve elektriksel donanımın anlatılmasının ardından projede kullanılan bilgisayar tabanlı kontrolör ile operatör arayüzü arasındaki iletişimi sağlayan ADS haberleşme protokolü hakkında bilgi aktarılmış, haberleşme altyapısı ile ilgili detaylar verilmiştir. Kullanılan kontrol yazılımı olan TwinCAT ile operatör arayüzü tasarımının yapıldığı .NET yazılımlarından C# hakkında genel bilgi aktarılmıştır. 
Genel bilgilerin verilmesinin ardından kontrol ve veri toplama yapısı başlığı altında TwinCAT programı içerisinde kontrol yazılımının nasıl oluşturulduğu anlatılmış, genel akış şeması verilerek kontrol programı hakkında bilgi aktarılmıştır. TwinCAT programının ardından tezin ana çalışmalarından biri olan C# yazılımında operatör arayüz programının detayları verilmiş, tasarım sayfaları anlatılmış ve örnek verilen parça kodlarla iki yazılım arasındaki değişkenlerin birbirleriyle nasıl ilişkilendirildiği detaylı olarak anlatılmıştır.  
Son olarak tasarlanan kontrol programı ve operatör arayüz programlarıyla sistem üzerinden alınan veriler grafikler halinde sonuçlar bölümünde gösterilmiştir. Yapılan testler ile koltukların itme ve çekme testleri sırasındaki uygulanan kuvvetleri, bu kuvvetlere karşı koltukların davranışlarını ve koltuk eğilme miktarları grafikler ile operatöre anlık olarak gösterilmekte ve bu veriler bilgisayar tabanlı kontrolöre kaydedilmektedir. Operatör geçmişe dönük test sonuçlarına ulaşabilmekte ve talep ettiği verilerin ve grafiklerin çıktısını alabilmektedir. 
Bu tezde C# ile tasarlanan operatör programı arayüzü sayesinde test düzeneğinin daha esnek bir arayüze sahip olması ve bu yazılımın düzenek üzerindeki kontrolcüden bağımsız olarak herhangi bir bilgisayarda kullanılması sağlanmaktadır. Böylece toplanan veriler direkt olarak operatör bilgisayarında kaydedilmekte olup raporlama işlemlerinin daha esnek bir şekilde yapılması amaçlanmıştır.

Abstract:
Since the invention of wheels, the need for transportation and logistics have been a priority for mankind. At the beginning, people used human and animal power to provide energy to basic transportation vehicles. Technologic developments changed the way of energy supply from live power to machines. Machines transform fossil fuel and electrical energy into mechanic energy. The modern transportation vehicles became widespread after 1980s as they are built economically through mass production facilities. 
As the modern transportation vehicles widely used around the world, the importance of safety arised. The objective of transportation vehicles is to carry people or things from a point to another. Nowadays, it is believed that doing so, the most important issue is safety of people in the vehicles. Seat belts are first introduced in 1903 as a way of protecting drivers and passengers. It took more than 30 years for transportation vehicle producers to accept seat belts as a standard equipment. Since than basics of seat belts slightly changed but it remained the most effective tool for safety. 
Major institutions and governments brought standards and regulations for vehicles concerning safety. A number of parts and equipments in the vehicles are assessed according to these standards including seat belts and seats. The valid regulation for European vehicles' seats and seat belts is set by Economic Commision for Europe (ECE). In this thesis, seat test mechanism of M type commercial vehicles seats is controlled by a PC based software according to ECE regulation no. 14 revision 5.  
A seat test mechanism is a machinery to test seat's behavior in case of an accident regarding fitness to regulations. The mechanism consists of mechanical, hydraulic and electrical components. The working principle of the seat test mechanism is based of gathering data from encoders and cencors installed on the seat, while applying push and pull powers. 
Mechanical part of the seat test mechanism consists of a chassis designed to attach the seat onto and some attachment tools. Mechanical part provides test mechanism to analyze only the seat's behavior as it fixes the seat in a similar manner of the seats fixed inside the vehicles and get rid of outer affects. 
Hydraulic component of test mechanism is arms attached to seats to apply power. There are six hydraulic arms in the test mechanism and each are able to apply power of 25000N. Different regulations requires different levels of push and pull powers between 800N to 20000N. Test duration of the seat test mechanism is under 5 seconds and hydraulic parts are able to reach target power level under 3 seconds. All arms are driven by hydraulic pump motors. 
The last component of the seat test mechanism6 is electrical part. Electrical part of the test mechanism used in this thesis consists of switch materials, sensors, actuators, electrical motors and controller. There are four electrical cabinets used in this mechanism which are; main power cabinet, main controller cabinet, operator cabinet and crane cabinet. PC based controller is located in the main controller cabinet and this controller execute all the control tasks in the system. Data required for the tests implemented is gathered by wire draw encoders, linear rulers and load cells. Wire draw encoders measure seat lean behavior, linear rulers measure positions of hydraulic pistons and load cells measures load on the seat. All these parts are embedded on main control cabinet. There is also uninterruptible power supply used in main control cabinet to prevent data loss and to allow safe shut down operation in case of power cuts.  
PC based controller is basically an industrial PC which can run PLC, motion control and HMI software with real-time capabilities. This controller runs Windows operating system so it makes running standard Windows softwares and capabilities possible for users. Therefore, PC based controller allows remote connection to the system without any hardware installation only by standard internet connection. 
Moreover, remote I/O station is used in the project to reduce wiring complexity. Valves, hydraulic pomps and motors are controlled through relays and contactors by remote I/Os. The communication between Remote I/O units and controller is real-time industrial ethernet based EtherCAT protocol. Due to ethernet based 100Mbit/s full dublex structure remote I/O units can be placed 100m far away from controller and can be used standard low cost CAT5 cables. 
The main objective of this project is to design an operator control software which can run in a standard personal computer and communicate with system controller through a standard network connection. In order to do this, it is decided to develop a C# software with windows form application and establish an Automation Device Specification (ADS) communication between C# and TwinCAT real-time control software. 
ADS communication is developed by Beckhoff Automation GmbH & Co. KG to provide a standard ethernet based network communication between real-time software and human machine interface software. This describes a device-independent and fieldbus-independent interface governing the type of access to ADS devices. 
TwinCAT is a real-time control software with PLC, motion control, CNC and HMI capabilities. With TwinCAT software almost any PC-based system turns into a real-time control with multiple PLC, NC, CNC and/or robotics runtime systems in windows operating system platform. TwinCAT is running in the kernels of the PC so it is not affected by any windows failures. 
The power of PC processors is performing better than any conventional PLC processors so with TwinCAT PLC controller, PLC cycle times can reduce below even 1ms. Therefore, the control software program can be processed more fast and with this processing speed the system can run more effective and precisely. This precise control provides more efficient data acquisition from the system. 
C# is Microsoft .NET based object oriented programming interface which can provide to program develeopers to design graphical user interfaces and develop applications. This windows based interface can both run in en external PC or in PC based controller system. Therefore, operator decides to run this C# interface in PC based machine controller or in external personal computer. This feature gives more flexibility to the operators of seat test mechanism.  
In this thesis, the communication infrastructure of C# and TwinCAT software, main TwinCAT control software flow diagram and designing of C# graphical user interface is explained.  
In Chapter 1 firstly, the general information about the project is explained. After the explanation, the regulations and test standards of commercial vehicles are given. Furthermore, M class vehicles are explained in this chapter.
In Chapter 2, seat test mechanism components are given and explained. This test system consists of mechanical, hydraulic and electrical components and all of these components are explained. Curve of seat lean behavior, scheme and connection of hydraulic parts and electrical connections are also explained in detail. Besides, it is explained which electrical cabinets contains which components and how are I/O connections done. After explaining of all electrical cabinets components, electrical sheme and I/O terminals connections are given as images.
In Chapter 3, details of ADS communication protocol are defined and compatible supported programming platforms are given with tables. Most of the top level computer programming languages are support by ADS communication protocol like Java, .NET, C/C++, Javascript, etc… In order to understand the controller programming interface, TwinCAT software is also explained in this chapter and shown how to start programming in TwinCAT. After giving a brief information about C# and .NET, ADS configuration details of C# program are explained.  ADS ports and and AmsNetId terms are also explained and ADS classes are given. 
In Chapter 4, control and data acquision program of TwinCAT and C# programmes are given in detail with flow diagrams and screenshots. Firstly, TwinCAT task management is explained and system tasks are introduced. After that, systems general control tasks and TwinCAT PLC program operation are explained. Furthermore, two program call tasks and program flows are given in detail. After that, C# design is explained at the end of this chapter. In the last part of chapter 4, main operation principle of C# platform is explained in detail. The main differences of operation are also explained like event based working. Morover, it is also explained how to create handles and assigning the variables to the handles. The importance of PLC and C# variable sizes are explained and matching sizes of variables are given in a chart. Furthermore, graphical user interface pages are given in this chapter as screenshots and explained which page does what in project. Finally, graphical displays of seat test results are given as curves and the results are discussed depends on the seat test standards.            
Chapter 5 is the conclusion part of this thesis. In this chapter, this whole studty is briefly summarized and the results of the seat test and purpose of this project are commented.