I'm working on a project for a summer internship and was hoping for some assistance with PLC Ladder Logic. I have been trying for the last couple of days to program the PLC to do what I want but have been unsuccessful so far (it's my first time using ladder logic). I am using a LRD12RD024 PLC, a Banner Engineering laser sensor, an LED indicator light, and a foot pedal. The sensor and the foot pedal are my inputs and the LED is my output. My project is to reduce human error in a part-marking operation, more specifically reducing the amount of parts that are marked twice or not marked at all. I am using the background suppression (BGS) feature on the sensor (recognizes background as OFF position and anything placed in front of it turns it ON).
Here is how the intended sequence for the programming would look:
I've attached picture of what I believe is the best starting point that I've had (I've tried to rewrite it different ways 4 times). The software that I came with the PLC uses M and N as auxiliary relays so I have been using them as temporary variables that could be manipulated to do what I want. C is counter, I is input, and Q is output. From the research I have done on Ladder Logic, I believe that these are the only 5 variables needed to make the program work. I have set I01 as the foot pedal, I02 as the sensor, C01 as counter 1, C02 as counter 2, Q01 as the LED indicator light, and the M and N's as temp variables.
The latest problem that I've run into deals with the counters. My idea was to simply have the counter count the number of times the pedal is pressed, but I ran into problems as I needed multiple counters (one for the ideal scenario and one for the undesired one (part marked twice)). Both of the counters need to be reset after each part is removed from the fixtures, but I could not find a way to make it so that the counter for the undesired case reset after the sequence ran through the ideal scenario. In the program I have wrote in the pictures, C02 keeps counting after C01 is reset, so when the sequence is restarted, the first time that the input I01 (foot pedal) is used, it runs both cases (ideal as it counted one input and undesired as it counted two inputs (one from the last cycle)).
If you have any idea of what to do or how the program would look, please let me know. It would be greatly appreciated. Don't hesitate to ask questions.
Here is how the intended sequence for the programming would look:
- i) Starts on: sensor in BGS and detects fixture as background (sensor light OFF)
ii) Action: place part on fixture
iii) Done when: part is recognized on fixture (sensor light ON)
- i) Starts on: part on fixture
ii) Action: press foot pedal to mark part
iii) Done when: fixture rotates part/part is marked
- i) Starts on: marked part is on the fixture
ii) Action: remove part from fixture
iii) Done when: part is removed and Sensor detects fixture (sensor light: OFF)
- repeat
I've attached picture of what I believe is the best starting point that I've had (I've tried to rewrite it different ways 4 times). The software that I came with the PLC uses M and N as auxiliary relays so I have been using them as temporary variables that could be manipulated to do what I want. C is counter, I is input, and Q is output. From the research I have done on Ladder Logic, I believe that these are the only 5 variables needed to make the program work. I have set I01 as the foot pedal, I02 as the sensor, C01 as counter 1, C02 as counter 2, Q01 as the LED indicator light, and the M and N's as temp variables.
The latest problem that I've run into deals with the counters. My idea was to simply have the counter count the number of times the pedal is pressed, but I ran into problems as I needed multiple counters (one for the ideal scenario and one for the undesired one (part marked twice)). Both of the counters need to be reset after each part is removed from the fixtures, but I could not find a way to make it so that the counter for the undesired case reset after the sequence ran through the ideal scenario. In the program I have wrote in the pictures, C02 keeps counting after C01 is reset, so when the sequence is restarted, the first time that the input I01 (foot pedal) is used, it runs both cases (ideal as it counted one input and undesired as it counted two inputs (one from the last cycle)).
If you have any idea of what to do or how the program would look, please let me know. It would be greatly appreciated. Don't hesitate to ask questions.
Attachments
-
4.2 KB Views: 2