Challenge

Week - 4

Aim 1:

  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

Answer:

1. First we created chart and enter the given input conditions

  • 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 turn on the finished LED.

2. After that we have given the assign values to each block.

3. Then we have given the inputs values to turn on and off the power supply and water supply, by using consatnt blocks.

Conditions:

If input=1, then power and water supply is on.

and if input=0, then power and water supply is off.

4. Display block and lamp indicator is used to display the results.

Output:

Case 1: If Power source=0, power supply is not on in system and system will not start.

Case2: If Power source=1 and water supply=0, then power supply will turn on and there is no water available so system will not activated.

Case3: If Power source=1 and water supply=1, then power supply and water supply will turn on and system will be activated.

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

Explaination:

1. First we created a chart and enter the given conditions.

Speed Range(kmph) Gear

0 to 15 1

16 to 25 2

26 to 40 3

41 to 60 4

Above 61 5

2.After that we adding two blocks constant ansd slider gain.

3. In this we are giving 1 and 0 values to turn on and off .

4. In this we also using lamp indicator to know power is on or off.

5. We also using dislpay block to display the results.

Case1:

If key=0 then power will turn off and gear shifting mechanism will not activate.

Case2:

If key=1 then power will turn on and gear shifting mechanism will activate.

Case3: By varrying the speed in in slider gain, gear position will change according to given conditions.

Output will be

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.