Challenge

Week - 4

Aim-to implement the control logic for washing machine and gear shift of automobile using stateflow in matlab&simulink

part1: Implementation of control logic chart for Washing Machine 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 junction feature from the stateflow window.

4.Control logic for washing m/c 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.

CONTROL LOGIC STRUCTURE

1.In the above control logic first jinction is created with 2 conditions for power supply .One is with power supply available(x>0)and second without power supply (x==0).If the power supply at entry is 1 or on the machine will get activated and start the next process of operation.

2.Nexst 2 power Supply State is created with 2 state one for if power on (PS=1) & another for power-off (PS=0)

3.After the power supply state next was to select the water supply.2 Water Supply State is created with 2 states one for it WATER SUPPLY ON (WS=1)applicable when (Y>0)& another for WATER SUPPLY OFF (WS=0)when (y==0).

4.Next 4 Operation srates have been created in flow order Soaking,Washing,Rinsing,Drying with their time of operation as 200sec for a soak,100sec for wash,20 sec for rinse & 50sec for dry.Entry and exit condition of the state are kept as 1 because of the continuous oeprations of the procesws of the Washing Machine.

5.After finishing all the sets of operation the power supply is changed to the state PS=0 which leeds to shut off the machine.

SYMBOL PANE:

Here,

x&y is input port

Dry PS RINSE,SOAK,WASH are output with an initial value of 0

FLOW CHART:

After event creations flow chart is generated using some block from their connections are done as memtioned below.

A Slider Switch is used from the Simulink dashboard category to switch on and off the power and water supply and connected with their inputs suppply of x and y respectively.

The DISPLAY block is connected with each output of the state of operation.

The LAMP block is dragged from the Simulink Dashboard category to respresents the LED for the various evoluation.

These Lamp blocks are connected to their respective outputs.

When the operation/process is ON it is representes by green colour indication in a lamp when the output is 1 and wise a versa for OFF is indicated by red colour.

LED COLOUR INDICATOR:

Part II : 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 browsert.

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

4.Control logic for geat 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.

CONTROL LOGIC STRUCTURE

1.IN the above control logic first the default transition is dragged from the menu.

2.Five Gear State is created with state condition of gear (G) 1,2,3,4and 5 respectively and their transition is connected with speed range condition as shown.

3.The transitions condition for the gear shift is decided as

Speed>15 shift to G=2

Speed>25 shift to G=3

Speed >40 shift to G=4

Speed>60 shift to G=5 when the speede is increasing from 0-60 kmph

similarly in reverse direction

Speed<60 shift to G=4

Speed<40 shift to G=3

Speed<25 shift to G=2

Speed<15 shift to G=1 when the speed is decreasing from 60-0 Kmph

SYMBOL PANEL:

Here speed is an input condition and G is an output condition

FLOWCHART PANEL:

After event creation flow chart is generated using some block from the library and their connections are done as mentioned below.

A Constant block is connected with Slider Gain block to provide initial input.

Slider Gain block is used to define the speed slider to change the speed during simulation is running and it acts as input for speed.

The output port (G) is connected with the display to indicate the current gear for the current speed in the slider gain.

RESULT :

When the run time is kept as an infinite and slider is made to slide for the speed of we can see the gear no (G) as 4.

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.