All Courses
All Courses
Courses by Software
Courses by Semester
Courses by Domain
Tool-focused Courses
Machine learning
POPULAR COURSES
Success Stories
AIM: To implement the control logic of the Washing machine and Gear shift mechanism using Stateflow. OBJECTIVE: 1. To 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,…
Syed Saquib
updated on 28 Sep 2022
AIM: To implement the control logic of the Washing machine and Gear shift mechanism using Stateflow.
OBJECTIVE:
1. To 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 and indicate through LED
- Soaking time should be 200s followed by Washing time of 100s
- Then rinsing happens for next 20s and 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 |
61 Above | 5 |
Give speed input while the simulation is running and display the gear number.
Stateflow: Stateflow provides a graphical language that includes state transition diagrams, flow charts, state transition tables, and truth tables. It is used to describe how MATLAB algorithms and Simulink models react to input signals, events, and time-based conditions. 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. Graphical animation enables you to analyze and debug your logic while it is executing. Edit-time and run-time checks ensure design consistency and completeness before implementation.
Control Logic: Control logic is a key part of a software program that controls the operations of the program. The control logic responds to commands from the user, and it also acts on its own to perform automated tasks that have been structured into the program. Control logic can be modeled using a state diagram, which is a form of hierarchical state machine.
SOLUTION: Part #1: THEORY: A washing machine is a home appliance used to wash laundry. The term is mostly applied to machines that use water as opposed to dry cleaning or ultrasonic cleaners. The user adds laundry detergent, which is sold in liquid or powder form, to the wash water. Washing machines can be classified as follows: 1. Semi-automatic washing machine: The semi-automatic is needed for your assistant to get the job done. Here, you will have to pour in the water manually and need to set up the timer, etc. 2. Fully automatic washing machine: The fully automatic washing machines are more convenient and offer a great range of functionality. You get fully automatic functions that carry out the washing without any manual interference. They are a little more budget-friendly, and you spend a normal price to get actually purchase. |
![]() |
Fully automatic washing machines can further be divided into two types:
- Front Load Washing Machine: You get a front door to put the load into the drum. The drum wash, rinse and spins the laundry. Here you see the different working principle, the clothes are tossing from one direction to the other, as the drum itself is moving. Most of the front-load washing machine uses agitator washing style to wash and rinse the clothes.
- Top Load Washing Machine: In a top-loading washing machine, you load the washing machine from the top. The drum here does not move from one direction to the other, but the base of the machine rotates and moves the clothes thoroughly. Here, the machine’s base takes clockwise and anti-clockwise rotation, to fully wash the dresses.
Procedure/Steps:
1. Create a chart block for defining the stateflow as per the given conditions.
2. Inside it, the circular junction is to terminate the signal flow and return a null value.
3. If power is OFF i.e. 0, the process is terminated at the junction else 1 is carry forwarded.
4. If water is OFF i.e. 0, the process is terminated at the junction else 1 is carry forwarded.
5. After this, Soak block gets activated and soaking action takes place.
6. After 200 sec of Soaking, Wash block gets activated and washing action takes place.
7. After 100 sec of Washing, Rinse block gets activated and rinsing action takes place.
8. After 20 sec of Rinsing, Dry block gets activated and drying action takes place.
9. After 50 sec of dry, Finish block gets activated. Finish is to terminate the signal flow in the process and exits the chart.
10. Define power and water as inputs whereas soak, wash, rinse, dry, finish as outputs.
11. Connect the chart block with constant blocks for power and water inputs. Input switches connected to them are slider switch and a toggle switch respectively (to distinguish between the two). Attach lamps to observe the ON/OFF condition.
12. A common scope block is connected to observe the entire washing process and obtain the output plot. Blue color in the lamp indicates that the process is complete.
A Simulink model for operating the washing machine according to given conditions is shown below.
Stateflow:
Input #1:
Power: ON, Water: OFF
Power: ON, Water: OFF, t = 0 sec
Power: ON, Water: ON, Soak: ON, t = 10 sec
Power: ON, Water: ON, Wash: ON, t = 230 sec
Power: ON, Water: ON, Rinse: ON, t = 330 sec
Power: ON, Water: ON, Dry: ON, t = 350 sec
Power: ON, Water: ON, Finish: ON, t = 500 sec
Part #2: THEORY: The transmission box which is also known as the gearbox is the second element of the power train in an automobile. It is used to change the speed and torque of vehicle according to a variety of road and load conditions. The transmission box changes the engine speed into torque when climbing hills and when the vehicle required. Sometimes it is known as a torque converter. Main functions of a gearbox are as follows: - Provide the torque needed to move the vehicle under a variety of road and load conditions. It does this by changing the gear ratio between the engine crankshaft and vehicle drive wheels. - Be shifted into reverse so the vehicle can move backward. - Be shifted into neutral for starting the engine. |
![]() |
Working: In a gearbox, the tertiary (counter) shaft is mashed to the clutch with the use of a couple of gears. So the countershaft is always in running condition. When the tertiary shaft is brought in contact with the main shaft by the use of meshing gears, the main shaft starts to rotate according to the gear ratio. When the driver wants to change the gear ratio, simply press the clutch pedal which disconnects the tertiary shaft with the engine and connects the main shaft with the tertiary shaft by another gear ratio by use of gearshift lever.
Procedure/Steps:
1. Create a chart block for defining the stateflow as per the given conditions.
2. Inside it, the circular junction is to terminate the signal flow and return a null value.
3. If ignition is OFF i.e. 0, the process is terminated at the junction else 1 is carry forwarded.
4. If speed is less than or equal to 0, the flow is terminated and gear 0 is activated. at the junction else 1 is carry forwarded.
5. If speed is greater than 0 and less than or equal to 15, the flow is terminated and gear 1 is activated.
6. If speed is greater than 15 and less than or equal to 25, the flow is terminated and gear 2 is activated.
7. If speed is greater than 25 and less than or equal to 40, the flow is terminated and gear 3 is activated.
8. If speed is greater than 40 and less than or equal to 60, the flow is terminated and gear 4 is activated.
9. If speed is greater than 60, the flow is terminated and gear 5 is activated.
11. Define ignition and speed as inputs whereas speedometer, scope and gear number display as outputs.
12. Connect the chart block with constant blocks for ignition and speed inputs. Input switches connected to them are slider switch and a slider bar to adjust variable speeds respectively (to distinguish between the two). Attach lamps to observe the ON/OFF condition.
13. A common scope block is connected to observe the speed numerically and obtain the output plot.
A Simulink model for operating the gear shift mechanism according to given conditions is shown below.
Stateflow:
Input #2:
Ignition: ON, Speed: 0, Gear Number: 0
Ignition: ON, Speed: 0 to 15, Gear Number: 1
Ignition: ON, Speed: 16 to 25, Gear Number: 2
Ignition: ON, Speed: 26 to 40, Gear Number: 3
Ignition: ON, Speed: 41 to 60, Gear Number: 4
Ignition: ON, Speed: Above 60, Gear Number: 5
CONCLUSION: Hence, the given problem was simulated for the washing machine and gear shift mechanism and executing the Stateflow as per according to given conditions.
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.
Other comments...
Week - 4 - 2D meshing for Plastic components
14 Feb 2024 04:24 PM IST
Week 3 - 2D meshing for Sheet metal
14 Feb 2024 04:10 PM IST
Project
AIM: To carry out a system-level simulation of an All-Terrain Vehicle (ATV). OBJECTIVES : To carry out a Simulation of ATV. To prepare a technical report explaining the model properties & comments on the results. THEORY : All-Terrain Vehicle (ATV) An All-Terrain Vehicle (ATV), also known as a light utility…
03 Jan 2024 10:45 AM IST
Project 1
Aim : Develop a double-acting actuator model using Simscape Multibody and Simscape components. Objective : The mechanical system of the cylinder needs to be built using Simscape Multibody library components/blocks, and the hydraulic system needs to be modeled using Simscape library physical components. Theory : The…
16 Oct 2023 03:59 PM IST
Related Courses
Skill-Lync offers industry relevant advanced engineering courses for engineering students by partnering with industry experts.
© 2025 Skill-Lync Inc. All Rights Reserved.