OK Terry, I'm ready to give it a go.
These days I'm reverse-engineering code to generate a spec, so that's what I'll do with your Karnaugh map.
Spec:
Sequence of Operation
- Operator presses Start Button (PB-1) to start motor.
- If PB-1 is released before motor is confirmed started, generate a "Fail to Start" alarm (=X).
- If the aux contact drops out after the motor has been running, generate a "Tripped" alarm (=Y)
- When Operator presses Stop Button (PB-2), the motor stops.
Now I can see, looking at your K-map, how this is, exactly, the "bubble diagram" that I was talking about. It's even better because the usual "bubble" (
Note to Pierre - those are not Venn diagrams. Venn diagrams are depictions of Sets, with overlapping (or not) areas), aren't always clear on the transitions. These are.
From the K-map, I can see how to build a table for an SFC. (
Note to Lurkers: I've done these before in other postings on the old forum, and I don't feel like describing too much about the Action(=Outputs) / Transition stuff here). Translating your K-map directly, I come up with this:
<TABLE BORDER CELLSPACING=5 CELLPADDING=5>
<TR><TD>Step</TD><TD>Description</TD><TD>Transition</TD><TD>Outputs</TD><TD>Exception(s)</TD></TR><TR><TD>1</TD><TD>Wait for Start</TD><TD>PB-1</TD><TD>--</TD><TD>--</TD></TR><TR><TD>2</TD><TD>Start Motor</TD><TD>Motor</TD><TD>Motor</TD><TD>--</TD></TR><TR><TD>3</TD><TD>Confirm Start</TD><TD>Aux</TD><TD>Motor</TD><TD>If Not PB-1, go to step X</TD></TR><TR><TD>4</TD><TD>Release PB-1</TD><TD>Not PB-1</TD><TD>Motor</TD><TD>--</TD></TR><TR><TD>5</TD><TD>Set Was</TD><TD>Was</TD><TD>Motor & Was</TD><TD>--</TD></TR><TR><TD>6</TD><TD>Wait for Stop</TD><TD>Not PB-2</TD><TD>Motor & Was</TD><TD>If Not Aux, go to step Y</TD></TR><TR><TD>7</TD><TD>Stop Motor</TD><TD>Not Motor</TD><TD>Was</TD><TD>--</TD></TR><TR><TD>8</TD><TD>Confirm Stop</TD><TD>Not Aux</TD><TD>Was</TD><TD>--</TD></TR><TR><TD>9</TD><TD>Release PB-2 </TD><TD>PB-2</TD><TD>Was</TD><TD>--</TD></TR><TR><TD>10</TD><TD>End</TD><TD>--</TD><TD>--</TD><TD>If Not Was, go to step 1</TD></TR><TR><TD>X</TD><TD>Fail to Start</TD><TD>--</TD><TD>--</TD><TD>If Not Motor, go to step 1</TD></TR><TR><TD>Y</TD><TD>Tripped</TD><TD>--</TD><TD>--</TD><TD>If Not Motor, go to step 1</TD></TR>
</TABLE>
Now here is where I start to go "SO WHAT?". Did you make this chart this way because of some formal "Rules to Generate Karnaugh Maps", or were you just creating a random example?
Big question - is it permitted to move diagonally in the chart (all your motions are either horizontal or vertical)? My guess is "No", because yuo are dealing with a single transition - a diagonal move would indicate two conditions changing simultaneously (which theoretically could happen). For example - instead of having a step 'Y", could you go to step 'X' from step 6, and just have a general "Faulted" alarm?
If I were to write the same table from scratch, based on the spec that I wrote above, I would simplify it, like this:
<TABLE BORDER CELLSPACING=5 CELLPADDING=5>
<TR><TD>Step</TD><TD>Description</TD><TD>Transition</TD><TD>Outputs</TD><TD>Exception(s)</TD></TR><TR><TD>1</TD><TD>Wait for Start</TD><TD>PB-1</TD><TD>--</TD><TD>--</TD></TR><TR><TD>2</TD><TD>Confirm Start</TD><TD>Aux</TD><TD>Motor</TD><TD>If Not PB-1, go to step X</TD></TR><TR><TD>3</TD><TD>Wait for Stop</TD><TD>Not PB-2</TD><TD>Motor & Was</TD><TD>If Not Aux, go to step Y</TD></TR><TR><TD>4</TD><TD>End</TD><TD>--</TD><TD>--</TD><TD>If Not Was, go to step 1</TD></TR><TR><TD>X</TD><TD>Fail to Start</TD><TD>--</TD><TD>--</TD><TD>If Not Motor, go to step 1</TD></TR><TR><TD>Y</TD><TD>Tripped</TD><TD>--</TD><TD>--</TD><TD>If Not Motor, go to step 1</TD></TR>
</TABLE>
But I don't see how to turn this into K-map. But it still works as an SFC.
Of course, If i were to do the whole thing in ladder, I could do the "ladder-ized" sequence (
Note to Lurkers: Again, did it on those posts on the old forum - search for "sequencer" and you should find that method). But I'd probably just bang it out, something like this:
STANDARD MOTOR START CIRCUIT
PB-1 PB-2 X Y MOTOR
---| |---+---|/|-------|/|-------|/|-------( )
|
MOTOR |
---| |---+
<BR>
<BR>
FAIL TO START ALARM
MOTOR AUX WAS PB-1 X
---| |-------|/|-------|/|-------|/|-------( )
<BR>
<BR>
TRIPPED ALARM
MOTOR AUX WAS Y
---| |-------|/|-------| |-----------------( )
<BR>
<BR>
"WAS" LOGIC - KNOW THAT THE MOTOR HAS BEEN STARTED
MOTOR AUX WAS
---| |---+---| |---------------------------( )
|
WAS |
---| |---+
Nothing to it.
I'll admit that the K-map helped me figure out the WAS logic, but that's because I usually use a "fault timer" rather than the PB release that your K-map implied.
Now, what I'd like to see, Terry, is how
you take that K-map you drew, and turn it into code. I can see the SFC easily enough (so no need to produce THAT), although again, my second chart contains all the functionality of the first, and generates a smaller SFC.
Or does it contain the same functionality? How about the ladder? Am I missing some sublety, like what happens when both buttons are pushed at the same time, or somesuch?
If this wasn't a good example (I liked it - it was managable), come up with something better.