Challenge

Week - 4

  1. 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

Ans:

Working principle of washing machine:

A washing machine works on the principle of centrifugal force. A washing machine spinning at some predefined speed range helps soap and dirt with it to leave the surface via centrifugal force and into outlet pipes and hence centrifugation is used for both clean and partially dry the clothes loaded in it. Thus the processes are electrically controlled, such as drum,valve,pump,motor and heating. The valve opens again and the dirty water drains out of the drum. The pump is used to take the water out from the drum. The valve lets the clean water again in the drum. The four processes are

1) Soaking:

It is used to dip the dirty clothes in detergent water to remove the dirt from the clothes. In the function a person need to select soak from the panel. Soak function is available with wash timer which includes washing and soaking process for perticular period of time.

2) Washing:

During this cycle a large agitator turns around, moving the 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 wasing machine is refilled and the clothes are rewashed in clean water. In spinning all water is drained completely, then the clothes are spun very fast and excess water is removed using the centrifugation effect.

4) Dryer:

They work by pushing warm air throgh the wet clothes to extract moisture, then cooling the now humid air in heat exchanger to condense the moisture, which is collected in a tank or drained out using pump. The air is reheated and cycle repeats.

Stateflow:

State flow is basically a new feature of connecting our logics into a systematical arrangement. In simple words it is the graphical representation of our logics. A stateflow chart contain sequential and logic in the form of state transition diagram, flow chart, state transition table and truth table. One can include stateflow as blocks in simulink model. The collection of these blocks in a simulink model is stateflow machine. Stateflow charts can contain state,boxes,function,data,events,messages,transition,junctions and annotations. States,boxes and functions can contain other states,boxes,junctions,transitions,functions,annotations,data,events and messages. The level of nesting can be continued indefinately.

Control logic of Washing machine:

It checks the extent of grease and dirt, the amount of soap and water to add,direction of spin and so on. The machine rebalances the washing load to ensure the correct spinning. Else, it reduses spinning speed if an imbalance is detected.Even distribution of washing load reduses spinning noise.

Fig. 1{a} Stateflow chart

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

Fig. 1{b} Stateflow model

  • The stateflow chart includes the stages as the different functions of washing machine. Initially we assigned a constants for power and water supply in simulink model as the input to the stateflow chart.
  • The output stages namely soaking,washing,rinsing and drying are given as outputs and are connected to lamps to indicate the process done.
  • The washing machine will be given both power and water supply which is indicated by LED lamp connected as output. For the initial 200 seconds, soaking process will takes place and once it gets over a lamp will be glown indicating completion of soaking process.
  • For the next 100 seconds washing process will gets over which will be indicated by the lamp glow.
  • Similarly rinsing followed by drying will occur for the period of 20 and 50 seconds respectively. This process will also be indicated by lamp glow.

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.

Ans:

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

Stateflow model:

Fig. 2{a} Stateflow model

The chart is added from the simulink library.In order to be able to give the speed input while the simulation is running, a Slider gain block is used. To visualize the number of engaged gear, a simple Display block is used.

Fig. 2{b} Stateflow chart

  • Inside the chart, the required conditions are implemented using the state blocks.
  • Here I have used G as common output parameter used for all the states, which is then connected to the display block in the main model.
  • Each of the step comes into play as per the provided conditions. For example, if the speed is below 15, gear 1 is in engaged condition. But if the speed goes beyond 15, gear 1 disengages and gear 2 gets engaged.
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.

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.