1 / 29

Introduction to Modular Programming

Introduction to Modular Programming. Agenda. Why Modular Programming?. Architecting Modular Code. Machine Example. Meeting Code Development Goals. Where to Learn More. Why Modular Programming?. Why Modular Programming?. Basin Operation: Fill Agitate Drain Spin.

marinel
Télécharger la présentation

Introduction to Modular Programming

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Introduction to Modular Programming

  2. Agenda Why Modular Programming? Architecting Modular Code Machine Example Meeting Code Development Goals Where to Learn More

  3. Why Modular Programming?

  4. Why Modular Programming? Basin Operation: Fill Agitate Drain Spin • Machine development requires…

  5. Why Modular Programming? Basin Operation: Fill Agitate Drain Spin Basin Operation: Fill Agitate Drain Fill Agitate Drain Spin • Machine development requires… • Adding machine functionality

  6. Why Modular Programming? Basin Operation: Fill Agitate Drain Spin Basin Operation: Fill Agitate Drain Fill Agitate Drain Spin • Machine development requires… • Adding machine functionality • Adopting new control technology

  7. Why Modular Programming? Basin Operation: Fill Agitate Drain Spin Basin Operation: Fill Agitate Drain Fill Agitate Drain Spin • All while… • Reducing development time • Increasing machine reliability • Fostering collaborative code development

  8. Architecting Modular Code What’s The Plan?

  9. Goals - Reliability • Machine Code Reliability • Runs • Machine meets or exceeds performance specifications • Responds predictably to operator requests and process conditions • Errors • Machine responds appropriately to hardware / software / mechanical exception conditions • Annunciates to operator that error occurred at a minimum • Recovers • Once the machine errors, it recovers from that error once the exception condition is cleared • Logic must never exhibit a condition that requires a power cycle to clear

  10. Goals - Flexibility And it should also be able to… And I want this hardware… And it needs to be compatible with… And there will be 3 not 2 of those… • Machine Code Flexibility • Minimize the time and cost impacts of late cycle design changes

  11. Goals - Reusability • Machine Code Reusability • Think in terms of a set of building blocks • Begin with a set of functional modules • Assemble these functional modules as required • Allows complex functions to be developed more quickly and with confidence

  12. Defining Structure State Procedure Hardware • From a functional description of a machine, we can define • Machine states to indicate what things can happen • Procedures to define when things happen • Hardware that makes things happen

  13. Defining Structure Running Stopped Paused Faulted State Step 1 Step 2 Step 3 Procedure Hardware Solenoid VFD Servo • Moving from basic to specific…

  14. Adding Functionality Running Stopped Paused Faulted Running Stopped Paused Faulted State Step 1 Step 2 Step 3 Step n Step n+1 Step 1 Step 2 Step 3 Step 1 Step 2 Step 3 Procedure Hardware Solenoid VFD Servo Solenoid VFD Servo • As additional is required, the model can be expanded…

  15. Linking Modules Separation between machine state and mode specific procedures that are performed Running Stopped Paused Faulted Linking Layer Step 1 Step 2 Step 3 Step 1 Step 2 Step 3 Step n Step n+1 Separation between operating procedure and logic to drive the hardware Linking Layer Valve Motor Valve Valve • This logical separation creates a need…

  16. Linking Modules Machine Mode / State control is independent of mode specific procedure Procedural operation changes are independent of both overall defined operation and hardware carrying out actions Running Stopped Paused Faulted Linking Layer Step 1 Step 2 Step 3 Step 1 Step 2 Step 3 Step n Step n+1 Linking Layer Solenoid VFD Servo • Hardware is independent of procedure • Hardware control is specific to hardware selected Why is this important?

  17. Modular Structure Benefits • Code Flexibility • A modular structure allows device modules, technology modules, and procedural code to be added or removed based on machine requirements • Code Reusability • Device modules / technology modules developed with specific functionality can be developed and tested independent of specific machine requirements • Code Reliability • The use of proven device, technology, and procedural modules in a defined framework facilitates rapid development of robust code

  18. Machine Example • Let’s examine a machine we should all be familiar with….

  19. Control Needs • Operating Requirements: • Scrub clothes with water and detergent • Rinse out detergent and dirt with water • Machine Actions: • Fill with water • Scrub clothes • Drain water • Spin out excess water • Procedures: • Sequence machine actions • Interact with control hardware • Define operating parameter values when executing • Manage responses to exception conditions

  20. Procedure Procedure Steps Clear Faults • Make Ready Wash Fill Agitate Drain Spin Rinse Fill Agitate Drain Spin Pause Resume Stop • Define states for machine: • Running • Stopped • Faulted • Define order of machine actions: • Fill – Water temp and level • Agitate – Speed and duration • Spin – Speed and duration • Define hardware for control needs: • Valve(s) • Motor(s) • Sensor(s)

  21. Structural Overview Running Stopped Paused Faulted Machine States Hardware Control Procedure - Double Rinse Cycle Procedure - Regular Cycle Fill Agitate Spin Fill Spin Fill Spin Fill Agitate Spin Fill Spin Valve Motor Valve Valve • In terms of machine control…

  22. Control Hardware Grouping Hot Water Valve Cold Water Valve Wash Basin Module - Fill Control Level Full Sensor Level Empty Sensor Drain Pump Module - Drain Control Agitator Drive Motor Module - Agitator Control • Control hardware is grouped into modules based on machine actions performed together

  23. Module Example - Agitator Control • The Module for Agitator Control is used to spin or agitate the basin. Three parameters are required: • Direction – Spin turns one direction and Agitate the other • Speed – For different cycles • Time – For amount of soiling • Define hardware functions for: • Motor control – Start, Stop, Direction • Speed selector – High, Low • Duration – Analog time value • Define procedure steps for executing hardware functions to: • Agitate • Spin

  24. Device Example – Motor Starter Module Commands Device Commands Procedure Agitate Basin Device Motor Starter Run Forward Stop Run Forward Device Conditions Module Conditions Running(Aux) Running Stopped • Device control triggered from procedure and managed through module • Device commands are device specific • Contacts for Run Forward or Run Reverse • Aux Contact provides Running status

  25. Device Example – VFD Module Commands Device Commands Procedure Agitate Basin Device VFD Forward Start Stop Run Forward Stop Module Conditions Device Conditions Faulted Active Running Running Stopped Interface between procedure and module does not change because it is based on the module action VFD uses different commands and conditions from motor starter

  26. Meeting Code Development Goals • Reliability • Simple modules for devices like a valve, pump, or motor starter are easily tested and debugged • Separating procedures from hardware control makes procedures easier to monitor, test, and step through • Flexibility: • Motor starter logic easily replaced with VFD logic for Agitator • Extra rinse or prewash cycle easily added to procedure with copy and paste of steps. • Reusability: • Control logic for a VFD can be reused for many applications • Separating Agitate procedure from Agitator VFD control frees module from Washing Machine specific requirements

  27. More About Modular Programming • Reference • ISA-88.00.01 - Batch Control Part 1: Models and Terminology (www.isa.org) • ISA-TR88.00.02 - Machine and Unit States: An Implementation Example of ISA-88 (www.isa.org) • IA-RM001C-EN-P - Foundations of Modular Programming (www.rockwellautomation.com) • 9300-MODPROG - Modular Programming Computer Based Training • Sample Code • PlantPAx Process Objects Library (Knowledgebase ID# 62682) • Power Programming Developers Toolkit (Knowledgebase ID# 66060) • Drives & Motion Accelerator Toolkit (www.ab.com/go/iatools) • Safety Accelerator Toolkit (www.ab.com/go/iatools) • Energy Management Accelerator Toolkit (www.ab.com/go/iatools) • On-Machine Accelerator Toolkit (www.ab.com/go/iatools) • Connected Components Building Blocks (www.ab.com/go/iatools)

  28. Why Modular Programming? • Reduce Development Time • Increase Machine Reliability • Foster collaborative code development Basin Operation: Fill Agitate Drain Spin Basin Operation: Fill Agitate Drain Fill Agitate Drain Spin

  29. Thank you!

More Related