The main approach used by our group was to evenly divide the program sections between each team member.  Our group chose to used a method called Sequential State Machine Design. This method is a mathematical model of computation typically being used to design such computer programs and sequential logic circuits and it allowed us to efficiently and independently develop the gantry crane automation program. It also allowed us to efficiently convey the information of our programme between us and later allowed us to debug our automation program more efficiently.  A variety of software aid at creating these types of State Machine Design diagrams. For this project we chose to use a software package called ARGO(http://argouml.tigris.org). Our group shared all our progress into an online shared file (dropbox) and later compiled all of it into a complete program. Once compiled, the program was loaded into similar PLC of the same brand and model use for the running the gantry apparatus. This along with using a development board allowed us to some degree test the program.

Programing Approach

The functions of the gantry crane automation program was broken into 5 main states and each having their own sub-states performing actions. These 5 main states are;

  1. Dormant/Initial Start Up Phase
  2. Start Up Phase
  3. Normal Operation
  4. Emergency Stop
  5. Re-initialize

A benefit for creating states within states became apparent later when debugging. This is because is enable any programing bugs to be contained into their own states and to let the other states continue to run interdependently form another.

Each of the 5 states were given a set number of memory and a set number of timers e.g. S1(State 1(Initial/Dormant Start Up Phase)) was allocated memory M10.0 to M19.0 and timers T10 to T19. This naming convention was loaded into the TIA Portal template and distributed to each group member in order to lessen the risk of conflicting memories or timers. A further breakdown of Timers and Memories can be seen in Resource Allocation.

To further simplify things each state was given its own Tag Table so that it became easier to find which memory related to which state as well as which step. This made debugging much easier as monitoring the simulation of the program became more simple to single out a particular state and monitor how it worked.

Each of the 5 main states were split into 2 functions, one of which was the “Indicator Function” which would flash specified lights and sound the buzzer, the other was a “Action Function” that was to carry out all of the movement of the Gantry Apparatus.

Dormant or Initial Start Up Phase:

Indicator Function – This function will continuously cycle through a sequence turning the red, yellow and green lights on/off in the following sequence R+Y+G+R-Y-G-

Action Function – In this state there is no action as the program is waiting for the Start Button to initialize a start up.

Start Up Phase:

Indicator Function Once the Start Button is pressed, provided the Stop Button is not also being pressed, the lights and the buzzer will be repeatedly switched on and off at a rate of 2Hz for 5 seconds then stops.

Action Function – No Action in this phase.

Normal Operation:

Indicator Function – The green light will flash at a rate of 1 Hz for as long as the action function is operating.

Action Function -This is the function that firstly stacks all the disks in the first column and then sorts the disks. Dependant upon whether the “Stack to Sort” memory bit is set, either the Stacker or Sorter function will be engaged accordingly. Further information on the operations of each these functions can be found under “Code and Programs”.

Emergency Stop:

Indicator Function – The yellow and red lights should flash alternatively for 2Hz.

Action Function – All Actions are stopped in this State and are completely stopped from moving.

Re-initialise:

Indication Function – The yellow light will flash at a rate of 2Hz.

Action Function – If something is being held by the suction cup it will first put it down, before then positioning the suction cup in the top most left position.