Week - 4
AIM: 1. To impliment the control logic of a washing machine using state flow in simulink?
Objective: 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
Model: The file which contains the model is attatched with this report.
Pictorial representation of the block diagram
parameters: conditions:
1. value '1'means there is input 1. when lamp shows GREEN,The task is IN PROCESS
2. value '0' maens there is no input 2. When iamp shows RED, The task is ENDS
CHARTDIAGRAM:

PARAMETERS

we have given water1, soak,washing,rinsing,dryer,cycle as output of the chart.
we have given our water_supply and power_supply as inputs of the chart
simulation time parameters
we used 430 sec so that it can cover the whole cycle and sufficient time to storeand solve the parameters. 
output:
There are two conditions asked to solve the question
CONDITION-1: when water supply is off
we should not provide water supply and check for the output
implementing control logic of a “washing machine” using Stateflow

parameters: conditions:
1. value '1'means there is input 1. when lamp shows GREEN,The task is IN PROCESS
2. value '0' maens there is no input 2. When iamp shows RED, The task is ENDS
From the above diagram, we can see that indicator of water is showing red ie.., when there is no water supply the process is terminated and the LED indicator is used to indicate the state.
CONDITION-2: When water supply is ON
Now we are providing the water supply and check the output
implementing control logic of a “washing machine” using Stateflow

parameters: conditions:
1. value '1'means there is input 1. when lamp shows GREEN,The task is IN PROCESS
2. value '0' maens there is no input 2. When iamp shows RED, The task is ENDS
As we can observefrom the above fig, all the states have been exicuted and indicates the process completion indicatoras showing green (in the cycle).
CONCLUTION:
The simulation of the washing machine using state flow is done and the result is satis factory.
OBJECTIVE: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.
MODEL:
The file which contains the model of the gear shift is attached with the report
BLOCK DIAGRAM OF THE MODEL:

condition:
speed range(kmph) gear
0-15 1
16-25 2
26-40 3
41-60 4
above 61 5
CHART DIAGRAM:
PARAMETERS:

Here we give the speed as the input of the chart
Here we give the speed as the output of the chart
SIMULATION TIME PARAMETERS :
Here we gave time as 'inf' for our simulation should run until we stop it

INPUT:
we use slider gain to provide the input to the chart.

i'm changing my speed values from 0 to 100 using slider gain during the simulation.
OUTPUT:
The output produced is recorded when it displaying the each gear
GEAR 1
SPEED RANGE: 0 to 15 kmph
INPUT SPEED: 10 kmpk
COLOUR: Pink

GEAR 2
SPEED RANGE: 16 to 25kmph
INPUT SPEED : 20kmph
COLOUR: Red

GEAR 3
SPEED RANGE: 26 to 40kmph
INPUT SPEED : 30kmph
COLOUR: orange

GEAR 4
SPEED RANGE: 41 to 60kmph
INPUT SPEED : 50kmph
COLOUR: vilot

GEAR 5
SPEED RANGE: Above 60kmph
INPUT SPEED : 80kmph
COLOUR: purple

CONCLUSION: Created a state flow for gear shift using simulink and results are satisfactory.