-
-
Physical prototype with Arduino, ultrasonic sensor, electromagnet, and control circuitry.
-
Measured nonlinear relationship between PWM input and magnetic-field strength.
-
Adapted gains reduced simulated overshoot across three operating points.
-
Synthetic disturbance classes used to train the vibration classifier.
-
Measured magnetic-field decay with increasing distance from the electromagnet.
-
Integrated pipeline from sensing and classification to adaptive gain selection and control output.
Inspiration
Maglev and hyperloop systems reduce mechanical contact and friction, but that also means they have less natural damping. Low-frequency sway and vibration can affect passenger comfort and, at larger amplitudes, system stability.
Our starting point was a physically characterized electromagnetic actuator. Measurements showed that the relationship between PWM input and magnetic field strength is strongly nonlinear:
Measured relationship:
B = 0.0644 × e^(0.00706 × OCR) + 7.6024
Since eddy-current damping scales approximately with (B^2), the same fixed PD gains can behave very differently across operating points. This motivated us to build an adaptive control system instead of relying on one fixed controller.
What it does
Our project combines measured hardware data with two machine-learning components:
Adaptive gain model
A Random Forest predicts better-performing (K_p) and (K_d) values for the current operating point.Vibration classifier
A Random Forest classifies displacement signals into:- no disturbance
- low-frequency sway
- high-frequency vibration
- impulse shock
The complete pipeline follows:
sense --> extract features --> classify --> select gains --> adjust control output
The system can run fully offline using synthetic data and can also accept live HC-SR04 sensor readings through an Arduino serial bridge.
What we built during vsHacks
The physical electromagnet prototype and magnetic-field measurements formed the research foundation.
During vsHacks, we built:
- the adaptive PD gain-selection model
- the vibration classifier
- the synthetic waveform generator
- time-domain and FFT feature extraction
- the integrated sense-classify-adapt pipeline
- an optional live Arduino serial interface
- the open-source demo and documentation
How we built it
The adaptive gain model was trained using labels generated from a mass-spring-damper simulation grounded in our measured PWM-to-field relationship. For each operating point, we searched a grid of PD gains and selected the pair that minimized a cost based on settling time and overshoot.
The vibration classifier was trained on synthetic signal windows representing sway, high-frequency vibration, impulse shocks, and background noise. Features include:
- RMS
- peak-to-peak amplitude
- spikiness
- dominant frequency
- low-frequency energy
- high-frequency energy
We used Random Forest models because they are lightweight, interpretable, and fast enough for real-time use.
Results
Compared with fixed gains tuned at full field, the adapted gains reduced simulated overshoot across weaker operating points:
- OCR 500: 45% → 24%
- OCR 650: 42% → 20%
- OCR 800: 28% → 6%
Both controllers still settled to zero, but the adapted controller produced a smoother response across the nonlinear operating range.
These results are simulation-based and grounded in experimentally measured PWM-to-field data from the physical prototype.
Challenges
The biggest challenge was connecting the machine-learning system to the real physics of the actuator instead of adding ML artificially.
We also had to:
- model the nonlinear relationship between PWM, magnetic field, and control authority
- generate meaningful training data without a large real sensor dataset
- balance settling time against overshoot
- integrate classification and gain selection into one understandable pipeline
- clearly separate what was physically measured from what was validated in simulation
Accomplishments
We are proud that the ML layer is directly motivated by measured hardware behavior.
Instead of treating vibration control as a generic classification problem, we built a complete adaptive control pipeline around a real electromagnetic system and demonstrated measurable improvements in simulation.
What we learned
We learned that machine learning is most useful when it solves a specific limitation exposed by physical measurements.
We also gained experience with:
- control-system simulation
- PD gain tuning
- Random Forest regression and classification
- FFT-based signal features
- Arduino serial communication
- technical documentation and open-source project organization
What’s next
Our next step is hardware-in-the-loop validation.
We plan to:
- collect real HC-SR04 displacement recordings
- test the adapted gains on the physical rig
- compare predicted and measured vibration reduction
- directly measure damping force
- expand the model to more operating conditions and disturbance types
Built With
- arduino
- control-systems
- control-theory
- damping
- electromagnetism
- fft
- github
- hc-sr04
- machine-learning
- matplotlib
- numpy
- pd-control
- python
- random-forest
- scikit-learn
- scipy
- signal-processing
- vibration-control
Log in or sign up for Devpost to join the conversation.