Skip to content

lfalc/deep-pmsm

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

86 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Deep PMSM – Bachelor’s Thesis (Embedded-Oriented ML for PMSM Temperature Estimation)

⚠️ Important context This repository is based on the original Deep-PMSM project by Kirchgässner et al. The work in this fork represents my Bachelor’s Thesis, in which I extended, re-evaluated, and adapted the approach with a strong focus on embedded feasibility, hyperparameter optimization, and quantitative benchmarking.


Thesis Overview

Title: Temperature Prediction in Permanent Magnet Synchronous Machines using Convolutional Neural Networks for Embedded Hardware

Author: Lorenz Falcioni Degree: B.Sc. Intelligent Systems Engineering Institution: Ostbayerische Technische Hochschule Regensburg Industry Partner: AVL Software and Functions GmbH Date: October 2024

Problem

Direct measurement of PMSM rotor temperature is costly and technically complex. This thesis investigates data-driven temperature estimation using Temporal Convolutional Networks (TCNs) with the explicit goal of real-time deployment on embedded motor control hardware.


My Contributions (Summary)

This fork contains original academic and engineering work performed as part of my bachelor’s thesis:

  • Designed and trained TCN-based models for PMSM rotor temperature prediction
  • Performed large-scale hyperparameter optimization using Hyperband
  • Achieved state-of-the-art accuracy compared to prior RNN/LSTM approaches
  • Evaluated model size vs. accuracy tradeoffs for embedded deployment
  • Applied post-training quantization and assessed accuracy degradation
  • Prepared models for ONNX-based embedded inference pipelines

Key Results

Results reported below are based on unseen test data from a PMSM testbench dataset.

Best Model (Accuracy-Optimized)

  • Architecture: TCN (4 layers, 91 units)
  • Parameters: ~151k
  • Model size: 590 KB → 177 KB after 8-bit quantization
  • Mean Squared Error: 0.48 K²
  • Maximum error: 2.84 K
  • Post-quantization MSE: 0.57 K²

Compact Model (Embedded-Optimized)

  • Architecture: TCN (1 layer, 52 units)
  • Parameters: ~33k
  • Model size: 130 KB → 38 KB after quantization
  • Mean Squared Error: 1.31 K²
  • Accuracy loss after quantization: negligible

These results outperform or match prior RNN/LSTM-based approaches while being significantly more suitable for embedded deployment.


Embedded Systems Relevance

A central contribution of this work is bridging ML research and embedded feasibility:

  • Quantized models compatible with 8-bit DNN accelerators

  • Target hardware considered: Infineon AURIX™ TC4xx

  • Models exported to ONNX for platform-agnostic inference

  • Explicit analysis of:

    • Memory footprint
    • Compute constraints
    • Real-time suitability

This positions the work directly within firmware / embedded ML contexts rather than pure offline ML research.


What This Repository Contains

  • Full training and evaluation pipeline (Python, TensorFlow/Keras)
  • Hyperparameter search scripts (Hyperband via Keras-Tuner)
  • Model evaluation and visualization utilities
  • Quantization and model export steps

Due to confidentiality constraints, industry-specific datasets are not included.


Original Project (Upstream)

This work builds upon:

Estimating Electric Motor Temperatures with Deep Residual Machine Learning Wilhelm Kirchgässner, Oliver Wallscheid, Joachim Böcker IEEE Transactions on Power Electronics, 2021

Original repository: https://github.com/upb-lea/deep-pmsm

All original authorship and licensing are fully preserved.


Citation

If you use the original method, please cite the upstream paper. If you reference this thesis work, please cite accordingly (thesis not publicly distributable due to NDA).


Getting Started (Original Instructions)

In order to clone this repo and use as a package in your own python projects, proceed as follows:

user@pc:~/projects$ git clone git@github.com:wkirgsn/deep-pmsm.git
user@pc:~/projects$ cd deep-pmsm
user@pc:~/projects/deep-pmsm$ pip install [-e] .

Use the "-e" flag in case you wish to edit the package. After installing via pip you can simply import this project in python with

import pmsm

Dataset

Download the public dataset here: https://www.kaggle.com/wkirgsn/electric-motor-temperature

Structure

Data must be available in pmsm/data/input - all results of trainings and predictions are stored in pmsm/data/output. Specific paths are editable in pmsm/preprocessing/config.py though. Data formatting is dealt with in preprocessing/, while hyper parameter tuning is conducted with utilities from opt/.

Executable python files are located in root package folder pmsm/.

Most configurations can be adjusted in pmsm/preprocessing/config.py.

Script files

  • hot_{r,s,c}nn.py
    • Train a neural network (Recurrent, Self-Normalizing, or Convolutional} with given hyperparameters from config.py
  • hp_tune_{r,c}nn.py
    • Conduct hyperparameter search via Bayesian Optimization with given hyperparameters from config.py
  • visualize.py
    • Visualize performance of a certain model, given its UID.
  • hp_vis.py
    • Visualize results of a certain hyperparameter search, given its UID.

Citation

This repository is published in order to support reproducability of experiments from the journal article Estimating Electric Motor Temperatures with Deep Residual Machine Learning. If you are using this code please cite as follows.

@ARTICLE{9296842,
  author={W. {Kirchgässner} and O. {Wallscheid} and J. {Böcker}},
  journal={IEEE Transactions on Power Electronics}, 
  title={Estimating Electric Motor Temperatures With Deep Residual Machine Learning}, 
  year={2021},
  volume={36},
  number={7},
  pages={7480-7488},
  doi={10.1109/TPEL.2020.3045596}}

About

Estimate intrinsic Permanent Magnet Synchronous Motor temperatures with deep recurrent and convolutional neural networks.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Jupyter Notebook 86.0%
  • Python 13.8%
  • Other 0.2%