Challenge

Week - 4

Problem 1:

Conditions:

  1. Implement control logic of a “washing machine” using Stateflow as per given sequence:
  • 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

After all the processes have completed turn on the finished LED

Solution:

Step1: Create a chart block for defining the state flow as per the given condition (Power and Water).

Step2: The circular junction was created to terminate the signal flow and return a null value for power and water.

Step3: If power is OFF 0, then no process run, otherwise If power is ON 1 then machine was run move to next condition.

Step4: If Water is OFF 0, then no process run, otherwise If Water is ON 1 then machine was run move to next condition.

Step5: Soaking condition going to ON, so the process going to run.

Step6: After 200 sec soaking finished then wash condition going to ON.

Step7: After 100 sec washing finished then rinse condition going to ON.

Step8: After 20 sec rinse finished then dry condition going to ON.

Step9: After 50 sec Dry finished then finish block going to ON and End the progress.

Step10: Define power and water as input data & soak, wash, rinse, dry, finish as output data.

Step11: Connect the chart block with constant blocks for power and water

Step12: Input switches connected to blocks are slider switch and a rocker switch respectively.

Step13: Connect lamps to observe the ON/OFF condition. (Green=1 and Red=0).

Step14: Scope block is connected to read the all washing process and obtain the output

Step15: Pink color in the lamp indicates that the process is complete.

Condition 1: Power OFF, Water OFF

Condition 2: Power ON, Water ON, Soak ON=200 sec

Condition 3: Power ON, Water ON, Wash ON=300 sec

Condition 4: Power ON, Water ON, Rinse ON=320 sec

Condition 5: Power ON, Water ON, Dry ON=370 sec

Condition 6: Power ON, Water ON, Finish=500 sec

Scope OUTPUT for each conditions

Problem 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.

Solution:

Step1: Create a chart block for defining the state flow as per the given condition (Gear and Speed).

Step2: The circular junction was created to terminate the signal flow and return a null value for Vehicle OFF.

Step3: If speed is less than or equal to 0, the flow is terminated and gear 0 is activated otherwise it was run move to next condition.

Step4: If speed is greater than 0 and less than or equal to 15, then gear 1 is activated.

Step5: If speed is greater than 15 and less than or equal to 25, then gear 2 is activated.

Step6: If speed is greater than 25 and less than or equal to 40, then gear 3 is activated.

Step7: If speed is greater than 40 and less than or equal to 60, then gear 4 is activated.

Step8: If speed is greater than 60, the flow is terminated and gear 5 is activated.

Step9: Define speed and ON as input data & Gear as output data.

Step10: Connect the chart block with constant blocks for ON and speed inputs.

Step11: Input switches connected to blocks are slider bar values (0 to 100) and a toggle switch respectively.

Step12: slider bar to adjust variable speeds respectively.

Step13: Scope block is connected to read the all Gear shifting level based on speed and display values shown the gear level.

Condition 1: Switch = ON, Speed = 10 kmph, Gear = 1.

Condition 2: Switch = ON, Speed = 25 kmph, Gear = 2.

Condition 3: Switch = ON, Speed = 40 kmph, Gear = 3.

Condition 4: Switch = ON, Speed = 60 kmph, Gear = 4.

Condition 4: Switch = ON, Speed = 80 kmph, Gear = 5.

Output Graph for each gear shifted levels

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.