Week - 4
QUESTION NO.1:
ANS:
In this problem, we have developed a logic using Stateflow.
Inputs for this problem are i)Power Supply and ii)Water Supply. We have denoted them by PS and WS respectively in our simulation.
Outputs for this problem taken are(as per the question) i)Water supply indication ii)soaking iii)washing iv)rinsing v)drying vi)finish. We have denoted them as WS1, soaking, washing, rinsing, drying & finished.
The Stateflow logic is as follows:
Step1: It will check the power supply. If "1" is applied at the input side, it will move towards the next state, or it won't.
Step2: It will check the water supply. If "1" is applied at the input side, it will move towards the next state and show a green indication; otherwise, it won't and show a red indication.
Step3: After step1 and step2 are successfully compiled all the other states of soaking, washing, rinsing, and drying will be carried out as per the time given in the question and will show a green indication for every state in which it is working.
Step4: after all the above steps the machine will stop and give a green indication for finishing the task.
(Total time required to complete the entire process is 434 secs)
All the necessary documents are attached herewith.
QUESTION NO.2:
ANS:
In this problem, the gear shifting logic with respect to the change in speed is implemented.
As per the question, one input and one output which is speed and gear location respectively are taken.
To vary the speed, a slider gain Simulink block on the input side is used.
Stateflow logic is as follows:
Step1: Logic gets checked at the input side, if the speed is less than 16 kmph it stays in gear 1, if the speed increases beyond 16 kmph it shifts to 2nd gear.
Step2: Logic gets checked at the input side, if the speed is less than 26 kmph it stays in gear 2 if the speed increases beyond 26 kmph it shifts to 3rd gear. If speed further reduces beyond 16 kmph, step 1 gets executed.
Step3: Similarly for gear 4: speed range from 41kmph to 60kmph & for gear 5: speed range above 61 kmph logic is applied in the Stateflow
All the necessary documents are attached herewith.
Thank you,
Chinmay.