State diagram, state table, etc.

In summary, the conversation discusses a problem involving three containers that need to be filled with sand and have sensors attached to monitor the sand level. The refilling process involves going to each container in a specific order and refilling if needed. The person needs help creating a state table or diagram and determining whether to use a Moore or Mealy model. They also request resources for similar problems.
  • #1
disclaimer
25
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
  • #2
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

.
 
  • #3
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?
 
  • #4
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?
 
  • #5
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 seperately as a state. So state 1 - 1st is empty, state 2 - 2nd empty and so on.
 
  • #6
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.
 
  • #7
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.
 
  • #8
I guess the possible inputs have to be:

[tex]\bar{X}\bar{Y}\bar{Z}[/tex] 000

[tex]\bar{X}\bar{Y}Z[/tex] 001

[tex]\bar{X}YZ[/tex] 011

[tex]\bar{X}Y\bar{Z}[/tex] 010

[tex]XY\bar{Z}[/tex] 110

[tex]XYZ[/tex] 111

[tex]X\bar{Y}Z[/tex] 101

[tex]X\bar{Y}\bar{Z}[/tex] 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:

FAQ: State diagram, state table, etc.

1. What is a state diagram?

A state diagram is a visual representation of the states that a system or process can be in, as well as the transitions between those states. It is a useful tool for understanding and analyzing the behavior of a system.

2. How is a state diagram different from a state table?

A state diagram is a graphical representation, while a state table is a tabular representation of the same information. Both show the states and transitions of a system, but a state table is often more detailed and easier to analyze for complex systems.

3. What are the benefits of using state diagrams and tables?

State diagrams and tables help in visualizing and understanding the behavior of a system, identifying potential problem areas, and designing efficient and effective solutions. They also aid in communication and collaboration among team members, as well as documenting the system for future reference.

4. How are state diagrams and tables used in the development process?

State diagrams and tables are commonly used in the design and development of software systems, control systems, and other complex systems. They are used to model the behavior of the system, identify and analyze possible scenarios, and validate the correctness and completeness of the system design.

5. Are there any limitations to using state diagrams and tables?

State diagrams and tables can become complex and difficult to manage for large and intricate systems. They may also not capture all possible scenarios and edge cases, leading to incomplete or inaccurate representations of the system. Additionally, they may not be as helpful for non-technical stakeholders who may have difficulty understanding the visualizations.

Similar threads

Replies
49
Views
3K
Replies
1
Views
1K
Replies
7
Views
2K
Replies
17
Views
5K
Replies
2
Views
11K
Replies
2
Views
1K
Replies
2
Views
2K
Replies
20
Views
2K
Replies
4
Views
2K
Back
Top