Week - 4
objective 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.
flow chart:-

symbol pane:-

in this elec.& water are input data. finish,stop,wash,activation, drying, rinising, soaking are output data.
block use:- constant, chart, display, lamp
result-1:-

result-2:-

explaination:-
result-1 shows that when power & water is available then washing process will start.
result-2 shows when power & water any one them is not available then washing will not start.
in washing process water soaking is for 200sec, washing is for 100sec, rinsing 20sec & finally drying 50 sec, the lamps are use as indicators when it glows the respective activity is on.
objective-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.
state flow model:-

blocks used are constant, slider gain, chart, display.
flow chart:-

here g is use as common parameter in all state, which is connected to display of model.
condition is when speed is <=15 gear will be 1, <=25 gear will be 2, <=40 gear 4, <=60 gear 5.
if speed >15 gear 2, >25 gear 3, >40 gear 4, >60 gear 5 will be shown in display.
result:-


explaination:- slider gain is use for giving input speed, to change the input speed while simulation the run time should be kept infinite(1/0). as we change the input speed from slider gain the following gear is shown in display.