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
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.
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
Results reported below are based on unseen test data from a PMSM testbench dataset.
- 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²
- 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.
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.
- 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.
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.
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).
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 pmsmDownload the public dataset here: https://www.kaggle.com/wkirgsn/electric-motor-temperature
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.
- 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.
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}}
