Challenge

Week - 4

Challenge1

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

What is washing machine and how its work?

Washing machine is the machine used to wash the various types of clothes without applying any physical efforts. With washing machine you don’t have to rub the clothes with hand or squeeze them to remove the water from them. The washing machine is also called as clothes washer or simply the washer. The washing machine enables you to wash your clothes automatically without having to supervise its operation. All you have to do is put the clothes in the machine and select the wash mode. The washing machine automatically takes in the amount of water and detergent required and it also automatically sets the timer for washing, rinsing and drying as per the selected mode and the amount of clothes.

what is stateflow in matlab?

Stateflow is control logic tool used to model ractive system via state machine and flow charts within simulink model.

control logic of washing machine in simulink-

explanation of this similunk model

we use two toggle switchs to get input as we want, one for water input and rest one for power input. we used LEDs and connect with block to see results and we create a simple stateflow for control logic of washing machine and then we connected this chart with scope to get and see output or results.

stateflow of washing machine

we take seven blocks power, water, soak,wash,rinse, dry and finish. Time delay are used as per given in the challenge( soaking for 200sec, washing for 100sec, rinse for 20 sec, dry for 50 sec)

when the power supply & water input both are active only then washing machine complete its process to the end , but eitheir one of them or both of them are inactive then washing machine does'nt work.

we have to fullfil four condition-

  1. power & water supply is 0.Output is 0
  2. power is 1 & water is 0, output is 0
  3. power is 0 & water is 1, output is 0

there is no machine operation and output is same for all three condition above ,

  • when power & water supply is 1, output is 1

only for this condition machine operate fully.

OBSERVATIONS-

when both power and water supply is 1 then the machine work properly.

OUTPUT- for power and water supply is provided.

CASE2- When one of themor both of them is inactive then machine will not work-

output for this

CONCLUSION- we observe that machine work accordingly power input and water supply and LEDs shows that wheather machine working or not by changing ligt green to red or red to green.

CHALLENGE2

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.

simulink model for "Gear shift"

Stateflow of Gear shift

Explanation-

In this model we use constant to give input to slider gain and slider gain give the speed range to the stateflow and then dispaly show the gear no according to speed

RESULTS-

when our speed is less than or equal to 15 then gear shifts on Gear 1-

when our speed is between 15-25 then it shifts on Gear2-

when our speed is btw 25-40 its shifts on Gear3-

When our speed is btw 40-60 then it shifts on Gear 4-

when our speed is above 60 then it shifts on Gear5-

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.