Week - 4
..
..
Week 4 Challenge
Introduction:
Simscape is a powerful extension within MATLAB that empowers engineers to:
- Model physical systems: Create simulations of real-world phenomena encompassing electrical, mechanical, thermal, and other domains governed by physics. Imagine an electric vehicle with a motor, drivetrain, and cooling system. Simscape lets you model these components and their interactions.
- Intuitive schematic building: Components like motors, springs, and actuators are represented by blocks. You can assemble them visually into a schematic, mimicking the physical system's structure. This simplifies the modeling process.
- Domain-specific expertise not required: Simscape takes care of the underlying mathematical equations that govern these components. You don't need in-depth knowledge of every domain's intricacies to build the model.
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
Let us now undergo the stages of a washing machine which in turn helps you to understand better and pick the option depending on the basis of your need successfully.
- Prewash
- Washing
- Rinsing
- Spinning
Learning these things essential to pick the right option at the right time.
Prewash
The option called prewash indicated filling the drum with a certain water level and mix up with the detergent powder. All this option helps to wash out all the stains including the stubborn or dirt very well from the clothes. This is possible as we soak the whole clothes placed into the drum. Finally, drain the water without making a second thought.
Taking the amount of water is different for both front load and top load washers respectively. In the front-load washing machines, it is all up to the settings done by the single user. Whereas at the top load washers, there are water level sensors for filling the drum at a certain level and clean the entire load getting rid of stubborn stains successfully.
Washing
At this particular time, the machine uses agitation which is for mixing both water and detergent, in turn moving the clothes all around the drum. Generally, the top load washing machines come with an agitator or impeller placed at the center of the tub.
While coming to front-load washers, it depends upon the rotation of the entire tub provided for enhancing better wash and cleaning the load ultimately. Moreover, the duration taken to complete the wash cycle is depends upon the settings option chosen by the user. Always the heavy load enhances high duration. Small or limited load enhances less duration.
Rinsing
The option called rinsing is known for the multi-talented option. During this particular cycle is on the flow, the soapy water taken from the clothes. And all the fresh or pure water is sparkled to the clothing available in the tub. This particular rinse option held responsible for taking soapy water out of the washer without facing any kind of difficulties. Finally, the agitation with plain water is considered the last step in the rinsing option.
Spinning
Spinning is done to dry the entire clothes before getting to the end of the actual wash cycle. And these several washing machines are going to be spun at different speeds. In turn, the speed of one particular spin is calculated in revolutions per minute (rpm) respectively. This indicates the speed of the spin extracting the whole amount of water from the clothes making it dry very well.

These are the different cycles done by each model available in the Indian market. Accordingly, the machine coming with these factors enhances high performance. All the things one should aware of these options and must pick the right one at the right time. For any doubts, mention a single comment in the following rectangular section.
So that we help you understand the terminology much better comparatively. Thank you. If you like to learn more interesting things related to washing machines, keep in touch with the best washing machine irrespective of time and place.
The control logic for the washing machine is developed using the stateflow. The inputs for the logic includes the power supply for the activation of the system followed by the input of water supply. Once these two inputs are given, the washing process happens in a sequence : Soaking - Washing - Rinsing - Drying.
First the water supply and power supply is checked, if both are available, then the process begins. The indication for each of these supplies is given by the Lamp block. Each operation is considered to be one state in stateflow. The transition between the states is temporal based, as described below.
Soaking for 200 seconds
Washing for 100 seconds
Rinsing for 20 seconds.
Drying for 50 seconds.
Once this cycle is complete the process terminates and the finished Lamp block is green indicating that the process is complete. The sampling time is kept as 1 seconds. The simulink block is as follows

The stateflow logic is constructed as follows

The initial state is default state when the washing machine is OFF. In this case, no operation happens. When the power supply and water supply is given, the condition is met, the transition from the default state to the Soaking operation state happens. After 200 seconds, the transition from this to the Washing operation state happens. Then after 100 seconds, the transition to the Rinsing operation state occurs, then after 20 seconds transition to the drying state happens. Finally, after more 50 seconds, the transition occurs to the End state, at which point the washing operations are all complete. At any state if the power supply is OFF, there will be a transition to the default OFF state. Likewise, if water supply is not there during the soaking operation, the state transition occurs towards the default OFF condition.
The simulink block is simulated for various test cases and the results are plotted as follows is shown below.
Case 1 : When power supply is OFF, Water supply is OFF. As both the inputs are in OFF condition, no washing occurs.


As it can be noticed, the operation doesnt happen through the simulation, as the input conditions are not met.
Case 2 : When power supply is OFF, Water supply is ON. Since, the power supply is OFF, the washing process doesnt occur.


Since both the input conditions are not met, the washing operation doesnt happen throughout the entire simulation.
Case 3 : When power supply is ON, Water supply is OFF. Since the water supply is OFF, the washing process doesnt occur.


Similar to the previous two cases, the input conditions are not met, the washing operation doesnt happen throughout the entire simulation.
Case 4 : When power supply is ON, Water supply is ON. Since both the input conditions are met, the washing process starts and proceeds one step after another based on the time constraints given for each operation.


The dashboard created indicates the current operation going in the washing machine.
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.
The Transmission operating mechanism:
To effect a gear change, selecting first gear, for example, the driver depresses the clutch, disengaging the input shaft. Using the shift lever, the driver selects the first gear, and the linkage moves the shift fork to connect the 1st-2nd locking collar with 1st gear, locking it to the output shaft. Now, when the clutch is released, engaging the input shaft, the output shaft turns because 1st gear is locked to the output shaft by the locking collar.
As the driver speeds up, selecting 2nd gear simply involved repeating the process, but moving the shift lever to 2nd gear. The shift shaft moves the shift fork to disengage 1st gear and engage 2nd gear. Releasing the clutch engages the input shaft again, this time routing power through 2nd gear. Changing to 3rd gear involves using a second shift linkage, shift fork, and locking collar, this one between 3rd and 4th gears.
Because the countershaft and output shaft turn at different speeds, moving from 1st to 2nd gear, trying to engage a higher gear while the vehicle is moving slower would be like trying to turn the shaft at two different speeds, which is impossible. Synchronizer rings are like tiny clutches, using friction to bring the locking collar and the gear to the same speed, at which point they easily mesh and power can be reapplied.
Before we go into the Simulink for the transmission box simulation w need to follow the below conditions for the setup.
Speed Range(km) Gear
0 to 15 1
16 to 25 2
26 to 40 3
41 to 60 4
Above 61 5
The simulink block is as follows

The stateflow diagram indicating the control logic is as follows :

The transition between the different gears is dependent on the speed conditions given above.
The speed is varied while simulation, and the gear number is plotted. The simulation results at different instances during the simulation is shown below.
Case 1 : When speed is between 0kmph and 15kmph. The gear number at the display is 1.

Case 2 : When speed is between 16kmph and 25kmph. The gear number at the display is 2.

Case 3 : When speed is between 26kmph and 40kmph. The gear number at the display is 3.

Case 4 : When speed is between 41kmph and 60kmph. The gear number at the display is 4.

Case 5 : When speed is above 61kmph. The gear number at the display is 5.

The input velocity plot and the corresponding gear numbers for the entire simulation is plotted below :

Gear Ratios:
- Each gear provides a different gear ratio. Lower gears (1st and 2nd) have a high ratio, multiplying engine torque for better acceleration from a standstill or uphill driving.
- Higher gears (4th and 5th) have a lower ratio, reducing engine RPM for fuel efficiency at cruising speeds.
Benefits:
- Provides greater driver control over the vehicle's performance compared to automatic transmissions.
- Generally, more fuel-efficient than automatic transmissions, especially when driven efficiently.
RESULTS:
1) Thus the control logic of a washing machine using stateflow is processed as per the given sequence and LED lights are turns to the green colour and the system is completed.
2) A simulink model is created for the gear shift logic and using slider gain the values are obtained.