Week - 4
Question 1:
Implement control logic of a “washing machine” using Stateflow as per the 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
- The soaking time should be 200s followed by a Washing time of 100s.
- Then rinsing happens for the next 20s & dryer runs for 50s
After all the processes have been completed turn on the finished LED
Answer:
Washing Machine Working Procedure:
The Washing Machine uses Centrifugal force as a Principle of operation to remove dirt and Clean Clothes. When the Drum rotates at 800 to 1440 Rpm in the washing powder(detergent) diluted water, the earth will leave the surface and gets collected through the outer drum pours and ejected out.
The Complete Process is divided into simple 4 stages:
1. Soaking: It is used to dip clothes in detergent water to remove dirt from the clothes. This function is available with a wash timer, In 320 sec of washing 200 sec is soaked and the remaining 120 sec machine will wash the clothes.
2. 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.
3. 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, then your clothes are spun very fast and excess water is removed thanks to centrifugal force.
4. 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.
Simulink Model:

Used Blocks:
Process:
1. Chart - The State Flow diagram of the Washing Machine Process
Inputs:
1. Constants: For Power and Water Supply
2. Slider Switches: Acting ON/OFF Switch Control for Power and Water Supply
3. Lamps: Indication GREEN/RED for Power and Water Supply ON/OFF respectively
Outputs:
1. Displays: Stage Indicator For Soak, Rinse, Wash, Dry, Finish and Terminate
2. Lamps: ON/OFF Indicator or Soak, Rinse, Wash, Dry, Finish and Terminate
3. Scope: For a Graphical View of the entire Process.
State flow Model:
1. Initially the Power and Water must be ON to start the Process.
2. Then the following Soak, Wash, Rinse, Dry, and Finish Process will continue for the defined seconds.
3. The Process will get terminated if Power / Water Supply gets Switched OFF.

Results:


--------------------------------------------------------------------------------------------------------------
Question 2:
Make a Simulink chart for the “Gear shift” logic as per the 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-2nd locking collar with 1st gear, locking it to the output shaft. Now, when the clutch is released, engaging the input shaft, the output shaft turns 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 vehicle is moving slower would be like trying to turn the shaft at two different speeds, which is impossible. Synchronizer rings are like tiny clutches, using friction to bring the locking collar and the gear to the same speed, at which point they easily mesh and power can be reapplied.

Simulation Model:

Used Block:
State Flow:
1. Chart: For the Process of Gear transition mechanism with respect to Acceleration.
Inputs:
1. Constants: For Ignition and Speed Inputs
2. Toggle Switch: For Ignition ON/OFF
3. Slider Input: For Linear Acceleration Input
Outputs:
1. Display: For Gear Number Indicator and Overspeed Indicator
2. Lamps: Visual Representation for Gear Number and Overspeed Indicator
3. Custom Gauge: For Speedometer Representation.
State Flow Model:

Results:

During Simulation Running, for the given Input Speed respective Gear Transmission will occur and be Graphically displayed on Speedometer and Gear Display.