Help with a Flip/Flop Type of Logic

chippieboy

Member
Join Date
Sep 2019
Location
Silicon Valley
Posts
56
I am having this issue trying to figure out how to do this. I have a Hydraulic ram that travels when a machine is running. The ram extends to the maximum travel then trips a limit switch and then retracts to the minimum travel then trips the other limit switch extends to the maximum travel .This cycle repeats indefinitely until power off.
The main issue I have, is the hydraulic directional valve starts out in a neutral position during the first power up. The valve does not know what way to go. If the ram is not at either travel limit (touching the limit switch) it does not matter what direction to start first. I was thinking of doing a one shot at first cycle then some sort of flip-flop or a Set-Reset or a Keep-Reset when the PLC is powered up to trigger the hydraulic directional valve and let the cycle begin. The problem is if the ram is touching either limit switch at power up, I have no idea how to factor that in the logic and what way to send the Ram. This machine is using an Omron PLC but the logic should be the same or I can alter it once I understand how to do this. I can do it with AB as well. I attached a primitive picture of what is happening.
 
I would create a sequence, step logic, state machine, which ever term you like. Example...

1. Step 1 extend
2. Step 2 waiting for extend switch
3. Step 3 retract
4. Step 4 waiting for retract switch
5. Reset to step 1

If you start with the ram extended, it doesn't matter as the logic will see the switch then retract. You can reset to step 1 on power up, or make it retentive, your choice.
 
This is what I think about at 4am when I can't sleep. I gotta get a life ;-/

The logic below is essentially the same approach as LD's solution (good coders borrow; great coders steal;)), but it

  • is implemented as a pair of Start/Stop circuits,
    • so the seal-in branches allow replacing the Sets and Resets with direct* outputs
      • * i.e. -( )-s; I don't know the right phrase; it is OTE in the A-B fantasy,
  • adds a [Run] input to override everything and shut the ram off when not running,
  • eliminates LD's first rung (Network) by ORing the "start when in-between limits" with the start branches one of the Start/Stop rung
    • which LD could do by
      • swapping the RaiseQ and LowerQ -] [-s between the last two rungs
      • changing those tests to -]/[-s,
      • ORing a -]/[- of LowerQ with the -] [- of RaisedSwitch.
This is only an alternate implementation of and inspired by LD's approach. Even though this has near-symmetry, one less instruction and one less rung, code golf and density are not design goals, so I still think LD's is cleaner and easier to understand, and I would recommend that; adding ANDed Run bits is trivial if needed.


Code:
    Run           LoLim_Input           HiLim_Input    Up_Output
----] [---+-----------] [------------+------]/[-----------( )-----
          |                          | 
          |        Up_Output         |
          +-----------] [------------+
          |                          |
          |  Up_Output  Down_Output  |
          +-----]/[--------]/[-------+


    Run           HiLim_Input           LoLim_Input  Down_Output
----] [---+-----------] [------------+------]/[----------( )------
          |                          |
          |       Down_Output        |
          +-----------] [------------+
 




Awesome!


Slightly? I must pass along a compliment I once saw that an instructor wrote on an Intel 8085 programming class assignment: "Compact as hell!"


I have never seen that -]NOT[- instruction before; assuming left-to-right and top-to-bottom (which Siemens sometimes unwisely violates), that raises two questions:

  • Will both outputs be on for the one scan when LoweredSwitch has a rising edge?
  • Will both outputs be off for the one scan when RaisedSwitch has a rising edge?
Not that it matters either way for either question, just curious and wanting to understand.
 
Last edited:
I had trouble understanding the "Not" thing and the first example with the "S" & "R" outputs, I'm guessing those are Set & Reset functions. This machine is using a Omrom PLC and those functions I do not recognize. I do know the set reset in CX Programmer. I might give the other ideas a shot later.
 

Similar Topics

Hi all, my first post here, I've been lurking for a while. I'm a beginner and I hit a wall on one of my first projects I'm working on. I know it...
Replies
6
Views
2,541
I'm fairly new to Rockwell software, I've had some basic training in the past but nothing too advanced. My company and I use Reliable products for...
Replies
2
Views
43
Hi all I need help on this As in my project used Schneider TM241 controller. Now I want to communicate Elite energy meter with controller by...
Replies
3
Views
107
Hi all, I am having issues accessing my Cimplicity software - the site code changed after re-install and I am no longer able to attain a new key...
Replies
10
Views
131
Good day all! Can someone help me with the procedure to update Beijers E700 firmware? The Panel I am working on is firmware 2.04v and I would...
Replies
1
Views
53
Back
Top Bottom