
Chopper43Dave (Customer) asked a question.
UPDATE: The solution Todd Rice provided has worked but the belt speed is still to fast so the instructor is ordering a speed controller which was originally going to be a part of the original build. The SC will should arrive next week. In an odd twist of fate, I found the original SC that was going to be installed a few days ago in class but the guts of the SC had been used on something else. I already have an idea how to install the SC along with already created the lines of code in Do More Designer that will actuate one of the four gates based on puck color via timers. I just need to dial in the actual time once the SC is installed and working. Thank you to all that offered a solution. I'm new at PLC's and the more I work with them the more it makes sense and the more I want a job doing this!
I am working on restoring a mini conveyor belt demonstrator that a student built and a programmed that another student messed up. It works like this, the start button is pushed and pneumatic actuator pushes a plastic different colored puck onto the belt every 1 second which then goes under a color sensor which determines the color and sorts the pucks into one of four gates that automatically open and close. If a puck makes it past all four gates, there is a light sensor at the end that I have been able to program to stop the belt and have a red light flash every second The speed of the belt cannot be adjusted and the problem I am having is that the color sensor does not have enough time to determine an objects color. As a work around, I have placed a light sensor in between where the pucks are pushed onto the belt and the color sensor but am having trouble setting up a timer on a 2 second delay that will allow for enough time for the color sensor to do its job then 2 seconds later the belt restarts. I have uploaded a screenshot of what I have programmed. I have tried adding an On Delay Timer/Off Delay Timer with a 2 second delay on the output side and have tired putting the light sensor (X12) on its own rung but so far nothing has worked. Any advice would be much appreciated!
Thank you Todd! This worked well. I'm still a green horn when it comes to PLC's and the more I work with them the more I like them.
Sounds like timer accuracy doesnt need to be that strict, so what Todd Dice posted will work well for this I think.
If you wanted something more accurate in timing, you could set up a hardware interrupt for a match register, set to TMR1 accumulator, to match a 2 second value. When the timer reaches the count it will run an interrupt service routine that you would have just a single contact in there to turn off the conveyor run bit. The TMR1 could have a contact start the counter that is set from an ISR itself, that is triggered by a hardware input event of the sensor rising edge being detected. It is a bit overkill, but I think it would be the absolute most accurate way to start, run, and trigger something from a sensor and timer in a PLC program that you could get.
I've never played around with Interrupt Triggers but am going to try this.
Guessing at some of your requirements, another approach might be to delay the pushing of the puck onto the conveyor. Instead of pushing the puck every second, this cycle timer here would energize your solenoid for 500ms/ off for 2s/ on for 500ms/ off for 2s/ etc. Timer setpoints could be adjusted to meet your solenoid requirements and your color sensor requirements.
Thank you K Price! I am going to try this next week in class.