Challenge

Week - 4

AIM :-1. To implement a control logic of a ''Washing machine'' using Stateflow as per the 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 the next 20s & dryer runs for 50s.
  • After all the processes have completed turn on the finished LED.

2. Make a simulink chart for the ''Gear shift'' logic as per the below conditions.

Speed Range(km/h) 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.

EXPLANATION:-

  • State flow:- Stateflow provides a graphical language that includes state transition diagrams, flowcharts, state transition tables. by using state flow to describe how Matlab algorithms and simulink modes react to input sgnals, events and time-based conditions.
  • control logic:- control logic is a model system logic of a washing machine using state flow.

MODEL 1:- Explanation for control logic of a ''washing machine'' using state flow

WASHING MACHINE:- It is a machine which is capable of handling various tasks like soaking, washing, rinsing,drying within a short period of time. All the task performed by machine is based on the centrifugation. It is a separation process that used centrifugal force to promote accelerated settling of the partile in the solid or liquid mixture.

In other words, a washing machine is a machine that washes dirty clothes. It contains a barrel into which the clothes are placed . This barrel is filled with water and then rotates very quickly to make the water remove the dirt from the cloths. These can help make the clothes cleaner.

STATEFLOW:

SYMBOL PANE:

Blocks Used:

1. Slider Switch,

2. Constant,

3. Chart,

4. Display,

5. Lamp.

Discription:-

1. Power and Switch inputs were controlled by the switch block. These two inputs were directed to the chart block.

2. State blocks were used inside charts to create a stateflow according to the given criteria.

3. The POWER input is get as input in the chart and directed to the POWER state from there, if Power==1(which is power supply in ON), it is directed to the next WATER block . or if power==0(Power supply is OFF), it directed to the junction.

4. Next state is WATER and from that if Water==1(Water supply is ON)it moves to the next stage or if Water==0(Water supply is OFF) then it is directed to the junction.

5. Next to water is SOAKING state, entry is given as 0, while exit is LED is made to glow which is connected to this state.

6. After 200 sec, it is directed to Washing state , and after 100 sec it is directed to Rinsing state and after 20sec, to Drying state and after 50sec, it is ended to End state.

2. Make a simulink chart for the ''Gear shift''

Given Data,

Speed Range(kmph) Gear

0 to 15 1

16 to 25 2

26 to 40 3

41 to 60 4

Above 61 5

Model:-

Chart:-

Symbol pane:-

Speed as input and G1,G2,G3,G4 and G5 are outputs.

Blocks used

1. Slider

2. Constant

3. Chart

4. Display

5. Lamp

Blocks used in chart

1. State

Discription:-

1. Using the Slider block the inputs are varied by the user during the run-time and it is connected to the Constant block.

2. This varying input values were given to the chart from constant blocks.

3. State blocks were used inside the chart to get a conditioned state flow.

4. First the input values are generated to the GEAR_SHIFT block, from there according to the condition, Gear>0 it proceeds to the next state if not like Gear==0 it ends the flow to a junction.

5. If Gear>0 it moves to the GEAR1 state and when the input values crosses 15, it moves to the next state. Like if Gear>15 it moves to the next state or it will be back to the first state.

6. If Gear>15 it moves to the GEAR2 state and if Gear>25 it moves to the GEAR3 state.

7. If Gear>40 it moves to the GEAR4 state and if Gear>60 it moves to the GEAR5 state . And a Lamp is connected with the each gear output. while entering the state the glows and while exiting the state the lamp goes OFF.

8. Stop time is given as inf as simulation goes on until the user pauses or ends the simulation.

Gear1:-

Lamp parameters:-

Results and Conclusion:-

A control logic of a ''washing machine'' using stateflow for the given sequence is implemented and a simulink chart for the ''Gear shift'' logic for the given conditions is made.

Your portfolio, next

Ship work like this
in your own course.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.