Week - 4
1.Aim:Implement control logic of washing machine using stateflow by giving certain conditions as per power input and water supply and as per their input,machine operates and obtain output by lamp light.
Steps:
- Create a chart block for defining the stateflow as per the given conditions
- After creating, at 200 sec soaking action takes place i.e Soak block gets activated
- At 300 sec washing action takes palce i.e Wash block gets activated
- At 320 sec rinsing action takes place i.e Rinse block gets activated
- At 370 sec drying action takes palce i.e Drying block gets activated
- After then the signal flow exit the chart
- To understand the above conditions we have to add lamp with each block
The simulink model for operating the washing machine according to the given condition is

Blocks used:
- Lamp
- Display
- Constant
- Slider Switch(Used For ON and OFF purpose)
Result:
Conditions:
When Power and Water supply is ON at run time 370sec.

When Power supply is ON and Water supply is OFF at run time 370sec:

When Power supply and Water supply is On at the run time 200 sec(Soak state):

When Power and Water supply is ON at the run time 300 sec(Wash state):

When Power and Water supply is ON at the run time 320 sec(Rine State):

When Power and Water supply is ON at the run time 370 sec (Dry State):

2.Aim:Create the stateflow for gear shift and vary the speed as input and obtain the output as gear number in display.
Steps and Conditions:
- Create a chart block for defining the stateflow as per the given conditions.
- If the speed is > 0 and <=15, then gear1 is activated
- If speed is >15 and <=25, then gear2 is activated
- If the speed is >25 and <=40, then gear3 is activated
- If the speed is >40 and <=60, then gear4 is activated
- If the speed is >60 and the gear5 is activated

Blocks Used:
- Constant
- Display
Slider Gain:

Result:
