Challenge

Week -2

Aim:

  1. To make a simulink model of Door Bell using solenoid block.
  2. To make a simulink model Using a thermistor to sense the temperature of a heater & turn on or turn off the fan.

OBJECTIVES:

FOR DOOR BELL:

  • Create a situation where the switch is closed for 2 seconds and then released. Observe the physical movement of the plunger. 

FOR FAN                                                           

  • Temperature source should be 20 °C from 0 to 10 seconds, 27 °C from 10 to 30 seconds, 23 °C from 30 to 50 seconds. Fan conditions should be ON if the temperature above 25 °C, OFF otherwise.

1 . To make a simulink model of Door Bell using soleniod block

Theory:-

  • In electric bell when the switch is closed the electromagnet receives the electric power from batery and pulls the metal hammer to hit the bell producing sound.

                                                                       

Basic components used to generate a simple doorbell circuit are:

  1. Battery
  2. Switch
  3. Solenoid
  4. A bell with plunger.

SOLENOID:

A solenoid is a type of electromagnet, the purpose of which is to generate a controlled magnetic field through a coil wound into a tightly packed helix. The coil can be arranged to produce a uniform magnetic field in a volume of space when an electric current is passed through it. The term solenoid was coined in 1823 by André-Marie Ampère to designate a helical coil. In engineering, the term may also refer to a variety of transducer devices that convert energy into linear motion. The term is also often used to refer to a solenoid valve, an integrated device containing an electromechanical solenoid which actuates either a pneumatic or hydraulic valve, or a solenoid switch, which is a specific type of relay that internally uses an electromechanical solenoid to operate an electrical switch for example, an automobile starter solenoid or linear solenoid. Solenoid bolts, a type of electromechanical locking mechanism, also exist. In electromagnetic technology, a solenoid is an actuator assembly with a sliding ferromagnetic plunger inside the coil. Without power, the plunger extends for part of its length outside the coil; applying power pulls the plunger into the coil. Electromagnets with fixed cores are not considered solenoids.

 Condition:-

FOR DOOR BELL:

  • Create a situation where the switch is closed for 2 seconds and then released. Observe the physical movement of the plunger. 

Simulink model:-

 Blocks used :-

  • Pulse generator: For generating a time interval to control the switch
  • Simulink-PS converter: To convert Simulink system to physical system
  • Battery: Is used for power supply
  • SPST Switch: To control the flow of current through battery.
  • Scope: To view the plots of Time interval, velocity and position of metal hammer.
  • PS-Simulink converter: To convert physical system to Simulink system
  • Electrical reference: To Grounding/Earthing the all electrical blocks
  • Mechanical Translational reference: To grounding the all mechanical blocks
  • Solver configuration: Defines solver settings to use for simulation.
  • Solenoid block: To generate the electromagnetic to attracts the hammer.
  • Ideal Translational motion sensor: device that converts an across variable measured between two mechanical translational nodes into a control signal proportional to velocity and position.
  • Display block: To display the velocity and position values.

Explanation:-

  1. From the above governing circuit of a door bell, we know that we need a switch, solenoid, battery and a plunger.
  2. So, in order to get all these components into a Simulink model we have to taken blocks that perform same action what the above devices perform.
  3. Now first a ‘Solenoid Block’ is taken to represent a solenoid in the model, then to represent the battery we have taken Battery Block’ from the library browser.
  4. Then this ‘Solenoid Block’ and ‘Battery Block’ are connected to each other via positive and negative terminals.
  5. A ‘Switch Block’ is placed in between ‘Solenoid Block’ and ‘Battery Block’ and it is connected with both the blocks.
  6. Now for the Switch to operate we need to provide a physical signal through ‘PS’ port in the ‘Switch Block’. The provided physical signal should be greater than the threshold of the switch, for switch being closed, or else it will open.
  7. Now this whole battery, switch and solenoid path is connected to an ‘Electrical Reference Block’ which represents earthing of the circuit. This ‘Electrical Reference Block’ should be connected with negative port of the ‘Battery Block’.
  8. Then in the ‘Solenoid Block’, ‘R’ and ‘C’ are two variables which represent plunger and fixed point respectively.
  9. Now this ‘R’ is connected to a ‘R’ of ‘Ideal Translation Motion Sensor Bock’, which senses the position of the plunger in the ‘Solenoid Block’ and gives the output.
  10. Now in ‘Ideal Translation Motion Sensor Bock’ the outputs are given as ‘V’ and ‘P’ which represent the velocity and position of the plunger. Since we are only interested in knowing the change in position of the plunger, so we need only results from ‘P’ output.
  11. Now ‘C’ in the ‘Ideal Translation Motion Sensor Bock’ is a mechanical translation conserving port, which means that the mechanical process starts from ‘R’ and ends at ‘C’ and again it starts at ‘R’ and the cycle goes on.
  12. So ‘C’ in the ‘Ideal Translation Motion Sensor Block’ is connected to a ‘Mechanical Translation Reference’ which represents a fixed point where it is rigidly clamped in real time.
  13. Similarly ‘C’ of ‘Solenoid Block’ is also connected to the same ‘Mechanical Translation Reference’ as fixed point for the solenoid.
  14. Since we position of the plunger as output from ‘Ideal Translation Motion Sensor Bock’ we have connected port ‘P’ to a ‘PS – Simulink Converter’ where the physical values from port ‘P’ are converted into Simulink value, and then this ‘PS-Simulink Converter’ is connected to ‘Scope Block’ which will generate a graph for change in position of plunger from port ‘P’ of ‘Ideal Translation Motion Sensor Bock’.
  15. Now to provide a physical signal for operating the switch, we have used a ‘Pulse Generator Block’, which generates a continuous square pulse.

Pulse genarator:-

              

  1. From the above Figure we can observe that we have taken we have given period value as ‘4’, pulse width as ‘50’, phase delay as ‘2’ and amplitude by default is ‘1’ we have not changed it. This means that initially the pulse will be zero, since we have given phase delay of ‘2’ so till 2 sec the pulse will be zero and at 2 secs the pulse will start from zero to 1 since we have given amplitude as ‘1’ and then now the pulse width will half of period ,so for the next two seconds the pulse will be at amplitude ‘1’ only, then it will again come down to zero at 4th second and then it will at zero for next 2 secs thus completing the period of 4 seconds.
  2. From starting to ending of the pulse it will take 4 secs of time period in which only for 2 secs the amplitude will be one and for rest of time it will be zero. So, after these 4 secs period again the pulse will be generated and thus cycle continues.
  3. To this ‘Pulse Generator Block’ a ‘Scope Block’ is connected to see how the pulse is generated.

Scope:-

  1. The above figure is obtained by running the Simulink model and double clicking on the ‘Scope1’ block. This figure shows, how the pulse is generated and in this figure the X-axis represents the time and Y-axis represents the amplitude. As mentioned in the point no.18, the pulse has started after 2 seconds, then for next two seconds it has amplitude of ‘1’ and then next two seconds the pulse is again zero. The pulse is starting from 2 seconds and ending at 6 seconds which nothing but a time period of two seconds.
  2. Thus, this represents that when amplitude is one, the switch will be closed and when it is zero the switch will open. Since our objective is only to see the change in position of plunger when switch s closed for 2 secs so the we have the amplitude as 1 for 2 secs in the pulse generator by making the pulse width half of the period in the inputs for ‘Pulse Generator Block’.
  3. Since the pulse that is coming from ‘Pulse Generator Block’ is a Simulink value, so to convert this value into a physical value we have used ‘Simulink-PS Converter Block’, since switch only takes physical value as inputs.
  4. As mentioned above the port ‘P’ of ‘Ideal Translation Motion Sensor Bock’ is connected to another ‘Scope Block’, and a ‘Solver Configuration Block’ is also connected to this path which generates equations and solves the whole model internally to give the results of the whole Simulink model as output.
  5. Now the run the model and double click on the ‘Scope’ Block which is connected to ‘Ideal Translation Motion Sensor Bock’ to get the results.

  1. We will get above graph as the result when we double click on the ‘Scope’ block. Here x-axis represents the time in seconds and y-axis represents position of plunger in mm
  1. From the above figure we can observe that the initial position of the plunger is at ‘5’, as from the pulse generator block, a pulse generated at 2, so in the position of the plunger is also changing at time 2 seconds and time till which the pulse amplitude is ‘1’ till that time the plunger is also at same position after the change from initial position.
  2. Again, as the amplitude of the pulse becomes zero, the plunger returns to its initial position back again and as the pulse cycle goes on, plunger also changes its position and comes back to its initial position.

2 . To make a Simulink Model Using a thermistor to sense the temperature of a heater & turn on or turn off the fan

THERMISTOR:

A thermistor is a type of resistor whose resistance is dependent on temperature, more so than in standard resistors. The word is a combination of thermal and resistor. Thermistors are widely used as inrush current limiters, temperature sensors (negative temperature coefficient or NTC type typically), self-resetting overcurrent protectors, and self-regulating heating elements (positive temperature coefficient or PTC type typically).

Basic components used to generate a simple cooling fan circuit are:

  1. Battery
  2. Thermistor
  3. Fan
  4. Transistor
  5. Resistor

Condition:-

FOR FAN                                                           

  • Temperature source should be 20 °C from 0 to 10 seconds, 27 °C from 10 to 30 seconds, 23 °C from 30 to 50 seconds. Fan conditions should be ON if the temperature above 25 °C, OFF otherwise.

Simulink model:-

Blocks used:

  • Thermistor: This block represents an NTC thermistor using the B-parameter equation. The resistance at temperature T is given by R(T) = R0*exp(B*(1/T-1/T0)) where R0 is the Nominal resistance at the reference temperature T0, and B is the Characteristic temperature constant. The temperature T of the thermistor is governed by the equation m*c*dT/dt = Q where Q is the net heat flow into port A, m is the mass and c is the lumped specific heat capacity. The thermal mass m*c is calculated from the Thermal time constant t_c and the Dissipation factor K_d using the equation m*c = K_d*t_c.
  • Resister: The voltage-current (V-I) relationship for a linear resistor is V=I*R, where R is the constant resistance in ohms.
  • Signal builder: To build the input Temperature signals
  • Scope: Used for plotting
  • Simulink-PS converter: Converts the Simulink input signal to a Physical Signal.
  • Controlled Temperature source: This block represents an ideal energy source in a thermal network that can maintain a controlled temperature difference regardless of the heat flow rate. The temperature difference is set by the physical signal port S. A positive temperature difference causes the temperature at port B to be greater than the temperature at port A.
  • Temperature sensor: To sense the temperature. This block measures temperature in a thermal network. There is no heat flow through the sensor. The physical signal port T reports the temperature difference across the sensor. The measurement is positive when the temperature at port A is greater than the temperature at port B.
  • Thermal reference: To grounding the thermal network
  • Electrical reference: To grounding the electrical network
  • Mechanical rotational reference: To ground the mechanical rotational parts
  • Slover configuration: Defines solver settings to use for simulation.
  • Battery: Power source
  • Voltage sensor: To sense the threshold voltage.
  • Switch: condition switch to control based on threshold value.
  • Controlled voltage source: To regulate the voltage.
  • DC motor: Used as a rotating device
  • Ideal rotational motion sensor: To sense the angular velocity and angular displacement of a DC motor.

Explanation:-

  1. To create a Simple Cooling Fan model using Thermistor we need a thermistor, battery, resistor, voltmeter, a logical switch which are basic components of the circuit we need in the Simulink model.
  2. First to represent a thermistor, a ‘Thermistor Block’ is taken and placed in the model. Now to represent a battery, a ‘Battery Block’ is taken and the positive port of this block is connected to positive port of the ‘Thermistor Block’.
  3. Now to represent a resistor, a ‘Resistor Block’ is taken from the library browser and its positive port is connected to negative port of the ‘Thermistor Block’. The negative port of ‘Resistor Block’ is connected to the negative port of the ‘Battery Block’. Now a ‘Electrical Reference Block’ is connected near the negative terminal of the ‘Battery Block’ which represents the earthing of the real time circuit.
  4. Now to represent a voltmeter a ‘Voltage Sensor Block’ is connected parallel to the ‘Resistor Block’, because to measure to voltage across a component, voltmeter should be always connected parallel to that component.
  5. Thus, we have completed our simple circuit model, but we need some physical quantities to as signal for thermistor to work.
  6. In this case we need the fan to get ON and OFF at different temperatures. So, to provide temperature, we have used ‘Controlled Temperature Source Block’ which only gives a specified temperature as output even though heat flow is more.
  7. Now to give different temperatures to this ‘Controlled Temperature Source Block’ we need to send temperature signals. To send these signals we have used a ‘Signal Builder Block’ which allows use to send any type of signals as inputs.
  8. We have to double click on the ‘Signal Builder Block’ to set the signal according to our requirement.

Signal builder:-

               

  1. Above Figure shows how the signal are set in the ‘Signal Builder Block’. As this dialogue box opens, first we have to click on the “Signal” at the top and then select “New” then select “Custom” option. Now it will ask to give the values of y-axis and x-axis. Since we know that at which time, we need which temperature as mentioned in the starting, we can give those values in an array in this box and then the above figure signals are generated.
  2. We can see in the figure that how different temperature are given at different time. So thus, we have created our signals and before connecting it to the ‘Controlled Temperature Source Block’ we have to convert these signals into a physical value. So, to do this we have used a ‘Simulink-PS Converter Block’.
  3. So now the port ‘B’ of ‘Controlled Temperature Source Block’ is connected to port ‘A’ of the ‘Thermistor Block’ and port ‘A’ of ‘Controlled Temperature Source Block’ is connected to the a ‘Thermal Reference Block’. In ‘Controlled Temperature Source Block’ a positive temperature difference causes the temperature at port B to be greater than the temperature at port A.
  4. Now the output of the ‘Voltage Sensor Block’ is connected to ‘Scope Block’ first, and before connecting to the ‘Scope Block’ a ‘PS-Simulink Converter’ is used to convert physical value to Simulink values.
  5. Now when we run the simulation and double click on the ‘Scope Block’ we will get the following the graph.

scope:-

  1. From the above figure we can see that how voltage is changing with change in temperature. Using this information, we can set conditions for fan to ONN and OFF.
  2. If we observe the graph, we notice that from time 0 to 10 seconds when temperature is 293K, voltage is between 0.0095 and 0.01 and from time 10 to 30 seconds when temperature is 300K, voltage is between 0.0125 and 0.013 and from time 30 to 50 seconds when temperature is 296K, voltage is nearly 0.011.
  3. As mentioned in the objective fan should be ONN when temperature is more than 25 degree Celsius, from the above graph when voltage is more than 0.011 the fan should ONN and when voltage is below 0.011, fan should be OFF.
  4. This above logic used to ONN and OFF the fan. To do this we have used a ‘Switch Block’ that routes the signals according to the conditions provided.
  5. The centre port of ‘Switch Block’ is connected to output of ‘PS- Simulink Converter’ which gives the voltage values. The top port of the ‘Switch Block’ is connected to a ‘Constant Block’ of value 1 and bottom port of the ‘Switch Block’ is connected to another ‘Constant Block’ of value 0.
  6. The centre port of ‘Switch Block’ is the condition input which means that when the value from ‘Voltage Sensor Block’ is more than the threshold value in the ‘Switch Block’ then it will pass the value 1 which we have specified in the top port of the ‘Switch Block’. If the voltage from ‘Voltage Sensor Block’ is less then the threshold value in the ‘Switch Block’ then it will pass the value 0 which we have specified in the bottom port of the ‘Switch Block’. Here it acts like a transistor in a real time circuit.
  7. To set the threshold value of ‘Switch Block’, we have to double click on the ‘Switch Block’ and then we can change the value of threshold. Since we want switch to be ONN only when temperature is 300K so the threshold is given as 0.011. So when voltage gets more than 0.011 the switch will give value 1 as output which means fan will be ONN and when voltage gets less than 0.011 the switch will give value 0 as output which means fan will be off.
  8. Now the output of ‘Switch Block’ is connected to another ‘Scope Block’ to get the results.

scope 2:-

  1. By double clicking the Scope Block we can observe the above graph. Here we can clearly see that when temperature is 300K the fan is ONN and at remaining temperatures the fan is OFF.

CONCLUSIONS:

  1. Thus, both the objectives were achieved successfully.
  2. Similar approach can be used for simulating other physical devices using Simulink.
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.