Week - 4
STUDY 1:
AIM:
Make a Simulate the process of washing machine with given condition.
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
- After all the processes have completed turn on the finished LED
FIGURE SHOWS BLOCK DIAGRAM OF WASHING MACHINE PROCESS:

EXPLANATION WHEN POWER AND WATER SUPPLY IS ON:
In the above control logic block diagram starting state is created with two transition conditions, 1st is power supply = 1 and 2nd is water supply = 1. That means both water and power supply are on
The second state is soaking, in this state the water supply is required so we give water supply. After completion soaking and water supply are off. As per given condition we gave time 200 sec for this process with the help of transition condition.
The third state is washing, in this state only washing is done with already available water in washing machine this process is took 100 sec time per given transition condition. And water drains from the machine.
The fourth state is raining, the water supply is off after 20 sec and rinsing state also done as per given transition condition.
The fifth state is dryer, in this process the cloths are dry in 50 sec as per given transition condition after completion of process dryer would off with the help of sate condition.
CHART BLOCK IN DETAILS:

PARAMETERS:

We have given water, soak, washing, rinsing, dryer, cycle as Outputs of the chart.
We have given our water_supply & 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 store and solve the parameters.

OUTPUT:
There are two conditions asked to solve in the question.
Condition-1: when Water Supply is OFF.
Condition-2: when Water Supply is ON.
We should not provide water supply and check for output.
From the above diagram, we can see that indicator showing Green i.e., When there is no water supply the process is terminated and LED indicator is used to indicate that state.

We should provide water supply and check for output.
From the above diagram, we can see that indicator showing Orange i.e., When there is water supply the process is completed and LED indicator is used to indicate that state.

CONCLUSION:
We can conclude that we simulate the washing machine control logic with the help of stateflow and got satisfactory results.
STUDY 2:
- AIM: -
Make a Simulink chart for the “Gear shift” logic with given condition
- OBJECTIVE: -
Make a Simulink chart for the “Gear shift” logic as per below conditions:

Give speed input while the simulation is running & display the gear number.
BLOCK DIAGRAM OF MODEL:

In the above model we used slider gain block for variable speed and connect to control logic stateflow block. Display block is connected to control logic to see which gear is running and also used lamp for better graphical presentation to user.
CHART DETAILS:

As per given condition for gear shifting, we created stateflow diagram with help transition to give condition with respect to speed.
INPUT AND OUTPUT PARAMETERS:

Here we give Speed as an Input for the chart.
Here we give Speed as an Output for the chart.
SIMULATION TIME PARAMETERS:

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

OUTPUT:
The Output produced is recorded when it's displaying each gear.
Gear-1:
Speed range: 0 to 15kmph.
Input speed: 10kmph.
Color: Light Blue.

Gear-2:
Speed range: 16 to 25kmph.
Input speed: 20kmph.
Color: Orange.

Gear-3:
Speed range: 26 to 40kmph.
Input speed: 30kmph.
Color: Pink.

Gear-4:
Speed range: 41 to 60kmph.
Input speed: 50kmph.
Color: Blue.

Gear-5:
Speed range: above 60kmph.
Input speed: 70kmph.
Color: Red.

CONCLUSION:
Created a State Flow for Gear Shift using Simulink and the results are satisfactory.