Week - 4
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.
ANSWER:
Basically washing machine under goes four process,
1.Soaking
2.Washing
3.Rinsing
4.Drying
SIMULINK AND LOGIC OF WASHING MACHINE:


WORKING PROCESS:
- In the above control logic first state is created with 2 conditions for power supply .
- One is with power supply available(Power==1)and second with water supply available (Water==1).
- If the power supply at entry is 1 and water supply is on, then machine will get activated and start the next process of operation.
- Next 4 Operation states have been created in flow order Soaking,Washing,Rinsing,Drying with their time of operation as 200sec for a soak,100sec for wash,20sec for rinse & 50sec for dry.
- Entry and exit condition of the state are kept as 1 & 0 & i.e at entry of operation states it is 1 and as operation completes it is 0 for every states.
- After all process has done washing machine completed LED will glow and we can shut the machine off.
CONCLUSION:
Thus the simulink is created for washing machine logic and obtained the output result.
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.
ANSWER:
Gear shift logic is decided by the speed of the vehicle is used to decide the gear of the vehicle.

Simulink block diagram and chart of "Gear shift":

In the above block digram, slider gain is used to obtain the values for gear shift.
LOGIC OF GEAR SHIFT:

CONCLUSION:
- By adjusting the slider gain i kept the value of 70.
- The value 70 is greater than 60, therefore the car running on the 5th gear and the result is displayed.
- Lamp of the 5th gear also glows green.
- Thus the simulink is created for gear shift logic and obtained the output result.