Simulink Onramp Progress after this session Modules 1–3 of 11  (27%)
📋

Session Overview

This session introduces Simulink — MathWorks' graphical block-diagram environment for modelling and simulating dynamic systems. You will work inside Simulink Onramp, a browser-based sandbox requiring no local installation.

By the end you will navigate the Simulink interface, understand what blocks and signals are, find blocks in the Library Browser, connect them to form a signal chain, and run your first simulation — all framed in EV engineering context.

🧠
Block A — 15–20 min
Theory: Simulink vs MATLAB, block diagrams, signal flow, Library Browser
🖱️
Blocks B & C — 90 min
Onramp Modules 1–3: environment, source blocks, Scope, connecting & running
Block D — 15 min
EV task: throttle-to-torque block diagram sketch & Onramp build
Objective
After this session you can navigate Simulink Onramp, add Source and Sink blocks, connect them with signal lines, run a simulation, and explain what each component represents in an EV powertrain.
⚖️

MATLAB vs Simulink

You have already used MATLAB. Simulink solves a fundamentally different kind of problem. Understanding the distinction is the most important conceptual step in this session.

PropertyMATLABSimulink
ParadigmScript-driven — write code line by lineGraphical block diagram — connect blocks visually
Core unitVariable — a static value at one momentSignal — a value that changes over simulation time
ExecutionSequential: line 1, line 2, line 3…Continuous simulation driven by a solver
Best forData processing, matrix math, analysisDynamic systems, control loops, time simulation
EV examplecurrent = (150*1000)/400Throttle block → Controller block → Motor block
Key Shift
In MATLAB x = 5 stores the number 5. In Simulink there is no x = 5. Instead you place a Constant block with value 5 and draw a wire carrying that value to the next block. The wire is the signal — it exists over simulation time, not just at a single moment.
🖥️

The Simulink Environment

When you open Simulink Onramp you see four key areas. Spend two minutes locating each one before starting the exercises.

Diagram — Simulink interface areas
flowchart LR A["📚 Library Browser (find blocks here)"]:::sig --> B["🖼️ Model Canvas (build model here)"]:::cyan B --> C["📊 Scope Window (view signal output)"]:::green D["▶ Simulation Toolbar Run · Stop · Stop Time"]:::orange --> B classDef sig fill:#EEF2FF,stroke:#4F46E5,color:#312E81,font-weight:bold classDef cyan fill:#E0F2FE,stroke:#0284C7,color:#0369A1,font-weight:bold classDef green fill:#D1FAE5,stroke:#059669,color:#065F46,font-weight:bold classDef orange fill:#FEF3C7,stroke:#D97706,color:#92400E,font-weight:bold

Library Browser

Catalogue of all available blocks organised into categories. Use the search bar at the top — it is faster than browsing folders. Drag a block from here to the canvas to add it to your model.

Model Canvas

The grid where you build your model. Drag blocks here then draw signal lines between them by clicking an output port and dragging to an input port.

Scope Window

Opens when you double-click a Scope block after running. Plots signal value (y-axis) vs simulation time (x-axis). Your digital oscilloscope.

Simulation Toolbar

Contains ▶ Run (Ctrl+T) and the Stop Time field. Stop Time sets how long the simulation runs in seconds. Default 10 — leave it for today.

🧩

Blocks & Signals

Every Simulink model is built from two things: blocks (functions) and signals (connections).

Diagram — block diagram pattern
flowchart LR A["INPUT Block produces a signal e.g. Constant = 300 RPM"]:::input B["PROCESS Block transforms the signal e.g. Scope / Display"]:::sink classDef input fill:#EEF2FF,stroke:#4F46E5,color:#312E81,font-weight:bold classDef sink fill:#D1FAE5,stroke:#059669,color:#065F46,font-weight:bold A -->|"signal wire"| B

What is a Block?

A block is a function. Every block has configurable parameters (e.g. the Constant value, the Sine Wave frequency). Double-click any block to open its parameter dialog.

What is a Signal?

A signal is a value that changes over simulation time — it travels along the wire between blocks. A signal has a complete time history; a MATLAB variable is a static snapshot.

Port Rule
Signal lines must go from an output port (right side ▷) to an input port (left side □). You cannot connect two outputs or two inputs. Simulink shows a red error if you try.
📚

Library Browser — Key Blocks for This Session

Find each block using the Library Browser search bar before starting Module 2. You need five blocks today.

BlockLibraryWhat it doesEV application
ConstantSourcesOutputs a fixed value — does not change during simulationFixed throttle position; motor speed at steady state
Sine WaveSourcesOutputs a sinusoidal signal (amplitude, frequency, phase)AC motor phase voltage; current ripple from inverter
ScopeSinksPlots signal value over simulation time — your oscilloscopeViewing motor torque output or voltage waveform over time
DisplaySinksShows the current (final) value of a signal as a numberReading final SoC value or motor speed at end of cycle
GainMath OperationsMultiplies input signal by a constant valueRPM → rad/s conversion; scaling throttle to torque command
Scope vs Display
Use Scope when the signal changes over time and you want to see its shape. Use Display when you only care about the final steady-state value. Connect the Gain output to both for maximum information.
🔗

Connecting Blocks & Running a Simulation

1
Add blocks from the Library Browser

Search for each block name. Drag it from the results panel onto the model canvas. Position it to leave room for wires on left and right.

2
Draw signal lines

Hover over the output port (right side of a block, triangle ▷). Click and drag to the input port (left side, square □) of the next block. A solid dark line = correct. Orange/dashed = error.

3
Set block parameters

Double-click any block to open its parameter dialog. Change values, click OK. Every parameter is a real engineering value — know what you are setting.

4
Press ▶ Run

Press Ctrl+T or click the Run button in the toolbar. After running, double-click the Scope block to see the output waveform. Must re-run after every parameter change — Simulink does not auto-update.

EV Context

Every stage of an EV powertrain is a signal transformation. Each transformation is a block. Each connection is a wire.

Diagram — throttle-to-torque signal chain (today's model)
flowchart LR A["Throttle Constant Block 0–100%"]:::s1 --> B["Motor Controller Gain Block (Session 06)"]:::s2 --> C["Wheel Speed Display / Scope"]:::out classDef s1 fill:#EEF2FF,stroke:#4F46E5,color:#312E81,font-weight:bold classDef s2 fill:#FEF3C7,stroke:#D97706,color:#92400E,font-weight:bold classDef out fill:#D1FAE5,stroke:#059669,color:#065F46,font-weight:bold

Today's build

Build: Constant (300)Display

This represents: motor running at 300 RPM → display confirms signal received. In Session 06 you add the Gain block that converts this to rad/s and links it to real motor physics.

Industry Link
OEMs at Tata, Mahindra, and BYD model their entire EV powertrain as hierarchical Simulink block diagrams. The Constant → Display model you build today is structurally identical to Level 1 of those production models — just without the internal complexity yet.
🔧

Block D — EV Task

Block D ⏱ 15 min Throttle-to-Torque Block Diagram Sketch
1
Paper sketch — EV powertrain signal flow

Draw four boxes connected by arrows: Throttle Input → Motor Controller → Electric Motor → Wheel Speed. Label each arrow with the signal type (throttle %, torque command N·m, angular velocity rad/s).

2
Map each stage to a Simulink block

For each stage in your sketch, identify the block from the Library Browser. Write the block name next to each box. Which block represents a fixed throttle? Which would plot wheel speed over time?

3
Build in Onramp

Build Constant (300) → Display. Run it. Verify Display shows 300. Then add a Scope in parallel with Display (connect Constant output to both). Run again — what does the Scope show for a Constant input?

4
Group discussion
Q1 — What does the Scope show for a Constant block input? Why is it a flat line?
A constant value does not change over time — what does that look like on a time-series plot?
Q2 — Which Library Browser block would you swap in to make the Scope show a waveform instead of a flat line?
Think about which source block produces a time-varying signal
Q3 — In a real EV, what signal does the Constant block throttle input represent physically?
Think about the driver's accelerator pedal position sensor
🛠️

Troubleshooting

❌ Scope is blank after running
Fix: Scope is not connected to a signal line, or Stop Time is 0. Check the wire. Verify Stop Time > 0.
❌ Red error: "Unconnected output port"
Fix: Every block output must connect to something. Add a Display or Scope, or add a Terminator block from Sinks.
⚠️ Orange dashed line between blocks
Fix: Connection is invalid. Delete the line and redraw from output port (right ▷) to input port (left □).
🔍 Can't find a block in Library Browser
Fix: Use the search bar at the top. Type the block name exactly (e.g. "Constant", "Gain") and press Enter.

Key Takeaways

⚖️Simulink is graphical; MATLAB is scripted. They solve different problems and are used together.
🧩A block is a function. A signal is a time-varying value on a wire. These two concepts underpin every Simulink model.
📚Use the Library Browser search bar — never browse folders manually.
🔗Signal lines go from output port (▷) to input port (□). Solid dark = correct. Dashed orange = error.
▶️Press Run after every parameter change. Simulink does not auto-update.

Before Session 06

You built a Constant → Display model. You can see the value but not how it relates to real motor physics. The Gain block changes that — it scales the signal and links it to a physical conversion.

Session 06 adds the Gain block, introduces block parameters in depth, and builds the RPM→rad/s conversion model.

Session 06 →