All Courses
All Courses
Courses by Software
Courses by Semester
Courses by Domain
Tool-focused Courses
Machine learning
POPULAR COURSES
Success Stories
Aim: Implementing control logic of a “washing machine” and making a Simulink chart for the “Gear shift” logic using Stateflow Procedure: A. Washing Machine The condition for the washing machine is; If the power supply is available, the system gets activated If the Water supply…
Sandeep Prajapati
updated on 19 Nov 2020
Aim: Implementing control logic of a “washing machine” and making a Simulink chart for the “Gear shift” logic using Stateflow
Procedure:
A. Washing Machine
The condition for the washing machine is;
The sequence of the washing machine along with its operational time is;
From the above it is evident that, at first we need to understand the sequence of the operation, and implement it. Then provide it with the condition.
The Stateflow for the sequence of the operation is:
Fig: Stateflow for sequence of operations
The first block with input is taken. The block is named as Power. The logic is, if there is power the value will be 1 else it will be 0. To implement this another block is taken, where we input the name as Input_Power. We give input variable of power as pow. When pow is 1, then the process will go ahead, else it will end. After input power, if the water level is checked. If the water level(ws) is not 1 then process will not go ahead. When process goes ahead. First the soaking operation takes place for 200 sec. For this there is an inbuilt function called after in the Event naming. When we use after we can give the timing that process will stay in for. Basically in that time the process will be going on for the mentioned time. The next process is Washing, which goes ahead for 100 seconds. Then rinsing for 20 sec and then drying for 50 seconds. Once this is completed the process will end. We have used various variable. First during input we have taken P. When the process goes ahead the value of P is stored as 1. We stored this is exit statement. The same is done for Water level (WS). For soaking, washing, rinsing and drying we have used the entry condition to showcase the process is going on.
Once it is done, we need to define the input and output variables. The ports are first defined as input and output data. What it essentially do is give the ports to the chart.
Fig: Defining the input and output data for port
The simulink model for Washing Machine along with stateflow chart is:
Fig: Simulink model for Washing Machine
The input data is the constant named x and y. The display is used to see the result. The value of x and y that is the condition is given by user from the command window. We have used lamp here to display the operational success of the process. We map every display with the lamps. When there is no power the signal will display red colour else green. When there is no water the signal will display red colour else it will display green colour. Only if first two process is a success rest of the operation takes place. The logic behind that is, if the values comes out as 1 the signal will display the green colour.
The input for x and y is given from the command window.
In case of power on and filled water level, x and y are 1;
In case of power off and no water, x and y are 0;
In case of power on and no water, x is 1 and y is 0;
The timer is set for time over total operation time (370 s). Lets say time is 400 s
B. Gear Shift
The condition for gear shift for different speed range is;
Speed Range(kmph) | Gear |
0 to 15 | 1 |
16 to 25 | 2 |
26 to 40 | 3 |
41 to 60 | 4 |
Above 61 | 5 |
The Stateflow chart for different gear speed is;
Fig: Stateflow for Gear Shift
The condition using if is bidirectional, that is if the speed crosses certain limits it goes in next gear, if price is less than than certain limits, it goes previous or lower gear. For above condition if the speed is above 15 system goes in second gear else it remains in the first gear. If the speed is above 25 the system goes in third gear or it will fall below it. Likewise the condition goes for the gears above. Here the variable F, S, T, Fo, Fi is used for entry and exit statement. If the gear is in some postion, its entry value will be 1 and evrything else values is 0.
Once it is done, we define this variable as an ouputor input data set.
Fig: Defining input and output data for the port
The input variable will take the value for vehicle speed.
Once this is done, we make simulink model. The Simulink model for gear is as follow:
For input, we use constant, with value 1. From Dashboard, we use slider block and set the lower limit to 0 and higher limit to 100. This is the speed limit. The timer is set to infinite(inf). The constant is connected to slider block and the constant output is an input to chart. The lamps are used to display the gear which is operational. The lamps are connected to its respective result. When any value is 1. That is if the condition is true in stateflow and the system is in particular gear, it will display its result and display that lamp. All other lamp are off as its value is 0.
Result:
A. Washing Machine
a. When there is no power and no water.
As there is no water and power the signal is displayed red and the further opeation did no take place.
b. When there is power and water.
As there was water and power level, the display became green, condition got cleared and all the above process proceeded and got completed.
c. When there is power and no water.
B. Gear Shift
After running the model and using slider to change the speed, we see the following result;
As speed is greater than 40 kmph and less than 60 kmph, we see system is in Fourth gear.
As speed is above 60 kmph, we see system is in Fifth gear.
As speed is below 15 kmph, we see system is in First gear.
Conclusion:
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...
Simulation of Whitworth Quick Return Mechanism using MATLAB
…
19 Mar 2021 08:00 PM IST
Related Courses
0 Hours of Content
Skill-Lync offers industry relevant advanced engineering courses for engineering students by partnering with industry experts.
© 2024 Skill-Lync Inc. All Rights Reserved.