Q: In Microchip’s E-Bike scheme, when the FOC library runs at a 100 kHz switching frequency, how much margin does the CPU leave for applications?
A: With a PWM frequency of 100 kHz, the algorithm calculation frequency can be adjusted according to the bandwidth. For example, the current loop adopts 50 kHz and the speed loop adopts 12.5 kHz. The recommended dsPIC33AK series features a 200 MHz clock frequency, 32-bit MCU, double-precision FPU, and hardware acceleration for trigonometric functions and square root (SQRT) operations.
When using the FOC library with a switching frequency of 100 kHz, the margin left by the CPU for applications mainly depends on the specific algorithm configuration and the performance of the selected MCU.
Taking the recommended dsPIC33AK series MCU (200 MHz clock frequency, 32-bit architecture, equipped with double-precision FPU and hardware acceleration for trigonometric functions and SQRT) as an example: when the PWM is 100 kHz, the current loop is configured at 50 kHz and the speed loop at 12.5 kHz, the double-precision FPU and hardware acceleration for trigonometric functions and SQRT are recommended.
Double-Precision FPU (Floating-Point Unit)
-
This is a dedicated hardware module in the MCU for processing floating-point operations. “Double-precision” means it supports 64-bit floating-point data (compliant with the IEEE 754 standard), which provides higher calculation accuracy and dynamic range compared with single-precision (32-bit) floating-point.
-
In the FOC algorithm, core operations such as PI regulation for the current loop and speed loop, and coordinate transformations (Clark/Park transformations) all involve a large number of floating-point calculations (e.g., decimal multiplication and division). The double-precision FPU can execute these operations directly through hardware, instead of relying on software emulation.
Hardware Acceleration for Trigonometric Functions
-
This refers to the dedicated hardware circuit built into the MCU for calculating trigonometric functions such as sine (sin) and cosine (cos), eliminating the need for time-consuming software-based methods like software table lookup or Taylor series approximation.
-
In the FOC algorithm, steps such as SVPWM (Space Vector Pulse Width Modulation) and inverse Park transformation require real-time calculation of trigonometric function values corresponding to angles, which are key operations executed at high frequencies.
SQRT Hardware Acceleration
-
This is a hardware acceleration module for square root (√x) operations, which can quickly calculate vector magnitudes (e.g., magnitude calculation of current vectors in FOC).
-
In motor control, square root operations are frequently used in scenarios such as the synthesis of current loop feedback signals and the judgment of overcurrent protection thresholds.
Without hardware acceleration, core operations would rely on the CPU to implement via software instructions, which would occupy a large amount of time. Using a double-precision FPU and hardware acceleration for trigonometric functions and SQRT can improve efficiency.
More Content Related to FOC
- Why Use a DSP to Control a Three-Phase Permanent Magnet Synchronous Motor (PMSM)?
- 3 Motor Control Techs Comparison: FOC, V/f Control, Trapezoidal Six-Step Control (BLDC)
Related Products:
- Digital Signal Controller (DSC) — dsPIC33CK256MP508
- Gate Driver — MIC4104YM
- DC-DC Converter — MIC2129
- Regulator — MCP16301HT
- Low-Dropout Regulator (LDO) — MCP1826ST-3302E/DB
- CAN Transceiver — MCP2561-E/SN
- Serial Flash — SST25PF040C-40E
- Current Limiter — MIC2091-1YM5-TR
- Comparators — MCP6569T-E/ST
- Voltage Reference — LM4040CYM3-2.5-TR
- Operational Amplifiers (Op-AMPs) — MCP651ST-E/OT
More related Microchip E-Bike Tech Q&A:
- Microchip E-Bike Tech Q&A - How to Divide Work for Real-Time Motor Control & Communication?
- Microchip E-Bike Tech Q&A - How Is EV Speed Control Detected?
- Microchip E-Bike Tech Q&A - What is the scheme architecture of E-Bike?
- Microchip E-Bike Tech Q&A - How to Ensure Anti-Interference & Data Accuracy of Speed Acquisition?
- Microchip E-Bike Tech Q&A - How Does FOC Control Manage Battery Voltage & Current?
- Microchip E-Bike Tech Q&A - How to Prevent Thermal Runaway of E-Bike ?
- Microchip E-Bike Tech Q&A - How Does CPU Achieve Hardware Acceleration?
- Microchip E-Bike Tech Q&A - How to Prevent E-Bike Stall via Hardware Detection?
- Microchip E-Bike Tech Q&A - Which Components Need Monitoring to Ensure Stability?
- Microchip E-Bike Tech Q&A - Will E-Bike Positioning System Power Supply Interrupt?
- Microchip E-Bike Tech Q&A - What Components Are Provided?