Flip flop circuit

Here is what I believe is meant to happen. Anybody feel free to correct me if I am wrong.


I think you got it right, but let me know if the following changes add clarity.


Row 0 - When A has a rising edge THEN Coil B is energized, but only for one scan cycle. That is the flip flop trigger. (the P inside the B coil means pulse)

Row 1 - When B is de-energized THEN Coil Z's state from the previous scan cycle keeps it energized or de-energized. This is the row that maintains Z's state on scan cycles after each B pulse and before the next B pulse.

Row 2 - When B is energized for one scan cycle - pulsed - THEN coil Z's state is toggled from what it was from the previous scan cycle. This is the row that, on one scan cycle, toggles - "flips or flops" - coil Z exactly once whenever a rising edge of A energizes B.
 
Last edited:
Thank you all so much for replies. The thing I don't get is that, once the pulse from coil B ceases (after one scan), and power is no longer transmitted via row 2, I cannot understand how row 1 transmits the power. Surely to do this, the NO switch Z and the NC switch B both need to pass power, I can't see how this is possible.

Yet it does work in my simulator so it must be my understanding of ladder logic which is at fault! :(
 
The thing I don't get is that, once the pulse from coil B ceases (after one scan), and power is no longer transmitted via row 2, I cannot understand how row 1 transmits the power.




Forget row (branch) 3 for this, because B is 0 so it will always be 0 and will never affect the OR result.


So, without that last branch, the second rung is now


    Z        B        Z
---] [------]/[------( )----




And since B is 0, the XIO/NC/--]/[--- of B is {NOT B}, which is {NOT 0}, which is 1, which reduces the rung to


    Z           Z
---] [---------( )---




So Z "seals" itself (Z) in as a 1 if it (Z) is a 1, and "seals" itself (Z) in as a 0 if it (Z) is a 0.


Also, be careful about thinking about PLC rungs as passing power or current or voltage: it's similar to that because the seminal idea PLCs decades was that all the maintenance techs and electricians, who were by definition able to read wiring schematics, could become diagnosticians or even programmers; I am not saying that is not intuitively and visually helpful, but if you get confused with PLC you have to drop back to bit logic i.e. ones and zeros.



Someone should shortly post the link for that "look for a 1/0" series of videos; that is 90 minutes that will change your entire approach to this.


See the image below:

  • Rung 2 branch 1 is an AND of Z and notB,
    • the result of which is a 2x2 box with three 0s and a 1;
  • Rung 2 branch 2 is an AND of notZ and B,
    • the result of which is a 2x2 box with three 0s and a 1,
      • but in a different pattern than branch 1;
  • the combining of the two branches is an OR,
    • represented by the 2x2 box to the left, which is an OR-combination of
      • 0 <= 0 OR 0, from the two top-left AND sub-boxes
      • 0 <= 0 OR 0, from the two bottom-right AND sub-boxes
      • 1 <= 1 OR 0, from the two bottom-left AND sub-boxes
      • 1 <= 0 OR 1, from the two top-right AND sub-boxes . The two ANDs are on the left, their OR-combination is to the right.
The left column of the OR-result box is where B is 0, so notB is 1, so Z is a seal-in of itself, maintaining its value on all scans between B rising edges.

IMG_20200515_154158.jpg
 
Last edited:
Ladder logic works from left to right (but also top to bottom)so after first scan Z will be on and not B will be off (N/C) because on second scan B is turned off as it is only on for one scan so the logic is true to keep Z on.

FlipFlop.png
 

Similar Topics

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...
Replies
31
Views
9,538
I found and fixed issue. B3:3 was used in MOV.
Replies
11
Views
2,597
I am calculating power factor from samples of voltage and current. Calculation is done by multiplying voltage and current samples. What Im...
Replies
0
Views
1,649
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,552
Hi Everyone, I am trying to write a flip flop circuit with one input that changes the state of two outputs. If I press the button once it brings...
Replies
3
Views
3,260
Back
Top Bottom