Challenge

Week - 4

AIM:

  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 and indicate through LED.
    • Soaking time should be 200s followed by a washing time of 100s.
    • Then rinsing happens for the next 20s, and the dryer runs for 50s.
    • After all the processes have completed, turn on the finished LED.
  2. Create a Simulink chart for the “Gear shift” logic as per the following conditions:

    Speed Range (kmph)Gear
    0 to 151
    16 to 252
    26 to 403
    41 to 604
    Above 615

    Provide speed input while the simulation is running and display the gear number.

ROCEDURE:

WORKING PRINCIPLE OF A WASHING MACHINE:

A washing machine operates by spinning at speeds of 800-1600 rpm to help soap and dirt leave the surface of the clothes through centrifugal force and into outlet pipes, utilizing centrifugation to clean and partially dry the clothes. The processes are electrically controlled, including the drum, valves, pump, motor, and heating. The valve opens to allow clean water in and the dirty water is drained out with the help of a pump.

The four main processes are:

  1. Soaking: Clothes are dipped in detergent water to loosen dirt. Typically, in a 42-minute washing cycle, 27 minutes are for soaking and 15 minutes for washing.
  2. Washing: A large agitator moves clothes through the water, and after washing, the pump drains the water.
  3. Rinsing: Dirty, soapy water is drained, the machine refills with clean water, and clothes are rewashed.
  4. Drying: Warm air is pushed through wet clothes to extract moisture, which is collected in a tank or pumped down the drain. The dry air is reheated, and the cycle repeats.

CONTROL LOGIC OF A WASHING MACHINE:

Using Stateflow in Simulink, the washing machine's control logic checks for the extent of dirt, the amount of soap and water to add, the direction of spin, and more. The machine rebalances the washing load to ensure correct spinning. If an imbalance is detected, the machine reduces the spinning speed. Even distribution of the washing load reduces spinning noise.

Steps:

  1. Open MATLAB and create a new Simulink model.
  2. Add a Stateflow chart to the model.
  3. Define the states and transitions according to the sequence:
    • Check Power Supply
    • Check Water Supply
    • Soaking
    • Washing
    • Rinsing
    • Drying
    • Finished
  4. Add input and output ports for power, water supply, and LEDs.
  5. Implement the logic using Stateflow blocks and transitions.

GEAR SHIFT LOGIC:

A gear shift mechanism for a manual transmission includes a shaft axially movable for selecting shift planes and rotatable for engaging the gears defining the shift planes. The shaft is held in a reference shift plane by two helical springs.

Steps:

  1. Open MATLAB and create a new Simulink model.
  2. Add a Stateflow chart to the model.
  1. Define the states and transitions according to the gear shift logic:
    • Gear 1: 0-15 kmph
    • Gear 2: 16-25 kmph
    • Gear 3: 26-40 kmph
    • Gear 4: 41-60 kmph
    • Gear 5: Above 61 kmph
  2. Add input ports for speed and output ports for gear.
  3. Implement the logic using Stateflow blocks and transitions.
  4. Use a slider gain to simulate varying speed inputs during the simulation.


RESULTS:

  1. The control logic of a washing machine using Stateflow was successfully implemented as per the given sequence. The LEDs indicated the process status, turning green upon completion.
  2. A Simulink model for the gear shift logic was created, and gear numbers were displayed correctly according to the speed input during the simulation.
Your portfolio, next

Ship work like this
in your own course.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.