Challenge

Week - 4

1. Stateflow control logic for washing machine:

A MATLAB stateflow is a graphical representation of finite state machine. It includes diagrams, flowchart, programs, tables etc.

Working operations of a washing machine includes:

*switching on power supply

*switching on water supply

*soaking

*washing

*rinsing

*dryer

Here the given conditions are :

  • 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 process is undergone it is indicated with the help of LED or lamp

Create an algorithm for the above process and implement it in a chart with the given conditions. From the symbols pane assign variable names for the input and output ports.

In the simulink window provide power input and water source input and in case of the output connect display blocks for indicating each stage of washing. Lamps are also connected in which on condition is green and off indicates red colour.

Run the simulation

Result:

*if power source=0 then system will not activate and lamps are red.

*if power source=1 and water source=0, supply will turn on but water supply is off and system is still not active. only lamp 1 will be green.

*if power source=1 and water source=1 system will turn activated and all lamps are on and green and process is complete when end lamp is also turned on.

2.Gear shifting logic:

Gears are the mechanical devices that help the driver to get desired transmission ratio by making use of shifting mechanisms.Shifting mechanism includes shifting up and down of the gear according to the speed. So that speed needs to be monitored depending on which the gear is selected.

For creating thde chart the conditions given are;

Speed range: 0 to 15 Gear: 1

16 to 25 2

26 to 40 3

41 to 60 4

above 61 5

According to the condition above enter datas in the chart and from symbols pane assigns symbols for input and output of the chart.

In the simulation window connect the input to a slider gain which varies the speed while running the simulation.

A constant block is provided in which the value is assigned as 0 or 1 to turn on and turn off and is connected with a lamp to indicate power on and off.

Gear position can be viewed using the display block.

Run the simulation

Result:

*if constant=0 then lamp will be red and no gear shifting mechanism is activated.

*if constant block=1 then lamp indicate green which is on and gear shifting mechanism takes place and by varying the speed in slider gain it is proved.

matlab files for 1 and 2 ;

https://drive.google.com/file/d/1KCrwtHj_vTqS3ef_KtRXV6Lefiejwt9t/view?usp=sharing

https://drive.google.com/file/d/1PhQ-hOwYpnmNy8bDfzH48a2pgjjfvE2a/view?usp=sharing

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.