It contain training report carried out at cadila pharmaceutical limited in samba, jammu&kashmir.
Sorry the doc structure have being scattered...Full description
Report on industrial training project
Full description
training report 2015 and practical reportFull description
experience during internship for HOVID company, learnt a lot of new things
Industrial Training ReportFull description
Industrial Training ReportFull description
hiFull description
example of final report industrial training polytechnicFull description
my first IT report... done in Kwara stateFull description
my industrial training report for junior to refer
Industrial Training Report Hotel 22 Week
Final Report for Industrial Training
TReport on Manufacturing of engine Valves
Full description
National Apprentice & Industrial Training Authority
Report on Industrial Training At
D.Samsons Industries (Pvt) Ltd Kalutara
General Sir John Kotelawala Defence University Rathmalana
Name
: RVSA Kumarage
Student Number
: ENG/14/091
Course
: Bachelor of Science in Engineering
Field
: Mechatronics Engineering
Training Period
: 27/06/2016 to 23/12/2016 (06 Months) i
PREFACE
In my industrial training period as a Mechatronics Engineering Undergraduate, I had my industrial training at D. Samson Industries – Sportswear plant, Kalutara from 27 th June 2016 to 23rd of December 2016. In this report, I present the experience, skills and the knowledge which I gained during six months of industrial training period. The report contains three chapters. The first chapter is belonged to introduction about the training place. The second chapter provides the information about the projects I’ve done during the training period. Finally, The third chapter contains the conclusion of the report. In the end I would like to mention that I successfully completed my industrial training period. Things I gained from this training will play an important role my future career.
RVSA Kumarage ENG/14/091 Department of Mechanical Engineering Faculty of Engineering General Sir John Kotelawala Defense University
i
ACKNOWLEDGEMENT
The academic to industrial transformation is happened in the industrial training period. Because of that, it could be very challenging period for any undergraduate student. With the immense support and the guidance to overcome all the challenges and obstacles, I managed to complete my training period successfully. At first, I’d like to thank General Sir John Kotelawala Defense University and National Apprentice and Industrial Training Authority for proving undergraduates a suitable place to do their industrial training. Then I would like to thank the former dean to the Faculty of Engineering Dr. TL Weerawardena and the current dean Dr. (Mrs.) WCDK Fernando for providing this opportunity to me and my colleagues. I sincerely thank the head of the department of Mechanical Engineering Mrs. PPSS Pussepitiya and Mechatronics Engineering coordinator Mr. Shehan Priyanga Fernando for giving me the opportunity to undergo my training. Also I’d like to pay my gratitude Cdr (E) WATPS Weerasooriya who is the training engineer of the industrial training unit at the University for guiding us through all the requirement before and during the industrial training. I sincerely thank Mr Lakshan Walpita, The Executive Engineer of the DSI-SPORTSWEAR for all his guidance and support throughout the industrial training period. And I would like to thank all the technicians of the workshop for helping me to make the training success.
ii
TABLE OF CONTENTS
PREFACE ...................................................................................................................................i ACKNOWLEDGEMENT .........................................................................................................ii TABLE OF CONTENTS......................................................................................................... iii LIST OF FIGURES ................................................................................................................... v LIST OF TABLES ...................................................................................................................vii CHAPTER ONE ........................................................................................................................1 1.0 Introduction......................................................................................................................1 1.1 Introduction to D Samson Industries (Private) Ltd .......................................................... 1 1.2 Vision ...............................................................................................................................1 1.3 Mission............................................................................................................................. 2 1.4 Values .............................................................................................................................. 2 1.5 Company Resources......................................................................................................... 2 1.5.1 Machinery Resources ................................................................................................ 2 1.5.2 Human Resources ..................................................................................................... 3 1.6 Products............................................................................................................................ 3 1.7 Organizational Structure .................................................................................................. 4 CHAPTER TWO ....................................................................................................................... 5 2.0 Training Experience ......................................................................................................... 5 2.1 Projects carried out ..........................................................................................................5 2.2 Mechatronics Engineering ............................................................................................... 6 2.3 Six Axis Robotic Arm Project ......................................................................................... 7 2.3.1 Software Part of the Project ...................................................................................... 7 2.3.1.1 Graphical User Interface .................................................................................. 10 2.3.1.1.1 The New Design .......................................................................................12 2.3.1.1.2 The Control ............................................................................................... 17 2.3.1.1.3 The Integration .......................................................................................... 19 2.3.1.2 The Configuration of the Robot Arm...............................................................22 2.3.1.2.1 Axis Motion Tuning..................................................................................24 2.3.1.2.2 Homing Process ........................................................................................ 26 2.3.1.3 Hardware Abstract Layer (HAL) of the Robot Arm ........................................30 2.3.1.3.1 Station Counter ......................................................................................... 31 iii
2.3.1.3.2 C-Motor’s 360degree+ motion ................................................................. 33 2.3.1.3.3 Individual axis jog speed adjuster .............................................................35 2.3.2 Electrical Part of the Project ................................................................................... 37 2.3.2.1 New additions .................................................................................................. 39 2.3.2.1.1 Station Counter ......................................................................................... 39 2.3.2.2 Rewiring Process ............................................................................................. 42 2.3.2.3 Servo Motor Tuning......................................................................................... 45 2.3.2.3.1 Position Loop Tuning ............................................................................... 46 2.3.2.3.2 Velocity Loop Tuning ............................................................................... 47 2.3.2.3.3 Current Loop Tuning ................................................................................49 2.3.3 Mechanical Part of the Project ................................................................................ 49 2.4 Production Monitoring System ......................................................................................50 2.4.1 Introduction.............................................................................................................50 2.4.2 Data Entering Software ...........................................................................................53 2.4.2.1 Introduction...................................................................................................... 53 2.4.2.2 The Version One .............................................................................................. 54 2.4.2.2 The Version Two ............................................................................................. 58 2.4.2.3 The Version Three ........................................................................................... 61 2.4.2.4 The Version Four ............................................................................................. 62 2.4.3 Data Visualizing Software ...................................................................................... 64 2.4.3.1 The Control ......................................................................................................65 CHAPTER THREE ................................................................................................................. 67 Conclusion ........................................................................................................................... 67 REFERENCES ........................................................................................................................ 69
iv
LIST OF FIGURES Figure 1 : DSI Group logo ......................................................................................................... 1 Figure 2 : DSI-Sportswear logo ................................................................................................. 1 Figure 3 : Organizational Structure............................................................................................ 4 Figure 4 : Maintenance Department .......................................................................................... 5 Figure 5 : The view of mechatronics a multidisciplinary concept (Lyshevski, 1999) ............... 6 Figure 6 : Linux CNC and Debian logos ................................................................................... 7 Figure 7 : Puma 560 Robotics Arm ...........................................................................................8 Figure 8 : Previous GUI Design............................................................................................... 10 Figure 9 : PyVCP example ...................................................................................................... 11 Figure 10 : Python VCP LED ..................................................................................................11 Figure 11 : Glade VCP LEDs .................................................................................................. 11 Figure 12 : Glade designer user interface ................................................................................ 12 Figure 13 : GTK+ current logo ................................................................................................13 Figure 14 : HAL Plugins ..........................................................................................................13 Figure 15 : Final layout of the new graphical user interface ................................................... 14 Figure 16 : Operation Section of the GUI ................................................................................ 15 Figure 17 : Jog Section of the GUI .......................................................................................... 16 Figure 18 : Display Section of the GUI ................................................................................... 17 Figure 19 : Signal Direction ..................................................................................................... 20 Figure 20 : HAL Section of INI file ......................................................................................... 23 Figure 21 TRAJ Section of INI file ......................................................................................... 23 Figure 22 : Settings for Axis X and Axis C ............................................................................. 25 Figure 23 : Settings for Axis A and B...................................................................................... 28 Figure 24 : Display Monitor .................................................................................................... 29 Figure 25 : Homed Position of the robot arm ..........................................................................29 Figure 26 : Home switch of the C-Axis ................................................................................... 34 Figure 27 : C-motor operation with the end effector ............................................................... 34 Figure 28 : Jog Speed Sliders................................................................................................... 35 Figure 29 : Outside of the panel board.....................................................................................38 Figure 30 : Inside of the panel board ....................................................................................... 38 Figure 31 Xinje XC3 PLC ....................................................................................................... 39 Figure 32 : Burnt Breakout board ............................................................................................ 42 v
Figure 33 : New Output Breakout Board .................................................................................43 Figure 34 : Before Wiring and After Wiring ........................................................................... 43 Figure 35 : Signal section of the wiring diagram ..................................................................... 44 Figure 36 : Power section of the wiring diagram ..................................................................... 44 Figure 37 : P.I.D. tuning block diagram .................................................................................. 45 Figure 38 : Position loop parameters ....................................................................................... 47 Figure 39 : Velocity loop parameters....................................................................................... 48 Figure 40 : End effector design ................................................................................................ 50 Figure 41 : Tableau Logo.........................................................................................................51 Figure 42 : Python and Postgresql logos..................................................................................53 Figure 43 : Qt logo ...................................................................................................................54 Figure 44 : Designing GUI with Qt designer ........................................................................... 55 Figure 45 : GUI of version one ................................................................................................ 56 Figure 46 : GUI of version two ................................................................................................ 59 Figure 47 : Connection settings window ................................................................................. 60 Figure 48 : About window .......................................................................................................61 Figure 49 : GUI of version three .............................................................................................. 62 Figure 50 : Monthly plan window of version four ................................................................... 63 Figure 51 : Data entry operation .............................................................................................. 64 Figure 52 : Data visualization ..................................................................................................65 Figure 53 : Matplotlib logo ...................................................................................................... 65
vi
LIST OF TABLES Table 1 : Machinery Recourses.................................................................................................. 2 Table 2 : Human resources ........................................................................................................ 3 Table 3 : Product details ............................................................................................................3 Table 4 : Comparison of Python VCP and Glade VCP ........................................................... 12 Table 5 : Home sequences summary ....................................................................................... 27 Table 6 : Station counter process summary .............................................................................40 Table 7 : Position loop parameter description .........................................................................46 Table 8 : Comparison of two approaches ................................................................................ 51 Table 9 : Summary of used libraries ........................................................................................ 52 Table 10 : GUI widget summary ............................................................................................. 55
vii
CHAPTER ONE 1.0 Introduction 1.1 Introduction to D Samson Industries (Private) Ltd
In 1962, late Mr. Samson Rajapakshe was founded D Samson Industries (Now called as DSI Group) in Galle. With more than 50 years of market experience DSI currently the largest footwear manufacturer in Sri Lanka. DSI group consists 22 subsidiary companies, 200 showrooms and 5000 Dealers Island wide. It is one of the largest family-owned group of companies. The group has rooted firmly into fourteen core business sectors to serve local and international markets with a higher satisfaction of its business partners. Our industrial training was done at the DSI sportswear, DSI group subsidiary.
Figure 1 : DSI Group logo
Figure 2 : DSI-Sportswear logo
1.2 Vision
“Produce merchandise with high quality by delighting the customers to the maximum, while maintaining affordable prices and establishing return to all stakeholders”.
1
1.3 Mission
“To improve the factory capacity utilization to 90% by the year 2015”
1.4 Values
•
We are passionate about design, providing quality, managing cost, timely delivery to the market to ensure customer satisfaction.
•
We adhere to respect religion, social and cultural norms of our country.
•
We pay due respect to all our employees.
•
We encourage challenges and innovation.
•
We are conscious of the need to be one team and team diversity.
•
We ensure our stakeholders' expectations.
1.5 Company Resources 1.5.1 Machinery Resources Table 1 : Machinery Recourses Machinery type
No of Machines
1) Injection molding machines.
04
2) Air born machines.
01
3) Chinese machines.
02
4) Special machines. I.
Cutting machines.
08
II.
Sewing machines.
135
Shoe line machines.
08
III.
(DSI-SP hand book, 2016)
2
1.5.2 Human Resources Table 2 : Human resources Level of Employee
CHAPTER TWO 2.0 Training Experience 2.1 Projects carried out
In the six month of training period we were assigned to three projects in DSI-SPORTSWEAR plant. Namely, 1. Six Axis Robotic Arm. 2. High Frequency Welding Machine. 3. Production Monitoring System. The task we were assigned in the Six Axis Robotic Arm project was complete its implementation phase (40% of work). HF Welding Machine and Production Monitoring System projects were designed from the sketch (100% of work). All projects were done at the
Maintenance Department of DSI-SPORTSWEAR Plant, Kalutara.
Figure 4 : Maintenance Department
5
2.2 Mechatronics Engineering
Mechatronics engineering is a collection multidisciplinary fields which deals with three main domains, mechanics, Electrical and Electronics and computer science. The term “Mechatronics” has used since its introduction in 1960’s. There are different definitions to define a mechatronics system. “Mechatronic systems are the result of the integration of mechanical, electronic and information technologies” (S. Turki, T. S. Lismma, & A. Sghaier, 2005) is the most widely shared definition.
Figure 5 : The view of mechatronics a multidisciplinary concept (Lyshevski, 1999)
Out of above disciplines, in our industrial training period most of them were covered. In Six Axis Robotic Arm and HF Welding Machine Projects, Electrical, Electronics, CAD,
Simulations, Computer Science, Sensors and actuators were covered. Mostly Computer Science domain was covered in Production Monitoring System project.
6
2.3 Six Axis Robotic Arm Project
As a first project we were assigned to complete implementation stage of a six axis robotic arm. The project was done by previous engineering interns of the company. All the mechanical Structure, Basic Electrical Wiring, Initial operating system configuration were completed in the project. Following objectives had to be completed as an implementation phase. •
Design a polymer applying head as an end-effector.
•
Reconfigure robotics arm operating system to add more features.
•
Reduce vibrations of the mechanical structure.
•
Implement emergency protocols.
•
Design a proper mounting to install the arm.
2.3.1 Software Part of the Project
The robotics arm was controlled by the operating system called “LINUX CNC”. It is a software system for computer control of machine tools such as milling machines, lathes and robots. The Linux CNC operating system is built based on “Debian” Linux distribution.
Figure 6 : Linux CNC and Debian logos
7
According to Linux CNC official documentation. (Linux CNC Documentation, 2017) It provides: •
A graphical user interface (actually several interfaces to choose from)
•
An interpreter for G-code (the RS-274 machine tool programming language)
•
A real-time motion planning system with look-ahead
•
Operation of low-level machine electronics such as sensors and motor drives
•
An easy to use breadboard layer for quickly creating a unique configuration for your machine
•
A software PLC programmable with ladder diagrams
The software configuration files for Linux CNC for the project was adopted from PUMA (Programmable Universal Machine for Assembly, or Programmable Universal Manipulation Arm) (PUMA , n.d.) 560 robotic arm configuration files and those were modified according to the project parameters. The configuration files are freely available at www.github.com.
Figure 7 : Puma 560 Robotics Arm
8
In the configuration files list, most important files are as follows. •
INI file (Provides sections that are read directly by the Hardware Abstraction Layer (HAL))
•
HAL files (Starts up process modules and provide linkages between EMC signals and specific hardware pins).
As the modification, one INI File (“ puma560_hme.ini”) and three HAL Files (“custom.hal”, “robot_arm.hal”, “puma560_postgui.hal”) were modified. •
“puma560_hme.ini”- Contains all the information about the robotics arm (ex: Axis count, Acceleration, Running Velocity etc.)
•
“robot_arm.hal” - Hardware Abstraction Layer file that contains information about signals.
•
“custom.hal” - Hardware Abstraction Layer file that contains pin configuration of the robot. It’s also known as “pinout hal” file.
•
“puma560_postgui.hal” - Hardware Abstraction Layer file that include information about signals which connect Graphical User Interface with Hardware.
All the files that mentioned above were already included and modified in previous phases of the project. But in HAL type files and INI file above had to be reconfigured and modified in the implementation phase. Additionally few more files were added during modifications. •
T2.ui
(User Interface Design File)
•
T2.py
(User Interface Control File)
•
position.py
(User Space Python Script Files)
9
2.3.1.1 Graphical User Interface
As the modifications in the implementation phase, Graphical user interface of the robot had to be redesigned with more user friendly capabilities. The previous GUI design which was built during on past phases, only suitable for testing purposes.
2
1
3
5
4
6
Figure 8 : Previous GUI Design Functions that had on previous GUI 1. Jog six axes positive and negative directions (X, Y, Z, A, B, C). 2. Change the jog speed (Fast jog mode and slow jog mode). 3. Positive and negative hard limit indication all six axes. 4. Save each axis Cartesian location as a G-Code. 5. Adjust feed-rate in the saved G-Code. 6. Display Station Counter as Binary Value. *Both 5th and 6th Functions were not in the srcinal design. They were added in the early implementation stage by myself. 10
The design was done using Python Tkinter graphic tool kit. In Linux CNC terms, it is known as Python VCP (Python Virtual Control Panel). The design process of Python VCP is little bit complicated. All the designing should be done as .xml scripting. To get familiarized with Python VCP, the Python VCP section of Linux CNC documentation was referred. As an example the .xml code needed to create a simple python virtual control panel (VCP) mentioned in figure 5 is as follows. "spindle-speed"5000
Figure 9 : PyVCP example
Python VCP satisfies the requirement in performances but its graphics quality is at lower stage. Because of that reason, The Design process of implementation phase graphical user interface was followed the Glade VCP. Glade VCP has attractive graphic quality compared to Python VCP.
Figure 10 : Python VCP LED
Figure 11 : Glade VCP LEDs
11
Table 4 : Comparison of Python VCP and Glade VCP Python VCP
Glade VCP
1. Uses Tkinter widgets.
Uses GTK+ widgets.
2. User interface creation: "edit XML file /
Uses the Glade user interface editor
run result / evaluate looks" cycle 3. No support for embedding user-defined
Several independent Glade VCP panels may
event handling
be run in different tabs
(Glade Virtual Control Panel, 2016)
2.3.1.1.1 The New Design
As mentioned on the above table Python VCP was built by scripting an .xml code. But in the user interface creation of Glade VCP, Glade UI editor was used. There are 2 versions of Glade UI Designer. One version is used for GTK+2(Latest version is 3.8) and other version is used for GTK+3(Latest version is 3.20). To build Glade VCP the GTK+2 version was used. GTK+3 is the newest technology of GTK but Linux CNC support only GTK+2 version.
Figure 12 : Glade designer user interface
12
GTK+ (GIMP Toolkit) is a multi-platform toolkit for creating graphical user interfaces. Originally GTK+ is written in C. But with using libraries GTK+ can be programmed using Java, C++, C, C#, Python and Perl. The library that integrate python with GTK+2 is “PyGtk”.
Figure 13 : GTK+ current logo
The Glade version of Linux CNC has some extra plugins which is not come along with the direct installation. This extra plugins is called HAL plugins that has capabilities to interface with HAL components of Linux CNC.
Figure 14 : HAL Plugins
New functions was added in the newly designed GUI for the robotic arm. New Functions that is added to the new GUI are, 1. Separate adjustment sliders to adjust the jog speed of 6 axes. 2. Two display widgets added to display G-code and Tool Path. 3. A Section added to select G-code for each injection molding machine stations and generate the O-Code. 4. Previous binary form of display station count was replaced with separate LEDs. Example: 1st LED is turned on to display 0001 binary input. 5. Section added to display whether the axis is homed. 6. “Play”, “Pause”, “Home”, “Stop” and “Connect” control buttons were added to the GUI.
13
Figure 15 : Final layout of the new graphical user interface
5
6
3
4
1
2
Before design the GUI on Glade, Varies paper prototypes were designed. After finalizing the layout, the design was proceeded. “LED”, “Button”, “Slider” and “Label” widgets were used for the basic design. “File Chooser Button”, “HAL Gremlin” and “Source View” widgets were used as special widgets. All used widgets are special HAL widgets that has Linux CNC interface capabilities (This will be explained on 2.3.1.1.3 The Integration).
1024x768 resolution 15inch monitor is used as display of the robotic arm. All widgets on Glade widget library has a fixed size. It isn’t adjust according to the screen size. Because of that
14
constraint, Put all necessary functions to a limited 15 inch space was become a big deal to me. To achieve that challenge the design was separated into 3 groups. Namely, 1. Operation Section. [ Left Section of Figure 15] 2. Jog Section. [ Middle Section of Figure 15] 3. Display Section. [ Right Section of Figure 15] Operation Section contains all necessary widgets were needed for Robot arm operation. The widgets on the Operation section are as follows, 1. File chooser buttons to select the G-Code of the shoe size according to station number. 2. LEDs to display station number. 3. Control Buttons (Play, Stop, Pause, Home and Connect) 4. LEDs to display Homed and Homing operations of each axes. 5. “Apply” Button to generate O-Code from selected GCodes. 2 1
5
4 5 Figure 16 : Operation Section of the GUI
In the early prototyping “In Operation” LED, “Play by Steps” buttons and area to display errors were planned to insert in the operation section. But due to limited display space those ideas were thrown out.
15
All the widgets that need for Jog the robot’s six axes were placed in the Jogging Section. The details about each widgets are as follows, 1. Buttons to jog each axes in both negative and positive direction. 2. LEDs to detect positive and negative hard limits of each axes. 3. Edit space to set feed rate of the G-Code. 4. “Save” button to save G-Code of current location. 5. Sliders to adjust each axis jog speed separately.
2 1
4 5
Figure 17 : Jog Section of the GUI
The hard limit detection LEDs were not labeled and they placed near the positive and negative jog buttons to reduce space. In earlier it was planned to place on the area shown on 5th section of figure 14. With the idea of separate jog speed settings, the planed space was allocated to place sliders. The current Cartesian position relative to home position of each axis is shown on the top of each axis jog buttons.
16
In the display Section DSI-SPORTSWEAR logo, Tool path display and G-Code display were included.
DSISPORTSWEAR Logo Tool path display
G-Code Display
Figure 18 : Display Section of the GUI
2.3.1.1.2 The Control
Like most of user interface designer software, in glade user interface designer the output file is in “.UI” format [in this project it was saved as ‘T2.ui’]. As mentioned previous Glade is a WYSIWYG (“what you see is what you get”) typed GUI designer for GTK+. WYSIWYG method has several advantages, 1. Less code needs to be written. 2. UI changes can be seen more quickly, so UIs are able to improve. 3. Designers without programming skills can create and edit UIs. 4. The description of the user interface is independent from the programming language being used.
17
But there is still a code has to be written for handling interface changes triggered by the user. Most of popular programming languages have libraries which has the capability to bind with GTK+. For examples, Language
Library
Java
Java-genome
C++
Gtkmm
C# Python
Gtk# Pygtk and PyGObject
(List of language bindings for GTK+, 2016) Among those languages C# and Java were rejected because the less compatibility in Linux environment. From C++ and Python, Python was selected to. The reason behind the selection was a personal favor. There are 2 libraries that bind GTK+ to python. Pygtk supports GTK+2 and PyGObect supports GTK+3. Therefore PyGtk was chosen. In PyGtk, “Gtk.Builder” is the class which is offered the opportunity to import “.UI” file into the python world. The python file which controls user interface contains,
1. Functions
that
get
the
filename
from
“File
chooser
button”
selection.
The code that import modules to python file. And
make
the
file
executable.
Get file name from File chooser button and save in “s1” variable
18
2. Function that generates the O-Code file when “apply” button is pressed.
Importing “.ui” file as python object
3. Function
that
open
“about
window”
when
“DSI
logo”
is
pressed.
2.3.1.1.3 The Integration
The “postgui.hal” file responsible for all the integration between graphical user interface and Linux CNC. In this case, the “postgui.hal” file was saved as “puma560_postgui.hal”. As the description on the design section all of widgets that were used in UI file are HAL compatible widgets. Each widgets have specific “HAL pin” name. For an example, the default pin name for LED is “hal_led1”. But the name can be customized for ea sy identification. The “postgui.hal” file identifies the widgets by its “HAL pin” name. To load “UI File” and “Control Python File” into Linux CNC userspace, a line of code is needed to add onto the “robot_arm.hal” file. Because all Linux CNC runtime and userspace operations are done by “robot_arm.hal” file.
The line that has blue colored text was used to load the old GUI. After the new GUI was created, the new line was added that is on black colored text. “loadusr –Wn DSISP” - The command “loadusr” loads a userspace HAL component. “-Wn DSISP" is flag that wait for the component and “DSISP” will be given as prefix of all loaded components. Example, 19
The “hal_led1” pin is loaded into runtime as “DSISP.hal_led1” “gladevcp -c DSISP -u ./T2.py ./T2.1.ui” - The command “gladevcp” connects glade virual control panel to HAL userspace (Previously “pyvcp” was used). “-c DSISP” is used to set component name to DSISP. This must be equal to the name that was used with “loadusr”. “-u. /T2.py. /T2.1.ui” connects user defined modules in this case T2.py is the control file and T2.1.ui is the UI file into userspace. After above line of code is loaded, all the “HAL pins” that was set in “ui.file” will be loaded into HAL userspace with a prefix of DSISP. Now they can be accessed from “postgui.hal”file. To create a “connection” between signals and HAL components “net” command is used in “postgui.hal” file. The syntax of “net” command as follows.
net
Figure 19 : Signal Direction
20
The brief code explanation of partial “postgui.hal” is shown below. Connect input from speed adjustment sliders and connect
them
to
corresponding HAL pins Connect inputs from jog buttons
and
connect
them to corresponding HAL pin which move the axis
Connect signals from HAL pin which count station
number
corresponding LED
21
with
Station
2.3.1.2 The Configuration of the Robot Arm
All the configuration data of the robot arm is stored in a standard file format called “.ini” file. In this project “puma560_hme.ini” is used as the “.ini” file. As mentioned earlier this configuration file was srcinally based on the parameters of a puma 560 robot . In Linux CNC’s default “.ini” file is divided into 11 sections. Namely, 1. [EMC] section for general information 2. [DISPLAY] section for settings related to the graphical user interface 3. [FILTER] section for settings input filter programs 4. [RS274NGC] section for settings used by the g-code interpreter 5. [EMCMOT] section for settings used by the real time motion controller 6. [TASK] section for settings used by the task controller 7. [HAL] section for specifies “.hal” files 8. [HALUI] section for MDI commands used by HALUI 9. [TRAJ] section for additional settings used by the real time motion controller 10. [AXIS] section for individual axis variables 11. [EMCIO] section for settings used by the I/O Controller But in this project only used 10 sections. [HALUI] section wasn’t needed for the operations. In the [EMC] section, all the general information about the robot arm is stored. Such as VERSION, MACHINE name and a developer level option DEBUG. This section was kept as default. [DISPLAY] section holds the information related to graphical user interfaces. DISPLAY variable contains the name of the default user interface to use. As mentioned in the previous “User Interface” section, a new GUI was designed to override the controls of default interface controls to make more user friendly. AXIS and Touchy are the two main default interfaces for Linux CNC. AXIS is an interface for use with normal computer and monitor, Touchy is for use with touch screens. AXIS was set to run on background in addition to our newly designed GUI. The reason behind was AXIS has more functionalities that I didn’t include on the new GUI. Because those functionalities are necessary for testing purposes only. Other important variable was PROGRAM_PREFIX. This contains the location where to scan for G-Codes. The location was set to Desktop. Therefore all the G-Code files was saved on the desktop.
22
[FILTER], [RS274NGC], [EMCMOT], [TASK] and [EMCIO] sections were left as default. In the [HAL] section all the configuration information about Hardware Abstraction Layer (HAL) is included. All “.hal files” used in the robot were assigned to HALFILE variable (robot_arm.hal and custom.hal) and the postgui.hal file was assigned to POSTGUI_HALFILE variable (puma560_postgui.hal). Detailed explanation about Hardware Abstraction Layer is described on the 2.1.3.1.3 section.
Figure 20 : HAL Section of INI file
[TRAJ] section contains machine specific settings such as number of axes (Stored in AXES variable), units (Stored LINEAR_UNITS and ANGULAR_UNITS variables), maximum velocity
and
maximum
acceleration
(Stored
in
MAX_ACCELERATION variables)
Figure 21 TRAJ Section of INI file
23
MAX_VELOCITY
and
[AXIS_] sections contains general parameters for the individual axis of the robot arm. Typically the axis numbering begins with zero. In this project it was used as same. Other axes were numbered according to that. 1. [AXIS_0] = X 2. [AXIS_1] = Y 3. [AXIS_2] = Z 4. [AXIS_3] = A 5. [AXIS_4] = B 6. [AXIS_5] = C In all axes TYPE variable was set as “TYPE = LINEAR”. Other variables were set specifically for individual axis.
2.3.1.2.1 Axis Motion Tuning
MAX_VELOCITY, MAX_ACCELERATION and FERROR variables were adjusted to tune individual axis motion. This tuning process can be called as software tuning process. MAX_VELOCITY and MAX_ACCELERATION variables contain values for maximum velocity and maximum acceleration for the axis in machine units per second. FERROR is the maximum allowable following error, in machine units. If the difference between commanded and sensed position exceeds this amount, the controller disables servo calculations, sets all the outputs to 0.0, and disables the amplifiers. INPUT_SCALE, OUTPUT_SCALE and SCALE variables are relevant to axes controlled by servos. In [AXIS_1] which is named X, has to be moved relatively slow velocity and accelerated relatively quickly. Therefore MAX_VELOCITY was set to 2000.0, MAX_ACCELERATION was set to 750.0, and OUTPUT_SCALE was set to 1.0. All the values were set according to the results of trial and error procedure. Most of other axes followed the same procedure. But after connecting end effector to the AXIS_5 (C Axis), its movement had become terribly fast due to direct coupling without using gears. To decrease the speed of the AXIS_5, MAX_VELOCITY was set to 1500 MAX_ACCELERATION was set to 500 and OUTPUT_SCALE variable was set to 2.5. The theory behind that output scale setting is the
24
computed output is divided by the OUTPUT_SCALE value before sending to Digital to Analog converter.
=
_
Figure 22 : Settings for Axis X and Axis C
25
2.3.1.2.2 Homing Process
SEARCH_VEL and LATCH_VEL are the parameters that is responsible for the homing sequence. Considering signs of SEARCH_VEL and LATCH_VEL and USEINDEX parameter, four possible home sequences can be defined. •
Below table contains the brief description above sequences.
Table 5 : Home sequences summary Homing Type
SEARCH_VEL
LATCH_VEL
USE_INDEX
Immediate
0
0
NO
Index-only
0
Nonzero
YES
Switch-only
Nonzero
Nonzero
NO
Switch and index
Nonzero
Nonzero
YES
(Homing Configuration, 2016)
“Switch-only” Homing type was used in the robot arm axes. First and second homing sequence were selected with a requirement of homing motion. For an example in X axis, POSITIVE (0.2 machine units per second) HOME_SEARCH_VEL and NEGATIVE (-0.2 machine units per second) LATCH_VEL was used (see Figure 19). In AXIS_3, AXIS_4 and AXIS_5 relatively larger HOME_SEARCH_VEL and HOME_LATCH_VEL values were used to make faster movements (see Figure 22). The HOME_OFFSET value was adjusted to set the home position of the robot to safer place. The safest place was found away from the injection molding machine. All axes HOME_OFFSET value was change to move that position after triggering the home limit
27
switch. HOME_FINAL_VEL value specifies the velocity to move HOME_OFFSET to HOME position. The HOME_FINAL_VEL value was set relatively larger in A, B, C than X, Y, Z. The HOME_SEQUENCE value defines the homing sequence of axis. When “Home all” is commanded, this is the sequence it follows. An axis may be homed after all axes with a lower HOME_SEQUENCE have already been homed and are at the HOME_OFFSET position. In this case HOME_SEQUENCE was set as follows, 1. HOME_SEQUENCE was set to zero in X, Y and Z axes 2. HOME_SEQUENCES of A Axis and B Axis were set to one (see Figure 23) 3. Finally C Axis HOME_SEQUENCE was set to two. (see Figure 22)
Figure 23 : Settings for Axis A and B
28
Figure 25 : Homed Position of the robot arm
Figure 24 : Display Monitor 29
2.3.1.3 Hardware Abstract Layer (HAL) of the Robot Arm
Hardware Abstract Layer (HAL) is a platform that interconnect hardware with Linux CNC operating system. Operations are done by HAL files that are specified in the [HAL] section of the INI file. In this project two HAL file were used. One was used to servo operations (robot_arm.hal) and other one is used for input and output parallel port operations (custom.hal). Most of modifications and additions were done to “custom.hal” file by myself. New Graphical user interface integration was included to the custom.hal as modifications. Three new features were added to the project by me through the custom.hal file. Namely, 1. Station counter was added. 2. Jog speed adjuster was added to change jog speed of individual axis. 3. C axis motor’s motion was increased to 360+ degrees.
In Linux CNC custom HAL pins can be created from a python script. To add those new features custom HAL pins had to be created because those features are new features. “Postion.py” python file was created to do that task. To create a pin following procedure should be done.
ℎ = ℎ. (“ℎ”) ℎ. (“”, ℎ. _, ℎ. _ ) After creating, this pin can be accessed by HAL pin
ℎ.
30
2.3.1.3.1 Station Counter
12 input pins and 4 input pins altogether 16 new HAL pins were created in “position.py” to perform this task. Those created pin holds HAL_BIT values. That means TRUE and FALSE.
Those created new input HAL pins were connected with Linux CNC default HAL pins from “custom.hal” file. And output HAL pins were connected to GUI’s LEDs from the “postgui.hal” file. The connection between input parallel port pins and new input HAL pins for station counter are as follows.
Those inputs are read as a 4 digit binary value. Four digits of the binary number represent the input from the parallel port pins. Python code was used to convert that binary number to decimal and trigger corresponding new output pin. After, the triggered output pin is connected GUI LED from the code which is written on the postgui.hal file.
31
Step 1: Input parallel port pins are triggered by the counter sensor. After that those pins triggered the newly created HAL pins.
Step 2: Python code is written to trigger corresponding newly created output pin. For an example “station1” pin is triggered if the parallel port input was 0001(Station1)
Step 3: Corresponding LED pin connected to the output pin which was triggered on the step 2. This connection is done on the postgui.hal file.
32
2.3.1.3.2 C-Motor’s 360degree+ motion
The motion of the C-motor is different than other axes motion. Because C-motor should be able to move more than 360degrees. But degree was limited by the limit switch. When the limit trigger hit the limit switch, Linux CNC terminate the operation. This restriction became a hard problem to solve. In X to B axes the limit switch operation was done by directly connect limit switch signal to limit HAL signal via parallel port HAL pin. Flow chart as follows.
Limit switch signal
Parallel port HAL pin
Axis Limit HAL pin
(ex: parport.1.pin-03-in)
(ex:axis.4.pos-lim-sw-in)
To solve that problem a new method was followed for the C-Axis. HAL pin called “axis.5.homing” pin was connected parallel port signal as AND gate. The output of AND gate connected to C-Axis HAL limit pin. Therefore C axis limit switch isn’t triggered during the operation. It’s only worked when homing operation.
Limit switch signal
parport.1.pin04-in
axis.5.pos-limsw-in AND GATE
Axis.5.homing-i The creation of AND gate was done by following code which was written on the custom.hal file.
The input and output connection to the AND gate was done using following code.
33
Figure 27 : C-motor operation with the end effector
Figure 26 : Home switch of the C-Axis 34
2.3.1.3.3 Individual axis jog speed adjuster
In Linux CNC there wasn’t had a default HAL pin to control the jog speed of individual axis. Only it have “ halui.jog-speed HAL pin which controls the jog speed of all axis. In our ”
requirement individual axis jog speed should be separately selected. To do that new HAL pins were created from “position.py”. Newly created HAL pin as follows,
Inputs for the jog speed were received from the newly created GUI. Sliders were used to select speeds.
Figure 28 : Jog Speed Sliders
The HAL pins of the sliders were connected to new HAL pins such as position.xin, position.yin etc.
35
The HAL pin connection between sliders and new HAL pins as follows,
After that, a python code was written to assign slider value to new HAL pin if the corresponding jog buttons are pressed. For an example, if X+ jog button or X- jog button were selected, Slider value of X Axis would assign to an output pin call position.speed. The written code is as follows,
After that position.speed HAL pin was connected to default HAL pin halui.jog-speed.
36
2.3.2 Electrical Part of the Project
All the electrical components of the robot arm were installed inside a panel board. A 15 inch monitor and a keyboard were fix on the panel door. The electrical components which were installed inside of the panel are, 1. Three 220V AC 3-Phase servo motor drivers for X, Y and Z motors. 2. Three 24V DC servo motor drivers for A, B and C motors. 3. 5V/2.5A output power supply. 4. 24V/14.6A output power supply. 5. 24V/2A output power supply. 6. 3 pole trip switch. 7. 3 pole circuit breaker. 8. 3 pole contactor. 9. 400V to 220V 3-phase transformer. 10. Input and output parallel breakout boards. The main power supply voltage of the factory is 400V 3-Phase. All the power electronics components of the robot arm work with 220V Voltage. Therefore 3-Phase step down transformer was used to transform 400V 3-Phase voltage to 220V 3-Phase voltage. All 3 Phases were connected to power up motors which were used as X, Y and Z axes. Single phase was used as the input of power supplies. 24V/14.6 power supply was used to power A, B and C motors. 24/2A power supply was used to power input/output breakout boards and the Programmable Logic Controller (PLC). 5V power supply was only used for signal purposes. In the previous phases of the project, most of the essential wiring process was completed. The works had to be done on the implementation stage was, 1. Wire the PLC connections. 2. Add new station counter proximity sensors and proximity sensor for the C motor’s limit switch. 3. Rewire all the wiring of the inside panel and panel door more neatly and design a wiring diagram of the wiring. 4. Tune all servo motors to reduce vibrations.
37
Figure 30 : Inside of the panel board
Figure 29 : Outside of the panel board
38
2.3.2.1 New additions
As mentioned earlier, in the previous phases most of essential wiring was completed. Those completed wiring was enough for the testing purposes but it wasn’t enough for the operation of the robot. Station counter and emergency protocol had to be implemented in the implementation stage. In order to achieve those objectives Programming Logic Controller was used. “Xinje XC3” Series PLC was used to implement the objectives.
Figure 31 Xinje XC3 PLC
2.3.2.1.1 Station Counter
The station counter was achieved by using two proximity sensors which were fixed under the injection molding machine. One proximity sensor was used as a counter and other one was used as counter reset switch (Count the first station of the molding machine). Both two proximity sensors were powered with 24V/2A DC power supply. A counter reset button which do same operation of counter reset limit switch was also added to the system in case of emergencies. 39
Signal pins of the sensors and the button’s terminal were connected to the PLC’s input pins. Then four outputs were connected to the parallel breakout board. The diagram below shows the operation of the process. Counter Limit Switch
Counter Reset Limit
Counter Reset Button
Switch
PLC Program
Parallel
Computer
breakout board
The program of the PLC count the triggers from the counter limit switch and pass the output to the parallel breakout board as a binary value. Finally the binary value was converted into decimal and display on the robot GUI (Explained on the software section of the project). For an example, Table 6 : Station counter process summary Station counter
Counter
reset
PLC program Output
limit limit switch or output
switch
the push button
Trigger Trigger
Not Trigger Not Trigger
0001 0010
1 2
Trigger
Not Trigger
0011
3
Trigger
0000
Not Trigger
0001
Trigger
40
of
display on the GUI.
1
Figure 33: PLC Wiring
Figure 34: Station Counter Sensors
41
2.3.2.2 Rewiring Process
After the implementation stage was almost completed, the robot arm was transferred to proposed place which was near the injection molding machine to finalize the implementation phase. At the first startup of the robot arm on its proposed place robot arm’s motors were failed to start. The motor drivers didn’t receive any signals which were s ent by the computer. To find the problem step by step investigation was started from the bottom to the top. Computer’s parallel port was checked first. We checked the voltage difference of the pins from the multi meter by sending signals from the computer. Clear 5volts and 0volt variation was noticed when we were checking. And same test was done with parallel cable to check whether the error on the cable. But it also went successful. Then the output parallel breakout board was tested. Finally the srcin of the problem was found. Some opto-coupler isolators of the breakout board were burnt. Therefore the signals were send by the computer did not pass through the breakout board to the motor drivers.
Opto-Couplers
Figure 32 : Burnt Breakout board
42
The cause for the burnt opto-couplers was found as ground voltage imbalance. Therefore more than 5Volt was passed through the opto-couplers. Burnt opto-couplers couldn’t be replaced, because we hadn’t enough resources and instruments to do that procedure. So instead of order a new breakout board a new breakout board was built on the workshop. Along with the replacement of the burnt breakout board the complete wiring of the robot arm panel rewired more neatly. In the rewiring process, hardly concerned on the common grounding set to zero volts. After the completion of the wiring, wiring diagram was designed using Solidworks Electrical software. To reduce the complexity of the diagram, signal and power wirings were separately drawn. Figure 33 : New Output Breakout Board
Figure 34 : Before Wiring and After Wiring 43
Figure 36 : Power section of the wiring diagram
Figure 35 : Signal section of the wiring diagram
44
2.3.2.3 Servo Motor Tuning
A tuning should be done after connecting a load to the servo motor to reduce the vibrations. Without the load servo motor might work well without any vibrations but with a load the inertia will be changed. So motor’s voltages and current should be changed depend on that load. PID (Proportional–Integral–Derivative) based tuning method was done in the tuning process. The manufacturer of the servo motor provided a software to tune the motor using a PID based tuning. The connection was simply done by connect the servo driver with the computer and run the software. In the software there were 3 main parameters had to be configured in order to tune the motor. The main parameters are, 1. Position loop 2. Velocity loop 3. Current loop ( Not recommended to modify ) Servo drives often have a multi-loop structure, with the current loop nested inside the velocity loop, which is nested inside the position loop
Figure 37 : P.I.D. tuning block diagram
Trial and error method with a proper understanding about the parameters was done to configure those parameters.
45
2.3.2.3.1 Position Loop Tuning
The position loop determines the following error, which is the deviation between the actual and commanded positions, and issues velocity commands to reduce or eliminate the following error. There were 5 sub parameters had to be configured in the section of position loop tuning. But in the user manual one parameter among those not recommended to modify. Below table shows the summery of those sub parameters. Table 7 : Position loop parameter description Parameter
Function
Pp
Rigidity
Effects
when Effects
increasing of
the
motor. Pf
when
decreasing
Motor vibration will Motor be increased.
will
run
slower.
Tracking accuracy of Positioning will be Hysteresis will occur the motor.
Pos error
Accuracy given
and
advanced. of
the
Increase the accuracy
actual
10000 motor stops
position Pos filter
Smoothness movement
If become less than
and give an alarm out of Smoothness
of Less smoothness in
movement will be motion. increased (Max value is 7)
After trial and error procedure optimal parameter values were found. The values as follows, 1. Pp = 3000 2. Pf = 2000 3. Pos Error = 30000 4. Pd = 0 (Not recommended value) 5. Pos Filter = 1
46
Figure 38 : Position loop parameters
2.3.2.3.2 Velocity Loop Tuning
The velocity loop compares the commanded velocity to the actual velocity via a tachometer or encoder and issues commands to increase or decrease the motor’s speed accordingly. The velocity loop is also referred to as a PI controller, as it typically uses both proportional gain and integral gain to determine the correction command. Among 8 sub parameters only 3 parameters were recommended to modify. The table given shows the description of those modifiable parameters.
47
Parameter
Function
Effects
when Effects
increasing Vp
Tracking speed and Vibrations response speed.
Vi
Regulate
will
be Slow response and
occurred.
Weaker rigid.
the Motor will shake and Not guaranteed to
positioning accuracy according
when
decreasing
to
unstable.
locate accurately.
the
positioning error Vel filter
Use
to
suppress Better
vibrations.
suppressing Lower
vibrations(Max is 7)
Configured parameter values are as follows, 1. Vp = 3000 2. Vi = 300 3. Vel filter = 7
Figure 39 : Velocity loop parameters 48
suppressing
vibrations
2.3.2.3.3 Current Loop Tuning
Current control is needed when the required response time is high, as in the case for many industrial servo applications. The primary goal of the current loop is to control torque, which influences speed, and therefore, position. In the manual of the servo motor, Modifications in the current loop parameters are not recommended. Therefore we continued tuning with its default values.
2.3.3 Mechanical Part of the Project
In the previous phases of the project, mechanical engineering part of the project was almost completed. Designing a proper “end effector” to apply the polymer on the shoe was the only remaining addition in the mechanical domain. Following facts were followed during designing process of a proper end-effector to the robot arm. 1. Avoid any damages to the shoe mold. 2. Easiness to replace the contacting head. 3. Self-adjust adjacent show sizes. 4. Minimize the c-motor rotation when applying the polymer. 5. Cover every point of the mold.
49
Figure 40 : End effector design
2.4 Production Monitoring System 2.4.1 Introduction
At that time there was no method to get real time production data of the company operations. The hourly target quantity and actual quantity data gathering process wasn’t being done well. Only daily plan and actual quantity data were displayed on a whiteboard near each section. The accuracy of that was most of the time at low level due to manipulation of data by supervisors and team leaders. On the other had down level workers hadn’t no idea about what is the ir end goals. All they know is their daily target. Company executives wanted to create a custom made system that would overcome those problems and give motivation to the workers on their progress. Two of us (including me) were assigned to build that monitoring system.
50
Firstly we had a meeting with company executives to discuss about this system. At that meeting “what is the company executives expect from us” was mainly discussed. Main features that the executives initially wanted as follows. 1. Real time update of the system. 2. Display monthly target and daily target quantities. 3. Visualize daily and monthly current progress in a chart. To evaluate our knowledge for this task and our software’s reliability, they said to build the system only sewing section. After giving those requirements we researched similar software that are already used in the industry. Finally the software called “tableau” was referred to get the basic idea about the system.
Figure 41 : Tableau Logo The graphical user interface, data visualization methods, connectivity medium, core language, database were discussed next. Programmers’ Q and A platform called stack overflow, YouTube, and other online resources were referred select proper software libraries which can achieve final goals more successfully without relatively minimum dirty work. After that time consuming process, two approaches were found to achieve expected goals. They were namely, 1. Standalone approach 2. Web based approach Both approaches had conventional pros and cons. Following table contains a brief description about those pros and cons. Table 8 : Comparison of two approaches Approach
Pros
Cons
1. Stand-alone approach 1.Cheap
1.
2.Secured
Limited
modifications.
51
do
further
2. Web based approach
1. Can be accessed from
1. 3rd party servers buying
anywhere over the internet.
cost is relatively high.
2.
2. If the security protocols
Easily
do
further
wasn’t perfectly designed,
modifications.
the system would at risk. Therefore have to invest in security.
After analyzing pros and cons on above approaches, Stand-alone approach was selected to proceed. “Python” programming language was selected as the core language of the design by considering its handy data mining, data visualizing and manipulating capabilities. In order to design functions of the stand-alone application following open source python libraries were selected. Table 9 : Summary of used libraries Python Library
Usage
1. PyQt
Design the GUI of the system.
2. Matplotlib
Data visualization.
3. Pandas / Numpy
Data manipulation.
Next major selection task was choose a database for the application. The facts we considered when choosing a database were. 1. Python language support. 2. Stability of the database. 3. Community support. After considering above facts, “POSTGRESQL” database management system was chosen as the core database of the application.
52
Figure 42 : Python and Postgresql logos
Design a system hierarchy was discussed next. Two separate softwares had to be design. One software is for data entering and other one is for the data visualization. The main functions of the data entering software were enter data to the database and retrieve them when requested. Data visualization software get the data from the database, do some calculations and display data. Summary of the total system hierarchy as follows,
Data Entering Software Database
Data Visualization Software
*Arrows show the dataflow
2.4.2 Data Entering Software 2.4.2.1 Introduction
53
The main tasks of the data entering software are send the data which were entered by the data entry operator to the database and retrieve those data when requested by the operator. All the programming of the data entering software was done using python and python library for design graphical user interfaces called the “PyQt4” was used. In the robotic arm graphical user interface, I used GTK+ and Glade to design the graphical user interface. But in this project “Qt” was used because of its attractive graphics.
Figure 43 : Qt logo
Similarly in Glade and GTK+, Qt designer was used to design the graphical user interface for Qt environment. C++ programming language is the officially supported programming language in Qt based applications. 3rd party library called “PyQt” was used as a “python” frontend to Qt. The basic flow chart for create Qt based using Python programming language is as follows.
Create the GUI using
Use PyQt4 to convert .ui
“Qt designer”
Add functions to the file using any python
file into .py file
compatible text editor.
File Format: “.UI”
File Format: “.PY”
To build functions which communicate with postgresql database, ‘psycopg2’ connector was used. The main achievement I targeted when I was designing this software was “create a more user friendly data entering software with more powerful functions”.
2.4.2.2 The Version One
The basic version of the display software was designed only with essential functions and simpler graphical user interface. Also this design was used to show the supervisor our capability to complete the project. 54
As mentioned in 2.4.2.1 Introduction, Graphical User Interface (GUI) was designed using Qt designer.
Figure 44 : Designing GUI with Qt designer
Widgets that were used in this design and its functions mentioned in the below, Table 10 : GUI widget summary Widget Name
Function(s)
1. Combo Box
Use to select the section (Cutting, Sewing, Injection Molding and Finishing).
2. Calendar Widget
Use to select the date.
3. Line Edit
Use to display monthly and daily targets.
4. Table Widget
Use to Display and Enter actual quantitates.
Then the completed .UI file was converted into a python file. Pyuic4 (Python UI conversion pyqt4) command was used to do that conversion.
55
Above example shows the conversion of uidesign.ui file into uidesign.py. (-x flag means set .PY as an executable). To run the python file as an executable, below command is used.
1
The result is as follows.
3
4
2
Figure 45 : GUI of version one Functions which were used to integrate the GUI widgets were written on the python file (ex – uidesign.py). A brief graphical explanation (flow chart) about used functions is mentioned below. 1. Calendar Widget Function. When click on a date cell 56
Get the selected date
Connect to the database
Data not available
Create a new
Check whether data for selected
hourly table
day is available on the database.
Data available
Select from
Select from
daily table
hourly table Select
from
monthly table
Insert data
Insert monthly
Insert
to the table
target to the
target to the
widget
line
line
edit.
2. Daily and Monthly Line Edit Function
When click on the edit button
Get the selected date and the values on the line edit 57
daily
edit.
Connect to the database
Data Update the
Check whether data for selected
available
entered
day is available on the database.
value
Data not available
Insert the entered value
The function which is triggered when pressed the ‘Save’ button act as the same procedure. It is inserting hourly data to the data base. If the data is available in the data base like above flow chart, it updates hourly data.
2.4.2.2 The Version Two
The completed design of the data entering software was shown to the supervisor after the basic design was completed. He appreciated our effort on the design and requested to do some modifications. Modification that were done to 2.4.2.2 The Version One of the design are as follows, 58
1. In the basic design, the place that was used to enter monthly planned quantity was only able to enter only one parameter. That was modified to enter planned quantities of all four sections in a separate places. 2. New ‘connection window’ was added to enter IP address of the database, database name, username and password of the database. 3. Also ‘about window’ was added to the design to display credits of the design. Buttons used to enter 2 and 3 windows
1
Figure 46 : GUI of version two
59
Figure 47 : Connection settings window
In the newly added ‘connection settings’ window was used to enter parameters which were needed to log in to the database. Above python code shows the functionality of the connection window. In the testing stages the database was also installed in the same computer which the data entering software was installed. Therefore in the IP address space, instead of entering the IP address had to enter
60
‘localhost’. If the connection was successful between the software and the database. “Connection Success” was displayed. Otherwise “Connection Failed” massage will be raised. Any software no matter it is open source or proprietary there is a space to display details about creators of the software. In the version two of the data entering software “about window” was added to display those details.
Figure 48 : About window
2.4.2.3 The Version Three
Data entering software could be implemented at the development stage of the version two. But in the meeting with company executives and team leaders of the sewing team new interface suggestions were discussed. They suggested give more space to data entering table and add date and time. Besides that back end functionalities of the software satisfied their requirement. Therefore no suggestion were given to modify those functions at the meeting.
61
Figure 49 : GUI of version three
After the completion of the version three of the data entering system, it was installed on a computer of the data entry section of the company. More space was added to the table widget and colored table rows to identify the sections of the sewing section more clearly. Also added new label that shows the connection status between software and the database.
2.4.2.4 The Version Four
After few days of operation with the version three of the software design, new modification were done according to the comments of the data entry operator.
62
In the previous design (version three) daily target should be entered in each day. At the beginning of each month daily targets of each day are planned. Therefore data operator suggested add a feature to enter monthly plan at once.
Figure 50 : Monthly plan window of version four
After adding this feature operator can enter monthly plan at the beginning of each plan period. In the company production targets are planned 25th of previous month to 25 th of current month. For an example, 2017 January production was planned 25 th of December 2016 to 25 th of January 2017.This detail was also introduced to the monthly plan window. With the completion of the version four, designing of the data entering software was completed. Few more functions planned to added in the future versions as follows, 1. Feature to read the Microsoft excel sheet of monthly plan and add those values automatically to the software. 2. Feature to track the order number when entering the data.
63
Figure 51 : Data entry operation
2.4.3 Data Visualizing Software
The data visualizing software was used to display the production data of each section on the screen. Graphical user interface design and other functions of the software were done by other member of the team (see Figure 48). Integrating the software with the database and implement formulas for plotting functions were done by myself. In this design two separate python files were created. Namely, python file which contains code about graphical user interface and python file which contains the control code. Graphical user
Control
interface
information.
information
64
2.4.3.1 The Control
The graphical user interface was built like stacks. Each stack contains the information about single sub-section of the sewing section. Items in a single stack are as follows, 1. Main plot. 2. Hourly plan and actual quantities on the top. 3. Hourly, Daily and Monthly production details on the sidebar.
Figure 52 : Data visualization
In the main plot ‘two line chart’ were used to visualize the hourly production. A ‘pie chart’ was used to display up to date monthly production and a ‘bar chart’ was used to display hourly production. All the plotting were done using “matplotlib” python library.
Figure 53 : Matplotlib logo
65
All the plotting functions were coded inside a function (graph_draw) which is looping every one second. To do that iteration timer (StackWidTimer1) was used.
The flow chart of the control procedure of the data visualizing software is as follows, Connect to the database
Read monthly table on the database.
Find monthly and daily targets of each sub section.
Looping every one second
Read hourly table of the current date. Find the sum of up to hour total production of each section. Calculate up to date actual production. (1st of month to current date)
Display calculated values.
66
CHAPTER THREE Conclusion
In all my six months of industrial training period I completed the training at the D.Samsons Industries (Pvt) Ltd – Sportswear plant (also known as DSI-SPORTSWEAR) at Kalutara. I’d like to mention that my training place was a wonderful place to undergo training as a mechatronics engineering undergraduate. Especially the industrial exposure and hands on experience I earned from my training period was intangible. I got opportunity to involve in two projects in my training period which were direct applications of mechatronics engineering field. One was an ongoing project and other was designed from the sketch. Implementation phase of six degree of freedom robot manipulator project was the first project we were assigned in our training period. In that project I directly involved in software and electrical parts of it. From the software part I had an experience on Linux operating systems (especially on debian based distributions), Graphical user interface (GUI) designing and python programming. And had a wonderful experience on the operating system that is used in the robot arm manipulator called Linux CNC. Also I faced some unique challenges that was never found a solution or clue from the internet or from other sources when implementing new functionalities to the project. They are described in 2.3.1.3.1 Station Counter and 2.3.1.3.2 CMotor’s 360degree+ motion chapters. We also get an opportunity to learn and practically apply kinematics to a robotic arm before we learn them in our final year. As an electrical exposure we got the opportunity to tune both AC and DC servo motors in a high precision level. Also we had an experience on panel wiring and design principles of printed circuits boards. The second project I was assigned, was design a real production monitoring system to the factory. The project was 100% computer science project. At the beginning of the project I was clueless about what I have to do. But In the end I was successfully completed project. The most important life lesson I learnt from that project was how guide myself thought an ambiguity situations. Another nonacademic experience I gained from that project was, how to work with people who are from different educational background and different attitudes. The academic related experience I got from this project was python programming in a higher order level, Graphical user interface designing using Qt tool kit, and relational database management systems (postgresql) and advance plotting with python using matplotlib.
67
Finally, I’d like to mention that we successfully completed our training as a mechatronics engineers with a support of our training supervisor and other company executives at DSISPORTSWEAR. The guidance and support received from the mechanical engineering department of KDU and regular visits from NAITA ensured that we were undergoing our training in the correct paths. So I would like to conclude by saying all the experience and exposure I got from the training period will be the foundation to my mechatronics engineering career in the future.
68
REFERENCES DSI-SP hand book. (2016). Glade Virtual Control Panel. (2016). Retrieved from Linux CNC Documentation:
http://www.linuxcnc.org/docs/html/gui/gladevcp.html Hal
Commands.
(2016).
Retrieved
from
Linux
CNC
documentaion:
http://linuxcnc.org/docs/2.4/html/hal_basic_hal.html Homing Configuration. (2016, 12 03). Retrieved from Linux CNC Documentation:
http://linuxcnc.org/docs/2.6/html/config/ini_homing.html#cha:homing-configuration Linux CNC Documentation. (2017). Retrieved from http://linuxcnc.org/docs/2.7/html/ List of language bindings for GTK+. (2016, August 13). Retrieved from wikipedia:
https://en.wikipedia.org/wiki/List_of_language_bindings_for_GTK%2B Lyshevski, E. (1999). Electromechanical Systems, Electric Machines and Applied Mechatronics. CRC Press. PUMA
.
(n.d.).
Retrieved
from
Wikipedia:
https://en.wikipedia.org/wiki/Programmable_Universal_Machine_for_Assembly S. Turki, T. S. Lismma, & A. Sghaier. (2005). A SysML profile for mechatronics intergrating bond graphs. 9th WSEAS International , 22.