Week - 4
CASE:1
AIM:- To Implement control logic of a “washing machine” using Stateflow in simulink and perform simulation.
OBJECTIVE:-
- To implement the control logic for "washing machine" 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 200sec followed by Washing time of 100sec.
- Then rinsing happens for next 20sec & dryer runs for 50sec.
After all the processes have completed turn on the finished LED.
MODEL:-
- Pictorial Representation-

EXPLANATION:-
- In this MODEL we use State flow chart to create Control logic for washing machine.We use two switches for water_ supply and power_supply.
- All the process ports (Output ports) are connected with display and display is connected to Lamp block for watching the performance of washing machine.
- After completing all the process Cycle light would appear Green.
- Chart (Washing machine)

EXPLANATION:-
We assume continuous power and water supply when simulation is running.
- Here in this control logic block starting state is created with two inputs transition conditions, first is power_supply and second is water_supply.
- Second state is Soaking, in this state water supply is required. When soaking is completed water supply are turn off .we gave 200 sec for this process.
- The thired state is washing, in this state washing is done with help of available water. We gave 100 sec for this process as per given transition conditions. After completing 100 sec water drain out from the washing machine.
- The fourth is rinsing, in this process machine repeat the washing. We gave 20 sec for this process.
- The fifth state is Dryer, in this process the clothes are dry in 50 sec as per given transition conditions.
- Input and output Parameters

Here we defined water, soak, washing, rinsing, dryer, cycle are outputs of the chart.
And we defined water_supply and power_supply as inputs of the chart.
Simulation time
we take 420 sec for completing all the process.

OUTPUT:-
Condition 1 : When water supply is "OFF"
Here we see that NO water_input (water supply) all the process are terminated and all led (Lamp block) indicate red colour.
Condition 2: When water supply is "ON"

Here we see all the process (State) executed and cycle led (Lamp) indicating (Green colour) the process completion.
CONCLUSION:-
Here we perform simulation of the washing machine using State flow and the results are satisfactory.
********************************************************************************************************************************************************************************************************************************************************************************************************
CASE:2
AIM:- To Make a Simulink chart for the "Gear shift" logic.
OBJECTIVE:-
- Making 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
MODEL:-
- Pictorial Representation-

- Chart (Gear shift)

We have gear shifting conditions, we create state flow diagram with the help of Transition to give condition with respect to speed.
- Input and output Parameters

Here speed is input for the chart and Gear is Output of the chart.
Simulation Time:- we give simulation time as 'inf' (infinity) for simulation. and simulation run until we stop it.

INPUT:-
Here we use slider gain Block to provide input, we can use some more different Block also.

We change the input speed by sliding the slider gain block while simulation is running . here we set lower and upper value for slider.
OUTPUT:-
Here we recorded the output for each gear.
- Gear_1st:
input speed: 14kmph
colour of led(Lamp) - Green.

- Gear_2nd:
input speed: 22kmph
colour of led(Lamp): Blue

- Gear_3rd:
input speed: 36kmph
colour of led(Lamp) : Light Blue

- Gear_4th:
input speed: 47kmph
colour of led(Lamp) : Orange

- Gear_5th:
input speed: 74kmph
colour of led(Lamp) : Red

** in place of lamp block we can use Speedometer block also
CONCLUSION:-
- Here we create State flow for Gear Shift using Simulink and run simulation and present results
- Here we lern actual idea about MBD ( Model based development).
**-- WE ATTACH MODEL FILE PLEASE GO THROUGH
************************************************************************************************************************************************************************************************************************************************************************************************************************************** END