(Microsoft Word - \332\307\343\32146- 54) Al-Khwarizmi Engineering Journal Al-Khwarizmi Engineering Journal,Vol. 13, No. 3, P.P. 46- 54 (2017) Programming a Pneumatic Processes Sequence based on PLC by Demonstration Amer Al-Mesaody Department of Control and Systems Engineering/ University of Technology Email: ameralmesaody@Gmail.com (Received 20 September 2016; accepted 24 April 2017) https://doi.org/10.22153/kej.2017.04.001 Abstract Pneumatic processes sequence (PPS) is used widely in industrial applications. It is common to do a predetermined PPS to achieve a specific larger task within the industrial application like the PPS achieved by the pick and place industrial robot arm. This sequence may require change depending on changing the required task and usually this requires the programmer intervention to change the sequence’ sprogram, which is costly and may take long time. In this research a PLC-based PPS control system is designed and implemented, in which the PPS is programmed by demonstration. The PPS could be changed by demonstrating the new required sequence via the user by following simple series of manual steps without having to change the PLC’s original program, which leads to decreasing the cost and time. Keywords: FIFO function block, Programming by Demonstration (PbD), System Frame. 1. Introduction Pneumatic processes sequence (PPS) is widely used in industrial applications, specially, in manufacturing of products. Usually, the PPS is controlled by central controller, such as microcontroller or microprocessor, and in this research a programmable logic controller (PLC) is used as the central controller. It is known that manufacturing of a product with many possible variants requires changing the PPS and this requires changing the PLC program which requires the programmer intervention and take time.To solve this problem, we must use a method of changing the sequence without having to change the PLC program (i.e. user guided programming). The user guided processes are either specified by declarative process models or by demonstration. When using a declarative model, the discovered process behavior is described as a (compact) set of rules. Moreover, discovering such models by the controller can easily be guided in terms of rule templates [1]. Programming by Demonstration (PbD) is extracting information from a human demonstration and transform it into an abstract, generalized representation [2]. In this research, PbD is chosen to solve the problem, where it is a learning method used forlearning the controller the models that were done by the user intervention. So,PbD is considered a semi- automated way of learning since it characterizes the operator involvement in the program creation and the information transformation [3]. PbD with some generalization capabilities overcomes the uneconomic usage of teach-in especially for the manufacturing of a product with many possible variants [4]. In this research, a PLC based PPS control system model was designed and implemented in the pneumatic laboratory. The system controller (PLC) is programmed originally to do a specific sequence and then reprogrammed by demonstration. In this paper, section 2 introduces the using experimental setup, section 3 introduces the control system general context, section 4 Amer Al-Mesaody Al-Khwarizmi Engineering Journal, Vol. 13, No. 3, P.P. 46- 54 (2017) 47 introduces the system structure, section 5 presents the controller software, section 6 presents the experimental verification of the implemented PPS control system and finally section 7 presents’ conclusions. 2. Experimental Setup Figure (1) shows the experimental setup and the main components of the experimental setup are listed in table (1). The PPS control system consists of four double acting cylinders, two valve blocks where each block contains two 5/2-way single solenoid directional control valve (DCV), four flow control valves, eight position sensors, 24VDC power supply, PLC and a control panel. Two of the double acting cylinders are with reed switches type and the other two with air cushion type. Each valve block contains two 5/2- way single solenoid directional control valve (DCV).The four flow control valves are used to adjust the cylinders speeds. A control panel which contains buttons and switches is used to control the system operation and changing the PPS. Eight position sensors, four inductive proximity sensors and four reed switch sensors, are the system feedback. 24VDC power supply is used to provide the system with the required power. Finally, the PLC is used as the system main control. Fig. 1. Experimental Setup of PPS Control System. Table 1 Main Components of the PPS Control System Experimental Setup Description Part No. Q’ty Double Acting Cylinder with Reed Switch pPD-25-125S 2 Double Acting Cylinder with Air Cushion pPD-25-125C 2 5/2-Way Solenoid Valve Block pSV-3521-2 2 Speed Control Valve pOV-1081 4 Proximity Inductive Sensor pPS-3015P 4 Programmable Logic Controller PC-7850-3 1 DC Power Supply PS7400-2 1 Signal Input Unit Switch SP-3003A 4 Air Distributer pPMC-6408 1 Air Service Unit pASU-10-2 1 CPU module GM4-CPUB 1 Power supply module GM4-PA2B: Input 220 VAC, 5VDC : 3A, 24VDC :0.5A 1 Digital input module G4I-D22A: 16-point 12/24 VDC input module (current source/sink input) 1 Digital output module G4Q-RY2A: 16-point relay contact output module(2 A) 1 Amer Al-Mesaody Al-Khwarizmi Engineering Journal, Vol. 13, No. 3, P.P. 46- 54 (2017) 48 3. PPS Control System Context The control system general context is demonstrated in Figure (2) in which the PLC receives the input signals from Start/Stop (SS), Add Step (AS) and Record sequence (Rec) push buttons, Auto/Manual (AM) and Extend Cylinder toggle switches, and the position sensors A0, A1, B0 …,D1. The PLC sends output signals to 5/2- way single solenoid DCVs. The PLC is programmed such that system start running as the SS button is activated (i.e. pressed) and stops if it is activated again and so on. AM and Extend Cylinder like EA toggle switches are lock switches where if one of them is pressed, when it was opened, it will be closed and stay closed until pressing it again. 5/2-way single solenoid DCV normally directs the pressurized air to one end of the cylinder and relief the other to atmosphere. As the solenoid receives high logic signal from the PLC it reverses its operation. As shown in figures (3), the PLC receives signals from the control panel push buttons and switches and the position sensors and sends signals to the solenoids to operate the directional control valves. As the SS button is activated, the PLC starts running the PPS according to the stored sequence, if the AM switch is at Auto position, else the control system should be operated manually or programmed by demonstration. The required new sequence is programmed via Add Step and Record Sequence push buttons, and extend cylinder switches. The PLC sends signals to operate the DCVs as response to the PPS program Fig. 2. The PPS Control System Context Diagram. LG-GLOVA GM4-CPU Digital Inputs Module G4I-D22A Digital Outputs Module G4Q-RY2A Q0.1.0 Q0.1.8 Q0.1.9 NC Q0.1.1 Q0.1.2 Q0.1.3 Q0.1.4 Q0.1.5 Q0.1.6 Q0.1.7 COM Q0.1.10 Q0.1.11 Q0.1.12 Q0.1.13 Q0.1.14 Q0.1.15 COM NC I0.0.0 I0.0.8 I0.0.9 NC I0.0.1 I0.0.2 I0.0.3 I0.0.4 I0.0.5 I0.0.6 I0.0.7 COM I0.0.10 I0.0.11 I0.0.12 I0.0.13 I0.0.14 I0.0.15 COM NC 24V / 5A DC Power Supply +24V 0V A0 A1 B0 B1 C0 C1 D0 D1 SS AM AS Rec EA EB EC ED ExA ExB 220 V 50 Hz ~ Start /St op (SS) EA EB EC ED Auto/Manual (AM) Add Step (AS) Record Sequence (Rec) From Position Sensors to Solenoid Valves Control Panel ExC ExD RtA RtB RtC RtD Fig. 3. The PLC and Control Panel Wiring. Amer Al-Mesaody Al-Khwarizmi Engineering Journal, Vol. 13, No. 3, P.P. 46- 54 (2017) 49 4. PPS Control System Structure As shown in figure (4) the PPS control system operation depends on the energy of compressed air that is taken from a reciprocating compressor. The compressor supplies compressed air to the main through the air service unit which consists of filter/water separator, pressure regulator, pressure gauge and lubricator. The PPS control system has four double acting cylinders, two of them with air cushion type and the other two are with reed switches type (i.e. it contains inductive position sensors fixed on its cylinder). The pneumatic cylinders are energized with compressed air via 5/2 way single solenoid DCVs called ExA, ExB, ExC and ExD. These DCVs are controlled by the PLC, which shown in figure 3, to move the cylinders between two extreme positions (fully retracted and fully extended positions). Feedback to the PLC is taken from eight position sensors, where they sense the cylinders extreme positions. These sensors are named A0, A1, B0 …D0, D1.So each cylinder is controlled by one 5/2 way single solenoid DCV and monitored by two position sensors, for example, cylinder A is controlled by ExA DCV and monitored by two position sensors A0 and A1. As well as of that the system contains a control panel, at which three buttons and five switches are placed. The Start/Stop button is used to start running the system. Auto/Manual switch is used to select the system operating mode, where atauto mode the system is operated according to a stored program, while at manual mode the system is either operated manually or programmed by demonstration. Add step button is used to save system frames (system frame is the information that consist of the cylinders positions and solenoids statuses and it is represented by the two bytes IB0.0.0 and QB0.1.0 respectively), Record Sequence button is used to reset the last sequence and record the new sequence. Finally, the toggle switches EA, EB, EC, and ED are used to control the pneumatic cylinders manually in manual mode. ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ExC ExD ExA ExB A A0 A1 B0 B1B C D C1C0 D0 D1 Compressor FilterLubricator PLC Pressure gauge Regultor Air Service Unit Fig. 4. Electro-Pneumatic Circuit Diagram of the PPS System. 5. PPS Control System Software The PLC is used as the system central controller in this control system. As explained in table (1), GLOVA PLC manufactured by LG Company is used in this research. It is a modular PLC type with GM4 CPU model and 1x16 digital inputs module and 1x16 digital outputs module. GMWIN is a software tool used to write a program and debug for all type of GLOFA PLC [5].GLOVA PLC could be operated in three processing methods which are cyclic operation method, time driven interrupt operation method, and event driven interrupt operation method [6]. In this control system the PLC is operated with the cyclic operation method. In the cyclic operation method the PLC reads inputs from external input devices first then the program is sequentially executed from first step to the last step, finally the PLC write outputs to the external output devices. This group of processes is called scan, and this scan is repeated continuously (i.e. cyclically). The cyclic operation of the PLC continues as long as conditions do not change for interrupt processing during program execution [7]. Amer Al-Mesaody Al-Khwarizmi Engineering Journal, Vol. 13, No. 3, P.P. 46- 54 (2017) 50 PLC Program The PLC logic program consists of main program and several blocks, which provide together a possibility of programming the PPS in the demonstration mode and execution of the stored program in the auto mode. Figure (5) shows the program general flowchart where the program of the PPS controller working procedure can be summarized as follows. As the SS button is activated, the PPS controller starts operation according to the Auto/Manual switch mode. If the auto/manual selecting switch was at auto position when the SS button is activated, the system will be controlled cyclically according to the program that was stored in the PLC memory. Otherwise the system is controlled manually and also in this mode the user could reprogram by demonstration, the auto sequence which was stored in the PLC and then return to auto operation. Fig. 5. PLC Logic Program General Flowchart. In the manual mode, the user can control any cylinder as required by using the toggle switches EA, EB, EC, and ED which shown in figure (3). According to the mentioned toggle switches statuses, each cylinder moves to extreme position. Each cylinder has two extreme positions detected by two sensors, for example cylinder-A positions are detected by sensor A0 and sensor A1, and since system contains four cylinders, the system contains eight sensors. These eight sensors are connected to the PLC as input byte, where this byte represents the cylinders statuses and called input system input frame or step. The PLC drives the cylinders via single solenoid conventional directional valves (CDV). These solenoids are connected to the PLC digital outputs in such a way to get any required inputs frame easily by applying the same system input frame as output frame directly. Auto Operation Block The main idea of the PPS PLC program is storing the system frames in “First In First Out” (FIFO) function block which is found in the function block library. FIFO function block is used to store an array of bytes or words in a sequence, such that the first loaded oneis unloaded first, then the next, then the next and so on. In this research, the PPS required steps are loaded as bytes to the FIFO function block step by step manually in the manual / reprogramming mode. Referring to figure (6-a), in the auto mode, step-1 is unloaded and applied on the system and reloaded as the final one. Now as the input frame- 1 is obtained, step-2 is unloaded and applied on the system and reloaded as the final one. As input frame-2is obtained step-3 is unloaded and applied on the system and reloaded as the final one and so on. When the last input frame is obtained step-1 is unloaded and applied on the system and reloaded as before and so on. Figure (6-a) shows the concept of FIFO operation at auto mode while figure (6-b) shows the PLC program blocks that satisfy this concept. Amer Al-Mesaody Al-Khwarizmi Engineering Journal, Vol. 13, No. 3, P.P. 46- 54 (2017) 51 (a) (b) Fig. 6. FIFO stack Function Block Operation at Auto Mode. Fig. 7. PLC Logic Program Detailed Flowchart. Amer Al-Mesaody Al-Khwarizmi Engineering Journal, Vol. 13, No. 3, P.P. 46- 54 (2017) 52 Manual / Reprogramming Block In the manual mode, the user can control any cylinder as required by using the toggle switches EA, EB, EC, and ED. Since single solenoid DCV is used, cylinder-A is extended in response to turning on EA and retracted if it is turned off. This means that in response to toggle switch statuses, To simplify software two bits are assumed to drive the PLC either turning on Ex solenoid to extend each cylinder, bit called Ex for extending and bit called Rt for retracting and these bits are always reverse each other. Figure (8) shows the step time diagram of cylinder-A and in the same way all the other cylinders response to their toggle switches. EA ExA RtA ExA = EA RtA = EA Cylinder-A A0 A1 Fig. 8. Step Time Diagramof Cylinder-A Manual mode. To reprogram by demonstration (i.e. without changing the PLC original program), the user must follow these steps: a) The user should choose manual mode, use the extend toggle switches to determine the initial system frame of the required new PPS, then press AD button to store it in a temporary FIFO. b) To add new system frame to the PPS use the extend toggle switches to determine the new system frame and press AD button. c) Repeat step b for all the required new frames. d) To finish reprogramming by demonstration press record button (Rec). Pressing the Rec button resets the Auto PPS FIFO at first, then transferring the new system frames from temporary FIFO to the Auto PPS FIFO. e) If the SS button is pressed or the AM toggle switch is changed to auto at any time before pressing the Rec button, the new frames will be deleted and the system will operate according to the last stored PPS. 6. Experimental Verification of the Implemented PPS Control System The required input frame is the required cylinders statuses which are determined by position sensors. The cylinders position sensors are connected to the PLC via the digital inputs module and represented by a byte in %IB0.0.0 memory address. Any required input frame is obtained simply by sending the stored input frame byte to the output frame byte in address% QB0.1.0 which is dedicated to turn on/off the required valves. Equality of the new input frame for the applied output frame, means that the applied output frame finishes its task and this triggers the controller to apply the next output frame. The input frames listed in table (2) are loaded manually to temporary FIFO function block as required input frames. Then these required input frames were transferred to the auto FIFO function block by pressing the Rec button. After that the system operated in auto mode by reversing the AM toggle switch. When the system was stopped and restarted again, it was operated in the same stored sequence. Then the pneumatic processes sequence was reprogrammed by demonstration by following the steps necessary to hold it and ran the system with the new sequence successfully. Then, reprogramming the sequence was repeated many times easily and successfully without changing the PLCs original program. Referring to figure It is noted that the cylinders not arrives their required extreme positions at the same time, and this occurs due to difference between the extension and retraction times. Non-equality of these times due to cylinders conditions and the speed control valves adjustments. The system is not affected by this differences since the controller watching the equality of the new input frame (all the positions sensors statuses) for the applied output frame and not each sensor separately. Table 2, Input Frames Amer Al-Mesaody Al-Khwarizmi Engineering Journal, Vol. 13, No. 3, P.P. 46- 54 (2017) 53 Fig. 9. Step Time Diagram of Experimental Operation 6. Conclusions In this research a pneumatic processes sequence system was designed and implemented and programed by demonstration. In this research, event frames (i.e. position frames) were used. Applying any frame is done by transferring the frame outputs to the solenoids via the PLC outputs byte QB0.1.0 and ending the frame depends on matching between the output frame and the PLC inputs byte IB0.0.0. In other words matching between the output frame and the PLC inputs byte IB0.0.0 is used as a trigger to start the next frame, so this research manipulate just pneumatic processes sequences that depend only on position frames. Some pneumatic processes sequences depend on position frames and time (i.e. after ending the position frame it stays for a specific time then transfer to the next position frame). This problem will be processed in future work. 6. References [1] F. M. Maggi, A. J. Mooij and W. M.P. van der Aalst,” User-Guided Discovery of Declarative Process Models”, Department of Mathematics and Computer Science, Eindhoven University of Technology, Netherlands, 2011. [2] R. Z¨ollner, T. Asfour and R. Dillmann,” Programming by Demonstration: Dual-Arm Manipulation Tasks for Humanoid Robots”, IEEE/RSJ Intern. Conf. on Intelligent Robots and Systems (IROS 2004), Japan, Sep. 28 - Oct. 2, 2004. [3] A.M. Zuzev, K.E. Nesterov, “Program Control Systems of Industrial Plants and Robotics”, Electricdrive and Automatics of Industrial Plants Department, Ural Federal University, 2012. [4] [Holger Friedrich and Rudiger Dillmann, “ROBOT PROGRAMMING BASED ON A SINGLE DEMONSTRATION AND USER INTENTIONS”, Institute for Real-Time Computer Systems & Robotics, University of Karlsruhe, Germany, 1995. [5] “GMWIN”, User Manual, LS Industrial Systems www.lsis.biz. [6] “GLOVA – GM4 Programmable Logic Controllers”, User Manual, LS Industrial Systems www.lsis.biz. [7] L. A. Bryan, E. A. Bryan, “PROGRAMMABLE CONTROLLERS, THEORY AND IMPLEMENTATION”, Industrial Text Company, 1997. )2017( 46-54، صفحة 3د، العد13دجلة الخوارزمي الهندسية المجلم عامر عبد منصور المسعودي 54 برمجة تسلسل العمليات الهوائية المعتمدة على المتحكم المنطقي القابل للبرمجة بالعرض العملي وديعرعبد منصور المسعام الجامعة التكنولوجية /قسم هندسة السيطرة والنظم ameralmesaody@yahoo.com :البريد األلكتروني الخالصة لقياما الشائع ومن الصناعية التطبيقات في واسع نطاق علىصناعية معينة النجاز مهمة المتسلسلة بتسلسل محدد سلفا الهوائية العمليات تستخدم د مثل العمليات المتسلسلة التي ينفذها ذراع الروبوت الصناعي وهذا التسلسل ق أكبر ضمن التطبيق الصناعي مهمة نجازال مهماتالهذه من بمجموعة حسب تغير المهمة وعادة يتطلب هذا تدخل المبرمج لتغيير برنامج التسلسل وهذا مكلف اقتصاديا وزمنيا. في هذا البحث تم تصميم بيتطلب التطبيق تغييره ) حيث يمكن باستخدامه تغيير PLC يعتمد في عمله على المتحكم المنطقي القابل للبرمجة ( هوائيةللتحكم بتسلسل العمليات الوتصميمها منظومة سيطرة بالعرض العملي ألي تسلسل مطلوب وذلك باتباع سلسلة بسيطة من الخطوات ينفذها المستخدم يدويا دون الحاجة الى تغيير الهوائية تسلسل العمليات . ووقته وهذا يعني تخفيض كلفة تغييرتسلسل العمليات ) PLC( البرنامج األصلي لل