Challenge

Week - 4

1.CONTROLL LOGIC FOR WASHING MACHINE IN STATE SPACE :

state space :

Stateflow provides a graphical language that includes state transition diagrams, flow charts, state transition tables, and truth tables. You can use Stateflow to describe how MATLAB algorithms and Simulink models react to input signals, events, and time-based conditions.

Stateflow enables you to design and develop supervisory control, task scheduling, fault management, communication protocols, user interfaces, and hybrid systems.

With Stateflow, you model combinatorial and sequential decision logic that can be simulated as a block within a Simulink model or executed as an object in MATLAB. Graphical animation enables you to analyze and debug your logic while it is executing. Edit-time and run-time checks ensure design consistency and completeness before implementation.

state machine :

A finite state machine is a model of a reactive system. The model defines a finite set of states and behaviors and how the system transitions from one state to another when certain conditions are true.

Stateflow is a graphical programming environment based on finite state machines. ... Finite state machines are representations of dynamic systems that transition from one mode of operation (state) to another. State machines: Serve as a high-level starting point for a complex software design process.

simulink model for washing machine :

Model under there is no water supply :

  • if water=0 then the condtion checks and red lighting will glow as shown in figure.

  • if water=1 then the condtion checks and proceds to the next state and complete the entire process and shows as shown in figure.

Diffrent states inside the chart :

In this chart there are diffrent states are used ie, power supply,water supply,soaking,washing,rinsing,drying,indicating and an start and end states are provided.

when ever the condition mentioned in trasistion is true is proceed to the next state.

The inputs are water and power to the machine these are mentioned using constant blocks. when ever the input is 0 to onstant block ie, power is off ,if it is 1 the power in on. same for water also.

Input and output variables declared on the symbol pane :

in this symbol pane power and water are input variables and remaining are output variables.

2.“Gear shift” logic as per below conditions:

0 to 15 1

16 to 25 2

26 to 40 3

41 to 60 4

Above 61 5

Gear shift model using charts in the simulink is given below :

A chart is used to create the diffrent states for controll logic.

The Slider Gain block allows you to vary a scalar gain during a simulation using a slider . The block accepts one input and generates one output. Data type support for the Slider Gain block is the same as that for the Gain block.

Scope is used plot the signals o graphs.

Display will display the output values.

Gear shift controll logic with diffrent states are shown below fig :

In this model intially input x is gien to the 1st state.then condtion is checked at 1st transition ie,

1.if the x is grater than 0,then it moves to the second state ie, gear1 and display shows "1".

2.The second transition condition will checked ie, if x>15 then it will moves to another state ie, gear 2 otherwise it will stay in gear1.

3.In case the above condtion is satisfied then it again checks for 3rd transition if its true the changes to next state ie, gear3.

4.The sme way follows untill we stop the simulation.

Input and output variabls are shown in symbol pane:

In this x is input speed and gear is the output variable.

Gear plot with respect given speed is shown below :

as the speed is changed by using slider gain.The run time is set as infinity,the gear changes from one state to another state by changing the input slider gain.

The below are the two plots at diffrent inputs.

This block represents inside the slider gain :

By moving the blue highlited symbol to right to left or vice versa to change the input while simulation runnning.

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.