Skip to content

Repository files navigation

⚡ EV Performance Analyzer 🏎️

Dashboard and CLI analysis tool for EV performance during endurance.

Features

  • 📊 Single Run Analysis - Detailed metrics for individual runs
  • 🔄 Run Comparison - Side-by-side comparison of multiple runs
  • 🤔 Projections - Projected metrics for a 22km endurance event
  • 🤑 Scoring - Scores for endurance and efficiency
  • 📄 PDF Export - Generate PDF reports of the analysis

🛠️ Installation

Prerequisites

  • 🐍 Python
  • 📦 Node.js

🐺 Setup

  1. Install Python dependencies:
pip install -r requirements.txt
  1. Install Node.js dependencies and compile TypeScript:
npm install
npm run build

🚀 Usage

Starting the Dashboard

  1. 🚀 Start the Flask server:
python app.py

The server will start at http://localhost:5001

  1. 🌐 Open the dashboard:

Open http://localhost:5001 in your web browser

Using the Dashboard

  1. 📋 View Runs:

    • All CSV files in the csv/ directory are automatically listed on the left sidebar
    • Each run shows: filename, comment, date, duration, and distance
  2. 👆 Select Runs:

    • Click on runs in the left sidebar to select them
    • Select 1️⃣ run for detailed analysis
    • Select 2️⃣+ runs for comparison and trend analysis
    • Click again to deselect
  3. 📊 View Analysis:

    • Single run: Complete detailed metrics and projections
    • Multiple runs: Comprehensive comparison of ALL metrics organized by category + trend charts 📈
  4. 📄 Export Reports:

    • Click "Export PDF" button 🖨️
    • Choose "Save as PDF" in the print dialog
  5. 🔄 Refresh:

    • Click the refresh button (↻) to reload CSV list

📋 Required CSV Columns

The CSV file must be exported from AiM with the following columns:

  • Time
  • GPS Speed
  • Distance on GPS Speed
  • State of Charge
  • MCU DC Current
  • Pack Temp
  • Pack Voltage
  • Min Cell Voltage

The script automatically parses AiM CSV format, including metadata like comment fields.

📊 Analysis Metrics

🏁 Run Information

  • Duration, distance, and average speed
  • Run date and comment from CSV

⚡ Power & Energy

  • Average and peak power (Watts)
  • Total energy used (kWh)
  • Energy efficiency (kWh/km)
  • State of charge (SOC) tracking

🔋 Current Draw

  • Average and peak current (Amps)
  • Current per kilometer

🌡️ Thermal Performance

  • Start, peak, and rise temperatures (°C)
  • Temperature per kilometer

🔌 Battery Status

  • SOC (estimated and logged)
  • Cell voltage tracking (mV)
  • Battery remaining (kWh)

🎯 Endurance Projection (22km)

  • Projected completion time (minutes)
  • Energy requirements (kWh and %)
  • Minimum cell voltage projection
  • Energy margin

🏆 Competition Scores

  • Endurance score (0-100)
  • Efficiency score (0-100)

💻 Command Line Usage

To analyze a single CSV file using the CLI:

python analyze.py csv/<csv_file>

Example:

python analyze.py csv/example.csv

This will print a detailed analysis report to the terminal.

📁 Project Structure

ev-performance-analyzer/
├── app.py              # Flask backend server
├── analyze.py          # Core analysis functions
├── index.html          # Dashboard HTML
├── styles.css          # Dashboard styling
├── print.css           # PDF print styling
├── app.ts              # ts source
├── build/
│   └── app.js          # Compiled js (generated)
├── csv/
│   └── *.csv           # Your CSV data files
├── package.json        # Node.js dependencies
└── requirements.txt    # Python dependencies

⚙️ Configuration

📝 Constants in analyze.py

You can adjust the following constants:

ENDURANCE_DISTANCE_KM = 22.0          # Endurance race distance
MIN_CELL_VOLTAGE_MV = 2500.0          # Minimum safe cell voltage
BEST_ENDURANCE_TIME_SEC = 1361.936    # Best reference time
BEST_EFFICIENCY_KWH_TOTAL = 3.275     # Best reference efficiency
BATTERY_CAPACITY_KWH = 7.29           # Battery capacity

© 2025 University of Connecticut Formula SAE Team

About

Analyze EV performance for endurance

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages