🛠 Advanced Phase Current Calibration on QuadESC
Objectifs
This tutorial aims to master the fine calibration of current measurement chains on the BeagleConnect QuadESC board. Unlike standard ESCs, the open architecture based on the BeagleConnect Torque SoM (TI AM13E23019) allows direct access to the TI DRV8323SRTAR driver registers and internal ADC inputs. The goal is to compensate for thermal drifts of the CSD88599Q5DC half-bridges and static offsets of operational amplifiers, essential for achieving accurate 40A continuous current. We will use the TinyEngine accelerator to perform real-time digital filtering without overloading the Cortex-M33 core.
Matériel nécessaire
- BeagleConnect QuadESC board powered by a 4S LiPo battery (14.8V) to simulate real conditions.
- A three-phase BLDC motor connected to outputs A, B, and C.
- A logic analyzer or oscilloscope to verify PWM signals and current feedback.
- A PC with the TI AM13E2X SDK installed and a JTAG/SWD debugger.
- Precision resistors (0.1 Ohm) optional for external current injection.
Étapes
Configure the microcontroller to activate the 12 current measurement channels. Ensure that the channels dedicated to phases U, V, W are in differential mode to reject common-mode noise generated by MOSFET switching.
- Measurement System Initialization
Power the board without running the motor (motor disconnected or zero dynamic braking). Sample ADC values over 1000 cycles. Calculate the average to determine the static offset for each channel. Save these values in a calibration structure in Flash memory.
- Zero-Load Offset Measurement
Inject a known DC current (e.g., 5A) into phase U using a test bench or a controlled short-circuit method (phase-to-phase). Note the raw ADC value. Calculate the Amperes/LSB conversion factor. Repeat for phases V and W.
- Gain Calibration via Known Injection
Use the TinyEngine accelerator to implement a first-order digital low-pass filter directly on the NTC sensor and current data streams. This allows smoothing high-frequency noise caused by DRV8323SRTAR driver switching without consuming CPU cycles.
- TinyEngine Filter Implementation
Launch a constant torque command (Foc) at 20A. Compare the measured value with the setpoint. Adjust gains if the error exceeds 2%.
- Closed-Loop Validation
Vérification
Static measurement error must be less than 1% of full scale. In dynamics, current response must follow the setpoint with minimal phase shift. On the oscilloscope, current signals should appear sinusoidal and noise-free during constant speed rotation.
Pour aller plus loin
Explore using the integrated NTC sensors to create a dynamic thermal compensation table for current offsets. You can also test CAN FD communication to transmit calibration data to an external flight controller via the DShot interface.