Süt sağım robotu tasarım ve imalatı
Desinging and manufacturing of milking robot
Yazar: HULUSİ ÖZÜDURUK
Danışman: DOÇ. DR. ZEKİ YAĞIZ BAYRAKTAROĞLU
İstanbul Teknik Üniversitesi / Fen Bilimleri Enstitüsü / Makine Mühendisliği Ana Bilim Dalı
Derece: Yüksek Lisans, 2014
Konu: Mekatronik Mühendisliği = Mechatronics Engineering
Dizin: Bilgisayarla görme = Computer vision ; Endüstriyel robotlar = Industrial robots ; Süt sağım makinesi = Milking machine ; Süt sağımı = Milking

Özet:
Bu tezde otomatik süt sağımı yapabilen robot kolun tasarım ve üretimi ele alınmıştır. Tasarım aşaması kendi içinde alt gruplara ayrılmaktadır. Mekanik ve elektronik tasarım alt konularının tamamlanmasının ardından üretim süreci tamamlanacak ve ölçüm cihazının montajı yapılarak deneysel olarak elde edilen veriler incelecektir.Otomatik süt sağım robotu, süt sağım işlemini herhangi bir personel gerektirmeden ve manuel süt sağım makinalarına göre daha hızlı bir şekilde yapabilmektedir. Bu noktada hayvanları zorlayarak sağım noktalarına götürülürken oluşan sıkıntılar da ortadan kalkmış olacaktır.Otomatik süt sağım robotları maliyetlerinden dolayı genellikle büyük çaplı çiftliklerde (en az 40-50 adet sağılan inek bulunan) kullanılmaktadır.Sağım işlemi süreci ineklerin alıştırılarak kafes yapısına girmesi ile başlamaktadır. İneğin kafese girmesinin ardından kamera ile ineğin meme ucu konumlarının tespiti yapılacaktır. Bu işlemin ardından robotik kol süt sağım pompasını alarak kamera tarafından belirlenen koordinatlara götürerek sağım işlemini başlatacaktır. Sağım işleminin bitimin ardından sağım pompasını ilk konumuna götürecektir. Süt sağım robotunu temelde mekanik ve elektronik aksam olarak iki kısımda inceleyebiliriz. Mekanik aksamda; gövde konstrüksiyonu, rulmanlar, cıvatalar ve diğer mekanik bağlama elemanları, elektronik aksamda; enkoderler, motorlar, motor sürücüleri, gömülü bilgisayar ve kamera bulunmaktadır. Ayrıca yine CANbus haberleşmesi ve bilgisayar programı bu bölümde bulunmaktadır.Mekanik tasarım ve üretim, Robkon Robotik ve Otomasyon firması tarafından yapılmıştır. Bu bölümde motor, redüktör ve enkoderlerin seçimi bu bölümde yapılmıştır. Motor ve redüktörlerin seçiminde öncelikli olarak motor tipi fırçasız dc motor olarak belirlenmiştir. Motorların ve redüktörlerin tork değeri mekanik tasarım aşamında eklemlerin tork analizi sonucunda ortaya çıkmıştır. Motorların ve redüktörün seçiminin ardından bu seçime uygun enkoder ve motor sürücüsü seçimi yapılmıştır.Elektronik tasarım motor sürücülerinin ve gömülü bilgisayar bileşenlerinin seçimi ve haberleşme programını içermektedir. Motor sürücüleri ile gömülü bilgisayarın haberleşmesi için kullanılacak protokol seçiminde en önemli nokta, sürücülerden alınacak olan referansların aynı anda örneklenmesinin gerekliliğidir. Senkron örnekleme için ise CANopen protokolü kullanılmıştır. Ortaya çıkması muhtemel problemlerin tasarım aşamasında giderilmesi için tasarım süreci uzun tutulmuş ve birçok problemin bu aşamada çözümü üretilmiştir. Üretim sürecinde karşılaşılan bazı problemlere ise bu süreçlerde müdahale edilebilmiştir.Sistem tasarıma uygun olarak üretilmiş ve montajı yapılmıştır. Mekanik ve elektronik akşamlar tasarım aşamasındaki kriterlere uygun bulunmuş ve deneysel çalışmalar gerçekleştirilmiştir.

Abstract:
This thesis explains the modelling, design and control of milking robot. The Modeling phase has two sub groups of determination of length and number of joint and kinematic modeling. Design phase has two sub groups of mechanical and electronic modeling. Control phase include motor controller design and path planning algorithm. After that, experimental works are done and obtained data are discussed. The recommendations to increase system performance are given in the last section.First milking machine which work with vacuum is patented in 1851 in England. Simply, milking machine consist of four teatcup, vacuum machine and bulk tank. Farmer attach teatcup to the udder one by one and start the vacuum machine. After the finishing of the milking, farmer stop the milking machine and takes the teatcup. This type of milking is takes long time in farm which has more than 50 cows. In big farms, milking process takes minimum 1 hour with eight milking machine and two workers. This type of milking has lower set up cost. However, it has higher long time operating cost like workers' salary.First milking robots is produced in 1992 which Lely Astronaut. Milking robots has 24 hour working capacity and milking 40-50 cows in a day. It has a cow cage with two automatic gate, a four axis robotic arm with teat detection sensor (camera, laser) system, a teat cleaning system, a cow feeding system, a cow detection system, a cow identification system, a milk analyzing system and a milk cooling tank. Firstly, Robotic Milking system detect the cow in front of entrance door and entrance door is opened by the sytem. After the cow enters the cage, entrance door is closed and system checks the last milking of cow. If cow is milked in last three or four hour, exit door is opened and system waits the cow's exit. If cow isn't milk last three or four hour, milking process is started. After that, feeding system is activated and provender is given to cow. Robotic arm detect the teat position with teat detection system and take tke teat cleaning system. After clening the teats, robotic arm takes teat cups and attach them one by one. When milking is started, milk is started to analyz. If milk has no problem then milk is transfered to the milk cooling tank. Otherwise milk is discarded and farmer is warned by the robotic milking system. After the milking exit door opened and cow exit the cage. Robotic milking system waits the next cow.Milking robot can be separated in to three fundamental areas; Modeling, Design and Control. Modeling area, start with determination of number of axis and length of links. If this a cow model is created in simulation environment and starting with three axis and half meter length of joints, because of this determination is done by changing the number of axis and length of joints. Milking robot has four rotary axis. After the determination of link's lenght and axis number, robotic arm's work space is founded. After that forward and inverse kinematic modeling algorithm and simulation is generated. Kinematic simulation is made on MATLAB and V-Realm Builder.In the design area, there are two main sub groups which are mechanical and electronic modeling. Mechanical model is provided by Robkon Robotic and Automation company. In this study, selection of motor, gear and encoder is made. In order to select motor and gear, Torque analyze is made for each axis with different speed and acceleration. According to torque analyze motor and gear selection is selected in Maxon motor productions. Static analysis is made for all links and parts of robotic arm. Motors are mounted to the axis with belt-pulley system. 25 mm T10 series belt is used. After the analysis and production of parts, robotic arm is mounted.Electronic modeling in design area consist of communication protocol, motor driver embedded computer, operating system and camera selection and setting up the electronic hardware. CANBUS is selected as communication protocol because of supporting synchronous communication and 1 mbps bandwidth. Motor driver is selected in Maxon EPOS2 controllers. These controller has current, speed and positioning controller and support CANOpen communication protocol. Peak System's PCAN-USB convertor is used for CANBus communication between motor drivers and computer. Windows 7 is used for operating system. Microsoft Kinect Xbox 360 is used for detecting cow's teat. Motor Driver's PDO,COB-ID and Baud rate are determined and loaded. These parameters is loaded with EPOS Studio program. Driver is connected to the computer with USB cable and parameters is entered. CANBUS, encoder, motor phase and power cable are connected to motor driver. In the control area motor controller parameters are selected. PID controller is used as control algorithm. PID controller parameters is assigned with EPOS2 auto tuning mode. Third degree path planning algorithm is used. Besides four different paths is defined for tracking system. First path is starting point to under to udder. Second path is under the udder to udder. Third path is udder to under the udder and last path is under the udder to starting point. Robotic arm tracks this path with third degree path planning algorithm with 20 ms sampling time. Haarcascade is used for cow's teat detection algorithm.  OPENCV's traincascade.exe and createsamples.exe programs are used for generating the teat cascade. Createsample.exe program generate vector file using positive photos. Traincascade.exe program generate cascade using vector file and negative photos. Positive photos are consist of teat potohos and negative ptohotos are consist of other objects around the teats. CANBUS communication protocol is used with PCANBasic.API and PCANBasicCLR.h files. Control program is crated using C++ CLR programming language. Microsoft Visual Studio 2010 is used for IDE. Program interface has CANBUS, Axis Control, Inverse Kinematic, Feedback section and Robot with Camera section. CANBUS section has  initialize, uninitialize, reset button to use PCAN-USB convertor. Besides, CANBUS section has operational, preoperational, stop, and reset buton which used for CANBUS comminication with drivers. Axis Control section has four main group which are Torque, Speed, Position and Path. These are used for axis control. For example, Path Control is used for third axis position control with path planning algorithm. Inverse Kinematic section has three input textbox which when the inverse start is pressed robotic arm endpoint goes to the these points. Feedback section shows the driver and motors current, speed, position and mode. Also feedback values are written in text files for the analysis of control and path planning algorithm. Robot with Camera section has only one input which is start button. When this button is pressed, camera detects the teat position and robotic arm goes to the teat position using tracking and path planning algorithm.In the experimental studies seciton, udder model is designed and produced in 3D printer. Firsly, axis PID controller is tested one by one and feedback is analysis. When controller performance is equal to our expectations, inverse kinematic test are began. In the inverse kinematic test, robotic arm goes to the input position and this posiiton is measured and results are compared to the input. Final test of robotic arm is done by camera and model udder. Model udder is attached to the robotic arm working space and camera is mounted. Test are start with START button in Robot with Camera section. Camera detect the udder position and converts the position to the robotic arm. After that robotic arm goes to this poisition using tracking and path plannig algorithm. During the all test path planning algotithm is used. All feedback and referances are written in text different text files. These text files is analysis in MATLAB. Result of experimantal studies Microsoft Kinect Camera is insufficent to the field experiment. In the future studies new camera must be used which has better proporties then Microsoft Kinect. Also, absolute encoders must be used on axis.