Challenge

State flow in simulink

AIM:

To Implement control logic of a “washing machine” using Stateflow

To make a Simulink chart for the “Gear shift” logic and Give speed input while the simulation is running & display the gear number.

OBJECTIVES:

To create a 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

To 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.

PROCEDURE:

Firstly, open the matlab and type simulink in command or select simulink in menubar.

Washing Machine:

The blocks used for washing machine are Rocker switch, Constant, Lamp, Display and chart.

Firstly, open the chart and add a state enter power switch state on(1) or off (0).

Similarly for all the processes done in washing machines like soaking, washing, rising and drying.

Soaking time set as 200s followed by Washing time of 100s.

Then rinsing happens for next 20s & dryer runs for 50s.

After all the state assigned with the symbol pane.

Connect the rocker switch with power switch and water supply.

Connect the lamp with each process done by washing machine.

Run the process.

The result shown on display.

Gear Shift:

The blocks used for Gear Shift are Signal builder, chart, scope and lamp.

Firstly, open the chart and add a state.

Gear 1, 2, 3, 4 & 5 and assign the state of input & output in the signal pane.

Enter the speed gear shifting values.

Run the simulation.

The results are shown in the Scope.

RESULTS:

The logical sequence has been created as per the given.

The Gear shift has given speed and created in state flow.

Blocks Used
1. Chart
A Finite state machine is a representation of an event-driven (reactive) system. In an event-driven system, the system responds to an event by making a transition from one state (mode) to another. This transition occurs if the condition dening the change is true.
2. Display
The Display block shows the value of the input data. You can specify the frequency of the display. For numeric input data, you can also specify the format of the
display.
3. Constant
The Constant block generates a real or complex constant value signal. Use this block to provide a constant signal input.
4. Lamp
The Lamp block displays a color indicating the value of the input signal. You can use the Lamp block with other Dashboard blocks to build an interactive dashboard of controls and indicators for your model. You can specify pairs of input values and colors to provide the information you want during the simulation.
5. Rocker Switch:
The Rocker Switch block toggles the value of the connected block parameter between two values during simulation. For example, you can connect the Rocker Switch block to a Switch block in your model and change its state during simulation.




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.