Challenge

Week - 4

Aim 1:

Implementation of control logic chart for washing machine using stateflow process.

Condition:

  • If the power supply is available, the system gets deactivated
  • If the water supply is not available, stop the process and indicate through LED
  • Soaking time should be 200s followed by washing time of 100s
  • Then rinsing happens for next 20s and dryer runs for 50s

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

Procedure:

  • Start the Simulink and create a blank model
  • Search for chart block in the stateflow category of library browser
  • Open the chart block and select the junction feature from the stateflow window
  • Control logic for washing machine is such that is should soak the water for the first 200s followed by drying time in 50s
  • After finishing the control logic run the stateflow and check the sequence of the operation for 370s

Lamp color indication:

Rocker Switch:

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

Logic explanation:

The rocker switch from the dashboard library is used with a constant to supply the power and as water supply. A lamp is used to indicate the power status and 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 timing for each state is as per the given inputs. The status of the running process can be seen by the glowing lamp corresponding to the process name.

Washing machine logic:

In the above control logic first state is created with 2 conditions for power supply. One is with power supply available (PowerSwitch==1) and second with water supply available(W==1). If the power supply at the entry is 1 and water supply is on, then machine will get activated and start the next process of the operation. Next 4 operation states have been created in flow order soaking, washing, rinsing, drying with their time of operation as 200s for a soak, 100s for wash 20s for rinse and 50sec for dry. Entry and exit condition of the state are kept as 0 and i.e., at entry of operation states it is 0 and as operation completes it is 1 for every state. After all process has done washing machine completed LED will glow and we can shut the machine off.

Symbol pane:

Here, powerswitch and W (water supply) is as input given while all other like washing_state, D(dryer), Wa(washing), S(soaking), R(rinsing), washing_completed are all output given.

Complete Simulink model:

Here all LED glows as green means all process has been completed and all display output as 1.

Here in the Simulink model, showing that the washing process is completed and rinsing is going on. Here red light means operation is not completed and green LED shows operation is completed which is also check from display box as output 1.

Aim 2:

Make a Simulink chart for the “Gear shift” logic

Condition:

Speed range (kmph) gear

  • Gear 1 (0 to 15)
  • Gear 2 (16 to 25)
  • Gear 3 (26 to 40)
  • Gear 4 (41 to 60)
  • Gear 5 (Above 61)

Process:

Start Simulink and create a blank model. Search for chart block in the stateflow category of library browser. Open the chart block and select the various features from the stateflow window. Control logic for gear shift is such that it should change the gear when the speed increases of decreases automatically. After finishing the control logic run the stateflow and check the gear shift operation for an infinite time.

Logic explanation:

The speed ranges from 0 to 100 and the slider is used to send the input. The first gear has speed input values from 0 to 15 so the entry condition for the first gear is 0< speed and speed<15 and the exit condition is when the speed greater than 15.

Similarly for 2nd gear the entry condition is 16<speed and speed<25 and exit the condition is when speed<16 and speed>25. In the same way for each gear, the entry and the exit condition are specified and the out is mapped to the lamp and the display block.

Logic:

Symbol Panel:

At speed 70 kmph:

At 72 kmph which is above 61kmph gear 5 is implemented and Gear 5th LED glows and displays output as 1.

At speed=20kmph

The gear 2 gets activated since it is above 15 kmph and the display shows 1.

At speed<15kmph

The gear 1 gets activated since the speed is less than 15kmph and the display related to it shows 1.

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.