Week - 4
1.
Aim:-
- 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
state flow:-
state flow provide a graphical language that includes state transition diagram,flow chart,state transition table and truth table.it is used to discribe how MATLAB algoritham and simulink model react to input signals,time based conditions.state flow enable you to design and develop supervisory control,task schduling,fault management,communication protocol,user interface,hybrid system.graphical animation enables you to analyze and debug your logic while it executing.edit-time and run-time checks ensure design consistency and completeness before implementation.
control logic:-
control logic is a key part of a software program that control the operations of the program.the control logic responds to commands from the user,and it also acts on its own to perform automated tasks that have been structured in to program.
washing machine:-
washing machine is a home appliance used to wash laundry.wasing machine can be classified as
semi automatic washing machine
fully automatic washing machine
simulink-state flow chart
logic of washing machine

variable chart-in simple pane ,we can assign what are the input and output of the logic.
procedure/step:-
1.soaking-soaking the clothes in to the water for 200 sec as per the requirement .
2.washing-motor run forward and backward direction to wash the clothes 100sec
3.rinsing-draining of water from the washing machine for 20sec.
4.drying- after drying of water a dryer is used for 50sec to dry the clothes.
for the above process iam using the state flow chart methode.
here iam using 2 inputs ,
1.power supply
2.water supply
here i used 2 slider switch power and water.and connected to a constant block to provide the conditions.
- in state flow chart we first apply the condition motor_on by putting power==1
in next process i made a logic to check water availibility if there is no water condition water==0,it shut the process by reaching the termination block and the water is available i applied water==1 it proceed to other process
after fullfilling the water supply all the process proceed one by one with given time delay.for time delay i used after[] command/condition for soaking(200sec),washing(100sec),rinsing(20sec)drying(50sec)
after completing all stages it goes to termination block.
conditions:-
1.when both,power supply and water supply off

2.power supply is on and the water supply is off

3.both switches are on

2.
Aim:-
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
state flow:-

symbol pane:-

simulink model:-

procedure/step:-
1.creat a chart block for defining the stateflow as per given condition
2.inside the circular junction is to terminate the signal flow and return a null valve
3.slider switch is used to controll ignition
4.slider is connected with speed .by using slider we can adjust the speed
5.speedometer also connected to input speed.so we can see the speed
6.spped conditions
neutral-spped 0
1st gear-speed is 0 to 15
2nd gear-speed is 16 to 25
3rd gear-speed is 26 to 40
4th gear-speed is 41 to 60
5th gear-speed is 61 and above.
conditions:-
when ignition:ON,speed:0,gear number:0

ignition:ON,speed:0-15,
Ignition:ON ,speed:16-25

ignition:ON ,speed:26-40,

Ignition:ON , speed 41-60

Ignition ON, speed above 60

conclusion:-
-To undestand the basic state flow,state machine,stages of the system
-We learn how logic is made and apply the condition to fullfill the requriement
-We learn the logic used in processing the washing machine,and gear shifting mechanisam on changing the speed.