Challenge

Washing machine & Gear shift logic using State flow

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.

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

WASHING MACHINE PROBLEM

AIM:

To control logic of a “washing machine” using Stateflow.

SIMULINK MODEL:

DESCRIPTION:

  • 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

In order to achieve the condition ,the power and water supply i have designed the signal from the signal builder for both current and water is made a same signal, for some times the power and water is given and for some times the signal is stopped, it is designed in order to observe the fluctuation of lamp.When the power and water is given the chart which is considered the washing machine .By using the control logics and condition ,the machine follows the logic like soaking for 200s, washing for 100s, rinsing for 20s, and drying for 50s. After following the soaking state ,washing state ,rinsing state,drying state,then it goes to the washing completed state.In this way the washing machine checks for the availability of water,electricity and proceeds the state also indicates the state of the machine through the lamp.

The simulink blocks used in the model are

  1. Signal builder
  2. Chart
  3. lamp
  4. Display

SIGNAL BUILDER

  1. The signal builder builds the input signal, needed for the condition for the water and power supply.
  2. The signal builder gives the signal to the chart.
  3. Using the signal builder the signal can be created for the period of 400s and can also change the x and y axis range.
  4. By using the signal builder the both current and water is made as the same signal, for some times the power and water is given and for some times the signal is stopped, it is designed in order to observe the working of the washing machine.

CHART

Chart is the graphical representation of a states and transition.

Here state flow chart is used to implement the control logic of the washing machine

In this chart there are many states and transition they are :

  1. Default transition
  2. On,off state
  3. Soaking state
  4. Washing state
  5. Rinsing state
  6. Drying state
  7. Completed state

DEFAULT TRANSITION:

  1. The default transition comes with the first state when using in the chart.
  2. The default transition gets the input from the signal builder.

ON ,OFF STATES:

  1. When the control enters from the default transition goes to the on state and performs the entry action and checks condition for off state if satisfied goes to it ,if not checks the other condition.
  2. The same applies for the off state ,it does the entry action and continuously checks the supply signal.
  3. when returning to the on state is does the exit action.

SOAKING STATE:

  1. If the off state condition is not satisfied then it goes to the soaking state.
  2. When is comes for the soaking state then it does the entry action and takes the delay of 200s and goes to washing state.

WASHING STATE:

  1. After getting enter to the washing state it does the entry action and leaves the washing state.
  2. When leaving the washing state the transition is delayed by the 100s and goes to the rinsing state.

RINSING STATE:

  1. After getting enter to the rinsing state it does the entry action and leaves the rinsing state
  2. When leaving the rinsing state the transition is delayed by the 20s and goes to the drying state

DRYING STATE:

  1. After getting enter to the drying state it does the entry action and leaves the drying state
  2. When leaving the drying state the transition is delayed by the 50s and goes to the completed state

COMPLETED STATE:

  1. After getting enter to the completed state it does the entry action and leaves the completed state
  2. When leaving the completed state ,it is directly transmitted to the off state

While doing all the state transition ,action the primary supply is checked continuously

LAMP:

  1. The lamp is used to indicate the state of machine and supply of the water supply.
  2. The state of every action in the chart gives the output to the 2 different lamps.
  3. The lamp glows in different colours corresponding to the different states.
  4. The lamp which indicates the supply of water which glows in 2 colours ,for the supply is given or not.
  5. The lamp which. Indicate the state of the machine which glows in 6 different colours ,for the indication of which process the machine is on the way.

Display:

  1. The display shows the value , varying over time.
  2. The display is used to show the state of the machine number(gets the output from the machinestate) and water supply number(gets the output from the blinksupply).
  3. This is also the additional number to avoid any confusion

By using these all the bock the required system is created in simulink platform

RESULT:

After performing various calculations the simulink model is submitted to give the accurate result.

Thus the control logic of the washing machine using the state flow is performed.

And results are shown below

The above simulink model link is given below:

https://drive.google.com/file/d/1yA43zedpT1G109pnuRR1bLl70I3q31lW/view?usp=sharing

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

2 )GEAR SHIFT LOGIC CHALLENGE

AIM:

To make a Simulink chart for the “Gear shift” logic using state flow.

SIMULINK MODEL:

DESCRIPTION:

To achieve the condition for the speed and gear given below

  • 0 to 15 1
  • 16 to 25 2
  • 26 to 40 3
  • 41 to 60 4
  • Above 61 5

The slider gain is used for the purpose for changing the speed, at the time of running the simulation ,the supply from the slider gain is given to the state flow chart .The state flow chart is is working control logic of the speed and gearshift.It consists of the 6 different states and numbers of transition logic is used to achieve the required results. Also the state action is displayed as the gear in the display block . The custom gauge is used to indicate the speed given to the state flow chart so the custom gauge is connected to the slider gain.

The simulink blocks used in the model are

  1. constant
  2. Slider gain
  3. State flow chart
  4. Display
  5. Custom gauge

CONSTANT:

  1. The function of the block is to give the constant value to the model over the simulink time.
  2. The constant block comes with pre-determine constant value,the value can be changed to our required constain.
  3. This block is used with the slider gain block for the gain value be constant

SLIDER GAIN:

  1. The slider gain block is used to slide the value from 1-100 while the simulation is running.
  2. Here the lower limit is 0 and the higher limit is 100.
  3. This value is Also connected to the custom gauge

CHART:

Chart is the graphical representation of a states and transition.

Here state flow chart is used to implement the control logic of the gear shift

In this chart there are many states and transition they are :

  1. Default transition
  2. Gear1
  3. Gear2
  4. Gear3
  5. Gear4
  6. Gear5

DEFAULT TRANSITION:

  1. The default transition comes with the first state when using in the chart.
  2. The default transition gets the input from the signal builder.

GEAR1

  1. The default transition gets into the gear1 state first, and then does the entry action .
  2. The entry action gives the gear number as output to the display.
  3. It remains in the state till the condition is satisfied.
  4. While leaving the state it has to satisfy the necessary condition for the transition(speed>15).

GEAR2:

  1. There are 2 possibilities of reaching the state one is from state gear1 and other is from state gear2 .
  2. After entering the state it does the state action.
  3. The entry action gives the gear number as output to the display.
  4. It remains in the state till the condition is satisfied.
  5. While leaving the state it has to satisfy the necessary condition for the transition for either state gear1 or gear3.(speed <15 or Speed >25)

GEAR3:

  1. There are 2 possibilities of reaching the state one is from state gear2 and other is from state gear4 .
  2. After entering the state it does the state action.
  3. The entry action gives the gear number as output to the display.
  4. It remains in the state till the condition is satisfied.
  5. While leaving the state it has to satisfy the necessary condition for the transition for either state gear4 or gear2.(speed <25 or Speed >40)

GEAR4:

  1. There are 2 possibilities of reaching the state one is from state gear3 and other is from state gear5 .
  2. After entering the state it does the state action.
  3. The entry action gives the gear number as output to the display.
  4. It remains in the state till the condition is satisfied.
  5. While leaving the state it has to satisfy the necessary condition for the transition for either state gear5 or gear3.(speed <40 or Speed >60)

GEAR5:

  1. There is only 1 possibility of reaching the state that is from state gear4.
  2. After entering the state it does the state action.
  3. The entry action gives the gear number as output to the display.
  4. It remains in the state till the condition is satisfied.
  5. While leaving the state it has to satisfy the necessary condition for the transition for state gear4 (speed <60 ).

CUSTOM GAUGE:

  1. This block is used to indicate the speed given is the input to the state flow.
  2. This is connected to the slider gain ,so the value given will reflect in the custom gauge.

DISPLAY:

  1. The display shows the value , varying over time.
  2. The display shows the gear value or in other words it shows the current state of the chart

By using these all the bock the required system is created in simulink platform

RESULT:

After performing various calculations the simulink model is submitted to give the accurate result.

Thus the Simulink chart for the “Gear shift” logic is made using state flow,and the results are shown below.

The above simulink model link is given below:

https://drive.google.com/file/d/1fuTREyxz9fGKkfiOb1AhLq8WDDgJRvRM/view?usp=sharing

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.