Week - 4
Aim:-
- To implement control logic at a "Washing machine" using Stateflow as per the given sequence.
- To create a Simulink chart for the "Gear Shift" logic as per the given condition.
*Objective:
1. In Simulink, Implement the control logic of a “washing machine” using Stateflow.
- If the power supply is available, the system gets activated.
- If the Water supply is not available, stop the process & indicate through the LED.
- Soaking time should be 200s followed by 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.
2. In Simulink chart for the gear shift logic as per below condition.
| Speed Range(km/h) | Gear |
| 0 to 15 | 1 |
| 16 to 25 | 2 |
| 26 to 40 | 3 |
| 41 to 60 | 4 |
| above 61 | 5 |
Given speed input while the simulation is running and display the gear number.
ANSWER 1:-
*State flow:-
State flow provides the graphical language that includes state transition diagram, flow chart, state transition table, and truth tables it is used to describe flow MatLab algorithms and reach the input signal, Graphically animation enable you to analyze and debug your logic while executing edit time and run-time check and ensure design continuous and ensure design consistency and completeness before implementation.
*Control logic:-
Control logic is the key part of a software program that controls the operation of the program the control logic is responsive to the commands from the user and it also wets on its own to perform an automated task that has been structured in the program, controlled logic can be modeled using a state diagram, which is a form of the hierarchical state machine.
*Washing Machine:-
It is used to wash various types of clothes without applying any physical effort. With a washing machine, you don't have to rub the clothes with your hand or squeeze them to remove the water from them.
*Soaking:-
It is used to dip clothes in detergent water to remove dirt from the clothes, In this function, customers need to select soak from a panel.
*Rinsing:-
The dirty soap and water are 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.
*Dryer:-
They work by pushing warm dry air through your wet washing to extra moisture. then cooling the now humid air in a heat exchanger to condense the moisture. Which is collected in a tank or pomped down the drain.
*Simulink Model:-

*Block Used:-
- Constant:- This block is used for power and water supply.
- Switch:- This is used to determine output.
- Lamp:- To indicate the running signal.
- Chart:- To create a control logic program.
- Display:- This block display the output of the state.
*Control logic:-

ANSWER 2:-
*Gear Shifting Mechanism:-
A gear shaft mechanism for a manual transmission includes a shaft planesand rotable for engaging the gears defining the shift planes. The shaft is beld in a reference shift plane by two helical spings.
*Simulink Model:-
*Block used;-
- Constant- This block is used as a constant values
- Slide Gain- This is performs a scalar gain that you can modify during simulation.
- Chart- A stateflow chart can be used as the action language to implement control logic.
- Display- This is used as only for display the final value.
*Flow Chart:-

*Result:-
- Thus the control logic of a washing machine using stateflow is processed as per the given sequence and LED light are used and the system is completed.
- Simulation of gear shift corresponding to the given speed range have been simlated successfuly.