All Courses
All Courses
Courses by Software
Courses by Semester
Courses by Domain
Tool-focused Courses
Machine learning
POPULAR COURSES
Success Stories
WEEK 4 CHALLENGE Implement control logic of a “washing machine” using Stateflow as per given sequence: If the power supply…
Racha Pavan Kumar
updated on 15 Nov 2021
WEEK 4 CHALLENGE
After all the processes have completed turn on the finished LED
ANS:
HERE THE BASIC BLOCKS USED ARE CHART, CONSTANT, DISPLAY, LAMP & ROCKER SWITCH
All blocks are taken from the library browser
Model of Simulink showing the block diagram of washing machine
From the above diagram the power and water are the inputs.
The outputs are washing state, drying, rinsing, soaking and END.
In the chart block we have given the logic for washing machine
The rocker switch from the library is connected with the constant block to provide the inputs parameters such as power and water supply, if the rocker switch is in ON position the constant value = 1 or if the rocker switch is in OFF position constant value = 0
The lamps are connected to the output blocks(Display) to indicate the statutes off the machine whether it is running in which mode such as washing, soaking and drying
Timing for each state is given as per the input instructions, the statutes of each state is shown the ouput block(display) and this display block is connected to the lamp
If the lamp is in red colour the output = 0 or if the lamp indicates green colour the output = 1
If the lamp is glowing is green colour it indicates the current state is in active mode
In the above chart block we have given logic for the washing machine
First state has 2 conditions, 1st is power and 2nd is water if the power==1&water==1 the washing machine gets activated and starts the processes and other operations are as shown in above figure such as
These 4 operations are in flow order of their respective timing
Soaking
Washing
Rinsing
Drying
The time for above state is given as per the input data and same logic is implemented in the flowchart (chart block)
200 seconds for Soaking
100 Seconds for Washing
20 Seconds for Rinsing
50 Seconds for Drying
Entry is kept as 0 and exit is kept as 1 when process is completed in each state it is 1
for example in above Simulink model is running at soaking state the output will show in the dispay as 1 and lamp glows in green colour for every state of operation it indicates with lamps and display as 1 same process will continue for every state.
When total process is completed in washing machine all LEDs will glow
SYMBOL PANE:
In above symbols pane water and power are considered as inputs
Washing
Soaking
Rinsing
Drying
END are considered as outputs
In below Simulink model red light indicates that mode of operation is not completed and it is in process green light indicates that mode of operation is completed
Model showing that washing machine is at Rinsing state
Model showing that washing machine is at drying state:
Model showing that washing machine completes all state of operations
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.
ANS:
Simulink model for gear shift logic as per above conditions
HERE THE BASIC BLOCKS USED ARE CHART, CONSTANT, DISPLAY, LAMP, SLIDER & ROCKER SWITCH
in this model all the blocks are taken from the simulink library browser
From the above diagram the power and Throttle are the inputs.
The outputs are first gear, second gear, third gear, fourth gear and fifth gear.
In the chart block we have given the logic for Gear shift
Logic for gear shift
Slider block from the library browser is used as throttle in this slider block we have to give the minimum and maximum speed limits i.e. from 0 to 1
Throttle is input and it is used as the accelerator with the help of this throttle pedal we can change the value of vehicle speed
Here engine is at OFF position at starting state when the power is ON the engine gets activated
Entry condition for First gear is speed should be >=0 and exit conditions is when the speed
is >15
Entry condition for second gear is speed should be >=16 and exit conditions are when the speed
is >25 and <=15.
Entry condition for third gear is speed should be >=26 and exit conditions are when the speed
is >40 and <=25.
Entry condition for fourth gear is speed should be >=41 and exit conditions are when the speed is >60 and <=40.
Entry condition for fifth gear is speed should be >=61 and exit conditions are when the speed is <60.
Here lamps are connected to each gear so whenever vechile runs at specified certian gear that the lamp glows according to the state of gear similarly display is also connected to each gear when ever vehicle is running at certian gear that gear output display value shows as 1 if gear is not active display shows as 0
vechicle running at 1st GEAR the speed is below 15kmph
vechicle running at 2nd GEAR the speed is above 15kmph and below 26 kmph
vechicle running at 3rd GEAR the speed is above 25kmph and below 41 kmph
vechicle running at 4th GEAR the speed is above 40kmph and below 61 kmph
vechicle running at 5th GEAR the speed is above 61kmph
Conclusion: As per above requirments the logics for washing machine and gear shift were implemented and display outputs and lamps were glown
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 1 Understanding Different Battery Chemistry
Week 1 Understanding Different Battery Chemistry 1.Prepare a table which includes materials & chemical reactions occurring at the anode and cathode of LCO, LMO, NCA,…
01 Aug 2022 04:43 PM IST
Project 2-Highway Assistant-Lane Changing Assistant
Highway Assistant – Lane Changing Assistant Introduction to the Feature: The Highway Assistant supports the driver and takes over the longitudinal and lateral guidance of the vehicle in monotonous driving situations on highways. The partially automated function can automatically start, accelerate, brake as well as…
29 Jul 2022 05:52 PM IST
Project 1- Traffic Jam Assistant Feature
Traffic Jam Assistant Feature Aim: - Development of a single feature of Traffic Jam Assist Model using MATLAB &…
14 Jun 2022 05:12 PM IST
Project 2 Adaptive Cruise Control
AIM: Adaptive cruise control (ACC) is an available cruise control advanced driver-assistance system for road vehicles that automatically adjusts the vehicle speed to maintain a safe distance from vehicles ahead. As of 2019, it is also called by 20 unique names that describe that basic functionality. This is also known…
26 Apr 2022 03:59 PM IST
Related Courses
0 Hours of Content
Skill-Lync offers industry relevant advanced engineering courses for engineering students by partnering with industry experts.
© 2025 Skill-Lync Inc. All Rights Reserved.