Week - 4
1.
The simulation diagram is shown as follows

Inputs to the chart
Electric supply status (ESS)
Time duration (T)
Water supply status (W)
Output
Status of the machine. LED
The ESS is verified with one at outside of the chart. So that the output of the logic is multiplied with time duration. The Time duration and W is given as inputs to the control logic of Washing machine.
The State flow diagram for the given conditions is shown below

The existing state chnaged to other state by following logic
1.Until 300 sec, Washing machine is in soaking mode.
2. T>300 and W==1, washing machine state changed to washing mode
The duration of washing is 100 sec so 400 sec is compared for next state i,e for rinsing
3. T>400 and W==1, washing machine state changed to rinsing mode
Rinsing duration is for 20 sec. T is compared with 420 sec
4. T>420 and W==1 , Washing machine state changed to drying
Dryer duration is 50 sec so T is compared with 470 sec
5. T>470 and W==1, washing machine stare changed to Finish state and enables LED=1.
In the complete process if W==0, i,e water supply status is zero then washing enters to finish state and enables LED=1.

The results are shown above fig. It is observed that at 300 sec, the water supply status is disable to zero so LED enables to one and shown green color.
2. The simulink model for given challange is shown in fig

As per given requirements of the challenge, speed is the input to chart and gear is the output
The performnace of the logic is verified with repeated sequence between 0 t0 70 kmph. and customized speeds with signal buider.
The state flow diagram for the given challenge is shown as follows

The signal flow is behaves as per the requirements
The states of the chart are first, second, three, four and five. The speed is verified as per the given conditions and changed the state form one to other.
in the existing state, the speed is verified with all given conditions, for changing gears.
The outputs to two type of inputs are shown as follows.

The speed is changed to 0 to 70 so the gear is changed according to the conditions. so the output is staircase.

The customized speeds are generated with signal builder. it stars from 26 kmph to 70 kmph. so the gears are changed according to the conditions. The speed is changed from 70 kmph to 10 kmph. so the gear is changed from 5th gear to 1st gear and changed as per speed.