Week - 4
1. Aim:
To implement the washing machine logic using stateflow and simulink
Blocks Used:
1. Toggle switch - To toggle the power supply which is in default ON
2. Slider switch - To toggle the signal for water supply to implement stop and completed condition
3. Signal builder - To create two signals for water supply
4. Mux - To combine all the outputs and plot in a single layout
5. Scope - To view signals
6. Chart - To write the logics of washing machine
7. Lamp - To indicate the status
Procedure:
i) All the blocks are taken and connected as shown below

ii) Control logic for the washing machine is written as shown below

iii) With respect to the power supply and water supply the logic is performed as given in the question
iv) Signal of water supply input is varied using the signal builder block to simulate the stop and completion process of the washing machine

v) When switching the water supply to 0 in between, the following output is obtained


vi) While giving the water supply signal continuously without any interrupt, the following output is obtained


Result: The washing machine logic is developed and logics are performed successfully as per the requirement.
2. Aim: To implement gear shifting logic in Stateflow
Procedure:
i) Logic for the gear shifting is framed with the help of statemachine with the inputs given in the task

ii) The speed input and gear input are connected to a display and a scope to generate and view the result w.r.t the input

Result:
The logic is developed as per the requirement and it is verified using the following graph
