Challenge

Control logic of washing machine and gear shifter using Stateflow

Implement control logic of a “washing machine” using Stateflow as per the given sequence.

  • If the power supply is available, the system gets activated.
  • If the water supply is not available, stop the process and indicate through LED.
  • Soaking time should be 200s, followed by washing time of 100s.
  • Then rinsing happens for next 20s and dryer runs for 50s.
  • After all the process have completed, turn on the finished LED.

Explanation:

  • The state of washing machine is defined (ON/OFF), and the required conditions are applied.
  • Then, the further washing states are defined with the required conditions.
  • Here, the variables are defined as inputs (Washing machine ON/OFF) and outputs (Soaking, Washing, Rinsing, Drying).
  • The stateflow chart is connected to two constant blocks which is then connected to two slider switches which control the power supply and the water supply.
  • The outputs are connected a display block each which is then connected to a lamp to indicate the process.

Results:

Link: click here

Make a Simulink chart for the “Gear Shift” logic as per the below conditions.

Speed range (kmph)

Gear

0-15

1

16-25

2

26-40

3

41-60

4

60 and above

5

Explanation

  • First, each individual states in stateflow chart is defined as per the speed and gear requirement. The conditions are applied for which the gear changes with respect to speed.
  • The properties are defined for each variable in the symbols pane (speed=input) (g1, g2, g3, g4, g5=output).
  • A slider block is connected to a constant block which is connected to the stateflow chart.
  • A number of display blocks are connected to each output (g1, g2, g3, g4, g5). This display block is connected to a light source indicates the gear position.

Results

Link: click here

Your portfolio, next

Ship work like this
in your own course.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.