State diagram, state table, etc.

Click For Summary
SUMMARY

The discussion focuses on designing a state diagram and state table for a system involving three sand containers with sensors. Participants agree that at least four states are necessary to represent the conditions of the containers: all full, one empty, two empty, and three empty. A Mealy machine is recommended due to the dependency of the next state on both the current state and the inputs from the sensors. The conversation emphasizes the importance of accurately defining states and outputs to manage the refilling process effectively.

PREREQUISITES
  • Understanding of state machines, specifically Mealy and Moore models
  • Familiarity with truth tables and state diagrams
  • Knowledge of binary representation for outputs
  • Basic principles of automation and control systems
NEXT STEPS
  • Research "Mealy vs. Moore state machines" for deeper insights into state machine design
  • Study "Creating state diagrams" to visualize complex systems effectively
  • Learn about "Truth tables in digital logic" to understand state transitions
  • Explore "Automation control systems" for practical applications of state machines
USEFUL FOR

Students and professionals in computer science, electrical engineering, and automation who are involved in designing control systems and state machines for various applications.

disclaimer
Messages
25
Reaction score
0

Homework Statement



Hi everyone;

I've got a problem to solve that involves three containers which should be filled with sand, each of them has a sensor attached at the same level, so if the amount of sand drops below that limit, it will be refilled. If all were empty, the refilling arm would first go to 1, then 2, and finally 3. Something like this:

2dtrea0.jpg



Homework Equations


No equations.


The Attempt at a Solution




I'm not sure how many states are needed, I'm guessing at least 3 (probably 4: 1st empty, 2nd empty, 3rd empty, all full). Could anyone help me make a state table or state diagram to get things going? Also, would I be better off using a Moore or Mealy model? Anyone know of good resources dealing with similar problems? Help greatly appreciated.
 
Physics news on Phys.org
disclaimer said:

Homework Statement



Hi everyone;

I've got a problem to solve that involves three containers which should be filled with sand, each of them has a sensor attached at the same level, so if the amount of sand drops below that limit, it will be refilled. If all were empty, the refilling arm would first go to 1, then 2, and finally 3. Something like this:

2dtrea0.jpg



Homework Equations


No equations.


The Attempt at a Solution




I'm not sure how many states are needed, I'm guessing at least 3 (probably 4: 1st empty, 2nd empty, 3rd empty, all full). Could anyone help me make a state table or state diagram to get things going? Also, would I be better off using a Moore or Mealy model? Anyone know of good resources dealing with similar problems? Help greatly appreciated.

Start with a truth table. There are 3 bins that can be empty (0) or full (1). Set up a counting on the left of the truth table -- how many lines does that give you? That tells you how many states you will have in your state diagram (well, unless you have a Reset state, but you probably won't in this problem).

http://en.wikipedia.org/wiki/State_machine

.
 
Thanks, maybe I wasn't too precise, the bins don't have to be filled in one cycle. One cycle involves refilling only one bin which narrows the amount of possible states down to 4 I guess. After refilling, the arm returns to the initial state and so on. There would have to be 4 outputs, converting to binary:

00 - no action, stay in initial state
01 - refill 1st
10 - refill 2nd
11 - refill 3rd

Is that correct?
 
How much information do you need to keep about your states? For example, one "state" can be 1 - full, 2 needs refill, 3 needs refill, filler is over bin 2. Is that a separate "state" as opposed to filler over bin 3.. what about both 2/3 needing refills, is that a separate state?
 
I know what you mean, but that is not the case here. We don't have "general" states representing the signals from all the sensors at a time, each of them is treated separately as a state. So state 1 - 1st is empty, state 2 - 2nd empty and so on.
 
Is it possible that all states always reduce to one, no matter if I assume 4 or 8? Either I'm doing something wrong here or I don't know why. Can anyone help? Thanks.
 
disclaimer said:
Is it possible that all states always reduce to one, no matter if I assume 4 or 8? Either I'm doing something wrong here or I don't know why. Can anyone help? Thanks.

You can't reduce to one state. I don't even think it'd be considered a state machine at that point.

Here's some pointers: You'll need to make a mealy machine, as the next state depends on the current state AND the inputs (sand level for each bin). Don't forget, you'll probably have a "get more sand" state, which will be called upon in between the filling of the containers.

Simply draw the problem out. Start at the initial state, and branch off from there. What happens if you get a call for more sand? What if you're currently filling the first OR second container and the third one asks for sand?

You should be able to simplify it down to 8 states; 4 seems insufficient.
 
I guess the possible inputs have to be:

\bar{X}\bar{Y}\bar{Z} 000

\bar{X}\bar{Y}Z 001

\bar{X}YZ 011

\bar{X}Y\bar{Z} 010

XY\bar{Z} 110

XYZ 111

X\bar{Y}Z 101

X\bar{Y}\bar{Z} 100

MarcMTL said:
You can't reduce to one state. I don't even think it'd be considered a state machine at that point.

Here's some pointers: You'll need to make a mealy machine, as the next state depends on the current state AND the inputs (sand level for each bin). Don't forget, you'll probably have a "get more sand" state, which will be called upon in between the filling of the containers.

Simply draw the problem out. Start at the initial state, and branch off from there. What happens if you get a call for more sand? What if you're currently filling the first OR second container and the third one asks for sand?

You should be able to simplify it down to 8 states; 4 seems insufficient.

Thank you. Can't I just assume 5 states then?

A - all full
B - get sand
C - 1st full (entry action: refill)
D - 2nd full (entry action: refill)
E - 3rd full (entry action: refill)

Just a general sketch:

6izi3d.jpg


Is that possible? In such a case the states probably won't reduce to one because of the intermediate state.

EDIT: I suppose adding the "get sand" state requires one more output. I can't possibly have the same input/output combinations branching off to two different states. That just wouldn't make sense at all. Also some kind of output has to tell the system to take some sand first before refilling any of the containers. Whenever I start to think that I'm already there, something always pops up and makes my great theory fall into shambles...
 
Last edited:

Similar threads

  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 49 ·
2
Replies
49
Views
5K
Replies
1
Views
3K
  • · Replies 17 ·
Replies
17
Views
6K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 20 ·
Replies
20
Views
3K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 25 ·
Replies
25
Views
6K
  • · Replies 4 ·
Replies
4
Views
2K