Skip to content

End-to-End Example: EV Drive Cycle Analysis

This comprehensive tutorial demonstrates a complete TrueFidelity workflow using the Drive Cycle system—an electric vehicle powertrain simulation with VCU (Vehicle Control Unit), MCU (Motor Control Unit), and BMS (Battery Management System). You'll learn how to create a system, configure networks, deploy ECUs, capture live data, analyze CAN logs with playback, and perform signal injection testing.

Time Estimate

  • System Setup: 15-20 minutes
  • Deployment and Monitoring: 10-15 minutes
  • Data Analysis: 20-30 minutes
  • Total Time: 45-65 minutes

Prerequisites

Before starting this tutorial, ensure you have:

  • TrueFidelity Desktop application installed and licensed
  • Docker Desktop running
  • Sample BLF log files (available in the examples folder)
  • The Drive Cycle DBC file with signal definitions
  • Basic familiarity with CAN bus concepts and EV powertrain systems

Scenario Overview

You're investigating an issue in an electric vehicle's drive cycle system. The symptoms include:

  • Unexpected motor torque oscillations during regenerative braking
  • Intermittent SOC (State of Charge) reporting anomalies
  • Occasional communication delays between VCU and MCU

Your task is to:

  1. Create a test bench system that models the EV powertrain network
  2. Replay captured log data to reproduce the issue
  3. Analyze signal patterns to identify root causes
  4. Test potential fixes using signal injection
  5. Document findings for the engineering team

Part 1: System Setup and Configuration

Step 1: Create a New System

Start by creating a fresh system for your analysis work.

  1. Launch TrueFidelity Desktop:
  2. If you see an existing system, save any changes first
  3. The application starts in System Design mode by default

  4. Create the new system:

  5. Click File → New from the menu bar
  6. Or use the keyboard shortcut Ctrl+N (Cmd+N on Mac)

File menu with New option highlighted

  1. Configure system properties in the dialog:
  2. System Name: Enter Drive Cycle
  3. Description: "Electric vehicle drive cycle simulation with pedal inputs and motor control"
  4. Click Create

New System dialog with system name and configuration

After creation, TrueFidelity automatically opens the System Design workspace with three main areas:

  • Left panel: Toolbox containing draggable components
  • Center: System Canvas where you'll build your topology
  • Right panel: Properties panel for configuring selected elements

System Design workspace showing Toolbox, Canvas, and Properties panels

Step 2: Add ECUs to the Canvas

Now add the Electronic Control Units that make up the EV powertrain system.

  1. Locate the Toolbox panel on the left side of the screen
  2. It contains two main categories: Components and Networks

Toolbox panel showing Components and Networks categories

  1. Add the VCU (Vehicle Control Unit):
  2. Expand the Components category
  3. Drag an ECU onto the upper-left area of the canvas
  4. This will be your main vehicle controller handling pedal inputs

Dragging ECU from Toolbox to Canvas

  1. Add the MCU (Motor Control Unit):
  2. Drag another ECU and place it in the upper-right area
  3. This will control the electric motor and inverter

  4. Add the BMS (Battery Management System):

  5. Drag a third ECU and place it in the lower area
  6. This monitors battery pack status and limits

Your canvas should now display three ECU nodes positioned for easy visualization.

Step 3: Configure ECU Properties

Each ECU needs hardware and software configuration matching the Drive Cycle system.

Configuring the VCU

  1. Select the VCU by clicking on it
  2. The Properties panel updates to show ECU settings

VCU selected on canvas with Properties panel

  1. Configure the VCU properties:

GENERAL Settings: - Name: VCU

HARDWARE Settings: - Board: Select S32K3X4EVB from the dropdown - Memory: 16MB - Flash: 2MB

SOFTWARE Settings: - Operating System: Select Zephyr - Firmware Mode: Select Binary File - Firmware Binary: Browse to select s32k3-vcu-demo firmware

Properties panel SOFTWARE section

  1. Click "Apply Changes" to save the configuration

Configuring the MCU

  1. Select the MCU and configure:
  2. Name: MCU
  3. Board: S32K3X4EVB
  4. Memory: 16MB
  5. Flash: 2MB
  6. Operating System: Zephyr
  7. Firmware Binary: Browse to s32k3-mcu-demo (optional)
  8. Click Apply Changes

Configuring the BMS

  1. Select the BMS and configure:
  2. Name: BMS
  3. Board: S32K3X4EVB
  4. Memory: 16MB
  5. Flash: 2MB
  6. Operating System: Zephyr
  7. Firmware Binary: Browse to s32k3-bms-demo (optional)
  8. Click Apply Changes

Step 4: Add CAN Network and Create Connections

In TrueFidelity, ECUs connect to shared network buses, accurately modeling real automotive architectures.

  1. Expand the Networks category in the Toolbox

Toolbox with Networks category expanded

  1. Drag a CAN Bus onto the canvas:
  2. Place it centrally between your three ECUs
  3. The CAN bus appears as a red horizontal bar

CAN Bus placed on canvas between ECUs

  1. Connect the VCU to the CAN Bus:
  2. Hover over the VCU to see connection handles
  3. Click and drag from a handle to the CAN bus
  4. Release when the bus highlights green

VCU connected to CAN Bus

  1. Connect the remaining ECUs:
  2. Connect the MCU to the same CAN bus
  3. Connect the BMS to complete the network

Step 5: Configure Network Properties

  1. Select the CAN Bus by clicking on it

CAN Bus selected with Properties panel

  1. Configure network settings:
  2. Name: Keep as "CAN Bus 1" or rename to "Powertrain CAN"
  3. Baud Rate: 500000 (500 kbps)
  4. Channel: can0
  5. DBC File: Browse to select DBC.dbc from your drive scenario folder

  6. Click Apply Changes to save the network settings

The DBC file defines the following message structure for our EV system:

CAN ID Message Name Sender Key Signals
0x100 VCU_Status_1 VCU Veh_Spd_BE, Drive_Mode, Torque_Req
0x101 VCU_Status_2 VCU Brake_Pedal_Pcnt, Accel_Pedal_Pcnt
0x201 MCU_Feedback_1 MCU Motor_Spd, Actual_Torque, Motor_Temp
0x202 MCU_Feedback_2 MCU DC_Link_V, Phase_Curr_RMS, Regen_Active
0x300 BMS_Pack_1 BMS Pack_V, Pack_I, SOC, SOH
0x301 BMS_Limits BMS Max_Discharge_Pwr, Max_Charge_Pwr
0x302 BMS_Temps BMS Cell_Tmin, Cell_Tmax, Coolant_T

Step 6: Save the System

  1. Save your system:
  2. Press Ctrl+S or click File → Save

File menu with Save option highlighted

  1. Verify the save:
  2. Default filename: truefidelity-system.json
  3. Look for "System saved" notification

File Format

The truefidelity-system.json file contains your complete system definition including ECU configurations, network topology, and diagram layouts.

Part 2: System Deployment and Monitoring

Step 7: Start the System

Deploy your ECUs as Docker containers and start them running.

  1. Start the entire system from the toolbar:
  2. Click the Start button (green play icon)

Main toolbar with Start button highlighted

  1. Monitor the startup process:
  2. ECUs transition: Stopped → Starting → Running
  3. Wait for all ECUs to show green "Running" status

ECU Status panel with all ECUs running

  1. Verify in the status bar:
  2. Should show "3 / 3 Containers Running"

Step 8: Switch to ECU Monitoring Mode

Monitor the health and status of your running system.

  1. Switch to ECU Monitoring mode:
  2. Click View → Layouts → ECU Monitoring

View menu showing Layouts submenu with ECU Monitoring option

  1. Review the monitoring layout:

ECU Monitoring layout with status, console, and resource panels

The layout includes:

  • ECU Hardware Status: Shows all ECUs and their states
  • ECU Console: Live log output from all ECUs
  • ECU Resource Monitor: Real-time CPU and memory graphs

  • Verify system health:

  • All ECUs should show "Running" state
  • CPU usage typically stays below 5% when idle
  • Memory usage should be stable

Step 9: Monitor Console Logs

The ECU Console aggregates logs from all running ECUs:

  1. Review log structure: 15:25:24.991 INF Vcu [00:04:13.213,000] <inf> s32k3_pedal_demo: ACCEL : status=0x01...
  2. 15:25:24.991: Wall clock time
  3. INF: Log level
  4. Vcu: Source ECU
  5. Message content: Actual log data

  6. Filter logs to focus on specific ECUs:

  7. Use the ECU dropdown to select "VCU", "MCU", or "BMS"
  8. Toggle log levels: INFO, WARNING, ERROR, DEBUG

ECU Console with filter active

Terminal Access Not Available

The VCU, MCU, and BMS ECUs in this tutorial run Zephyr OS, which does not support terminal access. Use the ECU Console logs for debugging, or enable GDB debugging for detailed firmware analysis.

Part 3: CAN Log Analysis

Step 10: Switch to CAN Log Analysis Mode

Prepare for data analysis and playback.

  1. Switch modes:
  2. Click View → Layouts → CAN Log Analysis

  3. Understand the layout:

  4. Signal Viewer (left): Hierarchical signal tree from DBC
  5. Network Traffic (center): Live CAN frames
  6. Signal Chart (right): Time-series signal plots
  7. Signal Player & Injection (bottom): Playback and injection controls

CAN Analysis mode panels

Step 11: Load and Configure Playback Data

Load your captured BLF log file for analysis.

  1. Open the Signal Player panel at the bottom of the screen

  2. Load the BLF file:

  3. Click Select BLF button
  4. Navigate to your log file (e.g., drive_cycle_capture.blf)
  5. Click Open

Signal Player with loaded BLF file

  1. Verify DBC mapping:
  2. The Networks list shows your CAN bus
  3. Confirm signal decoding is active

Step 12: Start Playback and Monitor Signals

Begin replaying the captured data through your system.

  1. Start playback:
  2. Ensure the system is running
  3. Click the Play button in Signal Player
  4. Progress bar shows current position

  5. Monitor live traffic in the Network Traffic panel:

  6. CAN frames appear as they're replayed
  7. Shows CAN ID, DLC, Data bytes, Timestamp

Network Traffic panel showing live CAN messages

  1. Use traffic filters if needed:
  2. Filter by CAN ID (e.g., 0x100 for VCU_Status_1)
  3. Filter by ECU source

Step 13: Analyze Decoded Signals

Examine the decoded signal values from your DBC file.

  1. Open Signal Viewer panel (left side)

  2. Find relevant signals using the search box:

  3. Search for "Motor" to find motor-related signals
  4. Search for "SOC" for battery state
  5. Search for "Torque" for torque values

  6. Examine signal details by expanding CAN frames:

VCU_Status_1 (0x100): - Veh_Spd_BE: Vehicle speed in km/h - Torque_Req: Requested torque in Nm - Drive_Mode: Current drive mode (0-7)

MCU_Feedback_1 (0x201): - Motor_Spd: Motor speed in rpm - Actual_Torque: Delivered torque in Nm - Motor_Temp: Motor temperature in °C

BMS_Pack_1 (0x300): - Pack_V: Battery pack voltage - Pack_I: Battery current (positive = discharge) - SOC: State of charge percentage

Signal Viewer with expanded frames

  1. Select signals for charting:
  2. Check Motor_Spd from MCU_Feedback_1
  3. Check Actual_Torque from MCU_Feedback_1
  4. Check SOC from BMS_Pack_1

Step 14: Chart and Analyze Signal Patterns

Visualize signal behavior over time to identify anomalies.

  1. View the Signal Chart panel (right side):
  2. Selected signals appear as colored lines
  3. Time axis along the bottom
  4. Value axis on the left

  5. Configure chart settings:

  6. Time Window: Set to 30 seconds for detail
  7. Auto-scale: Enable to fit all values

  8. Identify the anomaly:

  9. Play through the log while watching the chart
  10. Look for unusual patterns:
    • Torque oscillations during regen braking
    • SOC discontinuities
    • Motor speed spikes without torque request
  11. Click Pause when you spot an issue
  12. Note the timestamp

Signal Chart showing signal patterns

  1. Zoom into the problem area:
  2. Use mouse wheel to zoom time axis
  3. Click and drag to pan along timeline

  4. Document findings:

  5. Right-click on chart → Export Chart
  6. Save as torque_anomaly_chart.png

Part 4: Signal Injection Testing

Step 15: Prepare for Signal Injection

Test how the system responds to controlled inputs.

  1. Access injection controls in the Signal Player & Injection panel:
  2. Look for the Injection section on the right side
  3. Controls include: Start all, Pause all, Stop all, Clear all

Signal Injection controls

  1. Safety considerations:

Injection Safety

Signal injection sends CAN frames to the network and can affect running ECUs.

  • Only inject into test bench systems
  • Never inject into production vehicles
  • Monitor system response carefully

Step 16: Configure and Execute Injection

Set up a controlled test to reproduce the issue.

  1. Select signals for injection in Signal Viewer:
  2. Click on a signal row to open the injection options dialog

Signal injection options dialog

  1. Configure injection parameters:
  2. Override value: Enter the physical value to inject (e.g., 50% for Accel_Pedal_Pcnt)
  3. Start with playback: Enable to sync with playback
  4. Include in Start all: Enable to include in bulk start
  5. Length: Choose Continuous, Frames, or Duration

  6. Select the signal for injection by clicking its checkbox

Signal selected for injection

  1. Start injection:
  2. Click Start all in injection controls
  3. Monitor the response in Network Traffic and Signal Chart

  4. Analyze system response:

  5. Does the torque oscillation reproduce?
  6. How do related signals respond?
  7. Check ECU Console for any diagnostic messages

  8. Stop injection:

  9. Click Stop all when test completes
  10. Document the results

Part 5: Data Export and Documentation

Step 17: Export Analysis Data

Save your findings for reporting and further analysis.

Export Console Logs

  1. In the ECU Console panel, click Export
  2. Choose format:
  3. Text (.txt): Human-readable format
  4. CSV (.csv): For spreadsheet analysis
  5. JSON (.json): For automated processing
  6. Save as: drive_cycle_console_log.txt

Export Network Traffic

  1. In the Network Traffic panel, click Export
  2. Choose format:
  3. Text (.txt): Plain text format
  4. CSV (.csv): Spreadsheet-compatible
  5. JSON (.json): Structured data
  6. candump: Standard CAN log format
  7. Save as: drive_cycle_traffic.csv

Capture Traffic to Log File

For recording traffic to industry-standard formats:

  1. Click Configure in the Network Traffic toolbar
  2. Select the network/channel to capture
  3. Choose output format: BLF (Vector), MDF4, or CSV
  4. Click Start Capture to begin recording
  5. Click Stop Capture when done

Capture configuration dialog

Export Signal Charts

  1. Right-click on Signal Chart
  2. Select Export Chart
  3. Save as PNG for reports

Step 18: Create Analysis Summary

Document your findings for the team.

  1. Compile findings:
  2. Anomaly timestamp: Exact time of issue
  3. Affected signals: Motor_Spd, Actual_Torque, Regen_Active
  4. Pattern description: Torque oscillation during regen
  5. Injection results: Reproduced with specific pedal input
  6. Potential causes: Control loop timing, CAN message priority

  7. Organize deliverables:

DriveAnalysis/ ├── truefidelity-system.json # System configuration ├── exports/ │ ├── drive_cycle_traffic.csv # Network traffic data │ ├── drive_cycle_console.txt # Console logs │ └── torque_anomaly_chart.png # Chart screenshot ├── logs/ │ └── drive_cycle_capture.blf # Original capture └── analysis_summary.md # Summary document

  1. Write summary document:

Document Header: - Title: "Drive Cycle Analysis Summary" - Date: [Current Date] - Engineer: [Your Name]

Issue Description: - Primary issue: Torque oscillations during regenerative braking - Affected ECUs: MCU, VCU

Key Findings: - Anomaly timestamp: 14:32:15.234 - Motor torque oscillates ±50 Nm during regen - Pattern correlates with Regen_Active signal transitions - BMS SOC reporting delayed by ~100ms

Injection Testing Results: - Test: Brake pedal injection at 30% - Result: Oscillation reproduced - Observation: MCU response delayed when BMS limits active

Recommendations: - Review MCU regen control loop timing - Verify BMS message priority on CAN bus - Check SOC calculation algorithm

Part 6: System Cleanup

Step 19: Stop and Clean Up

Properly shut down the system after analysis.

  1. Stop the running system:
  2. Click the Stop button in toolbar

Toolbar with Stop button highlighted

  1. Verify clean shutdown:
  2. Check Console for any error messages
  3. ECU Status shows all ECUs as "Stopped"

  4. Save final system state:

  5. File → Save to preserve any changes

  6. Export logs before closing (recommended):

  7. Console logs capture diagnostic data
  8. Network traffic preserves communication patterns

  9. Clean up Docker resources (optional): ```bash # List TrueFidelity containers docker ps -a | grep truefidelity

# Remove stopped containers docker container prune ```

Troubleshooting Guide

Common Issues and Solutions

ECUs Won't Start

Symptom: ECUs remain in "Stopped" state

Solutions: 1. Verify Docker Desktop is running 2. Check Console for error messages 3. Ensure firmware paths are correct (if specified) 4. Verify memory limits are reasonable (minimum 128MB)

No CAN Traffic Visible

Symptom: Network Traffic panel stays empty

Solutions: 1. Verify system is running (not just built) 2. Check BLF file is loaded and Play is pressed 3. Confirm DBC file is properly associated 4. Clear any restrictive filters

Signals Not Decoding

Symptom: See CAN IDs but no signal names

Solutions: 1. Verify DBC file path in network properties 2. Check DBC contains definitions for your CAN IDs 3. Reload system after DBC changes

Playback Not Working

Symptom: Play button disabled or nothing happens

Solutions: 1. System must be running first 2. BLF file must be loaded 3. Check file isn't corrupted 4. Verify sufficient memory for large logs

Chart Not Updating

Symptom: Signal Chart remains empty

Solutions: 1. Select signals in Signal Viewer first (checkboxes) 2. Ensure playback is running 3. Check time window settings 4. Enable Auto-scale

Performance Tips

  1. For large BLF files:
  2. Close unnecessary panels to free memory
  3. Use filters to reduce displayed data
  4. Export smaller time ranges

  5. For smooth playback:

  6. Limit number of charted signals (3-5 recommended)
  7. Reduce Signal Chart time window
  8. Disable auto-scroll in Network Traffic

Summary

You've successfully completed a full EV drive cycle analysis workflow in TrueFidelity:

  • ✅ Created and configured a multi-ECU EV powertrain system
  • ✅ Connected VCU, MCU, and BMS to a shared CAN network
  • ✅ Deployed the system using Docker containers
  • ✅ Monitored system health and console logs
  • ✅ Loaded and played back captured CAN logs
  • ✅ Analyzed decoded signals from the DBC file
  • ✅ Performed signal injection testing
  • ✅ Exported data for documentation and reporting

This workflow forms the foundation for EV powertrain testing, validation, and debugging. Practice with different log files and signal patterns to build expertise with the TrueFidelity platform.

Next Steps

Immediate Actions

  1. Practice with your own logs: Load captured data from your test vehicles
  2. Explore advanced filtering: Master signal search and traffic filtering
  3. Create custom layouts: Optimize panel arrangement for your workflow

Advanced Topics

  • GDB Debugging: Enable debug mode for detailed firmware analysis
  • Multi-Network Systems: Create topologies with multiple CAN/LIN buses
  • Automated Testing: Use TrueFidelity's API for CI/CD integration
  • System Design Workflow: Detailed ECU configuration guide
  • ECU Monitoring Walkthrough: Deep dive into monitoring tools
  • DBC & Signal Definitions: Working with signal databases