Challenge

Week - 4

AIM:

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

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.

STUDY 1)To implement the control logic of a “washing machine” using Stateflow.

  • 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

MODEL:

The two constants are set as power supply and water supply and are connected by two switches.

They are further connected to the chart.

The outputs from the chart are connect to 7 seperate displays.

A lamp is connected to each of the displays and turn red/green if the given condition in the chart satisfies or not.

STATEFLOW:

The first state is the POWER state which checks the power supply is ONN/OFF . If its ONN it will move on to the next state.If its OFF it will move on to the PowerStatus state which indicates the power is OFF.

The next state is the WATER state.When the powersupply is on it will come to this state and check for watersupply.IF water supply is ONN then it will move on to the next state.If its OFF it willmove on to the WaterStatus state which indicate the power is OFF.

If WATER state is ONN then it will move on to SOAKING state.

After 200sec of soaking it will move on to WASH state.

The washing state continues for 100 sec and reaches rinsing state.

The clothes are then rinsed for 20 sec.

Then further move on to drying state where the cleaned cloths are dried in the DRY state for 50 sec.

And finally connected to finish state.

Output ports are made for the States are are connected from the charts to seperate displays.

Stop time is set as infinate.

Lamps are connected seperately to all the displays .

SYMBOLS:

POWER and WATER are given as input values.

S,WA,R,D,F are given as output values.

RESULTS:

Here LED light for power supply is green which means its ONN and system gets activated.The LED light for water supply is red which indicate its OFF.

Here both power supply and water supply is turned OFF, so both shows red light.

Here both power supply and water supply is turned ONN, every state shows green colour, so all processes are completed succesfully.

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

MODEL:

Here slider block is connected to the constant.the inputs are varied according to the userduring the run time.

The constand is the input and is connected to the chart block.

The output constains G1,G2,G3,G4,G5 respectively which are separately connected to each displays.

STATEFLOW:

First input values are generated to the GearShaft. from there is further moves to next state if Gear>0.if notGear==0 it ends the flow.

If Gear>0 it moves to Gear1 ie, the input value crosses 15,and moves to next stage.

likewise if Gear>15 it moves to Gear2 state and if Gear<15 it will go back to Gear1 state.

If Gear>25,it moves to Gear3 state and Gear>40 it moves to Gear4 state.

If Gear>60 , it moves to Gear5 state.

A lamp is cooected to each state .On reaching the specific state lamp glows while all others goes OFF.

Stop time is set as inf and slider is used by the user.

SYMBOLS:

Gear is the input.

G1,G2,G3,G4,G5 are outputs.

RESULTS:

FIRST GEAR

Here speed is more than 0 so Gear 1 is ONN.

SECOND GEAR

Here speed input is above 15,so first gear goes OFF and second Gear is ONN.

THIRD GEAR:

As speed increases more than 25,it shifts to Third gear.Second gear goes OFF and Third Gear is ONN.

FOURTH GEAR:

As speed increases more than 40,it shifts to Fourth gear.Third gear goes OFF and Fourth Gear is ONN.

FIFTH GEAR:

As speed increases more than 60,it shifts to Fifth gear.Fourth gear goes OFF and Fifth Gear is ONN.

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.