Application of Computer System in Control and Programming of a Robotized Soldering Station

This paper describes a new robotized station for soldering of through-hole elements on printed circuits boards (PCB). The general structure of this station with the SCARA type robot is presented along with the computer-based control system. The software prepared for control and for the programming procedures is described. The developed computer system software, whose structure is also presented, is applied for robot programming. The first main aim is to develop the data retrieval from the Gerber file and to use them to direct soldering robot programming. The second aim of the research presented in this paper is the application of the visual system for pads coordinate recognition. The system is presented and verified.


Introduction
Surface Mount Technology (SMT) has been recently becoming commonly applied in the assembly of electronics elements on printed circuit boards [1,2]. However, there are still many electronic elements that cannot be assembled using this technique because of their big dimensions, complicated shapes etc. This group of components includes large resistors (1W or more), high capacitance capacitors (µF ÷ mF), power transistors and some integrated circuits like power amplifiers, coils, transformers, connectors etc. Such elements must be assembled using Through-Hole Technology (THT). In this method, electronic components connecting pins must be inserted into holes drilled in PCB and soldered to pads on the opposite side either by a human (manual assembly) or by means of an automated, usually robotised, station.
The main objective of the works described in this paper is to develop an innovative robotised station for THT soldering of PCB. Such station consists of a PCB feeding and positioning unit, a standard Scara-type small robot, and soldering head, control and programming modules. Such station assures the automation of production processes, which is the basic direction of development in today's industry. Facilitating robot programming is an important requirement for the application of robots, which is why numerous researches have been conducted in this area [3,4,5].
The most important requirements for THT soldering stations are to assure full automation and to be simultaneously easy to use and easy to programme. Therefore, robotized soldering stations are equipped with the automated transport and positioning line for PCB and with a SCARA robot, for which the programming facilitation software is developed. The first step consists in developing the software for direct transformation of data stored in Gerber-type files into a robot programme.
Additionally, the visual system is applied to determine the position of PCB in the working station with the recognition of so-called "fiducial points," as well as to detect all pads with holes. In the work presented in this paper, a new robotized soldering station is designed and developed (Fig. 1). It is built within a project with the support from the National Centre for Research and Development (in Polish: NCBiR) at Renex Corp. and at Poznan University of Technology This station is dedicated for THT soldering. In a specially designed steel frame, a Scara-type small robot is mounted, on which an inductive soldering station is assembled. In this frame, the designed feeder is used, consisting of a PCB transporter and a positioning unit. Additionally, the vision system is applied, which is used in programming process and in supervision and final control of soldering quality.

The Station Control System
The control system of the soldering station consists of a: programmable logic controller (PLC), human-machine interface (HMI) operator panel, robot controller and inductive soldering iron control unit (Figs 2, 3). The PLC is also responsible for control of other auxiliary devices such as motors for PCB edge transport, solder tin wire feeding system, solder iron cleaning element, etc. In addition, there is a nitrogen supply system with a proportional pressure valve and a flow meter as well as elements for safety protection of the robot work zone and the entire station. The system is complemented by several non-contact optical sensors, mainly for edge transport and the soldering wire delivery system, a tip temperature sensor and a signalling column.
In order to implement the control of the abovementioned automation elements, it was necessary to use a PLC with a few analogue input/outputs (I/O), 2 outputs for stepper motor controllers and communication ports for HMI (Ethernet) and robot (RS232). For these tasks the PLC S7-1215 (Siemens) was selected along with the RS232 communication module type CM1241, a module for additional SM1223 digital I/O and the SB1231 module with temperature input, used for the thermocouple installed in the soldering iron head.
Due to the required high precision of the PCB transport positioning accuracy (better than ±0.02 mm) and due to the required precise amount of solder wire supply, 2 stepper motors with dedicated controllers were used. Both drives were connected to outputs of the PLC controller. They work in the step/direction mode. The transport system uses the MST231B02 (JVL) stepper motor, with a resolution of 200 steps/rev. The belt drive with a toothed belt (gear ratio 1:1) drives a trapezoidal screw with a pitch of 4 mm/rev. In the dedicated type SMD41/42 engine controller, the steps were additionally divided into 25, which allowed obtaining a width control resolution of 1250 steps/mm. The PLC also controls the following systems: the soldering iron tip temperature and the nitrogen supply flow. In both cases, PID regulators were implemented in the PLC control program. The parameters setting for both regulators were selected experimentally, by trial and error. The output signals determined by the PID regulators are sent by the analogue outputs of the PLC to the soldering iron electronic current controller and to the proportional valve used for nitrogen flow control. The current nitrogen flow measured by a flow meter is fed back into the built-in analogue input of the PLC.
The safety circuit uses a 3SK2 series safety relay from Siemens. It is a programmable relay, powered by 24VDC. The operating status of the relay outputs is monitored by the PLC controller from the monitoring contact. In accordance to the safety standards for robotic stations, the outputs of the safety relay supply the coils of 2 contactors, which control (switches on/off) the robot's power supply contacts. The safety relay inputs are two parallel circuits powered by impulse contacts with different test times T1 and T2. This type of solution provides the SIL3 security level required for robots. It also allows detecting an incorrect connection of the monitoring contacts or their short-circuiting. The test signals T1 and T2 pass in parallel through the emergency stop contacts and the electro-bolt contacts, which blocks the cover of the robot's working area. Two additional inputs are used to control the work of contactors monitoring safety and to switch on the work of the station -the Start button.

Programming of the Station
A touch-screen HMI operator panel was used to control, adjust and supervise the operation of the station. Its start screen is divided into several windows, with the help of which it is possible to monitor the work and set the operating parameters of the soldering station. In the main window, the user can view the basic states and operating parameters. The start screen of the application in the HMI is divided into several windows, with the help of which it is possible to monitor the work and set the working parameters of the soldering station (Fig. 4). A detailed configuration of work parameters is performed through dedicated windows, and is displayed taking into account the authorization mechanisms: user type and password. The windows are divided in accordance with the functionalities of the individual station modules, i.e.: support for the soldering iron, tin feeder, robot, belt transport and nitrogen control system. Fig. 5 shows two screens used for configuration of the station. There is a visible difference between the windows of the HMI panel in the simplified option (for the operator) and the extended one (for the admin): for example, for the soldering control in the operator mode it is possible to switch on and set the tip temperature, whereas in the expanded version, the screen is supplemented with monitoring elements of the main operation control system such as: errors, reset, controller parameters and additional options for calibration of internal temperature sensor in the solder iron head.
For the edge transport control window (Fig. 6) in the simplified version, it is only possible to set the width and homing. In the extended version, the specification of belt speed, settings of pressure parameters (for soldering time), module diagnostic control elements and SMEMA type machine communication are added. Fig. 6. Edge transport control screen (operator and admin). Fig. 7 shows a general view of the solder wire HMI control screen. It allows controlling such tin feeding parameters during soldering as feeding speed and the amount of solder. The window also allows setting parameters for the solder withdrawal phase after completing single point soldering. Manual mode (with cursors) allows manual adjustment of the amount of solder, which is useful especially during the process of setting up a new point or after replacing the wire. The robot control window, apart from its physical activation, contains two main frames of control modes (Fig. 8), i.e. the automatic mode and the manual mode. The automatic mode allows the user to run the proper programme controlling the robot's work, its interruption or switching on the step work. In the manual mode it is possible to manually move the robot arm by a given increment i.e. 0.1 mm, 1 mm, 10 mm or 50 mm in the X, Y, Z and R axes.

Robot Programming
For many years in the electronic industry a number of standards for files describing the electronic circuit scheme have been developed. One of them is a standard of describing a PCB pattern, used to provide the common language between designers and manufacturers. Today the standard in the electronics industry is the Gerber format [6]. Over the last 37 years, it has been thoroughly modified and improved. The format is based on commands described in 2D binary images in ASCII vector format, which can be easy transferred from EDA/CAD software to CAM. In Fig. 9 the Gerber file structure and processing chart are shown. A Gerber file is a stream of commands that must be filtered and processed by command processor by comparing them with apertures templates and apertures dictionary. As a result of this process a graphic object is drawn. The graphic state determines how to create the graphic objects. A single Gerber file specifies a single image. The file is complete -it does not need external files or parameters for interpretation. Offline SMT soldering machine programming method based on data taken from Gerber files is well recognized and commonly used. This solution was adapted for programming of the described above through-hole type (THT) soldering station. The developed software allows reading a text file type Gerber RS-274X and its graphical representation in the form of bitmaps. A special Gerber type file interpreter has been developed, whose task is to derive the list of solder points coordinates on the PCB for the THT elements pins. Prior to the commencement of the interpretation process, the user can choose a file with the GBR or GBL extension. After opening a file, the programme tests the format of data storage and searches for problems with the interpretation of commands. All inaccuracies are reported in the status line and the data import is interrupted. After opening the file, the user can choose the method of presenting the geometry of the PCB like track lines, soldering points etc. The information from Gerber file is also used to define PCB the mounting holes and so-called characteristic points' positions as well as their size called "fiducial points," which are then used for starting the soldering process.
In Fig. 10 based on data taken from Gerber file, the PCB with THT type elements soldering pads are presented. In the next step, the system generated the iron tip initial path for soldering all elements, which is shown in Fig. 11. An additional software module was made that generates optimal trajectories of movement of the soldering tip from point to point and/or from the group of points to the group of soldering points. This module was implemented by authors on the example of open source software PCB G-Code optimizer. The algorithm is searching for the nearest next point or group of points.
After approval of the soldering sequence, the coordinates of soldering points are entered into the soldering table. In the next step, the information on the inclination angle of the soldering head can be added. This can be set manually or using specially developed software, developed by our team, and the designed wireless pointer, which can be used for setting of the soldering iron orientation (angle) in the working space.
In the same way the soldering profile is established, in which the main and auxiliary times of soldering and bleaching of solder tin are specified for every particular soldering point. These times determine the amount of tin to be covered to the tip and how much tin will be delivered to the given soldering point -because tin feed Fig. 9. The Gerber file structure [6].
speed is constant. It was assumed that these times would be introduced by the operator based on their experience. Finally, these parameters can be changed by the operator, based on soldering quality assessment made after the first tests of soldering of a given plate. Each soldering point on this plate is assessed by the operator and the quality control department. After this assessment, all soldering parameters can be changed.  The result is presented in Fig. 12. Finally, the user may accept or decide to set the trajectory manually by using the mouse for choosing the points to be soldered and setting the soldering sequence pad by pad. After defining all parameters of the soldering process, the user can add the general information about the project, including soldering temperature parameters, the settings for the nitrogen supply system and the robot offset. This data can be saved as an XML type file. Each data field in this format is assigned an appropriate identifier.

Vision System Application
In the soldering station described in this paper, the vision system is applied to recognize the pads position on the PCB and to generate the coordinates of their centre. The vision system can be also used to determine the position of PCB in the soldering station using the "fiducial points." The task of the visual system is to detect all pads with holes, which have a circular-like shape in the PCB image, to extract coordinates of central points of all pads, and to send these coordinates to the soldering Scara robot. The vision system is used for programming the trajectory of the soldering station if the Gerber file is not available. The conducted research allowed developing an algorithm (Fig. 13) of image processing to extract central points of pads in a PCB. It was built based on [7,8,9]. The first stage, "Load Image," reads PCB picture data from a computer. The second block is a "Gauss Smooth" filter, which is used to reduce local min and max values of pixels and also to smoothen edges in the image. The next filter used is called "Threshold Image." It is used to cut off unnecessary pixels from the image and to produce a binary image. "Close Region" filter removes "dark holes" from groups of pixels by filling them fully with white colour. The next one is "Erode Filter," which makes every white pixel group smaller. As a result small noise regions are removed from the image and edges of groups are smoother. "Dilate Filter" restores the size of the white group of pixels. In the next step of the algorithm called "Split Region Into Blobs," individual groups are transformed into an array. Blobs are separate objects in the image that store information about their size and position. Using this block, we remove from the image small groups of pixels (noises). In this way, also too big groups of pixels, like mounting holes for screws, can be removed, owing to setting maximum sizes of blobs. The last step, a centre position of pads with the sub-pixel resolution is calculated. The coordinates x and y of the pads are used to draw the blue crosses in the middle of every pad and send to the robot controller as 5 MATEC Web of Conferences 252, 02008 (2019) https://doi.org/10.1051/matecconf/201925202008 CMES'18 points to soldered. The results of the application described above are shown in Fig. 14a- The coordinates x and y of the pads are used to draw the blue crosses in the middle of every pad and send to the robot controller as points to soldered. The results of the application described above are shown in Figs 14a-d.

Conclusion
This paper describes a new station for soldering throughhole electronic components [10]. In the station, a typical Scara type robot is applied. The station control system is based on the PLC, but in order to facilitate the station programming, computer-based solutions are developed. The programming of a robot used for soldering throughhole components is usually highly time-consuming, mainly because of a large number of point coordinates and parameters that must be provided. Therefore, the special software was developed for data retrieval from Gerber type files. These data are used for direct programming of the robot installed in the station. Its use enables fast and easy programming of the soldering iron tip path. The paper also describes the use of a visual system for soldering pads recognition. The research has shown that the recognition system worked in line with expectations. The application of the presented algorithm for pads detection can reduce the time required to prepare the control programme for a soldering robot. The important advantage of the proposed software is the possibility to work in the off-line mode, without the use of the soldering station. The soldering programme can be downloaded to the station according to the industry 4.0 principle. Our investigations have shown that the best results of pads recognition were achieved when the PCB images were taken from a 2D scanner. The pictures obtained from camera caused problems with lighting and with the perpendicular orientation of the camera above the centre point of the PCB. White lights, produced shades and different intensity of light, therefore, the use of camera caused errors in pads recognition. There are also lens distortions, which are typical for camera images. The investigations have shown that the developed algorithm provided better calculation results when the background colour was pink. The average error of detection point compared with Gerber file was 0.06 mm. Considering the material presented in this paper, it may be safely assumed that the main aim was achieved.