Week - 4
Ans1:
Automatic Washing Machine Control Logic -
1. Check if power supply is available or not.
Input - supplyinput
output - supply, watersupply = 0, soak = 0, wash = 0, rinse = 0, dry = 0
state - supply = 0 (power supply not available)
supply = 1 (power supply available)
watersupply = 0 (water supply not available), soak = 0 (not soaked), wash = 0 (not washed), rinse = 0 (not rinsed), dry = 0(not dried)
2. If supplyinput = 0 then check again till supply = 1.
3. If supplyinput = 1 then check if water supply is available or not.
Input - waterSupply
output - watersupply, supply = 1, soak = 0, wash = 0, rinse = 0, dry = 0
state - watersupply = 0 (water supply not available)
watersupply = 1 (water supply available)
supply = 1 (supply available), soak = 0 (not soaked), wash = 0 (not washed), rinse = 0 (not rinsed), dry = 0(not dried)
4. if waterSupply = 0 then repeat step 1 (can set the priority of the condition to check. like for ex. first priority to check for power supply then for water supply) .
5. If waterSupply = 1 then start soaking for 200sec. Turn the water supply LED indicator ON. Inbetween check for water supply and power supply availability. Repeat step 4 if water supply not available. Repeat step 1 if power supply not available.
Input - delay 200 sec (main control logic input)
waterSupply (side lined control logic input)
supplyinput (side lined control logic input)
output - supply, watersupply, soak, wash = 0, rinse = 0, dry = 0
state - supply = 0 or 1
watersupply = 0 or 1
soak = 0 (not soaked)
soak = 1 (soaking in progress)
soak = 2 (soak completed)
6. If waterSupply = 0 then repeat step 4. Turn the water supply LED indicator OFF.
7. If supplyinput = 0 then repeat step 1.
8. If both are available then wait for 200sec to get soaking completed. After 200sec, soak = 2.
9. If soak = 2, then start washing for 100sec. Check for water and power supply inbetween.
Input - delay 100 sec (main control logic input)
waterSupply (side lined control logic input)
supplyinput (side lined control logic input)
output - supply, watersupply, soak=2, wash, rinse = 0, dry = 0
state - supply = 0 or 1
watersupply = 0 or 1
wash = 0 (not washed)
wash = 1 (washing in progress)
wash = 2 (wash completed)
10. If waterSupply = 0 then repeat step 4. Turn the water supply LED indicator OFF.
11. If supplyinput = 0 then repeat step 1.
12. If both are available then wait for 100sec to get washed completely. After 100sec, wash = 2.
13. If wash = 2, then start rinsing for 20sec. Check for water and power supply inbetween.
Input - delay 20 sec (main control logic input)
waterSupply (side lined control logic input)
supplyinput (side lined control logic input)
output - supply, watersupply, soak=2, wash=2, rinse, dry = 0.
state - supply = 0 or 1
watersupply = 0 or 1
rinse = 0 (not rinsed)
rinse = 1 (rinsing in progress)
rinse = 2 (rinsing completed)
14. If waterSupply = 0 then repeat step 4. Turn the water supply LED indicator OFF.
15. If supplyinput = 0 then repeat step 1.
16. If both are available then wait for 20sec to get rinsed completely. After 20sec, rinse = 2.
17. If rinse = 2, then start drying for 50sec. Check for water and power supply inbetween.
Input - delay 50 sec (main control logic input)
waterSupply (side lined control logic input)
supplyinput (side lined control logic input)
output - supply, watersupply, soak=2, wash=2, rinse = 2, dry.
state - supply = 0 or 1
watersupply = 0 or 1
dry = 0 (not dried)
dry = 1 (drying in progress)
dry = 2 (drying completed)
18. If waterSupply = 0 then repeat step 4. Turn the water supply LED indicator OFF.
19. If supplyinput = 0 then repeat step 1.
20. If both are available then wait for 50sec to get dried completely. After 50sec, dry = 2.
21. Turn the LED indicator ON to show process completed.
Simulation results -

Time step - 10sec
Simulation -


Ans2:
Speed-Gear control logic design MATLAB -
Output - gear
State - gear = 1 or 2 or 3 or 4 or 5
1. If x >= 0 and x < 16 then gear = 1
2. If x >=16 and x < 26 then gear = 2
3. If x >=26 and x < 41 then gear = 3
4. If x >= 41 and x < 61 then gear = 4
5. If x >=61 then gear = 5
Simulation results -

Time step - 0.03sec
Simulation -

