Challenge

Week - 4

Aim :- To implement control logic behind the 'Washing Machine and Gear Shift Mechanism' using Stateflow.

* StateFlow Control Logic Washing Machine *

Objective :- 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.

Theory :-

Stateflow :- We can use Simulink based states to model a periodic or continuous dynamic system combined with switching logic

that uses transitions. We can also access inputs and outputs from your chart within each Simulink based state.

Control Logic :- Control logic is the part of a controller that defines how a reactive system responds to events or conditional changes.

Washing Machine,

Parts Of The Washing Machine :-

An inner drum :- This is where we put the clothes when we are ready to wash. we’ll notice this drum rotates a bit when we

touch it and there are a lot of holes punched into the drum. These allow the water to come in and wash the clothes.

Paddles :- These are ridges that lie on the edge of the drum and help move your clothes around while being washed.

Agitator :- These are more common in top load machines and is a paddle in the middle that helps turn the clothes around in

the soapy water.

The outer drum :- This is not obvious when you look inside the washer, but there is another drum that holds the water while

the inner drum or agitator rotates. This part is completely water tight to prevent our machine from leaking all over the bathroom or

kitchen.

Thermostat and heating element :- These control the temperature of the water and heats up the water to the specified

temperature.

Pump :- This removes the water from the drum after the wash.

Programmer :- This controls the washing machine through all the steps from washing to rinsing and spin drying.

Pipes and valves :- These allow the water in and out of the washer.

Working :-

The working of a washing machine is simpler than we thought. First of all, we need to consider the overall load of clothes. In

accordance with the load, we need to select water levels, the temperature of the water, wash/rinse cycle and its timings. In

addition, we need to decide agitating levels according to the types of clothes such as soft cloths or heavy cloths.

After selection, the washing machine automatically fills up the water to the desired level. Then, it starts rotating the clothes by using

an agitator. After some time, it drains the water and refills the drum with fresh water in order to remove all the soap. It starts

rotating again and drains the water after some time.

Furthermore, the next phase is the spinning of clothes in order to remove all water. In this phase, the whole drum rotates in a

circular motion and removes all the water, making them dry. Although these clothes may not be completely dry, we need to air dry

them for routine use.

Explanation :-

To create control logic using statefllow first we need to add chart block in the blank model of simulink.

Open the chart block by duoble clicking on it and add state block in it,First create two state block for the water supply and power

supply.

Connect both of them with the junction to terminate the signal flow.

For the ON condition of the washing machine it shows 1 value.

For the OFF conditiion of the washing machine it shows 0 value.

When the given condition gets satisfied it gets carry forwarded otherwise result get terminated.

Then taking our remaining conditions whiich is soaking,washing,rinsing,dryer with their respective time between them to process.

Simullink Stateflow Model :-

Inside The Chart Block,

Washing Machine Control Logic,

In the above image model is currently at OFF state.

Output :-

Condition || When Power Supply is ON , and Water Supply is OFF.

Condition || When Power Supply is ON , and Water Supply is ON.

Condition || When Power Supply is ON , and Water Supply is ON , Soaking is ON , t = 10 sec.

Condition || When Power Supply is ON , and Water Supply is ON , Washing is ON , t = 230 sec.

Condition || When Power Supply is ON , and Water Supply is ON , Rinsing is ON , t = 330 sec.

Condition || When Power Supply is ON , and Water Supply is ON , Dryer is ON , t = 350 sec.

Condition || When Power Supply is ON , and Water Supply is ON. End , t = 450 sec.

Output of the Washing Machine Control Logic Using Scope :-

* StateFlow Control Logic Gear Shift *

Objective :- To make a control logic behind the Gear shift,Using given conditions.

Speed Range (Km / hr) Gear
0 to 15 1
15 to 25 2
25 to 40 3
40 to 60 4
Above 61 5

Theory :-

Gear Shift : It is a mechanism by which the transmission gears in a power-transmission system are engaged and disengaged.

Gears are used for transmitting power from one part of a machine to another. In a bicycle, for example, it's gears (with the help of a

chain) that take power from the pedals to the back wheel. Similarly, in a car, gears transmit power from the crankshaft (the rotating

axle that takes power from the engine) to the driveshaft running under the car that ultimately powers the wheels.

You can have any number of gears connected together and they can be in different shapes and sizes.

Each time you pass power from one gear wheel to another, you can do one of three things,

Increase speed: If you connect two gears together and the first one has more teeth than the second one (generally that means it's

a bigger-sized wheel), the second one has to turn round much faster to keep up. So this arrangement means the second wheel turns

faster than the first one but with less force.

Increase force: If the second wheel in a pair of gears has more teeth than the first one (that is, if it's a larger wheel), it turns

slower than the first one but with more force.

Change direction: When two gears mesh together, the second one always turns in the opposite direction. So if the first one turns

clockwise, the second one must turn counterclockwise. You can also use specially shaped gears to make the power of a machine

turn through an angle. In a car, for example, the differential (a gearbox in the middle of the rear axle of a rear-wheel drive car) uses

a cone-shaped bevel gear to turn the driveshaft's power through 90 degrees and turn the back wheels.

Gear Shift Control Logic Using Stateflow :-

Gear Shift Control Logic Using Stateflow(Inside Chart Box) :-

Explanation :-

To draw a actual control logic behind the Gear Shift with respect to the Speed,here we use chart box and inside that we decide how

the gear will shift with respect to speed.

First we open the chart box and added the state block in that.First we add ignition state which will be the starting part of our

control logic.

After adding ignition state we added Neutral state which is zero state, or the state at which our ignition is ON but there isn't any

speed or torque provided to the vehicle gear box.

Between the two states we set the conditions using square brackets which will be executed each time when we run our model.

Here we use Toggle Switch to turn on the Ignition and also a Lamp which shows ON and OFF state.

We use two constant blocks first block is connected to the ignition switch which is toggle switch and another one is connected to

the gain where we can vary our speed whichever we want.

For the output purpose we use scope as well as display.Scope will show the output in the form of graphical representation and

display will show the current Gear Number.

Output : Ignition = ON , Gear = Neutral, Speed = 0

Graph,

Output : Ignition = ON , Gear = Gear 1 , Speed = Less Than 15

Graph,

Output : Ignition = ON , Gear = Gear 2 , Speed = Less Than 25

Output : Ignition = ON , Gear = Gear 3 , Speed = Less Than 40

Output : Ignition = ON , Gear = Gear 4 , Speed = Less Than 60

Output : Ignition = ON , Gear = Gear 5 , Speed = Above 61

Graph Output,

Conclusion,

From the given challenge I able to learn how things work in the sequence with respect to the Washing Machine and Gear Shift,

and most important how we can use stateflow to visualize the change in the model output in real time.

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.