Menu

Executive Programs

Workshops

Projects

Blogs

Careers

Placements

Student Reviews


For Business


More

Academic Training

Informative Articles

Find Jobs

We are Hiring!


All Courses

Choose a category

Mechanical

Electrical

Civil

Computer Science

Electronics

Offline Program

All Courses

All Courses

logo

CHOOSE A CATEGORY

Mechanical

Electrical

Civil

Computer Science

Electronics

Offline Program

Top Job Leading Courses

Automotive

CFD

FEA

Design

MBD

Med Tech

Courses by Software

Design

Solver

Automation

Vehicle Dynamics

CFD Solver

Preprocessor

Courses by Semester

First Year

Second Year

Third Year

Fourth Year

Courses by Domain

Automotive

CFD

Design

FEA

Tool-focused Courses

Design

Solver

Automation

Preprocessor

CFD Solver

Vehicle Dynamics

Machine learning

Machine Learning and AI

POPULAR COURSES

coursePost Graduate Program in Hybrid Electric Vehicle Design and Analysis
coursePost Graduate Program in Computational Fluid Dynamics
coursePost Graduate Program in CAD
coursePost Graduate Program in CAE
coursePost Graduate Program in Manufacturing Design
coursePost Graduate Program in Computational Design and Pre-processing
coursePost Graduate Program in Complete Passenger Car Design & Product Development
Executive Programs
Workshops
For Business

Success Stories

Placements

Student Reviews

More

Projects

Blogs

Academic Training

Find Jobs

Informative Articles

We're Hiring!

phone+91 9342691281Log in
  1. Home/
  2. Shlok Dixit/
  3. Week - 4

Week - 4

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…

    • Shlok Dixit

      updated on 22 Apr 2022

    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

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

     

    Answer-

    process:

    1.Start simulink and create a blank model.

    2.Search for chart block in the stateflow category of library browser.

    3.Open the chart block and select the junction feature from the stateflow window.

    4.Control logic for washing m/c is such that it should soak the water for the first 200sec followed by washing time of 100sec. Rinsing the water for the next

    20sec followed by drying time of 50sec.

    1. After finishing the control logic run the STATEFLOW and check the sequence of operation for 370sec

    Block Used

    1. Chart

    A finite state machine is a representation of an event-driven (reactive) system. In an event-driven system, the system responds to an event by making a transition

    from one state (mode) to another. This transition occurs if the condition defining the change is true.

    1. Display

    The Display block shows the value of the input data. You can specify the frequency of the display. For numeric input data, you can also specify the format of the

    display.

    1. Constant

    The Constant block generates a real or complex constant value signal. Use this block to provide a constant signal input.

    1. Lamp

    The Lamp block displays a color indicating the value of the input signal. You can use the Lamp block with other Dashboard blocks to build an interactive

    dashboard of controls and indicators for your model. You can specify pairs of input values and colors to provide the information you want during the simulation.


    1. Rocker Switch:

    The Rocker Switch block toggles the value of the connected block parameter between two values during simulation. For example, you can connect the Rocker Switch block to a Switch block in your model and change its state during simulation.

    Logic Explanation

    A Rocker switch from the dashboard library is used with a constant to supply the power and as water supply. A lamp is used to indicate the power status & water status. The power status is checked at the entry for every

    state and the water supply is checked for the soaking and the rinsing process. The timing for each state is as per the given inputs. The status of the running process can be seen by the glowing lamp corresponding to the process name.

    In the above control logic first state is created with 2 conditions for power supply .

    One is with power supply available(PowerSwitch==1)and second with water supply available 

    (W==1).If the power supply at entry is 1 and water supply is on, then machine will get activated and start the next process of operation.

     

    Next 4 Operation states have been created in flow order Soaking,Washing,Rinsing,Drying with their time of operation as 200sec for a soak,100sec for wash,20

    sec for rinse & 50sec for dry.Entry and exit condition of the state are kept as 0 & i.e at entry of operation states it is 0 and as operation completes it is 1 for every states.

    After all process has done washing machine completed LED will glow and we can shut the machine off.

    Here,

    PowerSwitch & W(water supply) is as input given while all other like Washing_State, D(dryer), Wa(washing), S(soaking), R(rinsing), Washing_Completed are all output given.

     

     

     

    Complete Simulink Model, Showing that the washing process is completed

     Here all LED glown as Green means all process has been completed and all display output as 1.

    Simulink Model, Showing that the washing process is completed & Rinsing is going on.

    Here Red light means operation is not completed and green LED shows operation is completed which is also check from display box as output 1.

     

    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. 

    Part II : IMPLEMENTATION OF CONTROL LOGIC FOR GEAR SHIFT USING STATEFLOW

    PROCESS:

    1.Start simulink and create a blank model.

    1. Search for CHART block in the stateflow category of library browser.
    2. Open the chart block and select the various features from the stateflow window.

    4.Control logic for gear shift is such that it should change the gear when the speed increases of decreases automatically.

    5.After finishing the control logic run the stateflow and check the gear shift operation for an infinite time.

    Blocks Used

    1. Chart

    A finite state machine is a representation of an event-driven (reactive) system. In an event-driven system, the system responds to an event by making a transition

    from one state (mode) to another. This transition occurs if the condition defining the change is true.

    1. Display

    The Display block shows the value of the input data. You can specify the frequency of the display. For numeric input data, you can also specify the format of the

    display.

     

    1. Constant

    The Constant block generates a real or complex constant value signal. Use this block to provide a constant signal input.

     

    1. Lamp

    The Lamp block displays a color indicating the value of the input signal. You can use the Lamp block with other Dashboard blocks to build an interactive

    dashboard of controls and indicators for your model. You can specify pairs of input values and colors to provide the information you want during the simulation.

     

    Rocker Switch:

    The Rocker Switch block toggles the value of the connected block parameter between two values during simulation. For example, you can connect the Rocker Switch block to a Switch block in your model and change its state during simulation.

    Logic Explanation

     

    The speed ranges from 0 to 100 and the slider is used to send the input. The 1st gear has speed values from 0 to 15 so the entry condition for the 1st gear is 0<=speed and speed<=15 and the exit condition is when the speed greater than 15.

     Similarly for 2nd gear, the entry condition is 16<=speed and speed<=25 the exit condition is when speed<16 and speed>25. In the same way for each gear, the entry and the exit condition are specified and the out is mapped to the lamp and the display block.

     

    1. In the above control logic , first Engine is started from input switch E=0/1 through Rocker switch which is power switch to make engine ON.Then next Gear_Shift_logic implemented through following states. 

     

     

    1. Five Gear State is created with state condition of gear (G) 1,2,3,4and 5 respectively and their transition is connected with speed range condition as shown.

     

    3.The transitions condition for the gear shift is decided as  

                 Speed>15 shift to G=2

                 Speed>25 shift to G=3

                 Speed >40 shift to G=4

                 Speed>60 shift to G=5 when the speed is increasing from 0-60 kmph

    similarly in reverse direction             

                  Speed<60 shift to G=4

                 Speed<40 shift to G=3

                 Speed<25 shift to G=2

                 Speed<15 shift to G=1 when the speed is decreasing from 60-0 Kmph

     

    While simulating Gear_Shift_logic , Engine [E==1] condition given with various speed change values.

     

    At speed 48kmph which is above 40kmph gear 4 is implemented and Gear_fourth  LED is glow green and display output as 1.

     

    And thus all condition simulated through stateflow chart successfully.

     

     

     

    Leave a comment

    Thanks for choosing to leave a comment. Please keep in mind that all the comments are moderated as per our comment policy, and your email will not be published for privacy reasons. Please leave a personal & meaningful conversation.

    Please  login to add a comment

    Other comments...

    No comments yet!
    Be the first to add a comment

    Read more Projects by Shlok Dixit (16)

    Week 3 - External flow simulation over an Ahmed body.

    Objective:

    Hello this is Shlok here in this we are going to discuss about the Ahmed bodyCimulation in CFD Ansys Fluent So beofre going furthur lets get a few details about Ahmed Body Ahmed body is a simplified vehicle body used for capturing basic yet charecteristic features seen in objects used in the automobile industry. It is…

    calendar

    01 Aug 2023 12:27 PM IST

    • CFD
    • HTML
    Read more

    Week 3.5 - Deriving 4th order approximation of a 2nd order derivative using Taylor Table method

    Objective:

    AIM:                To derive the fourth order approximations of a second order derivative using central differencing scheme, skewed right sided difference and skewed left sided difference with the help of taylor table method and to compare the analytical…

    calendar

    18 Jul 2023 09:03 AM IST

    • HTML
    Read more

    Week 2 - Flow over a Cylinder.

    Objective:

    Aim: To Simulate the flow over a cylinder and explain the phenomenon of Karman vortex street Objective: 1.To Calculate the coefficient of drag and lift over a cylinder by setting the Reynolds number to 10,100,1000,10000 & 100000. (Run with steady solver) 2.Simulate the flow with the steady and unsteady case…

    calendar

    11 Jul 2023 05:55 PM IST

    • BIM
    • CAE
    • CFD
    • CSS
    • DEM
    • FEA
    • GIS
    • HEV
    • MBD
    Read more

    Project 1 : CFD Meshing for Tesla Cyber Truck

    Objective:

    Objective : To Identifying & cleanup all the topological errors in the given Tesla Cyber Truck Car model. To create a surface mesh. To Create a wind tunnel around Tesla Cyber Truck Car . To create a volumetric mesh to perform an external flow CFD analysis simulation.   Introduction : ANSA :…

    calendar

    26 Feb 2023 04:02 PM IST

    • ANSA
    • CAE
    • CFD
    • RADIOSS
    Read more

    Schedule a counselling session

    Please enter your name
    Please enter a valid email
    Please enter a valid number

    Related Courses

    coursecard

    Design loads considered on bridges

    Recently launched

    10 Hours of Content

    coursecard

    Design of Steel Superstructure in Bridges

    Recently launched

    16 Hours of Content

    coursecard

    Design for Manufacturability (DFM)

    Recently launched

    11 Hours of Content

    coursecard

    CATIA for Medical Product Design

    Recently launched

    5 Hours of Content

    coursecardcoursetype

    Accelerated Career Program in Embedded Systems (On-Campus) Courseware Partner: IT-ITes SSC nasscom

    Recently launched

    0 Hours of Content

    Schedule a counselling session

    Please enter your name
    Please enter a valid email
    Please enter a valid number

    logo

    Skill-Lync offers industry relevant advanced engineering courses for engineering students by partnering with industry experts.

    https://d27yxarlh48w6q.cloudfront.net/web/v1/images/facebook.svghttps://d27yxarlh48w6q.cloudfront.net/web/v1/images/insta.svghttps://d27yxarlh48w6q.cloudfront.net/web/v1/images/twitter.svghttps://d27yxarlh48w6q.cloudfront.net/web/v1/images/youtube.svghttps://d27yxarlh48w6q.cloudfront.net/web/v1/images/linkedin.svg

    Our Company

    News & EventsBlogCareersGrievance RedressalSkill-Lync ReviewsTermsPrivacy PolicyBecome an Affiliate
    map
    EpowerX Learning Technologies Pvt Ltd.
    4th Floor, BLOCK-B, Velachery - Tambaram Main Rd, Ram Nagar South, Madipakkam, Chennai, Tamil Nadu 600042.
    mail
    info@skill-lync.com
    mail
    ITgrievance@skill-lync.com

    Top Individual Courses

    Computational Combustion Using Python and CanteraIntroduction to Physical Modeling using SimscapeIntroduction to Structural Analysis using ANSYS WorkbenchIntroduction to Structural Analysis using ANSYS Workbench

    Top PG Programs

    Post Graduate Program in Hybrid Electric Vehicle Design and AnalysisPost Graduate Program in Computational Fluid DynamicsPost Graduate Program in CADPost Graduate Program in Electric Vehicle Design & Development

    Skill-Lync Plus

    Executive Program in Electric Vehicle Embedded SoftwareExecutive Program in Electric Vehicle DesignExecutive Program in Cybersecurity

    Trending Blogs

    Heat Transfer Principles in Energy-Efficient Refrigerators and Air Conditioners Advanced Modeling and Result Visualization in Simscape Exploring Simulink and Library Browser in Simscape Advanced Simulink Tools and Libraries in SimscapeExploring Simulink Basics in Simscape

    © 2025 Skill-Lync Inc. All Rights Reserved.

                Do You Want To Showcase Your Technical Skills?
                Sign-Up for our projects.