Challenge

Week - 4

TASKS:

1) To implement the control logic of a" washing Machine" using stateflow in Simulink.

2) To make a Simulink chart for the "Gear Shift" Logic.

TASK -1:

AIM:

To implement the control logic of a "washing Machine" using stateflow in Simulink.

OBJECTIVE:


I. To implement the control logic of a washing machine using state flow as per given sequence:


a) If the power supply is available, the system gets activated.

b) If the Water supply is not available, stop the process & indicate through LED.

c) Soaking time should be 200s followed by Washing time of 100s.

d) Then rinsing happens for next 20s & dryer runs for 50s. After all the processes have completed turn on the finished LED.

PROCESS:

Implementation of control logic chart for Washing Machine using Stateflow
1.Start Simulink and create a blank model.

2.Search for chart block in the stateflow category of library browser.

3.Open the chart block and select the junction feature from the stateflow window.

4.Control logic for washing mac is such that it should soak the water for the first 200sec followed by washing time of 100sec. Rinsing the water for the next 20sec followed by drying time of 50sec.

5. After finishing the control logic run the STATEFLOW and check the sequence of operation for 370sec.

Blocks Used:


1. Chart
A finite state machine is a representation of an event-driven (reactive) system. In an event-driven system, the system responds to an event by making a transition from one state (mode) to another. This transition occurs if the condition defining the change is true.



2. Display
The Display block shows the value of the input data. You can specify the frequency of the display. For numeric input data, you can also specify the format of the display.

3. Constant
The Constant block generates a real or complex constant value signal. Use this block to provide a constant signal input

4. Lamp
The Lamp block displays a color indicating the value of the input signal. You can use the Lamp block with other Dashboard blocks to build an interactive dashboard of controls and indicators for your model. You can specify pairs of input values and colours to provide the information you want during the simulation.

5.Rocker switch

The Rocker Switch block toggles the value of the connected block parameter between two values during simulation. For example, you can connect the Rocker Switch block to a Switch block in your model and change its state during simulation.

WORKING PRINCIPLE OF A WASHING MACHINE:


A washing machine by spinning at 800-1600 rpm helps soap and dirt with it to leave the surface of the cloth via centrifugal force and into outlet pipes hence utilizing centrifugation to both clean and partially dry the clothes loaded in it. Thus, the processes are electrically controlled, such as the drum, valves, pump, motor and heating. The valve opens again and the dirty water drains out of the drums. The pump works to help get rid of the water. The valve lets clean water in again into the drums.

The four processes are:


SOAKING:
It is used to dip clothes in detergent water to remove dirt from the clothes. In this function customer need to select soak from a panel. Soak - This function is available with wash timer, in 42 min of washing 27 min is soak and 15 min machine will wash the clothes.


WASHING:
During the wash cycle, a large plastic agitator (green) turns around, moving your clothes through the water. When the wash is finished, the pump drains the water from the outer drum.


RINSING:
The dirty, soapy water is drained, then the washing machine is refilled and your clothes are "rewashed" in clean water. Spin: All the water is drained completely, then your clothes are spun very fast and excess water is removed thanks to centrifugal force.


DRYER:
They work by pushing warm dry air through your wet washing to extract moisture, then cooling the now humid air in a heat exchanger to condense the moisture, which is collected in a tank or pumped down the drain. The (now dry) air is reheated and the cycle repeats.

SIMULINK STATE FLOW MODEL:

CHART REPRESENTATION:

https://drive.google.com/file/d/1XRnLUOtyUO9A9vOjCQGlh1FgsxNzTpsi/view?usp=sharing

MODEL:

PARAMETERS:

We have given water, soak, washing, rinsing, dryer, cycle as Outputs of the chart. We have given our water supply & power supply as Inputs of the chart.


Simulation Time parameters:

We used 430 sec so that it can cover the whole cycle and sufficient time to store and solve the parameters.

OUTPUT RESULT:

There are two conditions to satisfactory of the stateflow model

1)When water supply is in OFF condition

The indicator of water is showing red i.e. when there is no water supply the process is terminated and LED indicator is used to indicate the state.

2) when the water supply is in ON condition.

The output of all the states have been executed and indicating the process completion showing the green colour indication.

CONCLUSION:

Hence from the Simulink stateflow model shows the implementation of a control logic in washing machine.

TASK-2

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


Give speed input while the simulation is running & display the gear number.

IMPLEMENTATION OF CONTROL LOGIC FOR GEAR SHIFT USING STATEFLOW PROCESS:

1.Start Simulink and create a blank model.


2. Search for CHART block in the stateflow category of library browser.

3. Open the chart block and select the various features from the stateflow window.


4.Control logic for gear shift is such that it should change the gear when the speed increases of decreases automatically. 5.After finishing the control logic run the stateflow and check the gear shift operation for an infinite time.

Blocks Used:


1. Chart
A finite state machine is a representation of an event-driven (reactive) system. In an event-driven system, the system responds to an event by making a transition from one state (mode) to another. This transition occurs if the condition defining the change is true.



2. Display
The Display block shows the value of the input data. You can specify the frequency of the display. For numeric input data, you can also specify the format of the display.

3. Constant
The Constant block generates a real or complex constant value signal. Use this block to provide a constant signal input

4. Lamp
The Lamp block displays a color indicating the value of the input signal. You can use the Lamp block with other Dashboard blocks to build an interactive dashboard of controls and indicators for your model. You can specify pairs of input values and colours to provide the information you want during the simulation.

BLOCK DIAGRAM MODEL:

https://drive.google.com/file/d/1bM8BT9VPsPaq24fO246oqLNNnHY3WgKv/view?usp=sharing

BLOCK PARAMETERS

INPUT:

we use a slider gain input to the flow chart

OUTPUT :

The Output produced is recorded when its displaying each gear.

Gear-1

Speed range: 0 to 15kmph.

Input speed:10kmph.

Color: Green.

GEAR-2

Speed range: 16 to 25kmph.

Input speed:20kmph.

Color: Blue

https://drive.google.com/file/d/1nAr1PVqOGhjUbIqbMSk8JrAk5STuvYJv/view?usp=sharing

GEAR-3

Speed range: 26 to 40kmph.

Input speed:30kmph.

Color: light Blue

GEAR-4

Speed range: 41 to 60kmph.

Input speed:50kmph.

Color: orange

GEAR-5

Speed range: Above 60kmph.

Input speed:80kmph.

Color: Red

OUTPUT

Hence created the stateflow of the Gear shift logic.

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.