Upgrade to Pro — share decks privately, control downloads, hide ads and more …

TMPA-2017: Modeling of PLC-programs by High-lev...

TMPA-2017: Modeling of PLC-programs by High-level Coloured Petri Nets

TMPA-2017: Tools and Methods of Program Analysis
3-4 March, 2017, Hotel Holiday Inn Moscow Vinogradovo, Moscow

Modeling of PLC-programs by High-level Coloured Petri Nets
Dmitriy Ryabukhin, Egor Kuzmin, Valery Sokolov, Yaroslavl State University

For video follow the link: https://youtu.be/XJoKuCNrTi0
Would like to know more?
Visit our website:
www.tmpaconf.org
www.exactprosystems.com/events/tmpa

Follow us:
https://www.linkedin.com/company/exactpro-systems-llc?trk=biz-companies-cym
https://twitter.com/exactpro

Exactpro

March 23, 2017
Tweet

More Decks by Exactpro

Other Decks in Technology

Transcript

  1. Modeling of PLC programs with High-level Coloured Petri Nets Ryabukhin

    D. A., Kuzmin E. V., Sokolov V. A. Yaroslavl State University 2017 Ryabukhin D. A., Kuzmin E. V., Sokolov V. A. Modeling of PLC programs with High-level Coloured Petri Nets
  2. Programmable Logic Controller (PLC) 2/12 INPUTS OUTPUTS PROGRAM EXECUTION PLC

    characteristics. Inputs: sensors, limit switches, buttons, meters . . . . Outputs: electromagnetic relays, motors, light indicators . . . . Working cycle: reading from inputs, program execution, writing to outputs. Wide sphere of application. Ryabukhin D. A., Kuzmin E. V., Sokolov V. A. Modeling of PLC programs with High-level Coloured Petri Nets
  3. The approach to constructing programs 3/12 Proposed sequence of writing

    PLC-programs: Creating LTL-specification G X( ¬_V ∧ V ⇒ FiringCond ) G X( _V ∧ ¬V ⇒ FiringCond ) Translation to SMV language and verification case{ ∼V & next(FiringCond ) : next(V ) := 1; V & next(FiringCond ) : next(V ) := 0; default : next(V ) := V ; }. Translation to IEC 61131-3 standard lanuages IF NOT _V AND FiringCond THEN V := 1 ; ELSIF _V AND FiringCond THEN V := 0; END_IF. Ryabukhin D. A., Kuzmin E. V., Sokolov V. A. Modeling of PLC programs with High-level Coloured Petri Nets
  4. PLC-programming by LTL-specification 4/12 Conditions for program variables: 1 Each

    variable value must not change more than once per one pass of PLC working cycle. 2 The value of each variable must change at only one place in the program. G X( V >_V ⇒ OldValCond ∧ FiringCond ∧ V = NewValExpr ) G X( V <_V ⇒ OldValCond ∧ FiringCond ∧ V = NewValExpr ) GX(V =_V ⇒ ¬(OldValCond ∧ FiringCond) ∧ ¬(OldValCond ∧ FiringCond )) Ryabukhin D. A., Kuzmin E. V., Sokolov V. A. Modeling of PLC programs with High-level Coloured Petri Nets
  5. Restrictions of the approach 5/12 Typical PLC Tasks: Hydraulic system

    Library lift Installation for preparation of mixtures Installation for lime dosage The approach is applicable for discrete tasks of logical control, requiring PLCs with binary inputs and outputs. SMV allows to build models with 259 states. Ryabukhin D. A., Kuzmin E. V., Sokolov V. A. Modeling of PLC programs with High-level Coloured Petri Nets
  6. Translation to Petri net 6/12 LTL-specification: G X( V >_V

    ⇒ OldValCond ∧ FiringCond ∧ V = NewValExpr ); G X( V <_V ⇒ OldValCond ∧ FiringCond ∧ V = NewValExpr ). Common scheme of a transition of Petri net: Ryabukhin D. A., Kuzmin E. V., Sokolov V. A. Modeling of PLC programs with High-level Coloured Petri Nets
  7. Installation for preparation of mixtures 7/12 PVlv LS0 LS1 LS2

    Mtr Tank 2 Tank 1 Vlv2 Vlv1 Tank 2 empty Tank 1 empty MS EVlv Emergency valve Pouring valve TS1 TS2 Level 2 Level 1 Level 0 Finished Proper Spoiled Mixture Component 2 Component 1 Components in reservoir Vlv1 Vlv2 Working On Motor Error Motor Valves Vlv1 Vlv2 PVlv PVlv EVlv Control panel Scheme of installation Reservoir Valves / lamps Switches PLC Outputs Inputs SBPVlv Open pouring valve Open pouring valve PVlv Open valve 1 1 1 2 Vlv1 SBVlv1 Open valve 1 2 SBVlv2 Open valve 2 3 SBMtr Start motor 5 Sensors LS0 Level sensor 0 8 LS1 Level sensor 1 9 LS2 Level sensor 2 10 Open valve 2 3 Vlv2 Start motor 5 Mtr MS Motor sensor 11 Open emergency valve 4 EVlv SBEVlv Open emergency valve 4 TS1 6 TS2 Tank sensor 2 7 States / lamps Mixture is proper 6 7 Mixture is spoiled 8 Component 2 in mixture 10 Component 1 in mixture 9 11 MxIsFin MxIsPrp MxIsBad C1InMx C2InMx MtrErr Mixture is finished Tank sensor 1 Motor error Ryabukhin D. A., Kuzmin E. V., Sokolov V. A. Modeling of PLC programs with High-level Coloured Petri Nets
  8. Petri Net 8/12 Ryabukhin D. A., Kuzmin E. V., Sokolov

    V. A. Modeling of PLC programs with High-level Coloured Petri Nets
  9. Consistent behaviour of sensors 9/12 Additional fine-tuning program model for

    corresponding to the actual behaviour of the PLC programs G( X( S) ⇒ Cond1 ), G( X(¬S) ⇒ Cond1 ). G( ¬S ∧ X( S) ⇒ Cond2 ), G( S ∧ X(¬S) ⇒ Cond2 ). These formulas are written in guard condition of Input transition. Some examples: (not p_TS1 orelse TS1 orelse p_Vlv1), (not p_TS2 orelse TS2 orelse p_Vlv2), (not MS orelse p_Mtr), (LS0 orelse not LS1 andalso not LS2) Ryabukhin D. A., Kuzmin E. V., Sokolov V. A. Modeling of PLC programs with High-level Coloured Petri Nets
  10. Examples of temporal properties 10/12 “Overspending”. Components will never be

    added to the spoiled mixture. G(¬(MxIsBad ∧ (Vlv1 ∨ Vlv2))) “Spoiled product”. The spoiled mixture will never be drained through valve “PVlv”. G(¬(MxIsBad ∧ PVlv)) “Spoiled mixture”. Spoiled mixture can not be proper or finished. G(¬(MxIsBad ∧ (MxIsPrp ∨ MxIsFin))) Ryabukhin D. A., Kuzmin E. V., Sokolov V. A. Modeling of PLC programs with High-level Coloured Petri Nets
  11. Conclusion 11/12 CPN Tools provides availabilities to: show data flows

    from input variables to outputs demonstrate dependences between inputs, outputs and program variables visualize possible concurrent blocks modeling resources and timing with tokens make simulation modeling for checking some class of properties Ryabukhin D. A., Kuzmin E. V., Sokolov V. A. Modeling of PLC programs with High-level Coloured Petri Nets
  12. Thank you! Ryabukhin D. A., Kuzmin E. V., Sokolov V.

    A. Modeling of PLC programs with High-level Coloured Petri Nets