Challenge

Week - 4

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

  • If the power supply is available, the system gets activated
  • If the Water supply is not available, stop the process & indicate through LED
  • Soaking time should be 200s followed by Washing time of 100s.
  • Then rinsing happens for next 20s & dryer runs for 50s

After all the processes have completed turn on the finished LED

ANS- Following model shows the control logic of a "washing machine" using stateflow.

To create automatic washing machine logic i used chart function from logic shown below.

Process:

1.I took chart block and create a logic in it with the help of state which is shown above.

2. To chart input i gives the input from simulink and output to simulink.

3. For that input and output of chart gives the simulink inputs and output.

4. And get the result by hit the run button.

BLOCK USED WITH THERE FUNCTION-

1.Chart-

A finite state machine is a representation of an event-driven (reactive) system. In an event-driven system, the system respondsto an event bymaking atransition from one state(mode) to another.

2. Two constant-

The constant block generates a real or complex constant value signal.

3. Lamp-

For indication.

4. Display-

For output.

When supply get to our model but water false then model indication in lamp which is shown in below pic:

when model is normally working then there is more opreations which is soaking, rising, drying etc. with interval of time which is shown in below pics:-

1.Soaking time- 200

Colour- Blue

2.Rinsing time- 300

Colour- yellow

3.Drying time-350

Colour- Light blue.

4.Stop/End time- 400

Colour- Pink

Out of Model.

Q.2. Make a Simulink chart for the “Gear shift” logic as per below conditions:

Speed Range(kmph) Gear

0 to 15 1

16 to 25 2

26 to 40 3

41 to 60 4

Above 61 5

Give speed input while the simulation is running & display the gear number.

ANS- Chart for the “Gear shift” logic as per given condition:

Model of gear shift:

Block used and there function-

1. Chart-

A finite state machine is a representation of an event-driven (reactive) system. In an event-driven system, the system respondsto an event bymaking atransition from one state(mode) to another.

2. Two constant-

The constant block generates a real or complex constant value signal.

3. Display-

For output.

As per the condition, gear ewith there corresponding speed shown in below pics.

1. Speed: 0-15 with gear number on display.

2. Speed: 15-25 with gear number on display.

3. Speed:25-40 with gear number on display.

4.Speed:40-60 with gear number on display.

5.Speed:60-100 with gear number on display.

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.