Challenge

State Flow Logics for Washing Machine And Automatic Gear Shifting

State Flow Logics for Washing Machine And Automatic Gear Shifting

AIM

  • Implement control logic of a “washing machine” using Stateflow.
  • Make a Simulink chart for the “Gear shift” logic

OBLECTIVES

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.

1. Implement control logic of a “washing machine” using Stateflow.

THEORY

State Flow:

  • Stateflow enables you to design and develop supervisory control, task scheduling, fault management, communication protocols, user interfaces, and hybrid systems.
  • With Stateflow, you model combinatorial and sequential decision logic that can be simulated as a block within a Simulink model or executed as an object in MATLAB.

Washing Machine:

  • A washing machine is a home appliance used to wash laundry. The user adds laundry detergent, which is sold in liquid or powder form, to the wash water.

Basic steps of the wash cycle are,

  • Soaking or Prewash: The prewash step includes filling the washing machine's tub with water and mixing in the detergent. Oftentimes the prewash entails allowing the load to soak for a while to loosen dirt and begin to remove stains that otherwise might not be cleaned during a normal wash cycle.
  • Washing: During the wash cycle, the machine uses agitation to mix the water and detergent, as well as to move the clothing around the tub--and against other clothing--to clean the load.
  • Rinsing: Rinsing the load is usually a multi-step procedure. First, the soapy water must be spun from the clothing and wash tub. During the latter minutes of the purging, fresh water is sprayed into the tub to rinse the clothing.
  • Drying or Spinning: Spinning is necessary for wringing the clothing, getting it as dry as possible before the end of the wash.

MODEL

  • We can control the power supply on & off and the water supply on & off using the slider switches.
  • You can view the logical outputs from the stateflow char by connecting the scope to the outputs.
  • Lamp blocks are included in the model to indicate water supply, power supply and process details.

STATEFLOW CHART:

  • The inputs to the chart, power supply and water supply are checked in the first 2 steps by the condition check, and if the value is true (1) then allowed to follow the chart and if its false value (0) it will stop working.
  • The next process is followed as soaking for 200sec, and during the process a variable sock = 1 is assigned, which is used to light the lamp with the proper indication.
  • for the time delay of 200sec after keyword is used. [after(200,sec)].
  • The same syntax is followed for all other processes with proper time delay, and variables are assigned to each process to give the inputs to indicate the light in the lamp block.
  • After all the processes, we enter a finish variable that gives input to the finish indication lamp block.

RESULTS

Power ON, Water Supply OFF and Stop Time = 400

  • The indicator light will be indicated in red as water supply is not available.

SCOPE:

Power ON, Water Supply ON and Stop Time = 400

SCOPE:

  • So the state flow control logic of the washing machine works exactly according to the time delay given in the objectives.
  • By pausing the simulation and By Using the step forward we can see each step, and observe which process is currently taking place as indicated by the lamp block.

2. Make a Simulink chart for the “Gear shift” logic

THEORY

Importance of Gear shift Strategy:

  • Creating intelligent gear shift schedules is of great importance to the design of any vehicle using an automatic gearbox. It is a key part in generating desired and efficient performance, and much effort is put into finding the best gear shifting strategies.
  • These strategies highly affect important properties like fuel consumption and travel time, but also some less noticeable ones, like gearbox lifetime

MODEL

  • Speed value is given as input to the chart using Slider gain block. Values can be changed from 0 to 100kmph when the simulation is running.
  • A circular gauge block is attached to the slider gain block to visualize the speed rate. A display block is provided to display the selected gear for a specific speed.
  • For implement the gear shift logic a state flow chart is used.
  • The stop time of the simulation is set to infinity, so we can vary the input speed while the simulation is running.

STATEFLOW CHART:

  • The chart will compare the speed input and give the appropriate gear for that particular speed.
  • Speed and gear shifting details are given, so conditions are given accordingly.
  • The gear number is given as the output from the chart to the display block.

RESULTS

  • As we can see for the variation in speed, gear selection takes place according to the speed and gear selection criteria.
  • Gear shifting occurs at different speeds, so the state flow chart of gear shifting logic is successfully implemented.

CONCLUSION

  • Control logic has been successfully implemented for a washing machine using state flow.
  • Simlink chart for gear shift logic successfully implemented.
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.