Week - 4
1. Implement the control logic of a “washing machine” using State flow
Aim: Design a Washing Machine to wash the cloth which shows all operations per step
Mechanism:
- I will power ON the main switch of the Power supply so that the system can get active. power ON =1 and OFF = 0.
- I will switch ON the main switch of the water supply so that the water can be get supplied in the washing machine chamber.
- Condition: If the water supply is (switch OFF) stopped then the whole process of washing the cloth should be stopped else go for the next step.
- Soaking: This process will take 200 Seconds. In this state, the Clothes are soaking in the water So that the cloth's dirty particles can be dissolved in water and removed from the cloth.
- Washing: This process will take 100 Seconds. In this state, the clothes are washed forcefully in the washing machine by an automatic washing system So that the oil and dust particle remove from the cloth.
- Rinsing: This process will take 20 seconds. In this state, the water is forcefully pullouts from the clothes.
- Dryer: This process will take 50 seconds. In this state, the clothes are dried by heating or another method.
- Finish: Complete the whole process.
- I have fitted all the (green/red) Lamp to show whether the operation is complete or not.
Simulink Model of Washing machine:

State Flow chart of Washing machine:

--------------------------------------------------------------------------------------------------------------------------------
Output Washing machine:
1. Power Supply ON but still water Supply OFF, So soaking, washing, rinsing and dryer process are stop and Operation is not Finish.

2. Power Supply and water supply are ON so in 1st step Soaking operation of 200 seconds is completed and go for next step.
3. Power Supply and water supply are continuing ON so in the next 2nd step Washing operation of 100 seconds is completed and go for the next step.

4. Power Supply and water supply are continuing ON so in the next 4th step Rinsing operation of 20 seconds is completed and go for the next step.

5. Power Supply and water supply are continuing ON so in the next 3rd step Dryer operation of 20 seconds is completed and go for the next step.

Now, the washing machine all operations are now finished and then Finish Lamp will glow up.
===============================================================================================
2. Simulink state flow chart for the “Gear shift” logic as per the Variation in Speeds:
Aim: To change the gear according to the variation of Speed
Speed Range(kmph) : 0 to 15 16 to 25 26 to 40 41 to 60 Above 61
Gear : 1 2 3 4 5
Mechanism:
The speed controller is joined by a constant Simulink block which is the input Speed for the Simulink flow Chart. So let's start with zero Speed.
- At zero speed Gear is set to a Neutral state and the lamp glows dark green.
- If speed > 0 then the operation will go for the next stage and Gear 1 shifts and the lamp will glow light Blue but if Speed = 0 then again Neutral gear will shift.
- If speed > 15 then the operation will go for the next stage and Gear 2 shifts and the lamp will glow dark Blue but if Speed <= 15 then again Gear 1 will shift.
- If speed > 25 then the operation will go for the next stage and Gear 3 shifts and the lamp will glow light Green but if Speed <= 25 then again Gear 2 will shift.
- If speed > 40 then the operation will go for the next stage and Gear 4 shifts and the lamp will glow Yellow but if Speed <= 40 then again Gear 3 will shift.
- If speed > 60 then the operation will go for the next stage and Gear 5 shifts and the lamp will glow Red but if Speed <= 60 then again Gear 4 will shift.
Simulink chart for Gear shift according to Variation in Speed:

Flow chart for Gear shift according to Variation in Speed:

--------------------------------------------------------------------------------------------------------------------
The output of Gear Switching:
If Speed ==0: Gear is neutral

If 0<Speed<=15: Shifted Gear 1

If 15>Speed <= 25: Shifted Gear 2

If 25>Speed <= 40: Shifted Gear 3

If 40>Speed <= 60: Shifted Gear 4

If Speed> 60: Shifted Gear 5
