Week - 4
1. 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
Answer:
>Flowchart been driven and attached below
> Double click chart block and the new set been open, in that form the flowchart with given sets.
>Take state set and form flowchart.
> First connect the set for power supply and connect another state set parallel to power supply, and give the condition as (1,-1) for on and off.
> The same procedure to followed for water supply.
> Create a state set for soaking with time interval of 200second and similar steps to be followed for washing, rinsing and dryer with respective time interval given.
> Soaking - 200 second, washing - 100 second , rinsing - 20 second, dryer - 50 second.
> Using symbols pane mark the power supply and water flow as input.
> and the other sets like soaking, washing, rinsing, dryer are marked as output
> The output been show in display block which of the condition is true.
> Lamp block is used to display the colour for the output.
> For soaking time is 200 second, then output is going to be

> Washing time is 100 second, then output will be

> rinsing happens for next 20 second, then output will be

> dryer runs for 50 second, then output will be,

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
Answer:
> In simulink search for chart block and double it new page will be open, in that new page asign a flowchart for gear shift.
> Take 6 satate set and named it as gear.
> while connecting each set need to set the speed range at each gear set.
> If the speed is (in between 0 to 15) 12, the output is in gear 1 condition, if it is in gear 1 then the condition is true.
> Like this we have prove for each speed range as given above.
> By using repeating signal we can asign a values to check weather the condition is true or not.
Repeating Signal:

Scope:
The output has been shown in the graph form.