Week - 4
Question 1:
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
Aim: To implement the control logic for Washing machine as per given conditions:
Control logic for above problrm:

inputs are power supply(ps) and water supply (ws),and above shpw control logic satisfies all the conditions stated,below are the attachments.
input and output ports:

1.System gets activated only if power supply is in ON state:

Conditon regarding water supply

Satisfying all the conditions


2.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.
Aim : based on given output we need to make a control logic that shfts gears based on speed
control logic

input and output ports:

Condition for gear 1:

condition for gear 2:

Condition for gear 3:

Condtion for gear 4:

Condition for gear 5:

Conclusion:
Both the challenges have been sucessfully completed.