Challenge

Week - 4

IMPLEMENTING CONTROL LOGIC OF "WASHING MACHINE" USING STATEFLOW AS PER BELOW MENTIONED SITUATIONS:-

  1. If power supply is available, system gets activated.
  2. If watersupply is not available, stop the process & indicate through LED.
  3. Soaking time should be 200sec followed by washing time of 100sec.
  4. rinsing happens for next 20sec & dryer runs for 50sec.

After all the processes have completed turn on the finished LED.

BLOCKS USED:-

1)Chart

2)Display

3)Constant

4)Lamp

5)Rocker Switch

CHART:-

In event driven system, the system responds to an event by making a transition from one state to another.This transition occurs if the condition defining the change is true.

DISPLAY:-

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

CONSTANT:-

The Constant block generates a real or complex fixed value signal. For getting constant valued signal we can use this block.

LAMP:-

The LAMP blocks gives us colour indication based on the value of the input signal.

ROCKER SWITCH:-

The Rocker switch block toggles the value of the connected block parameter between two values during simulation.

IMPLEMENTED LOGIC BEHIND THIS MODEL:-

  • A Rocker switch from the dashboard library is used with a constant to supply the POWER & as WATER SUPPLY.
  • LED lamp is used to indicate the power status & water status.
  • The power status is checked at the entry for every state and the water supply is checked for the soaking and the rinsing process.
  • The time period for each state is as per the given conditions.
  • Lamp will indiacates the currently running process.

WASHING MACHINE LOGIC:-

In above logic chart you can see that FIRST STATE is created with 2 conditions:-

  • One is with Power Supply available(Powerswitch==1) and Second with water supply available(w==1).
  • If power supply is high i.e (logic 1) and water supply is high i.e (logic 1) then machine will get activated and starts its operation.
  • After machine gets started , next four washing operation states have been created in flow order i.e SOAKING, WASHING, RINSING,DRYING with there time of operation as 200sec for soaking, 100sec for washing, 20sec for rinsing & 50sec for dry.
  • Entry and exit condition of the state are kept as logic high i.e 1 and logic low i.e 0.
  • Each and every washing state is connected with a LED LAMP, and every state is having separate LED for indication.

SYMBOLS PANE:-

Symbol pane windows show all the unspecified symbols that are used in chart logic for various purpose.Here we need to specify the input and output values to various variables.

Above it is clearly mentioned various symbols used to perform various operations. Here powerswitch and water is an input values while all other like washing_state,s(soaking),wa(washing),r(rinsing),d(dryer),washing_completed all are output values.

ABOVE DIAGRAM SHOWS A STATE WHEN MACHINE IS IN OFF STATE.

ABOVE DIAGRAM IS SHOWING A STATE OF MACHINE, WHEN WASHING IS COMPLETED.

IMPLEMENTATION OF CONTROL LOGIC FOR GEAR SHIFT USING STATEFLOW PROCESS:-

We have to design control logic for shifting gear in such a way that gear should changed based on speed of vehicle. For more clarification, if speed reduces due to traffic condition then gear should automatically goes down value and if speed increases the gear should automatically goes upward.

BLOCKS USED:-

  1. Chart
  2. Display
  3. Constant
  4. Lamp
  5. Rocker Switch
  6. Slides

CHART:-

In event driven system, the system responds to an event by making a transition from one state to another.This transition occurs if the condition defining the change is true.

DISPLAY:-

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

CONSTANT:-

The Constant block generates a real or complex fixed value signal. For getting constant valued signal we can use this block.

LAMP:-

The LAMP blocks gives us colour indication based on the value of the input signal.

ROCKER SWITCH:-

The Rocker switch block toggles the value of the connected block parameter between two values during simulation.

SLIDES:-

By the Slides Block you can change the value of any parameter during simulation time.You can change the value of range of the slides block so as to fit our data in that range.

LOGIC EXPLANATION:-

We are going to vary the speed from (0-100)kmph and the slides is used to send the input speed.The 1st gear has speed value from 0 to 15, so the entry condition for the first gear is 0<=speed & speed<=15 and the exit condition is when the speed greater than 15.

Similarly for 2nd gear, the entry condition is 16<=speed & speed<=25 the exit condition is when speed <16 & speed>25 .In the same way for each gear, the entry & the exit condition are specified and the output for each condition is mapped with lamp for indication.

GEAR SHIFTING LOGIC:-

In the above Control logic,First Engine is started from switch E=0/1 Through Rocker switch which is power Switch to start engine.Then next gear shifting logic is implemented.

Five Gear State is created with state condition of Gear(G) 1,2,3,4 and 5 respectively and their transition is linked through changing speed , as shown below

The state transition system for gear is decided as shown below, when the speed is increasing from 0-60kmph

Speed>15 shift to G=2

Speed>25 shift to G=3

Speed>40 shift to G=4

Speed>60 shift to G=5

Similarly in reverse direction, when speed is decreasing from 60-0 kmph

Speed<60 shift to G=4

Speed<40 shift to G=3

Speed<25 shift to G=2

Speed<15 shift to G=1

While Simulating Gear_Shift_logic, Engine[E==1] condition given with various speed change values.

SYMBOLS PANE:-

From the above variables,"E" and "speed" variables are are INPUT VALUES while all others are like 'powerswitch','gear_first','gear_second','gear_third','gear_fourth','gear_fifth' are OUTPUT VALUES.

SIMULINK MODEL AT VARIOUS SPEEDS:-

Above model is showing a state of engine when ENGINE IS IN TURNED OFF condition.

Above model is showing the state of various LED LIGHTS when we set throttle valve at 70. When throttle is fixed at 70 then power switch is 'ON' and 'Gear_Fifth is in ON' Condition.

Above model is showing the state of gear shifting mechanism when throttle value is set at 20.

At 20 throttle value power switch is 'ON' and Gear_second LAMP is also blinks.

CONCLUSION:-

So by using CHART BLOCKS we have performed the simulation of washing states of washing machine and gear shifting mechanism. We implement our logic using state-flow diagram.

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.