Challenge

Week -2

1.)

Simulink Model Setup

  1. Open Simulink:

    • Launch MATLAB and open Simulink.
  2. Create a New Model:

    • Go to File > New > Model.
  3. Add the Components:

    • Battery: Use a DC Voltage Source block.
    • Switch: Use a Switch block (or a Manual Switch).
    • Solenoid: Use a Simscape block for a solenoid or a custom force block that simulates the plunger's motion.
    • Bell: Represent this as a simple mechanical block that receives input from the solenoid (this could be a spring or mass block).

Parameters

Assume the following parameters for the components:

  • Battery Voltage: V=12 VV = 12 \, \text{V}V=12V
  • Switch Timing: The switch will be closed for t=2 st = 2 \, \text{s}t=2s.
  • Solenoid Force: Adjust parameters to simulate the pull of the solenoid (e.g., a force of 5 N5 \, \text{N}5N).
  • Plunger Mass: m=0.1 kgm = 0.1 \, \text{kg}m=0.1kg (this can be adjusted based on desired behavior).

Model Steps

  1. Battery Configuration:

    • Add a DC Voltage Source block and set it to 12 V12 \, \text{V}12V.
  2. Switch Configuration:

    • Add a Manual Switch or Switch block. Connect it to the battery and solenoid.
    • To automate the switch for 2 seconds, you can use a Pulse Generator or Signal Builder block to control the switch state.
  3. Solenoid Configuration:

    • Use a Simscape block representing the solenoid or create a custom model with a force acting on the plunger based on the battery voltage.
    • Connect the output of the switch to the solenoid input.
  4. Mechanical Setup:

    • Add a Mass block to represent the plunger.
    • Add a Spring and Damper block if you want to model the physical properties of the plunger mechanism.
  5. Output:

    • Use a Scope block to visualize the movement of the plunger over time.
    • Connect the output of the plunger (or force) to the scope to observe its behavior.

Sample Connections

  • DC Voltage Source → Manual Switch → Solenoid.
  • Solenoid → Mass (Plunger).
  • Mass → Scope to observe displacement/velocity.

Running the Model

  1. Set the Simulation Parameters:

    • Go to Simulation > Model Configuration Parameters.
    • Set the stop time to 5 s5 \, \text{s}5s to observe the plunger movement after the switch is released.
  2. Run the Simulation:

    • Click the Run button to simulate the model.
  3. Observe the Output:

    • Open the Scope to view how the plunger moves when the switch is closed for 2 seconds.

2.)

Simulink Model Setup

  1. Open Simulink:

    • Launch MATLAB and open Simulink.
  2. Create a New Model:

    • Go to File > New > Model.
  3. Add Components:

    • Temperature Source: Use a Signal Builder or Step block to generate the temperature profile.
    • Thermistor: This can be represented simply by a transfer function or a sensor block that outputs the current temperature.
    • Fan Control Logic: Use a Switch block to turn the fan ON/OFF based on the temperature.
    • Fan Model: Use a Scope to visualize the fan state (ON/OFF).

Step-by-Step Configuration

1. Create the Temperature Source

  • Signal Builder Block:

    • Drag a Signal Builder block from the Simulink library.
    • Set it to output the following temperatures:
      • From 000 to 101010 seconds: 20∘C20^\circ C20∘C
      • From 101010 to 303030 seconds: 27∘C27^\circ C27∘C
      • From 303030 to 505050 seconds: 23∘C23^\circ C23∘C

    You can set the points in the Signal Builder as follows:

    • (0, 20)
    • (10, 20)
    • (10, 27)
    • (30, 27)
    • (30, 23)
    • (50, 23)

2. Add the Thermistor

  • The thermistor can be represented as a simple output from the temperature source. Just connect the output of the Signal Builder directly to the input of the switch.

3. Add Fan Control Logic

  • Switch Block:
    • Drag a Switch block from the Simulink library.
    • Set the threshold of the switch to 25∘C25^\circ C25∘C to determine whether the fan should be ON or OFF.
    • Connect the output of the temperature source to the first input of the Switch block.

4. Configure the Fan Output

  • Fan State:
    • For the second input of the switch, connect a constant block set to 000 (OFF) and a constant block set to 111 (ON) for the fan.
    • Use a Scope to visualize the output of the Switch block, which will show the fan state (1 for ON, 0 for OFF).

5. Connect the Blocks

  • Connect the output of the Signal Builder to the first input of the Switch block.
  • Connect the second input of the Switch to the constant blocks (0 and 1).
  • Connect the output of the Switch to a Scope block to visualize the fan state.

6. Set Simulation Parameters

  • Go to Simulation > Model Configuration Parameters.
  • Set the stop time to 50 seconds.

7. Run the Model

  • Click the Run button to simulate the model.
  • Open the Scope to observe the fan's state over time based on the temperature profile.

Saving the Model in Previous Version

  1. Save the Model:

    • Go to File > Save As.
    • Choose a name for your model.
  2. Convert to Previous Version:

    • Go to File > Save As.
    • Select Previous Version.
    • Choose R2021a or any lower version.
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.