Challenge

Week - 4

QUESTION-1:

  1. 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 & indicate through LED
  • Soaking time should be 200s followed by Washing time of 100s.
  • Then rinsing happens for the next 20s & dryer runs for 50s

using constant block, slider gain, chart, lamp, and display block the model can be created as shown below.

Inside the chart block, the logic for washing machine operation is as follows:

Logic is given as per the conditions mentioned in the problem statement.

Results:

set the simulation time to 300 secs which is greater than the cycle time of the washing machine.

Case-1: set power=1& water=1 using slider gain

All the process in the washing cycle is executed and the display block displays 1 and lamp glows to green.

Case-2: set power=1& water=0 using slider gain

Result after running the simulation:

As we can see in the image only power display is 1 and lamp is green rest all are red indicating that particular process is not executed.

Case-3: set power=0& water=1 using slider gain

Result after running the simulation:

As seen in the image no process take place since power=0.

Case-4: set power=0& water=0 using slider gain

Hence we can conclude that using the given model desired output is obtained.

QUESTION-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.

using constant block, slider gain, chart, and display block the model can be created as shown below.

Inside the chart block, the logic for gear shifting is as follows:

Results:

slider gain block settings:

set the low value=0 & high value as 100 as shown in fig.

by setting the simulation time to Infinity, and adjusting the speed by using the slider gain block,

Case-1:

Speed>0 kmph and gear is g-1

Case-2:

Speed>15 kmph and gear is g-2

Case-3:

Speed>25 kmph and gear is g-3

Case-4:

Speed>40 kmph and gear is g-4

Case-5:

Speed>60 kmph and gear is g-5

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.