This thesis addresses the design, embedded firmware development, and experimental validation of a hierarchical control architecture for attitude stabilization and yaw rate regulation of an autonomous electric bicycle prototype. The control system, implemented in C on the Cortex-M4 core of the STM32H745ZI microcontroller with a 100 Hz periodic loop (Ts = 10 ms), consists of three active regulators: two cascaded steering loops (an outer proportional yaw rate controller generating the roll reference, and an inner PD roll regulator with direct voltage actuation and ACS712 thermal overcurrent protection) alongside a PI loop for longitudinal speed regulation equipped with Feed-Forward and Back-Calculation Anti-Windup. On the considered prototype, direct voltage actuation of the steering motor avoided the phase lag introduced by the filtered current loops tested in previous works. Communication with the supervision unit is handled via a binary serial protocol at 921 600 baud compliant with BFMC standards and protected by CRC32 validation. Ground tests under full vehicle weight confirm accurate longitudinal speed tracking (1.0, 1.5, and 2.0 m/s), while outdoor tests demonstrate the effectiveness of the inner PD regulator in maintaining dynamic roll balance through active counter-steering (achieving a roll RMS of 1.58◦ in roll-only tests and 1.92◦ in the three-loop test at v ≈ 2.0 m/s). Concurrently, quantitative evaluation highlights insufficient regulation performance of the outer yaw rate loop: with a zero reference (ψ̇ref = 0◦/s), the yaw rate fluctuates between −39.69◦/s and +15.69◦/s with a mean of −16.91◦/s (RMS = 22.49◦/s), resulting in a progressive curvilinear deviation of the trajectory. Since the microcontroller already measures ψ̇ via the onboard IMU, this steady-state error is not a consequence of the absence of the High-Level Controller, but stems from the low proportional gain (|Kp,yaw| = 0.015), the lack of integral action, and the unused feedback on the mechanical steering angle δ (the steering encoder is installed but was not employed). Conversely, integrating a High-Level Controller (NVIDIA Jetson) addresses the distinct structural requirement of estimating global pose (X, Y, ψ) and tracking a spatial trajectory.
Il presente lavoro di tesi affronta la progettazione, lo sviluppo firmware embedded e la validazione sperimentale di un’architettura di controllo gerarchica per la stabilizzazione dell’assetto e la regolazione della velocità di imbardata (yaw rate) di un prototipo di bicicletta elettrica autonoma. Il sistema di controllo, implementato in linguaggio C sul core Cortex-M4 del microcontrollore STM32H745ZI con ciclo periodico a 100 Hz (Ts = 10 ms), si articola su tre regolatori attivi: due anelli in cascata per lo sterzo (un regolatore proporzionale esterno di velocità di imbardata che genera il riferimento di rollio e un regolatore interno PD di rollio con comando diretto in tensione e protezione termica da sovracorrente tramite sensore ACS712) affiancati da un anello PI per la regolazione della velocità longitudinale provvisto di Feed-Forward e Anti-Windup con Back-Calculation. Sul prototipo in esame, il pilotaggio diretto in tensione del motore di sterzo ha permesso di evitare i ritardi di fase introdotti dai filtri sugli anelli di corrente sperimentati in lavori precedenti. La comunicazione con l’unità superiore avviene tramite protocollo seriale binario a 921 600 baud conforme allo standard BFMC con validazione CRC32. Le prove sperimentali a terra dimostrano il corretto inseguimento dei riferimenti di velocità longitudinale (1.0, 1.5 e 2.0 m/s) e l’efficacia del regolatore PD interno nel mantenere l’equilibrio dinamico del rollio all’aperto tramite controsterzo attivo (RMS(ϕ) = 1.58◦ in solo rollio e 1.92◦ nel test a tre anelli a v ≈ 2.0 m/s). Al contempo, l’analisi quantitativa evidenzia prestazioni di regolazione insufficienti dell’anello esterno di yaw rate: a fronte di un riferimento nullo (ψ̇ref = 0◦/s), la velocità di imbardata oscilla tra −39.69◦/s e +15.69◦/s con valore medio −16.91◦/s (RMS = 22.49◦/s), determinando una progressiva deviazione curvilinea della traiettoria. Tale errore stazionario non dipende dall’assenza dell’High-Level Controller – poiché l’STM32 dispone già della misura IMU di ψ̇ – ma deriva dalla ridotta autorità del guadagno proporzionale (|Kp,yaw| = 0.015), dall’assenza di azione integrale e dal mancato utilizzo della retroazione sull’angolo meccanico di sterzo δ (encoder presente ma non impiegato). L’integrazione dell’unità ad alto livello (NVIDIA Jetson) risponde invece alla distinta esigenza strutturale di stimare la posa globale (X, Y, ψ) e governare la traiettoria nel piano.
Stabilizzazione dell’Assetto e Controllo di Yaw Rate per una Bicicletta Elettrica Autonoma
FELICETTI, EMANUELE
2025/2026
Abstract
This thesis addresses the design, embedded firmware development, and experimental validation of a hierarchical control architecture for attitude stabilization and yaw rate regulation of an autonomous electric bicycle prototype. The control system, implemented in C on the Cortex-M4 core of the STM32H745ZI microcontroller with a 100 Hz periodic loop (Ts = 10 ms), consists of three active regulators: two cascaded steering loops (an outer proportional yaw rate controller generating the roll reference, and an inner PD roll regulator with direct voltage actuation and ACS712 thermal overcurrent protection) alongside a PI loop for longitudinal speed regulation equipped with Feed-Forward and Back-Calculation Anti-Windup. On the considered prototype, direct voltage actuation of the steering motor avoided the phase lag introduced by the filtered current loops tested in previous works. Communication with the supervision unit is handled via a binary serial protocol at 921 600 baud compliant with BFMC standards and protected by CRC32 validation. Ground tests under full vehicle weight confirm accurate longitudinal speed tracking (1.0, 1.5, and 2.0 m/s), while outdoor tests demonstrate the effectiveness of the inner PD regulator in maintaining dynamic roll balance through active counter-steering (achieving a roll RMS of 1.58◦ in roll-only tests and 1.92◦ in the three-loop test at v ≈ 2.0 m/s). Concurrently, quantitative evaluation highlights insufficient regulation performance of the outer yaw rate loop: with a zero reference (ψ̇ref = 0◦/s), the yaw rate fluctuates between −39.69◦/s and +15.69◦/s with a mean of −16.91◦/s (RMS = 22.49◦/s), resulting in a progressive curvilinear deviation of the trajectory. Since the microcontroller already measures ψ̇ via the onboard IMU, this steady-state error is not a consequence of the absence of the High-Level Controller, but stems from the low proportional gain (|Kp,yaw| = 0.015), the lack of integral action, and the unused feedback on the mechanical steering angle δ (the steering encoder is installed but was not employed). Conversely, integrating a High-Level Controller (NVIDIA Jetson) addresses the distinct structural requirement of estimating global pose (X, Y, ψ) and tracking a spatial trajectory.| File | Dimensione | Formato | |
|---|---|---|---|
|
tesi_felicetti.pdf
accesso aperto
Dimensione
4.55 MB
Formato
Adobe PDF
|
4.55 MB | Adobe PDF | Visualizza/Apri |
I documenti in UNITESI sono protetti da copyright e tutti i diritti sono riservati, salvo diversa indicazione.
https://hdl.handle.net/20.500.12075/29612