Challenge

Week - 4

Answer-1

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

Theory-

In this model we use stateflow chart to create control logic for washing machine. We used two switches to operate power and water supply. Lamps are used to indicate power and water supply state which is green for on, red for off and blue for not completion of process i.e. soaking, washing or drying. The rocker switches are connected to constant block. Constant block is connected with control logic. All the processes are connected with display and display is connected with lamp to indicate the process of washing machine with respect to given time. After completion of all processes the process completion status light would appear green. We have run this simulation for 500 sec.

Simulink Model for Washing machine using Stateflow-

The simulink model file attached named as Washingmachinec.

Control logic-

  • If the Water supply is not available, stop the process & indicate through LED-

Result-All the conditions has been successfully fulfilled-

  • When power supply is available, the system is activated and indicates through green LED lamp.
  • If the Water supply is not available, stop the process & indicate through red LED lamp.
  • Soaking time is 200s followed by Washing time of 100s.
  • Then rinsing happens for next 20s & dryer runs for 50s.
  • After all the processes have completed the green finished LED turned on.

---------------------------------------------------------------------------------------------------------------------------------------------

Answer-2

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

Theory-

here we gave Speed as input by the help of a constant and a slider gain block to the control logic chart.

Gear1,Gear2,Gear3,Gear4,Gear5 as output from the control logic chart with the help of display block.

on which display the value 1 is showing then the vehicle is running on that gear number.

we have run this model for 70 seconds.

Simulink Model for the “Gear shift”-

speed=72 is given by the slider gain

Simulink model file attached name as gearp5week4.

Simulink chart for the “Gear shift” logic-

For Gear1-

Speed range= 0-15

Given speed=15

For Gear2-

Speed range= 16-25

Given speed=20

For Gear4-

Speed range= 41-60

Given speed=50

Results-

Made the 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

displayed the gear number as per the speed.

Conclusion:

Created a State Flow for Gear Shift using Simulink and the results found satisfactory.

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.