Challenge

Week - 4

1. AIM - Implement control logic of a “washing machine” using Stateflow.

Model of the Washing Machine :

Stateflow :

Explanation :

1.For making the model we have to create a stateflow chart with power, water , soak,wash, rinse, dry and finish of the cycle.

2. To start with the charts we require a breakpoint added with chart power.

3. From power to water we make a loop condition if power is 1, the flow of the current goes to engage the water and when the water has one condition the washing machine cycle runs from soak till the end.

4. I have given soak =1 . With this we set breakpoint flow of water is for 200 seconds and once it reaches above 200 seconds it will go to next state wash. The wash, rinse, and dry are seet as per the given time.

5. Here i have finish =1 so the lamp will indicate when the display is one.

6. After creating the chart we have to check the input and output through the symbols tool which is visible on the left side of the chart page. In type column we have to define the input and output.

7. After giving the input and output we will be connecting the power and water to two constant and all the fve outputs to display.

8. I have connected inputs power and water to switch and lamps , all four cycles are then connected to display and lamps to indicate the washing cycle.

Result :

power and water OFF :

power ON and water OFF :

power OFF and water ON :

power ON water ON and soaking process ON :

power ON water ON and soaking and washing process ON :

power ON water ON and soaking, washing and rinse process ON :

power ON water supply ON and soaking, washing, rinse and dry process ON :

power ON water ON and All process ON :

RESULT : The Washing machine logic is successfully implemented and executed.

2. AIM : Make a Simulink chart for the “Gear shift” logic .

Model of Gear shift in simulink :

Stateflow :

Explanation :

1. To create a simulink model of gear shift create a state flow chart and start with the power block which is connected to the breakpoint and a junction with power ==0 and connected to speed block (state) power==1 so that when the speed is above 1 the process will start flowing oto gears.

2.Here is have mentioned speed to conway our conditions as above speed greater than 0 the gear shift should start the cycle of changing to next gear.

3. In gear 1, the breaking point is mentioned up to 16 then it is respectively changing the speed till 61.

4. From gear 5 till gear 1, there up arrow(breaking point) the speed is decreased till 0 so that we can shift our gear not only increasing it can be decreased too.

5.After completion of our chart we can see the input power and speed and output speeds.

6. I have connected two constants with power and speed so that when the switch is on the power will be indicated from the lamp which is green in color. speed is connected to a slider which requires manually increasing the speed.

7.From the output of the gear , i have connected the gear shift indicator to indicate the gear .

8. I have connected it to the slider to the speedometer to view the speed in the speedometer.

Result :

Power OFF :

power ON:

power on 14 kmph :

Power on 35 kmph :

Power on 72 kmph :

Your portfolio, next

Ship work like this
in your own course.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.