Challenge

Week - 4

Question 01:-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:-

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

Simulink chart :- According to question chart for Washing Machine logic.

in above chart According to question stateflow logic are use.

Soaking time= 200s use and entry time s=1 use for Soaking lamp on after 200s s=0 its off.

Washing time =100s use and entry time wt=1 use for washing lamp on after 100s wt=0 its off.

Rinsing time=20s use and entry time r=1 use for washing lamp on after 20s r=0 its off.

Dryer time=50s use and entry time d=1 use for washing lamp on after 50s d=0 its off.

Input And Output in Chart:-

In below table show input and output. where "p" and "w" is input.

"pled", "wled", "s", "wt", "r", "d", "fi" is output.

Simulation Model:-

Switch:- In above simulation model 2 switch uses. one switch for supply power on and off. other switch for water supply on and off.

Indication Lamp:- in above simulation there are 3 main lamp use

Power lamp show power present or not. If green its mean power ON condition.

if show like this its means that no power is available.

  • When Power is OFF, Water check condition :-

In above condition power is off the process of water check not done and finish lamp also show red with water lamp red.

it means that at NO Power no further process will happen.

  • When Power is ON, Water is Available:-

After the power is available Water lamp logic check.

Water lamp show green its means that water is ON.then whole process is completed finish lamp show green. below the lamp indication when all process completed.

  • When Power is ON, Water is not Available:-

In that condition first power is ON, water is off red led indicate the water is not present. so process also not finish show Finish lamp also show red light.

  • When Power is ON, Water is Available:-

In this condition First Power lamp is green then after water lamp green.

After this

Soaking time start for 200sec and Soaking lamp ON for 200sec after that its off.

Washing time for start 100sec and Washing lamp ON for 100sec after that its off.

Rinsing time for start 20sec and Rinsing lamp ON for 20sec after that its off.

Dryer time for start 50sec and Soaking lamp ON for 50sec after that its off.

After Dryer time complete the Finish Lamp light turn from Red to Green its means that Process of Washing machine is completely Sucessfully.

  • When Power is OFF any process, Water is Available:-

When power is off at any process is working process is goes to Stop1 and indication show like below.

  • When Power is ON, Water is not Available at soaking and washing state :-

When Power is ON, Water is not Available at soaking and washing state process will stop and show below indication on lamp.

Output:-

when power On and water is present:- the below scope show values

when power On and water is not present:- the below scope show values

when power Off and water is present:- the below scope show values

Question 02:- 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:-

AIM:- Creat 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 chart :- According to question chart for Gear Shift logic.

in above chart State flow condition according to below table

Speed Range(kmph) Gear

FirstGear 0 to 15 1

SecondGear 16 to 25 2

ThirdGear 26 to 40 3

FourtGear 41 to 60 4

FifthGear Above 61 5

Simulation Model:-

According to question Display use from Dashboard for show output value of gear no. Edit box also use for provide value of speed during Simulation is running.

Run Time:- In this condition use inf time value for edit the value speed and check the gear no.

Result:- When provide value in edit running speed box according this show Running Gear no. Display show value of current gear.

Scope show value according running gear output situation.

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.