Week - 4
1.Implement control logic of a “washing machine” using Stateflow as per given sequence
ANS: washing machine include many steps they are soaking , washing,rinsing, drying. and the same way some condtion are applicable too. they are water avalaiblity,power souse must be avalaible. machine control it self take care of all these thing
now this controll steps are write in state flow
that can show in fig given below

here stateflow is constructed like above fig
and the logic is given blow

at first step power avalaible i.e x=1, (here when vaue is one that mean ON or proccced to next level and suppose it is zero oFF these is appilacable for all logic in the charts)and water sorce allso show in this
after saoking about 200sec moved to next washing and after follow by next sten with given time delay rinsing,drying, and fininshinf finnally.
annd all rsult are show in the fig.

2. Make a Simulink chart for the “Gear shift” logic as per below conditions
here we have some conditions to apply let see what are condition
1.when the speed is 0 to 15 thats 1st gear
2.when the speed is 16 to 25 thats 2nd gear
3.when the speed is 26 to 40 thats 3rd gear
4.when the speed is 41 to 60 thats 4th gear
5.when the speed is 61 to above thats 1st gear
now to solve this problem we can use chart and constant,slider,lamp, display blocks and in th chart logic and condition are programmed that can shown in the fig.
and finnaly simulation is done that is attached in the file and as well as in fig.

here when power is in th eon state lamp indicate red and when poer off it shows green(power os takaen as 1 for on and 0 for off)

here i am taking the speed is 30 kpm as per our condtion that in the 3rd gear the result is tested in simulation
the speed is given by slider block and constant
