Week - 4
1. Washing Machine Control Logic Diagram:
Aim:
To implement control logic of a washing machine using state flow as per the given sequence:
- If the power supply is available, the system gets activated.
- If water is not available, stop the process and indicate through LED.
- Soaking time should be 200s followed by washing time of 100s.
- Then rinsing happens for next 20s and dryer runs for 50s.
After all the processes have completed turn on the finished LED.
State Flow:
State flow provides a graphical language that includes state tables and truth tables. With the help of state flow we can describe how MATLAB algorithms and simulink models reach to input signals, events and time based condition. In other words, we can view the nature and behaviour of the control system designed using MATLAB algorithms and get real time informations such as circuit behaviour.
Control Logic:
Control Logic is model system logic using state machines, flowchart and truth tables.
Theory:
Washing Machine:
A washing machine is a home appliance used to wash laundry. This device is also known as laundry machine, clothes washer or washer. The term is mostly applied to machines that use water as opposed to dry cleaning which uses alternative cleaning fluids and is performed by specialist businesses or ultrasonic cleaners. The user adds laundry detergent, which is sold in liquid or powder form to the wash water.
Working of a Washing Machine:
The working principle of a washing machine is centrifugation. Centrifugation is a separation process which uses the action of centrifugal force to promote accelerated settling of particles in a solid-liquid mixture. The washing machine consists of centrifuge for this purpose. A centrifuge is a piece of equipment that puts an object in rotation around a fixed axis, applying a force perpendicular to the axis of spin that can be very strong. A domestic washing machine works like an electromechanical system in which there are four processes namely:
1) Soaking
2) Washing
3) Rinsing
4) Drying
All the four processes occur according to the timing that has defaultly given in the system. When we provide the power supply the washing machine gets switched on and we also provide water supply so that the water will be used for above processes to wash the clothes. The processes are electrically controlled, such as the drum, valves, pump, motor and heating. The valve opens again and the dirty water drains out of the drums. The pump works to help get rid of the water. The valve lets clean water in again into the drum then the process continues.
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 the panel. Soak- This function is available with wash timer.
Washing:
During the wash cycle, a large plastic agitator turns around, moving our 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 our clothes are rewashed in clean water.
Spin- All the water is drained completely, then our clothes are spun very fast and excess water is removed due to centrifugal force.
Dryer:
They work by pushing warm dry air through our 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 dowm the drain. The (now dry) air is reheated and the cycle repeats.
Explanation of Control Logic of a Washing Machine using State Flow:
State flow as said earlier, is a simulink tool to implement the state machine. Here, the model system logic of a washing machine using state flow has been done.
Step 1: Create a chart and enter the given input conditions.
Given input conditions are:
1) If power supply is available, the system or the device is activated.
2) If the water supply is not available, stop the process and indicate through LED.
3) Soaking time should be 200s followed by washing time of 100s.
4) Then rinsing happens for next 20s and dryer runs for 50s.
After all the processes have completed turn on the finished LED.
Step 2: After entering the input conditions in the chart, go to symbols pane and assign thee given variable. That is, input data, output data, etc,.
Step 3: Give the input values for turning on or off for the power supply and water supply.
Condition:
If value=1, Power and Water Supply will turn ON.
If value =0, Power and Water Supply will turn OFF.
Step 4: Use display block and lamp indicator to display the results.
Blocks used:
Chart:
The chart block is used to define the state flow diagram of the washing machine. Not only for this case for any situations for creating the state flow diagram of the given system. It represents the real-time machine or system.
Display:
The display blocks are used for observing the values at the output of the stateflow chart. It determines wether the device is in active state or not.It is actually used for measuring purpose for determining the value of parameters of a circuit. In this control logic diagram, we have used the display block to indicate the state of the system is active or not. Here, when the display block shows the value 1 for say, the washing port, it means that the system is curently in washing state.
Lamp:
The lamp block is used for the indication purpose. Here, the states of the washing machine can be seen via display block but for simplicity, the lamp is used to indicate wether a particular state of the machine is active or not. Here, for value 0, the lamp indicates via red light and for value 1, the colour of lamp changes to green indication that the state is active. Here, the lamp is connected with the ouput port of the chart via display block set which is connected to the output of the chart.
Constant:
Constant block, as we all know, it provides a constant value for the circuit. Here, we have used two constant blocks reprensenting the power supply and water supply. It is based on the value of the constant block which determines wether the whole control logic is ON state or OFF state. We have given the constant as the input to the state flow diagram.
Toggle Switch:
Toggle switch block represents the switching device here, we have connected the toggle switch t the constant block so that whenever we switch on or off , the value of the constant block changes to 1 and 0 respectivels. By this way we don't need to repeatedlt change the value of the constant by double clicking the constant block and all.
Simulation Diagram:
Below attachment is the simulation diagram of washing machine using control logic diagram.
Conclusion:
We have successfully created the simulation diagram of the washing machine system using control logic and state flow diagram and observed the result.
2. Gear Shift Logic:
Aim:
To 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 and display the gear number.
Theory:
Transmission is a mechanism that transmits power developed by the engine to the wheels of the car which is called as transmission system. For the vehicle to move forward at different speeds power changing devices is required to transfer the power developed by the engine to the wheels, such devices are known as transmission.
The following are the functions of gear box:
1) Provides the much needed torque for the vehicle to move forward under road and load conditions.
2) It can be shifted to reverse gear so that the vehicle can move backward.
3) It is also shifted into neutral for starting the engine.
The figure below shows the basic transmission system of an automobile.
Working:
In a gearbox, the tertiary shaft is mashed to the clutch with the use of a couple of gears. So, the countershaft is always in running condition. When the tertiary shaft is brought in contact with the main shaft by the use of meshing gears, the main shaft starts to rotate according to the gear ratio. When the driver wants to change the gear ratio, simply press the clutch pedal which disconnects the tertiary shaft with the engine and connects the main shaft with the tertiary shaft by another gear ratio by use of gearshift lever.
Procedure:
1) Create a chart block for defining the stateflow as per the given conditions.
2) Inside it, the circular junction is to terminate the signal flow and return a null value.
3) If the ignition is OFF, that is 0, the process is terminated at the junction else 1 carry is forwarded.
4) If speed is less than or equal to 0, the flow is terminated and gear 0 (Neutral), is activated at the junction else 1 is carry forward.
5) If speed is greater than 0 and less than or equal to 15, the flow is terminated and gear 1 is activated.
6) If speed is greater than 15 and less than or equal to 25, the flow is terminated and gear 2 is activated.
7) If speed is greater than 25 and less than or equal to 40, the flow is terminated and gear 3 is activated.
8) If speed is greater than 40 and less than or equal to 60, the flow is terminated and gear 4 is activated.
9) If speed is greater than 60, the flow is terminated and gear 5 is activated.
10) Define ignition and speed as inputs whereas speedometer, scope and gear number display as outputs.
11) Connect the chart block with constant blocks for ignition and speed inputs. Input switches connected to them are slider switch and a slider bar to adjust speed respectively. Attach lamps to observe the ON/OFF condition.
12) A common scope block is connected to observe the speed numerically and obtain the output plot.
A simulink model for operating the gear shift mechanism according to given conditions is shown below in the attachment.
Result:
the result of simulation of the model shifting gear at various speed is also shown in below attachment.