Week - 4
- Implement control logic of a “washing machine” using Stateflow as per given sequence:
- If the power supply is available, the system gets activated
- If the Water supply is not available, stop the process & indicate through LED
- Soaking time should be 200s followed by Washing time of 100s.
- Then rinsing happens for next 20s & dryer runs for 50s
After all the processes have completed turn on the finished LED.
Answer:-
AIM:-
- Implement control logic of a “washing machine” using Stateflow as per given sequence:
- If the power supply is available, the system gets activated
- If the Water supply is not available, stop the process & indicate through LED
- Soaking time should be 200s followed by Washing time of 100s.
- Then rinsing happens for next 20s & dryer runs for 50s
PROCEDURE:-
- WORKING PRINCIPAL OF A WASHING MACHINE:
A Washing machine by spinning at 800-1600 rpm helps soap and dirt with it to leave the surface of the cloth via centrifugal force and into outlet pipes hence utilizing centrifugation to both clean and partially dry the clothes loaded in it.Thus the processes are electrically controlled,such as the drum,valves,pump,moter and heating.The valve opens again and the dirty water drains out of the drums.The pump works to help get rid of water.The valve lets clean water in again into the drums.The four process are:
SOAKING:
It is used to dip clothes in detergent water to remove dirt from the clothes.In this function customer need to select soak from a panel.Soak-This function is available with wash timer,machine will wash the clothes.
WASHING:
During the wash cycle a large plastic agitator turns around,Moving your clothes through the water.When the wash is finished,The pump drains the water from the outer drum.
RINSING:
The dirty,soapy water is drained,then the washing machine is refilled and your clothes are rewashed in clean water.Spin-All the water is drained completely,Thencyour clothes are spun very fast and excess water is removed thanks to centrifugal force.
DRYER:
They work by pushing warm dry air through your wet washing to extract moisture.then cooling the now humid air in a heat exchanger to condense the moisture,Which is collected in a tank or pumped down the drain.The (NOW DRY) air is reheated and the cycle repeats.
- STATE -FLOW:
Systematic soluction of a problem is possible with sequential,unambiguous and realizable finite process step set.This set is called "ALGORITHM" and it is one of the most important part of the programming languages.In this study it represented how to learn algorithm by using simulink stateflow.In flow diagram based algorithm learning.

CONTROL LOGIC OF A WASHING MACHINE:
It checks for the extent of dirt and grease,the amount of soap and water to add,direction of spin,and so on.
The machine rebalances washing load to ensure correct spinning.Else,it reduces spinning speed if an imbalance is detected.Even distribution of washing load reduces spinning noise.

The two inputs are given for the power and water supply.Once the inputs are given outputs are displayed by the flow chart as per the given sequence.The system are observed for sometimes then it is checked and the process is completed by green light as displayed.

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.
ANSWER:-
The transmission operating mechanism:
To effect a gear change,selecting first gear,For example,the driver depresses the clutch,disengaging the input shaft.Using the shift lever,the driver selects the first gear,and the linkage moves the shift fork to connect the 1st to 2nd lockingcollar with 1st gear,locking it to the output shaft.Now,when the clutch is relesed,engaging the input shaft,the output shaft yurns because 1st gear is locked to the output shaft by the locking collar.
As the driver speeds up,selecting 2nd gear simply involved repeating the process,but moving the shift lever to 2nd gear.The shift shaft moves the shift fork to disengage 1st gear and engage 2nd gear.
Releasing the clutch engages the input shaft again,this time routing power through 2nd gear.Changing to 3rd gear involves using a second shift linkage,Shift fork,and locking collar,this one between 3rd and 4th gears.
Because the countershaft and output shaft turn at different speeds,moving from 1st to 2nd gear,trying to engage a higher gear while the vechicle is moving slower would be like trying to turn the shaft at two different speeds,Which is impossible,Synchronizer rings are like tiny clutches,usingfriction to bring the locking collar and the gear to the same speed,at which point they easily mesh and power can be reapplied.
Before we go into the simulink for the transmission box simulation we need to fallow the below condiations for the setup.
Speed Range(kmph) Gear
0 to 15 1
16 to 25 2
26 to 40 3
41 to 60 4
Above 61 5
and by doing so we do that in a coded pattern in the state flow chart which we get to see below:

These are the fallowing block setup did we need for the setup:
- Stateflow chart
- Constant
- Display
- Lamps
and the output is just as similar as it is
0 to 15 speed 1st gear

16 to 25 speed 2nd gear

26 to 40 speed 3rd gear

41 to 60 speed 4th gear

Above 61 speed 5th gear

and that's how we did the gear shift logic in the simulink,As we can see the lamp is lit according to the gear it shows and the gear is at the current running according to the speed.