Week - 4
Aim- To implement control logic behind the washing machine and gear shift mechanism using State flow
*State flow control logic washing machine*
Objective:- If the power supply is available, the system gets activated.
If the water supply is not available, stop the process and indicate through the led
Soaking time should b 200s followed by a washing time of 100s then rinsing happens for the next 20 and the dryer runs for the 50s
Theory
State flow :- we can use Simulink-based states to model a periodic or continuous dynamic system-based state
Control logic:- control logic is the part of a controller that defines how a reactive system responds to events or conditional changes
Parts of washing machine
An inner drum
Paddles
Agitator
Outer drum
Thermostat and heating element
Pump
Programmer
Pipes and valves
Working:-
The working of a washing machine is simpler than we thought. First of all, we need to consider the overall load of clothes.
In accordance with the load, we need to select water levels, the temperature of the water, the wash/rinse cycle, and its timings.
In addition, we need to decide agitating levels according to the types of clothes such as soft cloths or heavy cloths.
After selection, the washing machine automatically fills up the water to the desired level.
Then, it starts rotating the clothes by using an agitator. After some time, it drains the water and refills the drum with fresh water in order to remove all the soap. It starts rotating again and drains the water after some time.
Furthermore, the next phase is the spinning of clothes in order to remove all water.
In this phase, the whole drum rotates in a circular motion and removes all the water, making them dry. Although these clothes may not be completely dry, we need to air dry them for routine use.
Explanation:-
To create control logic using State flow first we need to add a cahart block in the blank model of Simulink.
Open the chart block by double clicking on it and adding a state block to it, First create two state blocks for the water supply and power supply.
Connect both of them with the junction to terminate the signal flow.
For the ON condition of the washing machine, it shows 1 value.
For the OFF condition of the washing machine, it shows 0 value.
When the given condition gets satisfied it gets carried forward otherwise result gets terminated.
Then taking our remaining conditions which is soaking, washing, rinsing, dryer with their respective time between them to process.
Simulink State flow Model:-
Inside The Chart Block,
Washing Machine Control Logic,
In the above image, the model is currently in the OFF state.
Output :-
Condition || When Power Supply is ON , and Water Supply is OFF.
Condition || When Power Supply is ON , and Water Supply is ON.
Condition || When Power Supply is ON, and Water Supply is ON, Soaking is ON, t = 10 sec.
Condition || When Power Supply is ON, and Water Supply is ON, Washing is ON, t = 230 sec.
Condition || When Power Supply is ON, and Water Supply is ON, Rinsing is ON, t = 330 sec.
Condition || When Power Supply is ON , and Water Supply is ON , Dryer is ON , t = 350 sec.
Condition || When Power Supply is ON , and Water Supply is ON. End , t = 450 sec.
Output of the Washing Machine Control Logic Using Scope :-
* State flow Control Logic Gear Shift *
Objective:- To make a control logic behind the Gear shift, Using given conditions.
Speed Range (Km / hr) Gear
0 to 15 1
15 to 25 2
25 to 40 3
40 to 60 4
Above 61 5
Theory :-
Gear Shift: It is a mechanism by which the transmission gears in a power-transmission system are engaged and disengaged.
Gears are used for transmitting power from one part of a machine to another. In a bicycle, for example, its gears (with the help of a chain) that take power from the pedals to the back wheel. Similarly, in a car, gears transmit power from the crankshaft (the rotating axle that takes power from the engine) to the driveshaft running under the car that ultimately powers the wheels.
You can have any number of gears connected together and they can be in different shapes and sizes.
Each time you pass power from one gear wheel to another, you can do one of three things,
Increase speed: If you connect two gears together and the first one has more teeth than the second one (generally that means it's a bigger-sized wheel), the second one has to turn round much faster to keep up. So this arrangement means the second wheel turns faster than the first one but with less force.
Increase force: If the second wheel in a pair of gears has more teeth than the first one (that is, if it's a larger wheel), it turns slower than the first one but with more force.
Change direction: When two gears mesh together, the second one always turns in the opposite direction. So if the first one turns clockwise, the second one must turn counterclockwise. You can also use specially shaped gears to make the power of a machine turn through an angle. In a car, for example, the differential (a gearbox in the middle of the rear axle of a rear-wheel drive car) uses a cone-shaped bevel gear to turn the driveshaft's power through 90 degrees and turn the back wheels.
Gear Shift Control Logic Using State flow :-
Gear Shift Control Logic Using State flow(Inside Chart Box) :-
Explanation:-
To draw an actual control logic behind the Gear Shift with respect to the Speed, here we use a chart box and inside that, we decide how the gear will shift with respect to speed.
First, we open the chart box and added the state block in that. First, we add the Ignition state which will be the starting part of our control logic.
After adding the Ignition state we added a Neutral state which is a zero state, or the state at which our Ignition is ON but there isn't any speed or torque provided to the vehicle gearbox.
Between the two states, we set the conditions using square brackets which will be executed each time when we run our model.
Here we use a Toggle Switch to turn on the Ignition and also a Lamp that shows ON and OFF states.
We use two constant blocks first block is connected to the Ignition switch which is a toggle switch and another one is connected to the gain where we can vary our speed whichever we want.
For the output purpose, we use the scope as well as display. The scope will show the output in the form of graphical representation and display will show the current Gear Number.
Output : Ignition = ON , Gear = Neutral, Speed = 0
Output : Ignition = ON , Gear = Gear 1 , Speed = Less Than 15
Output : Ignition = ON , Gear = Gear 2 , Speed = Less Than 25
Output : Ignition = ON , Gear = Gear 3 , Speed = Less Than 40
Output : Ignition = ON , Gear = Gear 4 , Speed = Less Than 60
Output : Ignition = ON , Gear = Gear 5 , Speed = Above 61
Conclusion:-
From the given challenge I was able to learn how things work in the sequence with respect to the Washing Machine and Gear Shift, and most importantly how we can use state flow to visualize the change in the model output in real-time.