Saturday, November 1, 2014

Now You Can Have Robust Data Logging for Free - Part 2

Now You Can Have Robust Data Logging for Free - Part 1
Now You Can Have Robust Data Logging for Free - Part 2 


PLC program 


The programmable logic controller PLC will log the data in the PLC memory using indirect addressing for the data log. Information will be collected based upon shifts.
We will use the following shift schedule. Midnight, Afternoon and Days for the weekday and have two weekend shifts. Each shift will show amount of product made, utilization of the machine and rate of product made.
Also we will log a minute by minute account of the machine. This will log the amount of product made and the rate at which it is made. We can then graph the machine performance to determine if it is running correctly.

Hardware:
Do-More Designer
http://www.automationdirect.com/adc/Overview/Catalog/Programmable_Controllers/Do-more_Series_PLCs_(Micro_Modular_-a-_Stackable)
We will demonstrate everything in the PLC simulator, but the hardware would be the following:

  1. Qty 1 - H2-DM1E - Do-more PLC H2 series CPU module, three built-in communications ports: (1) RS-232 port; (1) USB port; (1) Ethernet port
  2. Qty 1 - D2-03B-1 (110/220 VAC) 3-slot base (includes power supply)
  3. Qty 1 - D2-08ND3 - 8 pt. 12-24 VDC current sinking/sourcing, 1 common (2 common terminals), removable terminal

Software:
The software will be broken down into several elements. Understanding each element and how it relates to the program is important.

Shift Bits- These are the shifts that employees will work.
C0 - Internal Bit - Weekend - 12 - 12am
C1 - Internal Bit - Weekend - 12 - 12pm
C2 - Internal Bit - Weekday - 12- 8am
C3 - Internal Bit - Weekday - 8 - 4pm
C4 - Internal Bit - Weekday - 4- 12pm

Total Shift Seconds - This is the number of seconds that have elapsed on each shift. If the PLC was not in run mode then this would not function. This will be used to determine the percentage of the shift that the machine was running.
D0 - Total Shift Seconds - Weekend 12-12am
D1 - Total Shift Seconds - Weekend 12-12pm
D2 - Total Shift Seconds - Weekday 12-8am
D3 - Total Shift Seconds - Weekday 8-4pm
D4 - Total Shift Seconds - Weekday 4-12pm
Note: 8 hour shift = 8 x 60 x 60 = 28800 seconds
         12 hour shift = 12 x 60 x 60 = 43200 seconds

Shift Seconds Reset - Use the leading edge of the shift bit to reset the shift seconds and the total shift seconds.

Next we have to determine if the machine is running or not. If it is running then count the number of seconds for the shift.
The input X0 is a signal off of a proximity sensor for a length counter. Every pulse of the input will represent 0.303 meters of product.
Machine Running Bit:
Determine if the machine has stopped. If the count input stops counting for 2 seconds then the output stop bit turns on.
Timers are used for both the on and off condition of the input. The input can stop when the input is on or it can stop when the input is off.
Stop Bit - C10 - Will be on if the machine has stopped counting

Shift Seconds - This is the total number of seconds that the machine has run for each shift.
D10 - Shift Seconds - Weekend 12-12am
D11 - Shift Seconds - Weekend 12-12pm
D12 - Shift Seconds - Weekday 12-8am
D13 - Shift Seconds - Weekday 8-4pm
D14 - Shift Seconds - Weekday 4-12pm

We will stop here and continue the PLC program in part 3.
If you have any questions or need further information, please contact me.
Happy programming,
Garry

No comments:

Post a Comment