Industrial Automation course Lesson 6 PLC SFC Exercises Politecnico di Milano Universidad de Monterrey, July 2015, A. L. Cologni 1
Exercise 1 Let s consider a rocks transport system based on a cart. The operator defines the beginning of the cycle using the START button. The cart goes through the entire rail from left to right and it stops waiting to be filled. The rocks, after being accumulated in a tank, are moved mechanically into the cart, which must automatically move along the rail from right to left. Politecnico di Milano Universidad de Monterrey, July 2015, A. L. Cologni 2
Exercise 1 As INPUTS we have six sensors: Rocks Start Start button ET Empty Tank LS Left Switch TDS Tank Down Switch RS Right Switch TUS Tank Up Switch UPT TUS DWT Start TDS ET LM RM LS As OUTPUTS we have: RS RM Right Motor DWT Down Tank LM Left Motor UPT Up Tank Politecnico di Milano Universidad de Monterrey, July 2015, A. L. Cologni 3
Exercise 1 Stop TankUP N UPT Start AND NOT(ET) TUS CartR N RM CartL N LM RS LS TankDW N DWT TDS Unload ET Politecnico di Milano Universidad de Monterrey, July 2015, A. L. Cologni 4
Exercise 1.1 Let s add to the previous exercise a maintenance stop every 100 cycles. It is necessary to add: MS (Maintenance Stop) as output MR (Maintenance Reset) as input N.B.: It will be necessary also to create a counter variable! Politecnico di Milano Universidad de Monterrey, July 2015, A. L. Cologni 5
Exercise 1.1 Stop MaintReq N>=100 N MS Start AND NOT(ET) AND N<100 CartR N RM E: N = N + 1; RM X: N = 0; RS TankDW N DWT TDS Unload ET TankUP N UPT TUS CartL N LM Politecnico di Milano Universidad de Monterrey, July 2015, A. L. Cologni 6 LS
Exercise 2 Let s consider an automatic car wash plant. The customer approaches to the belt when the traffic light is green. The wash phases are: soaping, brushing, rinsing and drying. All the phases are preceded by a photocell that detects the car arrival in that section of the plant. Every 1000 washes the plant must be blocked and wait for the maintenance, made by an operator. Politecnico di Milano Universidad de Monterrey, July 2015, A. L. Cologni 7
Exercise 2 SM BM RM DM MAI RTL MAIR InP BP RP DP OutP Inputs Outputs InP Input photocell RTL Red traffic light (0=GREEN, 1=RED) BP Brushing photocell SM Soaping motor RP Rinsing photocell BM Brushing motor DP Drying photocell RM Rinsing motor OutP Output photocell DM Drying motor MAIR Maintenance reset MAI Maintenance stop Politecnico di Milano Universidad de Monterrey, July 2015, A. L. Cologni 8
Exercise 2 The plant can be considered as a set of single smaller plants: Soaping Brushing Rinsing Drying Each of these «plants» must be turned on when the input photocell detects the passage of a car, while it must be switched off when the car is completely exited from the section (when the next photocell is deactivated). Politecnico di Milano Universidad de Monterrey, July 2015, A. L. Cologni 9
Exercise 2 As already described in lesson 4, the solution of this exercise requires a «distributed» management of each single part of the plant. With the SFC we don t have the possibility of manage more than one «execution cycles» in one single chart, for this reason it is necessary to use more than one program. We will have a program for each part of the plant (in the soaping chart we will manage also the traffic light and the maintenance). Politecnico di Milano Universidad de Monterrey, July 2015, A. L. Cologni 10
Exercise 2 Each part of the plant will have this SFC: Stop entrancep SectionON Ladder exitp N Transition Politecnico di Milano Universidad de Monterrey, July 2015, A. L. Cologni 11
Exercise 2 Oltre a questi programmi, nel programma di gestione dell insaponatura, è necessario introdurre la gestione di semaforo e manutenzione. X: N :=0; N>=1000 Maintenance ON N MAI Stop S RTL R RTL N<1000 AND FIn E: N:=N +1; SoapingON N SM S RTL MAIR Ladder BP N Transition Politecnico di Milano Universidad de Monterrey, July 2015, A. L. Cologni 12
Exercise 2 Example of SFC for the brushing section Stop FS BrushingON Ladder RP N Transition Politecnico di Milano Universidad de Monterrey, July 2015, A. L. Cologni 13
Exercise 3 Let s consider an automatic drilling and riveting system for sheet metal. When the two pieces arrive, a robot execute the handling of the components (subsequently one to each other) and it positions them on the mounting jig. When the handling is finished the machining can be executed using the automatic driller (the duration of this operation is 5 sec) and the riveter (10 sec). At the end of the operations the robots moves the piece in a pallet. Politecnico di Milano Universidad de Monterrey, July 2015, A. L. Cologni 14
Exercise 3 PA CA CB RST RC P PB BDS FDS FRS BRS DON DFM DBM T MA MB R RON RFM RBM Inputs PA Presence sensor conveyor A FDS Front driller switch PB Presence sensor conveyor B BRS Back riveter switch RST Robot state (0=IDLE, 1=EXECUTING) FRS Front riveter switch BDS Back driller switch Politecnico di Milano Universidad de Monterrey, July 2015, A. L. Cologni 15
Exercise 3 PA CA CB RST RC P PB BDS FDS FRS BRS DON DFM DBM T MA MB R RON RFM RBM RC Robot command (0=STOP, 1=from CA to MA, 2=from CB to MB, 3=from M to P) Outputs DON RFM Driller ON Riveter front motor DFM Driller front motor RBM Riveter back motor DBM Driller back motor RON Riveter ON Politecnico di Milano Universidad de Monterrey, July 2015, A. L. Cologni 16
Exercise 3 Consider the steps necessary to achieve the final product: 1)Wait the activation of CA and CB 2)Send the command 1 to the robot and wait the end of the execution 3)Send the command 2 to the robot and wait the end of the execution 4)Move the driller until reach its front switch 5)Activate the driller for 5 seconds 6)Move back the driller until it reaches the back switch 7)Move the riveter until reach its front switch 8)Activate the driller for 10 seconds 9)Move back the driller until it reaches the back switch 10)Send the command 3 to the robot and wait the end of the execution 11)Send the command 0 to the robot Politecnico di Milano Universidad de Monterrey, July 2015, A. L. Cologni 17
Exercise 3 This example, that in lesson 4 was «solved» using the ladder with the states, is perfect for the SFC logic. We have a set of states that a subsequent one to each other, with simple transitions between the states. The solution is «trivial», the states ar the points described in the slide 17. Politecnico di Milano Universidad de Monterrey, July 2015, A. L. Cologni 18
Exercise 3 Stop DrillerBW N DBM E: RC :=1; PA AND PB FTI MovingA RivFW N RFM E: RC :=2; NOT RST FRS MovingB RivON N RON NOT RST RivLav.t >= T#10s DrillerFW N DFM RivBW N RBM FDS E: RC :=3; BRS DrillerON N DON MovingProd DrillerON.t >= T#5s NOT RST Politecnico di Milano Universidad de Monterrey, July 2015, A. L. Cologni 19
Conclusions SFC Remarks It is the best language for the development of finite state machine control algorithms. It is not always good for «decentralized» logical controls (we have a single execution in the program, except the parallelism). As it will be described, it matches perfectly with the Petri nets logic. Politecnico di Milano Universidad de Monterrey, July 2015, A. L. Cologni 20