Week - 4
Task-1
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.
Simulink Model:

Chart Diagram:

Parameters:

We have given power_supply & water_supply as the two input values to the chart. And, we have given water,soak,wash,rinse,dryer,cycle as the output values of the chart.
Simulation time parameter:

We have given the simulation time to be 400 secs ,so that it can cover all the steps & provide a desired output by solving all parameters.
Output:
Condition-1:When water supply is OFF.

From the above image, we can understand that the Red colour & 0 as the output value indicates that the water supply is not provided, in order, to start the washing process.
Condition-2:When Water supply is ON.

From the above image, we can observe green colour in the LED connected to the cycle parameter, which indicates that the washing process has been completed.
Task-2
Objective:
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.
Simulink Model:

Chart Diagram:

Parameters:

We have given the speed of the vehicle as an input value to the chart & gear as the output value of the chart.
Simulation time parameters:

We have considered the simulation time to be infinite, in order, to observe the gear shift when the throttle is given & speed changes.
Output:
Condition-1:When the speed is between 0 to 15kmph & the gear is 1.

Condition-2:When the speed is between 16 to 25kmph & the gear is 2.

Condition-3:When the speed is between 26 to 40kmph & the gear is 3.

Condition-4:When the speed is between 41 to 60kmph & the gear is 4.

Condition-5:When the speed is above 61kmph & the gear is 5.
