Project

Programming of Fully Automated Washing Machine using Simulink Model and StateFlow Control Logic

AIM: To Implement control logic of “washing machine” using stateflow.

THEORY:

StateFlow - StateFlow provide the graphical language that includes state transition diagram ,flow chart,state transition table & truth tables. it is used to decribe how MATLAB algorithms and Simulink model react to input signals, events and tame based condition.State flow allows you to design and develop supervisory control, task, scheduling, fault management, communication protocols, user interface & hybrid system. With StateFlow, you model combinatorial & seuential decision logic that can be simulated as a block within a Simulink model or executed as an object in MATLAB. Graphical animation enable you to analyse and Debug your logic while executing. edit time and run time check & ensure design consistency and completeness before implemenation.

Control Logic - Control logic is the key part of a Software program that control the operation of program. the control logic repond to the commands from the user & it also acts on its own to perform automated Task that have been structured in program. Controlled Logic can be modelled using a state diagram, which is a form of hierarchical state machine.

OBJECTIVE:

  1. Implement control logic of a “Washing Machine” using Stateflow as per given Sequence:
  2. If the power supply is available, the system get a active
  3. If the water supply is not available, stop the process and indicate through LED
  4. Soaking time should be 200s followed by washing time of 100s.
  5. Then rinsing happens for next 20s & dryer runs for 50s.

BLOCKs USED:

1. Constant Block- For Power and Water supply.

2. Switch Block - to determine output.

3. Lamp Block- to indicate the running Signal.

4. Chart Block- to create control logic program.

5. Display Block - to display the output of state.

OPERATIONS PERFORMED:

1. Soaking - 200,sec (0-200 sec).

2. Washing - 100,sec (200-300 sec).

3. Rinsing - 20 sec (300-320 sec).

4. Drying - 50 sec (320-370 sec).

5.Power OFF - After Drying (>370 sec).

WASHING MACHINE:

A Washing machine (laundry machine, cloth washer, or washer) is a home appliance used to wash laundry. The term is mostly applied to machine that use water as opposed to dry cleaning or ultrasonic cleaners. The user adds laundry detergent, which is solid in liquid or powder form, to the wash water.

Washing machine are generally of 2 categories as follows -

1. Semi-Automatic washing machine -

the Semi-Automatic is needed for your assistance to get th job done & you will have to pour the water manually and need to set up the timer.

2.Fully-Automatic washing machine -

The Fully Automatic machine are more convenient & offer a great range of functionality. we get fully automatic functions that carry out the washing without any manual interference. They are little bit budget friendly.

SIMULINK MODEL :-

MAIN SYSTEM,

SUBSYTEM,

STATEFLOW MODEL,

EXPLANATION:

  1. First, we have created a chart using “CHART BLOCK” to define the logic of the washing machine.
  2. The First state is “Power” state; this is where the program checks weather the power is ON/OFF. If the Power is ON the process will go to next state or else it will not go further. Here we have defined the variable “P” as it will help us to indicate whether this particular state is going ON or OFF.(in our case we have gave the equation as { exit P = 1} means if the ON{1} Power will pass on to next state & if P = 0 the power is OFF and it will not pass on to next state.)
  3. Next we have “Water” state; where water will be filled, and similar to that of power state we have defined variable “W” which will help us to see whether is being filled or not. The process between “” and “” is defined as if power is equal to 1 which means if power is ON then only it water state will start , and power equal to 0 is refer as power OFF then it will remain the power state only.
  4. Now next state is “Soak State”, this is where the cloths are Soaked once the water is filled. Here we have defined inside this state that when it enter the state the value of variable “S” will be 1 which means that this state is going ON. Once this state is over the process exit by value ”S = 0” which means now the state is not going On.
  5. Now next is the “Wash State” this is where the cloth are washed, here as per conditions mentioned above after 200s of soaking the washing state takes place. This condition is mention between “Soak State” and “Wash State”.
  6. Then, “Risen State” take place where all the water is drained out, here when the state is in this state it will indicate “R=1” once this state is over it will indicate “R=0” and it will move next state. Process between “Wash State” & “Rinse State” id defined as per the condition mentioned above.
  7. Next state is the “Dry State” where the clothes are dried inside the machine. Similar condition is defined in the state as like previous states, and the process is defined as per the conditions given the objectives.
  8. The final state is “Finish State”, this where the process ends and the power needs to be switched off manually. Here also similar condition is mention.
  9. Now once the Machine Logic is created we have defined the variable entered as output variable and power and water as inputs as these has to be provided to the machine in real time.
  10. To give power and water as input we have use “Slider Switch Block” and “Constant Block” is used. Each Slider switch is connected to the chart block where the washing machine program is defined.
  11. If the slider switch is OFF the value in constant block is “0”which indicate there is no water supply or power supply. By this way we have defined the inputs. And for the outputs we have connected each one with each “Display Block”.
  12. These display block are then connected to “Lamp Block” which will turn Green when particular state is going and it will be red if that particular state is not going on.
  13. To set conditions for lamp block, double click on it set the condition as shown, click on the connection on which you want your Lamp to lit.
  14. Now if u run the model we will see Lamp turning into Green and Red when the particular state is going ON and OFF.

CONDITION I - BOTH WATER AND POWER SUPPLY:-

In this process both power and water supply are provided.

As both the supply are provided so the system gets activated.

SOAKING STATE,

As the system gets activated tha soaking process starts which is been continued till 200 sec.

WASHING STATE,

After 200 sec the washing process get initiated which is being continued till 300 sec.

RINSING STATE,

After 300 sec the rinsing process get initiated which is being contined till 320 sec.

DRYING STATE,

After 320 sec the drying process get initiated which is being continued till 370 sec. And once the rinsing stage is crossed the water supply is cut off because for drying it's not required.

FINISH STATE,

After all the process are completed the washing machine will not take any more water or power to wash the cloths until the user unload the wsshed cloths and load the cloths to be washed. so the finish lamp indicate that the washing cycle is complete.

RESULTS :-

The machine ran successfully by completeing all the process so that the cloths are ready to drying under sun.

CONDITION II - NO WATER SUPPLY :-

In this process only power supply is provided and the water supply is turned OFF.

As the water supply is turned OFF the washing machine didn't start the process cycle. only the power supply lamp is blinking.

CONDITION III - NO POWER AND WATER SUPPLY :-

In this process bothe water and power supply is turned OFF.

CONCLUSIONS:

  1. Thus, all objectives were achieved successfully.
  2. Similar concepts and approach can be adopt to create state flow for other systems
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.