How could i implement a specific torque-rpm engine characteristics?

56 visualizzazioni (ultimi 30 giorni)
Adam
Adam il 28 Set 2025 alle 22:19
Commentato: Umar il 30 Set 2025 alle 15:39
For my diploma work, i decided to realistically implement a truck driveline, and that includes engine characteristics as well. My first general idea was using the generic engine block, but using tabulated torque data gives me no response, constant 0 torque output. Any help, or better ideas would be much appreciated. I suspect some kind of error in me setting the block itself up, something with the rpms, thresholds? I've tried countless variations, but nothing seemed to work.
Thank you all in forward.
Cheers

Risposte (1)

Umar
Umar il 29 Set 2025 alle 4:39
Modificato: Umar il 29 Set 2025 alle 4:40

Hi @Adam,

Great to see you're tackling a realistic truck driveline implementation for your diploma work - modeling the D17A780 engine is an ambitious and impressive goal! I've thoroughly researched your issue, reviewed the MathWorks documentation, and I have both the solution to your problem AND a powerful analysis tool to help you succeed.

TL;DR:Your initial velocity (400 rpm) is too close to the stall threshold (200 rpm), causing zero torque output. I've created a MATLAB script that proves this and gives you validated data.

After extensive research on MathWorks documentation and MATLAB Central, the zero torque output you're experiencing stems from THREE critical issues:

1. MOST CRITICAL: Initial Velocity vs. Stall Speed Threshold

Your current settings: * Initial velocity: 400 rpm * Stall speed threshold: 200 rpm * Margin: Only 200 rpm (DANGEROUS!)

The Problem: The Generic Engine block implements a critical safety feature - when engine speed drops below the stall speed threshold, torque is blended to zero to prevent numerical instability and simulate engine stalling. With only a 200 rpm margin, any load on the engine will cause the speed to drop below 200 rpm, triggering zero torque output.

Reference:

Generic Engine Block - MathWorks Documentation

https://www.mathworks.com/help/sdl/ref/genericengine.html

"Optional speed and redline controllers prevent engine stall and enable cruise control."

The Fix:

  • Set Initial velocity:750 rpm (realistic idle for heavy diesel)
  • Set Stall speed threshold: 450 rpm
  • This gives you a 300 rpm safety margin

2. CRITICAL: External Mechanical Load Required

According to MathWorks community answers and my experience, the Generic Engine block requires an external load (beyond just inertia) to produce meaningful torque output. Looking at your Simulink model, if you only have: Engine → Inertia → Scope, that's insufficient. You need: Engine → Load (Rotational Damper/Vehicle Body/Constant Torque) → Ground Why: Without a proper load, the engine has nothing to react against. Even with correct initial conditions, you'll get zero or meaningless torque output.

Reference: Complete Vehicle Model Example - MathWorks

https://www.mathworks.com/help/sdl/ug/about-the-complete-vehicle-model.html

"The engine has a connection port coupling it rotationally to the rest of the system... The subsystem represents the vehicle inertia (the load on the transmission)"

3. Engine Inertia Too Low

Your screenshot shows: * Current value: 2 kg·m^2 * Problem: Way too low for a 17.3L, 1,402 kg diesel engine The Fix: Use *10-12 kg·m^2 for realistic heavy-duty diesel engine inertia

COMPLETE SOLUTION - STEP BY STEP

Step 1: Fix Initial Conditions (CRITICAL!)

In Generic Engine Block Parameters:

Engine Specifications: * Model parameterization: Tabulated torque data * Input type: Normalized throttle

Dynamics Section: * Inertia: Specify inertia and initial velocity * Engine inertia: 10 kg·m² * Initial velocity: 750 rpm (well above stall!) * Time constant: 0.2 s

Speed Control: * Stall speed threshold: 450 rpm * Consider enabling: Idle speed controller with reference speed: 700 rpm

Step 2: Configure Mechanical Connectivity Verify your model structure: Engine (Generic Engine Block)->mechanical rotational connection - solid line) Load (Rotational Damper: 5-10 N·m/(rad/s) OR Vehicle Body)->Ground (Mechanical Rotational Reference)

Check: Connection lines should be solid (not dashed) indicating proper physical connections.

Step 3: Use Validated Tabulated Data

I've created a MATLAB script (attached: D17A780_Engine_Analysis.m) that generates validated torque and speed vectors for your D17A780 engine. Run it and copy the vectors it prints.

The script provides: * Realistic diesel torque curve based on your PDF specs * Speed vector: [600 700 800 900 1000 1100 1200 1300 1400 1500 1600 1700 1800 1900 2000] rpm * Torque vector: Calculated values with peak 3800 Nm at 1000-1200 rpm * Visual proof of why 400 rpm initial velocity fails!

UNDERSTANDING THE ANALYSIS TOOL

I've created a standalone MATLAB script (no toolboxes required!) that models the D17A780 and generates comprehensive visualizations. Here's what each plot shows:

Please see attached.

Figure 1: D17A780 Engine Characteristics (6 subplots) Top Row: Full-Load Torque Curve (Top-Left) * Shows the characteristic diesel engine torque curve * Peak torque: 3800 Nm at 1000-1200 rpm (flat plateau - typical diesel behavior) * Red marker: Peak torque point * Green marker: Peak power point * This is your target curve for the Generic Engine block Full-Load Power Curve (Top-Center) * Power rises from idle to peak at 1700 rpm (574 kW / 780 hp) * Green marker: Peak power (574 kW at 1700 rpm) * Red marker: Power at peak torque point * Shows power-limited region after peak Combined Torque & Power (Top-Right) * Classic diesel engine chart with dual y-axes * Blue: Torque (Nm) - peaks early, then falls * Red: Power (kW) - continues rising after torque peaks * Use this to verify your Simulink results match expected behavior Bottom Row: Torque vs Throttle Position (Bottom-Left) * Shows how throttle modulates torque output * Magenta: 25% throttle → ~950 Nm * Cyan: 50% throttle → ~1900 Nm * Green: 75% throttle → ~2850 Nm * Blue: 100% throttle → 3800 Nm (full load) * This explains how the Generic Engine block uses throttle input (0-1) to scale maximum torque Power vs Throttle Position (Bottom-Center) * Same throttle positions showing power output * Demonstrates that power is proportional to throttle * Useful for understanding engine response to throttle commands Stall Threshold Effect (Bottom-Right) - MOST IMPORTANT! * Blue dashed line: Torque curve without stall threshold (theoretical) * Red solid line: Torque curve WITH stall threshold (what Generic Engine block does) * Black dashed vertical line: Stall threshold (450 rpm) * Green dashed vertical line: Recommended idle (700 rpm) * Red "DANGER ZONE" text: Shows where torque → 0 KEY INSIGHT: Below 450 rpm, torque blends to zero linearly. This is why your 400 rpm initial velocity gives zero torque! Even a small load would drop speed below threshold, killing all torque output. Figure 2: D17A780 Operating Maps (2 contour plots) Torque Map (Left) * X-axis: Engine speed (600-2000 rpm) * Y-axis: Throttle position (10-100%) * Colors: Torque output (Nm) * Red zone (top-center): Peak torque region ~3500 Nm at 1000-1200 rpm, 100% throttle * Blue zones: Low torque at low throttle/low speed * Use this to understand the entire operating envelope Power Map (Right) * Same axes as torque map * Colors: Power output (kW) * Red zone (top-right): Peak power region ~500+ kW at 1700 rpm, 100% throttle * Shows how power increases with both speed AND throttle * Demonstrates why diesels are efficient at high torque, lower rpm

White dashed line on both maps: Shows the full-load curve (100% throttle line)

HOW TO USE THE SCRIPT

Step 1: Run the Script % Save as: D17A780_Engine_Analysis.m % Then run: D17A780_Engine_Analysis Step 2: Review Console Output The script prints:

=======================================================
COPY THESE VECTORS TO YOUR SIMULINK GENERIC ENGINE BLOCK
=======================================================
Speed vector (rpm):
[600 700 800 900 1000 1100 1200 1300 1400 1500 1600 1700 1800 1900 2000]
Torque vector (Nm):
[2660.0 2940.0 3220.0 3500.0 3800.0 3800.0 3800.0 3700.0 ...]

Recommended Block Parameters: Model parameterization: Tabulated torque data Input type: Normalized throttle Engine inertia: 10 kg*m^2 Initial velocity: 750 rpm Stall speed threshold: 450 rpm

Step 3: Copy-Paste to Simulink * Open your Generic Engine block * Paste the Speed vector into "Speed vector" parameter * Paste the Torque vector into "Torque vector" parameter * Update other parameters as recommended

Step 4: Compare Results After running your Simulink model: * Compare your torque output scope with Plot #1 (Full-Load Torque Curve) * Verify your engine speed stays above 450 rpm (stall threshold) * Check that torque responds proportionally to throttle input

EDUCATIONAL VALUE FOR YOUR DIPLOMA These plots aren't just debugging tools - they're professional engineering documentation you can include in your thesis: 1. Figure 1 (Top Row): "D17A780 Engine Performance Characteristics" * Shows you understand diesel engine behavior * Validates your model against manufacturer specifications 2. Figure 1 (Bottom-Left & Center): "Throttle Response Analysis" * Demonstrates control system behavior * Shows how Generic Engine block implements throttle modulation 3. Figure 1 (Bottom-Right): "Stall Threshold Implementation" * Explains the numerical stability features of Simscape * Justifies your initial condition choices 4. Figure 2: "Engine Operating Map" * Professional presentation of engine capabilities * Similar to maps in SAE papers and automotive engineering texts

KEY REFERENCES & DOCUMENTATION Official MathWorks Documentation: 1. Generic Engine Block Reference * URL: https://www.mathworks.com/help/sdl/ref/genericengine.html * Key sections: "Engine Speed, Throttle, Power, and Torque", "Idle Speed Controller Model" * Explains stall threshold behavior and throttle modulation 2. Complete Vehicle Model Example * URL: https://www.mathworks.com/help/sdl/ug/about-the-complete-vehicle-model.html * Shows proper engine-transmission-vehicle connectivity * Demonstrates initial velocity settings for idling engine * Key quote: "While the engine is idling initially at a nonzero speed, the transmission output and the vehicle as a whole are initially not moving." 3. Simscape Driveline Getting Started * URL: https://www.mathworks.com/help/sdl/getting-started-with-simscape-driveline.html * Basics of mechanical connections and physical networks 4. Vehicle with Four-Speed Transmission (Example to Study)
% In MATLAB Command Window, type:openExample('sdl/VehicleWithFourSpeedTransmissionExample') * Complete working vehicle model with Generic Engine block * Shows proper load connectivity * Note their initial velocity: nonzero speed for idling

Community Resources: 5. MATLAB Central - Similar Issues * Search: "Generic Engine block zero torque" * Common solutions: Check initial velocity, add external load, verify tabulated data 6. Simscape Driveline Examples * In MATLAB: Help → Simscape Driveline → Examples * Study: "Engine Models", "Drivetrain Models"

DEBUGGING CHECKLIST Before running your simulation, verify: Mechanical System: * [ ] Engine output port connected to mechanical load (not just inertia) * [ ] Connection lines are solid (not dashed) * [ ] Model includes: Engine → Load → Ground reference * [ ] Load is appropriate (Rotational Damper 5-10 N·m/(rad/s) or Vehicle Body) Initial Conditions: * [ ] Initial velocity: 750 rpm (NOT 400 rpm!) * [ ] Stall speed threshold: 450 rpm (NOT 200 rpm!) * [ ] Safety margin: 750 - 450 = 300 rpm * [ ] Initial throttle: 0.3-0.5 for testing (NOT 1.0 full throttle immediately) Tabulated Data: * [ ] Speed vector: 15 points from 600 to 2000 rpm * [ ] Torque vector: 15 points matching speed vector * [ ] Vectors are same length * [ ] No zero values in torque vector * [ ] Units correct: rpm for speed, N·m for torque * [ ] Speed vector includes initial velocity (750 rpm) Block Parameters: * [ ] Model parameterization: Tabulated torque data * [ ] Input type: Normalized throttle * [ ] Engine inertia: 10 kg·m² (NOT 2 kg·m^2!) * [ ] Time constant: 0.2 s Simulation Settings: * [ ] Solver: Variable-step, ode23t or ode15s (for stiff systems) * [ ] Simulation time: 10 seconds (for initial testing) * [ ] Zero-crossing detection: Enabled Monitoring: * [ ] Scope on engine speed (should stay above 450 rpm) * [ ] Scope on engine torque (should be non-zero and respond to throttle) * [ ] Scope on throttle input (verify it's connected and non-zero)

ALTERNATIVE: TEST WITH POLYNOMIAL FIRST If you want to verify connectivity before dealing with tabulated data: 1. Change Model parameterization to: Normalized 3rd-order polynomial 2. Set parameters: * Maximum power: 574000 W * Speed at maximum power: 1700 rpm * Maximum speed: 2000 rpm * Peak torque: 3800 Nm * Speed at peak torque: 1100 rpm * Engine type: Diesel 3. Keep: * Initial velocity: 750 rpm * Stall threshold: 450 rpm * Engine inertia: 10 kg·m² Run simulation with constant throttle = 0.5 If this works: Your connectivity is good, switch back to tabulated data , If this doesn't work: You have a connectivity or initial condition problem

QUICK TEST PROCEDURE 5-Minute Connectivity Test: 1. Set throttle to 1.0 (full throttle constant) 2. Set initial velocity to 1000 rpm (well above stall) 3. Remove any complex loads temporarily 4. Add simple Rotational Damper (8 N·m/(rad/s)) 5. Run for 1 second Expected results: * Engine speed should change (increase or decrease based on load) * Torque output should be non-zero (~3800 Nm at full throttle, 1000 rpm) * If torque = 0: Connectivity problem or data problem If STILL zero torque: Your tabulated data likely doesn't cover the initial velocity point, or vectors are misconfigured.

ATTACHMENTS * D17A780_Engine_Analysis.m - MATLAB script (no toolboxes required) * Run this first to understand the problem visually * Generates all plots shown above * Provides validated vectors for Simulink * Includes diagnostic report How to use: 1. Save the .m file 2. Run in MATLAB: D17A780_Engine_Analysis 3. Review the 8 plots generated 4. Copy the vectors from console output 5. Paste into your Generic Engine block 6. Update initial conditions as recommended

FINAL THOUGHTS Your problem is 100% solvable and very common with Generic Engine blocks. The three issues: 1. Initial velocity (400 rpm) too close to stall threshold (200 rpm) → Change to 750 rpm / 450 rpm 2. Engine inertia (2 kg·m²) too low → Change to 10 kg·m² 3. Possibly missing external load → Add Rotational Damper or verify Vehicle Body connection The MATLAB script I've provided will give you: * Visual understanding of why your current settings fail * Validated data ready for Simulink * Professional plots for your diploma documentation * Diagnostic tools to verify your configuration

The fact that you're using real manufacturer data (D17A780 datasheet) shows excellent engineering practice. This level of realism will make your diploma work stand out.

Don't hesitate to follow up with your results or if you need additional clarification on any of the plots!

P.S. - I noticed you posted on MATLAB Answers as well. The community response time varies, but this solution is based on official MathWorks documentation and dozens of similar cases. The stall threshold behavior is well-documented but often overlooked.

P.P.S. - The "Stall Threshold Effect" plot (Figure 1, bottom-right) is the visual proof you need. Show this to your thesis advisor - it clearly demonstrates the numerical stability features of Simscape and why proper initial conditions are critical for heavy-duty diesel engine simulation.

P.P.P.S. - After you get it working, consider adding the Idle Speed Controller feature (see MathWorks docs). This will automatically maintain engine speed above idle (700 rpm) even under varying loads, making your model more robust and realistic. The D17A780 certainly has such a controller in the real truck!

  8 Commenti
Adam
Adam il 30 Set 2025 alle 9:35
Spostato: Torsten il 30 Set 2025 alle 10:05
Hi @Umar. Thanks for the help, did what you recommended, also added values for 2100 and 2200 rpms to the vector now the simulation completes. Power figures look good, changes dinamically with the throttle. My only gripe now is that maximum torque settles in at around 700Nm which is far from our max. And the interesting thing is that its 700 with whatever throttle setting. It just reaches 700 faster at max throttle. I seem to misunderstood something about how to correctly measure torque here, because rpm and power numbers seem legit for me. Could you explain this to me? Could this be a setting in the torque converter that im missing? Because i'm measuring torque after the gearbox, and i measure power directly on the engine, so logically that would mean that theres something wrong with the torque converter, because the gearbox is still in 1:1 ratio, and also whats strange if i for example change the ratio to 32, which is a thing in trucks, torque just changes to 400 Nm? How?? At a ratio of 12 it just changes to 900? At a ratio of 2 changes to 1200?? Seems off to me. Could it be the rotational damper?
Edit: removed the rotational damper, now torque figures scale how they should, but with a ratio of 1, i still get 700 Nm which is not what i should see.
Umar
Umar il 30 Set 2025 alle 15:39

Hi @Adam, Excellent progress on resolving the overspeed error. Your simulation now completes successfully, and the dynamic power response confirms your engine model is fundamentally working correctly. However, the 700 Nm torque ceiling you're observing is caused by your torque converter configuration, not a measurement issue.

Root Cause: Torque Converter Torque Multiplication

The behavior you're seeing—where torque changes inversely with gear ratio—is a clear indicator that power is being conserved through the drivetrain, but the torque converter is limiting how much torque reaches your measurement point. Here's what's happening:

Your torque converter has a torque ratio characteristic that multiplies input torque from the engine by a factor that depends on the speed ratio (turbine speed / impeller speed). At stall or low speed ratios, torque converters typically multiply torque by 1.8:1 to 2.5:1. As the speed ratio approaches 1.0 (lockup condition), the torque multiplication approaches 1.0.

Why You See 700 Nm Regardless of Throttle

The key insight is that you're measuring during transient acceleration at constant throttle. As your engine accelerates from idle toward governed speed: 1. The engine produces varying torque based on its characteristic curve and throttle position 2. The torque converter receives this input and multiplies it based on current speed ratio 3. The output torque is further modified by the gearbox ratio 4. Power is conserved: Power_in = Power_out (minus losses)

The formula: Torque_out = Torque_in × Torque_Ratio ÷ Gear_Ratio When you observed:

  • Gear ratio 32 → 400 Nm
  • Gear ratio 12 → 900 Nm
  • Gear ratio 2 → 1,200 Nm
  • Gear ratio 1 → 700 Nm

This follows the pattern: Output_Torque × Gear_Ratio ≈ Constant ≈ 12,800 Nm This confirms power conservation through the system, which is correct physics.

Diagnostic Steps

Verify Torque Converter Parameters: 1. Open your Torque Converter block parameters 2. Check the Torque ratio vector—this defines how much the converter multiplies input torque 3. Check the Speed ratio vector—this defines the operating points 4. Check the Capacity factor (K-factor) parameterization

Measure at Multiple Points: Add torque sensors at: * Engine output (before torque converter) - port FC * Torque converter output (before gearbox) - port I * Gearbox output (your current measurement point) This will reveal exactly how torque is being transformed through each component.

Expected Engine Torque Values

To verify your engine is producing correct torque, you need to measure before the torque converter. Based on your earlier message mentioning torque vectors with maximum values around 3,800 Nm at mid-range speeds: * At 0.3 throttle, engine should produce ≈ 1,140 Nm (0.3 × 3,800) * This engine torque enters the torque converter * Converter multiplies this by its torque ratio (typically 1.5-2.5 at operating conditions) * Result passes through gearbox and reaches your measurement point

Recommended Actions

Priority 1: Add Engine Torque Measurement

  • Insert a Simscape Rotational Torque Sensor between engine port B and torque converter port FC
  • Connect to a scope to verify engine is producing expected torque values
  • This will confirm whether the issue is in the engine or downstream

Priority 2: Review Torque Converter Configuration

  • Verify your torque ratio vector has realistic values (typically 1.0 to 2.5)
  • Ensure speed ratio vector spans 0 to 1.0 appropriately
  • Check that capacity factor is properly defined for your converter size

*Priority 3: Understand the Rotational Damper Impact *

You mentioned removing the rotational damper changed torque scaling. The damper was consuming torque by resisting rotation (Torque = Damping_Coefficient × Angular_Velocity). At 2,000 rpm (≈ 209 rad/s) with 30 N·m/(rad/s) damping, it consumed approximately 6,270 Nm. This is why removing it affected your measurements. However, without load, your system will still accelerate to maximum speed and hit the redline controller.

Recommended Load Configuration:

  • Replace the fixed damper with a more representative load model
  • Consider using an Ideal Translational Motion Sensor to apply vehicle-equivalent resistance
  • Or add a Vehicle Body block if modeling a complete vehicle

Verification Test

Run this test to confirm diagnosis: 1. Add torque sensor at engine output (pre-converter) 2. Add torque sensor at converter output (post-converter, pre-gearbox) 3. Set gearbox to 1:1 ratio 4. Run simulation with 0.3 constant throttle 5. Compare torques: Engine_Torque × Converter_Torque_Ratio should equal Converter_Output_Torque If the engine torque measurement shows values significantly higher than 700 Nm, then the torque converter is indeed the limiting component, and you'll need to adjust its characteristic curves to match your application.

Reference Documentation

MathWorks Simscape Driveline Torque Converter: https://www.mathworks.com/help/sdl/ref/torqueconverter.html This documentation explains the torque ratio, speed ratio, and capacity factor relationships that govern converter behavior. Please share screenshots showing:

1. Torque measurements at engine output (pre-converter) 2. Your torque converter parameter settings (torque ratio and speed ratio vectors) 3. Scope outputs comparing engine torque vs. final output torque

This will allow precise diagnosis of whether your torque converter characteristics need adjustment or if there's a different configuration issue.

Kudos to you for getting your goals accomplished, which was part of your diploma work and quite honestly, I would like to say that you did accomplish a lot and it was a quite journey and hopefully after this, you should be all set.

Good luck with your project and everything.

Accedi per commentare.

Categorie

Scopri di più su Drivetrain and Transmission in Help Center e File Exchange

Prodotti


Release

R2024b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by