Week - 4
1. Aim: To implement control logic of a washing machine using stateflow as per the given sequence
If the power supply is avaialble, the system gets activated
If the water supply is not available, stop the process & Indicate it through LED
Soaking time should be 200S, followed by washing time of 100S
Then rinsing happens for 20S & dryer runs for 50S
Chart:

The above image represents the stateflow of a washing machine
Symbols and Ports assigned in the chart

Model:

The model has slider switch for power supply and water supply. Each port from the chart is connected to the display and in turn the display's are connected to the Lamp to indicate the on going state of operation.
Conditions Involved:
a. Power Supply off:

When the power supply is off using a slider switch, the system is not activated. The same is displayed and indicated in the lamp
b. Water Supply off

When Powe supply is On and water Supply is off the same is indicated through the Lamp.
c. When Both Power and Water supply is On, Soaking takes place for 200S and it is indicated by the soaking lamp

d. After 200S, washing operation takes place for 100S and the same is indicated by the lamp- simulation is run for 300S

e. The next operation is rinsing and it takes place for 20S, indicated by the Rinsing lamp

f. Once, Rinsing is completed, drying takes place for 50S.

g. Once all these operations are done, the process is finished indicated by End lamp

2. Aim: To create a chart for gear shift logic for the below conditions
Speed Range (kmph). Gear
0 - 15. 1
16-25. 2
26-40. 3
41-60. 4
above 61. 5
Chart:

Symbol:

Where S indicates Speed as an input data and G indicates Gear as an output data
Model:

The model is modelled using a horizontal slider block to a constant block as an input for speed, which is inurn connected with the chart, then with display to view the corresponding gear shift. Additionally a lamp is connected to the gear display with various colour indicators for varoius gear shifts
The simulation is run for infinity while the horizontal slider is moved to vary the speed.
1. 0 to 15 kmph Gear 1

2. 16 to 25 kmph Gear 2

3. 26 to 40 kmph Gear 3

4. 41 to 60 kmph Gear 4

5. Above 61 kmph Gear 5
