State Flow using Matlab Simulation
Washing Machine Simulation:
Washing machine has following states:
- Initial State
- System Activated
- No water
- Soaking State
- Washing
- Rinsing
- Drying
- Clothes washed
Input variables:
Power, Water.
Initial state:
In this state, Washing machine is in power off mode. The input variables in this state are:
power = 0
System Activated:
In this state, Washing machine is in power on mode. The system is getting the power supply. In this state, the input variables are:
power = 1
No Water :
Washing machine enters into this state if there is no water supply. State of input variable conditions:
power = 1
water = 0
Soaking state:
In this state, Washing machine is soaking the clothes. The input variable condition to enter this state is
water = 1;
The washing machine is in this state for 200 sec.
Washing state:
In this state, Washing machine is washing the clothes. The input variable condition to enter this state is
water = 1;
The washing machine is in this state for 100 sec.
Rinsing:
In this state, Washing machine is rinsing the clothes. The input variable condition to enter this state is
water = 1;
The washing machine is in this state for 20 sec.
Drying:
In this state, Washing machine drying the clothes. The input variable condition to enter this state is
water = 1;
The washing machine is in this state for 10 sec.
System end state:
In this state, Washing machine has washed the clothes. This ends the process.
2. Gear Simulation:
The gear has following states
- Idle
- Gear1
- Gear2
- Gear3
- Gear4
- Gear5
INPUT:
Slider gain: To give the input during simulation time (Minimum value = 0; Maximum value = 300)
Variable: speed
Output:
Display: to display the gear number
variable : Gear
Blocks:
Idle state:
The condition for this state is
speed = 0
Gear 1:
The condition for this state is
speed = 0 to 15
Gear 2:
The condition for this state is
speed = 16 to 25
Gear 3:
The condition for this state is
speed = 26 to 40
Gear 4:
The condition for this state is
speed = 41 to 60
Gear 5:
The condition for this state is
speed = Above 60.
Attachments: The simulink files for both the problems and the output images.