This repository is a dedicated propulsion dynamics identification module for the complete DIY UAV platform.
It is a submodule of the main UAV project:
๐ DIY_UAV (main repository)
๐ https://github.com/CrissCCL/DIY_UAV
Within the full UAV architecture, this module provides:
- Experimental motorโESC lag estimation (ฯ)
- Rotational plant modeling component
- Basis for rate loop bandwidth design
- Realistic simulation plant integration
This repository contributes to the rotational dynamic modeling of the UAV.
It experimentally identifies the motorโESC dynamic lag (ฯ), which directly affects:
- Roll, pitch and yaw rate response
- Inner rate loop bandwidth
- Phase margin and stability
- Transient torque generation
The motor dynamics are modeled as:
/Scriptsโ MATLAB acquisition and processing scripts/exp_motorโ Teensy PWM step generator firmware
Test performed with 9450 propeller installed to capture real aerodynamic load dynamics. Identification includes aerodynamic loading effects due to installed propeller.
Brushless motor mounted on bench test configuration during acoustic identification. Microphone positioned at fixed distance to ensure repeatability.
- Microphone: HyperX QuadCast (USB condenser microphone)
- Fixed distance positioning
- Ambient noise controlled environment
- Brushless Motor: 2212 โ 920 kV
- ESC: 30A
- Hover reference PWM: 1400 ยตs (โ 40% RC throttle)
- Step excitation: 1200 โ 1400 ยตs
- Controller: Teensy (PWM deterministic step generator)
- No hardware logging (time reference defined in MATLAB)
Motor time constant:
This value is integrated into the rotational axis models:
Note This identification represents an initial experimental estimate of the propulsion dynamics. Additional tests with new ESC hardware will be performed to refine the motorโESC dynamic model.
- Deterministic throttle step (Teensy)
- Audio acquisition in MATLAB (44.1 kHz)
- DC removal and zero-phase low-pass filtering
- STFT spectrogram computation
- Band-limited ridge tracking (60โ450 Hz)
- Median + moving average smoothing
- Time constant estimation (Tau63 + LS fit)
![]() RAW Spectrogram |
![]() Filtered spectrogram |
Welch PSD is computed for:
- RAW signal
- Filtered signal
This validates:
- Fundamental frequency dominance
- Harmonic structure visibility
- Filtering effectiveness
- Proper tracking band selection
PSD plot example:
Using:
The identified continuous-time axis models are:
Factored form:
These models represent the complete rotational plant used for rate loop design in the main DIY_UAV project.
This explicitly shows:
- Integrator from rigid-body rotational dynamics
- First-order lag from propulsion system
Denominator:
represents:
-
$$s$$ โ rotational inertia -
$$(0.17 s + 1)$$ โ motorโESC lag
Numerator constants (45.92, 56.39, 2.232) correspond to the effective torque-to-inertia ratio
where:
-
$$K=$$ torque per PWM effectiveness -
$$J=$$ axis inertia
This motor lag must also be considered when discretizing the plant model for embedded implementation (Ts = control loop sampling time).
Motor pole:
Equivalent frequency:
This defines a safe inner rate-loop bandwidth region.
The identified motor lag introduces an additional pole at:
ฯ = 5.88 rad/s
This produces:
- โ20 dB/dec slope transition
- Additional phase drop approaching โ90ยฐ
- Bandwidth constraint for inner rate loops
The combined plant (integrator + motor pole) yields:
โ40 dB/dec slope after the motor pole frequency.
The identified motor lag introduces an additional pole at:
This limits achievable inner rate-loop bandwidth and reduces phase margin.
Roll (Gp)
|
Pitch (Gq)
|
Yaw (Gr)
|
|
| Parameter | Value |
|---|---|
| Motor model | 2212 โ 920 kV |
| ESC | 30A |
| Hover PWM | 1400 ยตs |
| Identified ฯ | 0.17 s |
| Motor pole | 5.88 rad/s |
| Equivalent frequency | 0.94 Hz |
| Conservative BW limit | < 2.9 rad/s |
This summary defines the propulsion dynamic constraint used in the UAV rotational model.
This propulsion identification module directly supports the design of the inner rate control loops implemented in the main DIY_UAV project.
Including ฯ in the plant model ensures:
- Realistic simulation
- Correct phase margin prediction
- Controlled bandwidth selection
- Reduced oscillatory risk
- Physically consistent tuning
Ignoring motor lag results in:
- Overestimated bandwidth
- Reduced stability margin
- Instability in real flight despite stable simulation
run("record_audio.m");run("process_audio_tau.m");The identified motor lag model is directly integrated into:
- Rate loop tuning
- Simulation plant model
- Embedded discrete-time controller design
Support me on Patreon https://www.patreon.com/c/CrissCCL
MIT License







