Brandon_K
Member
I'm having a hard time wrapping my head around this today. Very likely due to being sick and not thinking straight, plus my inexperience with ladder logic.
I have a pair of pressure transducers that send off to analog inputs.
The scaling is done in PSI and I have some compare values set with two timers.
Right now I have it configured as;
*If the pressure is between 4-15psi or greater than 23psi, Timer A accumulates.
*If the pressure is between 16-22psi, Timer B accumulates.
What I want to add is a function that only allows the timers to accumulate if the pressure value has been constant for more than lets say, 300ms. So, if the pressure is increasing or decreasing, unless it stands on a value for more than 300ms, I do not want the timer to start. Example; if the 7psi is present for longer than 300ms, timer A starts accumulating. If the value changes, the timer stops, until another value is present for 300ms or greater.
Some background on the process to possibly help understand better;
This is part of a game (attraction industry). The players need to set a pair of regulators to a the correct values (19psi and 55psi, +/- 3psi) in order to proceed to the next step. If they set it to the incorrect pressure, "bad time" (Timer A) starts accumulating, which part of their score is based on. As it currently sits, they players are forced to accrue "bad time" even if they know to correct values before they start playing with the regulators. Initially I was going to put a deduction of time in as a constant for the formula that calculates their scores, but I've found people wildly vary in the time it takes to get there. For me, I could start from 0psi and set 19psi in ~1400ms. One employee took ~9000ms to get there, another 6000ms.
I figure if I they sit on a given pressure value for more than ~300ms or so, they've made a choice to set that pressure as the "puzzle solve", so I want Timer A to start accumulating.
I can't think of any way to do this without creating a timer for every value between 4 and 125, each setting a bit to start Timer A. That's a lot of timers and I know there has to be a better way to do it. With my inexperience with ladder logic, I don't know of a more efficient way to do it.
Thoughts? I'm using a Productivity 2000 PLC.
I've attached a screenshot of my current timer setup for one of the transducers. This setup works, but has no consideration for what I spoke about above. There are some additional contacts in there to stop accruing bad time once they solve the puzzle, as well as to not start accruing any time until they complete the tasks needed prior to this particular game. There is also a contact that resets the "good time" if they go outside of the "good" range before the determined time value is set. The game is designed that they must be in the good range for 3 seconds to trigger that complete. Once it is complete, no additional "bad time" is possible to accrue.
I have a pair of pressure transducers that send off to analog inputs.
The scaling is done in PSI and I have some compare values set with two timers.
Right now I have it configured as;
*If the pressure is between 4-15psi or greater than 23psi, Timer A accumulates.
*If the pressure is between 16-22psi, Timer B accumulates.
What I want to add is a function that only allows the timers to accumulate if the pressure value has been constant for more than lets say, 300ms. So, if the pressure is increasing or decreasing, unless it stands on a value for more than 300ms, I do not want the timer to start. Example; if the 7psi is present for longer than 300ms, timer A starts accumulating. If the value changes, the timer stops, until another value is present for 300ms or greater.
Some background on the process to possibly help understand better;
This is part of a game (attraction industry). The players need to set a pair of regulators to a the correct values (19psi and 55psi, +/- 3psi) in order to proceed to the next step. If they set it to the incorrect pressure, "bad time" (Timer A) starts accumulating, which part of their score is based on. As it currently sits, they players are forced to accrue "bad time" even if they know to correct values before they start playing with the regulators. Initially I was going to put a deduction of time in as a constant for the formula that calculates their scores, but I've found people wildly vary in the time it takes to get there. For me, I could start from 0psi and set 19psi in ~1400ms. One employee took ~9000ms to get there, another 6000ms.
I figure if I they sit on a given pressure value for more than ~300ms or so, they've made a choice to set that pressure as the "puzzle solve", so I want Timer A to start accumulating.
I can't think of any way to do this without creating a timer for every value between 4 and 125, each setting a bit to start Timer A. That's a lot of timers and I know there has to be a better way to do it. With my inexperience with ladder logic, I don't know of a more efficient way to do it.
Thoughts? I'm using a Productivity 2000 PLC.
I've attached a screenshot of my current timer setup for one of the transducers. This setup works, but has no consideration for what I spoke about above. There are some additional contacts in there to stop accruing bad time once they solve the puzzle, as well as to not start accruing any time until they complete the tasks needed prior to this particular game. There is also a contact that resets the "good time" if they go outside of the "good" range before the determined time value is set. The game is designed that they must be in the good range for 3 seconds to trigger that complete. Once it is complete, no additional "bad time" is possible to accrue.
Last edited: