Challenge

Week - 4

AIM

(a) To implement control logic of a “washing machine” using Stateflow for the given sequence.

(b) To make a Simulink chart for the “Gear shift” logic for the given conditions.

GIVEN DATA

(a) To Implement a 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.

(b) 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.

DESCRIPTION

(a) To implement a control logic of a “washing machine” using Stateflow for the given sequence.

Given criteria

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

Model

Stateflow

Symbol pane

Power and Water are given as input data.

D,R,S,W and E are given as output data.

Blocks Used

  1. Slider Switch.
  2. Constant.
  3. Chart.
  4. Display.
  5. Lamp.

Blocks used inside Chart

  1. States are used in Chart.

Description

  1. Power and Switch inputs were controlled by the Switch block. These two inputs were directed to the Chart block.
  2. State blocks were used inside charts to create a stateflow according to the given criteria.
  3. The POWER input is get as input in the chart and directed to the POWER State from there, if Power==1(Which is power supply in ON), it is directed to the next WATER block. or if Power==0(Power supply is OFF), it directed to the junction.
  4. Next state is WATER and from that if Water==1(Water supply is ON) it moves to the next stage or if Water==0(Water supply is OFF) then it is directed to the junction.
  5. Next to water is SOAKING state, entry is given as 0, while exit is LED is made to glow which is connected to this state.
  6. After 200 sec, it is directed to Washing state, and after 100sec it is directed to Rinsing state and after 20sec, to Drying state and after 50sec, it is ended to End state.

If power supply is on, the system gets activated. If the Water supply is not available, stop the process & indicate through LED.

Power supply is given 1, and LED denoting power is glowing Green which shows the system is activated. and Water is off with help of Slider switch and the LED is denoting Red which indicates the off state of water supply.

When Water supply is given as 1(ON).

After all the processes have completed turn on the finished LED.

(b) Make a Simulink chart for the “Gear shift”

Given Data

Speed Range(kmph) Gear

0 to 15 1

16 to 25 2

26 to 40 3

41 to 60 4

Above 61 5

Model

Chart

Symbol pane

Gear as input and G1,G2,G3 and G4 are output.

Blocks used

  1. Slider
  2. Constant
  3. Chart
  4. Display
  5. Lamp

Blocks used in chart

  1. State

Description

  1. Using the Slider block the inputs are varied by the user during the run-time and it is connected to the Constant block.
  2. This varying input values were given to the chart from constant blocks.
  3. State blocks were used inside the chart to get a conditioned state flow.
  4. First the input values are generated to the GEAR_SHIFT block, from there according to the condition, Gear>0 it proceeds to the next state if not like Gear==0 it ends the flow to a junction.
  5. If Gear>0 it moves to the GEAR1 state and when the input value crosses 15, it moves to the next state. Like if Gear>15 it moves to the next state or It will be back to the first state.
  6. If Gear>15 it moves to the GEAR2 state and If Gear>25 it moves to the GEAR3 state.
  7. If Gear>40 it moves to the GEAR4 state and If Gear>60 it moves to the GEAR5 state. And a Lamp is connected with the each gear output. while entering the state the lap glows and while exiting the state the lamp goes OFF.
  8. A Display block is connected with each gear output to get the value of 0 or 1, which denotes whether the gear is in active state and according to this lamp glows on and off.
  9. Stop Time is given as inf as simulation goes on until the user pauses or ends the simulation.

1st Gear

2nd Gear

As speed input is above 15, it shifts to the second gear and the lamp for 2nd gear is on and 1st gear lamp goes off.

3rd Gear

As speed increases more than 25, it shifts to 3rd Gear.

4th Gear

As speed increases more than 40, it shifts to 4th Gear.

5th Gear

As speed increases more than 60, it shifts to 5th Gear.

Lamp Parameters

LEARNING OUTCOME

The working of Slider block, Lamp block and learnt the working of stateflow for the given condition.

RESULTS AND CONCLUSION

A control logic of a “washing machine” using Stateflow for the given sequence is implemented and A Simulink chart for the “Gear shift” logic for the given conditions is made.

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.