53.4.1. QEO_ABZ_OUT
53.4.1.1. Overview
The QEO_ABZ_OUT sample project demonstrates the functionality of QEO (Quadrature Encoder Output) peripheral in generating ABZ quadrature encoder signals based on position information. QEO can receive position information either through software injection or from hardware (such as MMC), and generate standard ABZ quadrature encoder signals based on preset resolution lines, supporting position synchronization for ABZ signal output.
53.4.1.2. Working Process
This example demonstrates two working modes:
Software Position Injection Mode Configuration steps:
Initialize QEO module and configure ABZ signal output mode
Configure ABZ signal generation parameters:
Set encoder resolution (1024 lines/revolution)
Set maximum output frequency (250kHz)
Configure A/B signals with 4x frequency output
Configure Z signal to output one pulse per revolution
Software position injection process:
Calculate position increment value
Enable software position injection
Cyclically inject position values to simulate 2 forward revolutions
Wait for ABZ signals to reach injected position
Reset position to 0 and disable injection
Hardware Position Input Mode
In this example, the MMC (Motor Motion Control) peripheral provides position information to QEO, which generates ABZ signals in real-time based on the received position information.
Configuration steps:
Initialize QEO module with the same ABZ parameters as software mode
Configure hardware position input:
Connect MMC position output to QEO through TRGM
Configure MMC open-loop prediction mode
Enable motor system timestamp function
53.4.1.3. Hardware Setting
Use oscilloscope/logic analyzer to observe the quadrature encoder signals on QEO ABZ output pins (Please refer to Pin Description section).
53.4.1.4. Notes
QEO ABZ Signal Uniformity Issues:
When QEO’s position input frequency is greater than 2 times the output ABZ signal frequency (position difference between inputs does not exceed 1/4 line of ABZ), the output maintains uniformity
When QEO’s position input frequency is less than 2 times the output ABZ signal frequency (position difference between inputs exceeds 1/4 line of ABZ), uniformity is maintained by dynamically adjusting the minimum width of ABZ signals
QEO ABZ Signal Position Synchronization Function
When QEO’s current position and target sync position fall within the same 1/4 line, synchronization errors may occur. The current position or sync position should be adjusted to avoid the same 1/4 line, refer to the qeo_abz_position_sync function
53.4.1.5. Running the Example
When the project runs correctly, you will observe the following:
Serial terminal output:
QEO ABZ example
QEO generate ABZ signal with software inject position
QEO generate ABZ signal with hardware(MMC) provide position
ABZ Signal Output:
Using oscilloscope/logic analyzer, you can observe the ABZ signal waveforms: - A/B signals: Quadrature square waves with 90-degree phase difference - Z signal: Index pulse once per revolution