Automatic level control apparatus, method and transmitter
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BEIJING BBEF SCI & TECH
- Filing Date
- 2026-04-13
- Publication Date
- 2026-08-07
AI Technical Summary
然而,在功放工作于非线性区(如饱和区)时,其增益会发生压缩,导致传统的数字ALC算法为逼近目标功率,容易在目标值附近出现反复的“过冲”与“欠冲”迭代,如图1所示,这种迭代过程使得收敛速度与控制精度相互矛盾:追求速度则牺牲精度,保证精度则响应缓慢
1、检波器对发射机功放输出信号采样输出检波电压信号,模数转换器将检波电压信号数字化得到实时采样电平值,MCU计算实时采样电平值与目标电平值的误差值,根据误差值生成包含衰减量调整方向信号和步进量大小信号的目标步进控制信号,使数控衰减器单向单调调整自身衰减值以改变发射链路增益,MCU以自身时钟周期为固定时间间隔循环生成目标步进控制信号,对数控衰减器的衰减值进行单调调整直至实时采样电平值与目标电平值的误差处于预设范围内,能兼顾快速响应与高稳态精度,避免现有模拟架构复杂和数字架构迭代振荡的问题,达到提高控制精度和响应速度的效果;
Smart Images

Figure CN122533596A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technology, specifically to an automatic level control device, method, and transmitter. Background Technology
[0002] The channel transmitter needs to adjust its output power in real time according to communication requirements to balance power consumption and communication quality. Automatic Level Control (ALC) is the core technology for achieving this function. Currently, mainstream ALC solutions are divided into analog and digital architectures. Analog ALC typically uses an analog integrator composed of an operational amplifier and an integrating capacitor. Its control voltage changes continuously and monotonically, resulting in high steady-state accuracy. However, it suffers from drawbacks such as complex hardware circuitry, response speed limited by capacitor charging current, large temperature drift, and difficulty in debugging. Digital ALC, on the other hand, uses a microprocessor (MCU) to control a digitally controlled attenuator based on the sampled output power value using a digital algorithm. However, when the power amplifier operates in the nonlinear region (such as the saturation region), its gain is compressed. This causes traditional digital ALC algorithms to repeatedly iterate between "overshoot" and "undershoot" near the target power value in order to approximate the target power. Figure 1 As shown, this iterative process creates a trade-off between convergence speed and control accuracy: pursuing speed sacrifices accuracy, while ensuring accuracy results in a slow response. Therefore, there is an urgent need in the field for an ALC scheme that can balance fast response and high steady-state accuracy to overcome the technical shortcomings of complex analog architectures and iterative oscillations in digital architectures in existing technologies. Summary of the Invention
[0003] The purpose of this application is to overcome the above-mentioned technical problems. This application provides an automatic level control device, method and transmitter.
[0004] In a first aspect, this application provides an automatic level control device applied in a transmitter, comprising: a detector for sampling the output signal of the transmitter power amplifier and outputting a detector voltage signal; an analog-to-digital converter electrically connected to the detector for digitizing the detector voltage signal and outputting a real-time sampled level value; a digitally controlled attenuator disposed in the transmission link for adjusting the gain of the transmission link; and an MCU electrically connected to both the analog-to-digital converter and the digitally controlled attenuator. The MCU is configured to perform the following operations: receive the real-time sampled level value and calculate the error value between the real-time sampled level value and a target level value, wherein the target level value is a level value corresponding to a target output power; generate a target step control signal based on the error value and output it to the digitally controlled attenuator, so that the digitally controlled attenuator unidirectionally and monotonically adjusts its own attenuation value based on the target step control signal to change the gain of the transmission link, wherein the target step control signal includes an attenuation adjustment direction signal and a step size signal; and the MCU cyclically generates the target step control signal at a fixed time interval of the MCU clock cycle until the error between the real-time sampled level value and the target level value is within a preset range.
[0005] By adopting the above technical solution, the detector samples the output signal of the transmitter power amplifier and outputs a detector voltage signal. The analog-to-digital converter digitizes the detector voltage signal to obtain the real-time sampled level value. The MCU calculates the error value between the real-time sampled level value and the target level value. Based on the error value, a target step control signal is generated, which includes an attenuation adjustment direction signal and a step size signal. This enables the digitally controlled attenuator to unidirectionally and monotonically adjust its own attenuation value to change the transmit link gain. The MCU generates the target step control signal cyclically at a fixed time interval of its own clock cycle, and monotonically adjusts the attenuation value of the digitally controlled attenuator until the error between the real-time sampled level value and the target level value is within a preset range. This approach can balance fast response and high steady-state accuracy, avoid the problems of complexity in existing analog architectures and iterative oscillations in digital architectures, and achieve the effect of improving control accuracy and response speed.
[0006] Optionally, the MCU includes: an error calculation module, a threshold judgment module, and a step control module. The target step control signal is generated collaboratively by the error calculation module, the threshold judgment module, and the step control module. The error calculation module is used to calculate the error value between the real-time sampled level value and the target level value. The error value includes an error direction signal and an error absolute value. The error direction signal is used to indicate whether the error value is positive or negative. The threshold judgment module is used to compare the error absolute value with a preset threshold value and output a step size control signal based on the comparison result. The step control module is used to output a target step control signal to the numerically controlled attenuator based on the error direction signal and the step size control signal, so as to perform step control of the attenuation value of the numerically controlled attenuator by accumulating or subtracting.
[0007] By adopting the above technical solution, the error calculation module calculates the error between the real-time sampled level value and the target level value, including the error direction signal and the absolute value of the error. The threshold judgment module compares the absolute value of the error with the preset threshold value and outputs the step size control signal. The step control module outputs the target step control signal to the numerically controlled attenuator according to the error direction signal and the step size control signal, so that the numerically controlled attenuator can unidirectionally and monotonically adjust its own attenuation value to change the transmission link gain. This can avoid the repeated "overshoot" and "undershoot" iterations of the traditional digital ALC algorithm near the target value, and take into account both fast response and high steady-state accuracy.
[0008] Optionally, the preset threshold values include a first set of threshold values and a second set of threshold values. The first set of threshold values is used when the error direction signal indicates that the error value is positive, and the second set of threshold values is used when the error direction signal indicates that the error value is negative.
[0009] By adopting the above technical solution, different groups of threshold values are used to judge the positive and negative values of the error, enabling the automatic level control device to output step size control signals more accurately according to different error conditions. This allows for more reasonable control of the digital attenuator to adjust the gain of the transmission link, thereby improving the accuracy and adaptability of the automatic level control.
[0010] Optionally, the first set of threshold values includes a first threshold value and a second threshold value, and the second set of threshold values includes a third threshold value and a fourth threshold value. When the error value is positive and the absolute value of the error is less than the first threshold value, or when the error value is negative and the absolute value of the error is less than the third threshold value, a no-step control signal is output. When the error value is positive, the absolute value of the error is greater than or equal to the first threshold value and less than the second threshold value, a small-step control signal is output. When the error value is negative, the absolute value of the error is greater than or equal to the third threshold value and less than the fourth threshold value, a small-step control signal is output. When the error value is positive, the absolute value of the error is greater than or equal to the second threshold value, a large-step control signal is output. When the error value is negative, the absolute value of the error is greater than or equal to the fourth threshold value, a large-step control signal is output. The step size control signal includes a no-step control signal, a small-step control signal, and a large-step control signal, and the step size corresponding to the large-step control signal is greater than the step size corresponding to the small-step control signal.
[0011] By adopting the above technical solution, setting two different threshold values, and outputting different step control signals according to the sign of the error value and the relationship between the absolute value of the error and the threshold value, the step size of the digitally controlled attenuator can be controlled more accurately according to the error situation, realizing flexible adjustment of the transmit link gain. When the error is small, no step control signal is output to avoid unnecessary adjustment; when the error is moderate, a small step control signal is output for fine adjustment; and when the error is large, a large step control signal is output for rapid adjustment, thus balancing the speed and accuracy of control.
[0012] Optionally, the judgment logic of the threshold judgment module is configured as asymmetric judgment logic, wherein the step judgment interval for positive error values defined by the first threshold value and the second threshold value, and the step judgment interval for negative error values defined by the third threshold value and the fourth threshold value are asymmetrically set to compensate for the gain compression characteristics of the transmitter power amplifier when it operates in the nonlinear region, wherein the third threshold value is greater than the first threshold value, and the fourth threshold value is greater than the second threshold value.
[0013] By adopting the above technical solution, the threshold judgment module will asymmetrically set the step judgment intervals for positive and negative error values, which can compensate for the gain compression characteristics of the transmitter power amplifier when it is operating in the nonlinear region. Through asymmetrical judgment logic, based on the gain compression characteristics of the power amplifier when it is operating in the nonlinear region, the step judgment intervals for positive and negative errors are set differently, which can effectively compensate for the impact of power amplifier gain compression, so that the power can be adjusted more accurately under both positive and negative error conditions, thereby improving the accuracy of power control.
[0014] Optionally, the stepping control module is used to output a target stepping control signal to the CNC attenuator in at least one of the following ways: when the error direction signal indicates that the error value is positive and the step size control signal is a small stepping control signal, a first control signal is output to the CNC attenuator, the first control signal being used to instruct the CNC attenuator to increase the attenuation value by one step, wherein the target stepping control signal includes the first control signal; when the error direction signal indicates that the error value is positive and the step size control signal is a large stepping control signal, a second control signal is output to the CNC attenuator, the second control signal being used to instruct the CNC attenuator to increase the attenuation value by a second step, wherein both the first step and the second step are... The target step control signal includes the second control signal, where the error direction signal indicates a negative error value and the step size control signal is a small step control signal. A third control signal is output to the numerically controlled attenuator, instructing it to reduce the attenuation value by the first step amount. The target step control signal includes the third control signal. When the error direction signal indicates a negative error value and the step size control signal is a large step control signal, a fourth control signal is output to the numerically controlled attenuator, instructing it to reduce the attenuation value by the second step amount.
[0015] By adopting the above technical solution, different control signals are output according to the error direction signal and the step size control signal, which can instruct the digitally controlled attenuator to increase or decrease the attenuation value according to different step sizes, thereby realizing precise adjustment of the transmit link gain. This effectively solves the iterative problems of "overshoot" and "undershoot" that occur when the power amplifier is working in the nonlinear region in the traditional digital ALC algorithm, and takes into account both fast response and high steady-state accuracy.
[0016] Optionally, the step control module also includes a carry unit, where the second step amount is equal to N times the first step amount, and N is a positive integer. When the cumulative number of adjustments according to the first step amount reaches N times, the carry unit triggers the second step amount to carry over, and the number of adjustments for the first step amount is cleared to zero, ensuring the continuity of the transmit link gain adjustment.
[0017] By adopting the above technical solution, setting a carry unit and making the second step amount equal to N times the first step amount, the second step amount carry is triggered and the first step amount adjustment count is cleared when the cumulative number of first step amount adjustments reaches N times, which can ensure the continuity of transmit link gain adjustment.
[0018] Optionally, the error calculation module obtains the difference between the real-time sampled level value and the target level value through subtraction, determines the error direction signal using the overflow flag of the calculation result, and obtains the absolute error signal by converting the absolute value of the difference.
[0019] By adopting the above technical solution, the error direction signal is determined by subtraction and overflow flag, and the absolute value of the error is obtained by converting the absolute value of the difference. This can accurately calculate the error between the real-time sampling level value and the target level value, providing a precise basis for the subsequent generation of the target step control signal. It also helps the automatic level control device to adjust the transmission link gain more accurately, taking into account both fast response and high steady-state accuracy.
[0020] Optionally, the above device further includes: a directional coupler, which is connected in series between the transmitter power amplifier and the transmitter output terminal, for coupling a preset ratio of a coupling signal from the main signal output by the transmitter power amplifier and transmitting it to the detector; the output signal sampled by the detector is the coupling signal, and the power of the coupling signal is in a fixed ratio with that of the main signal.
[0021] By adopting the above technical solution, the directional coupler couples a preset ratio of coupling signal from the main signal output by the power amplifier to the detector, which facilitates the detector sampling. Moreover, the coupling signal and the main signal power have a fixed ratio relationship. The fixed ratio coupling characteristic of the directional coupler allows the coupling signal to accurately reflect the main signal power, providing a reliable data foundation for detection, digitization and subsequent MCU control, and indirectly improving the overall control accuracy of ALC.
[0022] In a second aspect of this application, an automatic level control method is also provided, applied in any of the aforementioned automatic level control devices, comprising: Step 1: A detector samples the output signal of a transmitter power amplifier and outputs a detector voltage signal; Step 2: An analog-to-digital converter digitizes the detector voltage signal to obtain and output a real-time sampled level value; Step 3: An MCU receives the real-time sampled level value and calculates the error value between the real-time sampled level value and a target level value, wherein the target level value is a level value corresponding to a target output power; Step 4: The MCU generates a target step control signal based on the error value, the target step control signal including an attenuation adjustment direction signal and a step size signal; Step 5: The MCU outputs the target step control signal to a digitally controlled attenuator, causing the digitally controlled attenuator to unidirectionally and monotonically adjust its own attenuation value based on the target step control signal to change the gain of the transmission link; wherein the MCU executes steps 3 to 5 cyclically at a fixed time interval of its own clock cycle until the error between the real-time sampled level value and the target level value is within a preset range.
[0023] In a third aspect of this application, a transmitter is also provided, including the automatic level control device of any of the foregoing.
[0024] In summary, one or more technical solutions provided in this application have at least the following technical effects or advantages: 1. The detector samples the output signal of the transmitter power amplifier and outputs a detector voltage signal. The analog-to-digital converter digitizes the detector voltage signal to obtain the real-time sampled level value. The MCU calculates the error value between the real-time sampled level value and the target level value. Based on the error value, it generates a target step control signal that includes an attenuation adjustment direction signal and a step size signal. This enables the digitally controlled attenuator to unidirectionally and monotonically adjust its own attenuation value to change the transmit link gain. The MCU generates the target step control signal cyclically at a fixed time interval of its own clock cycle, and monotonically adjusts the attenuation value of the digitally controlled attenuator until the error between the real-time sampled level value and the target level value is within the preset range. This approach can balance fast response and high steady-state accuracy, avoiding the problems of complexity in existing analog architectures and iterative oscillations in digital architectures, thereby improving control accuracy and response speed. 2. The error calculation module calculates the error between the real-time sampled level value and the target level value, including the error direction signal and the absolute value of the error. The threshold judgment module compares the absolute value of the error with the preset threshold value and outputs the step size control signal. The step control module outputs the target step control signal to the numerically controlled attenuator according to the error direction signal and the step size control signal, so that the numerically controlled attenuator can unidirectionally and monotonically adjust its own attenuation value to change the transmit link gain. This can avoid the traditional digital ALC algorithm from repeatedly iterating between "overshoot" and "undershoot" near the target value, and take into account both fast response and high steady-state accuracy. 3. Different threshold values are used to judge the error value based on whether it is positive or negative, so that the automatic level control device can output step size control signals more accurately according to different error conditions, thereby more reasonably controlling the digital attenuator to adjust the gain of the transmission link and improving the accuracy and adaptability of automatic level control. Attached Figure Description
[0025] Figure 1 This is a schematic diagram of the digital ALC architecture implementation in related technologies; Figure 2 This is a frame diagram of an automatic level control device provided in an embodiment of this application; Figure 3 This is a schematic diagram of the relationship between the integrator circuit and the output voltage in the analog architecture of related technologies; Figure 4 This is a hardware block diagram of a digital ALC device provided in an embodiment of this application; Figure 5 This is a block diagram of the MCU implementation in the digital ALC device provided in the embodiments of this application; Figure 6 This is a control flowchart of the digital ALC device provided in the embodiments of this application; Figure 7 This is a schematic diagram illustrating the tracking effect of the digital ALC device provided in the embodiments of this application; Figure 8 This is a block diagram illustrating the implementation within a single clock cycle provided in an embodiment of this application; Figure 9 This is a schematic diagram of the conversion relationship between large and small steps provided in the embodiments of this application; Figure 10 This is a schematic diagram of the threshold values provided in the embodiments of this application; Figure 11 This is a schematic diagram of the step carry provided in the embodiments of this application. Detailed Implementation
[0026] To enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments.
[0027] In the description of the embodiments of this application, the words "for example" or "for instance" are used to indicate examples, illustrations, or explanations. Any embodiment or design that is described as "for example" or "for instance" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design options. Rather, the use of the words "for example" or "for instance" is intended to present the relevant concepts in a specific manner.
[0028] In the description of the embodiments of this application, the term "multiple" means two or more. Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. The terms "comprising," "including," "having," and variations thereof all mean "including but not limited to," unless otherwise specifically emphasized.
[0029] When a channel transmitter is operating, its output power needs to be adjusted in real time based on the communication distance and the receiving threshold at the other end to ensure good power consumption and linearity. The transmitter needs to achieve instantaneous controllability of the output power, changing in real time with waveform characteristics, while also maintaining the accuracy of the power amplifier's output power during high-power transmission. When the transmitting power amplifier is transmitting at high power, it is often in a saturated compression state, and its power consumption fluctuates significantly with changes in output power. For example, a 0.1dB increase in the output power of a 50W power amplifier will increase the overall power consumption by approximately 7W. In applications with strict power consumption requirements, precise control of the output power is essential. The channel's ALC (Automatic Attenuation Control) can control the transmit power, allowing for real-time controllability as required. A well-designed ALC can achieve precise control of the output power in a relatively short time. Commonly used ALC schemes in related technologies are divided into analog and digital architectures: In a digital ALC architecture, the main controller adjusts the attenuation value in the transmit link based on the detector output voltage at the power amplifier output. When a power amplifier operates at saturation, it compresses its output power, which in turn compresses the gain of the actual loop control. If a stable output power value is to be reached quickly, the output power will be inaccurate compared to the target value, failing to meet the requirements for precise control. To achieve precise control, the digital architecture's ALC needs to repeatedly compensate for the difference between the gain and the target value, requiring iterative processing, which is therefore time-consuming. Traditional digital architecture implementations, such as... Figure 1 Iteration time and output accuracy are inversely related. In analog ALC architectures, an integrating capacitor is generally used, with the open-loop integrating loop being a first-order loop, which is reflected in the closed-loop as a first-order pole control loop. This can achieve good steady-state accuracy, but because it is an analog architecture, the hardware circuit is relatively complex, requiring a sufficiently large detector drive current to meet the charging time of the integrating capacitor, which can easily place high demands on the hardware.
[0030] This application provides an automatic level control device for use in a transmitter, see reference. Figure 2 , Figure 2This is a framework diagram of an automatic level control device provided in an embodiment of this application. The device includes: a detector for sampling the output signal of a transmitter power amplifier and outputting a detected voltage signal; an analog-to-digital converter (ADC) electrically connected to the detector for digitizing the detected voltage signal and outputting a real-time sampled level value; a digitally controlled attenuator (DCE) disposed in the transmit link for adjusting the gain of the transmit link; and an MCU electrically connected to both the ADC and the DCE. The MCU performs the following operations: receiving the real-time sampled level value and calculating the error between the real-time sampled level value and a target level value, wherein the target level value is a level value corresponding to the target output power; generating a target step control signal based on the error value and outputting it to the DCE, so that the DCE unidirectionally and monotonically adjusts its own attenuation value based on the target step control signal to change the gain of the transmit link, wherein the target step control signal includes an attenuation adjustment direction signal and a step size signal; and the MCU cyclically generating the target step control signal at a fixed time interval of the MCU clock cycle until the error between the real-time sampled level value and the target level value is within a preset range.
[0031] In the above embodiment, the detector samples the output signal of the transmitter power amplifier and outputs a detector voltage signal. The analog-to-digital converter digitizes the detector voltage signal to obtain a real-time sampled level value. The MCU calculates the error value between the real-time sampled level value and the target level value. Based on the error value, it generates a target step control signal that includes an attenuation adjustment direction signal and a step size signal. This causes the digitally controlled attenuator to unidirectionally and monotonically adjust its own attenuation value to change the transmit link gain. The MCU generates the target step control signal cyclically at a fixed time interval of its own clock cycle, and monotonically adjusts the attenuation value of the digitally controlled attenuator until the error between the real-time sampled level value and the target level value is within a preset range. This approach can balance fast response and high steady-state accuracy, avoiding the problems of complexity in existing analog architectures and iterative oscillations in digital architectures, thereby improving control accuracy and response speed.
[0032] This automatic level control device achieves power stability through a closed-loop control of "sampling-digitization-unidirectional monotonic adjustment." The core logic is as follows: The detector samples the output signal of the transmitter power amplifier and converts it into a detector voltage signal; the analog-to-digital converter digitizes the analog voltage and outputs the real-time sampled level value, that is, the output power of the power amplifier is fed back to the MCU in real time and digitally; the MCU calculates the error between the sampled level and the target level and generates a target step control signal containing the adjustment direction and step amount; the digitally controlled attenuator adjusts the attenuation value unidirectionally and monotonically according to the target step control signal, and the MCU executes this process cyclically with a fixed clock cycle until the error between the real-time sampled level value and the target level value falls within the preset range. Unlike traditional digital ALC algorithms (such as PID or its variants) that make iterative adjustments based on the magnitude and direction of the error, this embodiment requires the MCU to control the digitally controlled attenuator to always move in one direction (increasing or decreasing attenuation) and to continuously (monotonically) adjust it. This adjustment direction is determined by the initial error and should not be changed during the current convergence process once it begins. The MCU uses its fixed clock cycle as a rhythm to continuously sample and calculate the error and output control signals (including direction and step size), forming a high-frequency closed-loop control until the error enters the preset tolerance range. This embodiment overcomes the shortcomings of analog ALC, eliminating the need for complex analog integrator circuits and avoiding problems such as large temperature drift, difficult debugging, and response speed limited by capacitor charging. It solves the iterative oscillation problem of digital ALC by replacing the bidirectional iteration of traditional digital ALC with "unidirectional monotonic adjustment," avoiding the "overshoot" and "undershoot" cycles that occur when the power amplifier's nonlinear region gain is compressed. It breaks the contradiction between convergence speed and control accuracy: the closed-loop cycle with a fixed clock period + unidirectional adjustment mechanism balances fast response and steady-state accuracy, solving the dilemma of "losing accuracy for speed and losing speed for accuracy" in traditional digital ALC. This embodiment utilizes fixed-interval control based on the MCU clock cycle, eliminating the delay caused by capacitor charging in analog circuits. Unidirectional adjustment avoids iterative waste and improves control timeliness. Closed-loop cycling continues until the error meets preset requirements, while unidirectional monotonic adjustment prevents oscillation, ensuring the final sampled value stably approaches the target level. The adoption of a digital architecture of "detector-ADC-MCU-digitally controlled attenuator" eliminates the need for complex analog components, reducing hardware complexity and debugging difficulty, and minimizing the impact of temperature drift. Stable control remains even when the power amplifier operates in nonlinear regions such as saturation, unaffected by gain compression.
[0033] In an optional embodiment, the MCU includes: an error calculation module, a threshold judgment module, and a step control module. The target step control signal is generated collaboratively by the error calculation module, the threshold judgment module, and the step control module. The error calculation module calculates the error between the real-time sampled level value and the target level value. The error value includes an error direction signal and an absolute error value. The error direction signal indicates whether the error value is positive or negative. The threshold judgment module compares the absolute error value with a preset threshold value and outputs a step size control signal based on the comparison result. The step control module outputs a target step control signal to the numerically controlled attenuator based on the error direction signal and the step size control signal, thereby performing step control on the attenuation value of the numerically controlled attenuator by accumulating or subtracting steps.
[0034] In the above embodiment, the error calculation module calculates the error between the real-time sampled level value and the target level value, including the error direction signal and the absolute value of the error. The threshold judgment module compares the absolute value of the error with the preset threshold value and outputs a step size control signal. The step control module outputs a target step control signal to the numerically controlled attenuator according to the error direction signal and the step size control signal, so that the numerically controlled attenuator can unidirectionally and monotonically adjust its own attenuation value to change the transmit link gain. This can avoid the traditional digital ALC algorithm from repeatedly iterating between "overshoot" and "undershoot" near the target value, and take into account both fast response and high steady-state accuracy.
[0035] The MCU's control logic comprises three cooperating modules that enable refined generation of control signals. The specific process is as follows: The error calculation module first performs precise error analysis, calculating not only the absolute value of the error between the real-time sampled level and the target level, but also generating an error direction signal to clarify whether the current sampled value is higher or lower than the target value, providing a clear basis for subsequent adjustment. This module is responsible for core feedback information processing, calculating not only the absolute value (magnitude) of the error but also its direction signal (positive or negative). This direction signal is the fundamental basis for determining unidirectional adjustment (whether to increase or decrease attenuation). The threshold judgment module is key to achieving "graded stepping." It presets one or more threshold values and compares the absolute value of the error with the threshold. Its logic is: when the error is large, a large step control signal is output to quickly approach the target; when the error is small, a small step control signal is output to prevent overshoot, achieving fine approximation and thus determining the adjustment range appropriate for the current error. The step control module integrates the outputs of the first two modules, combines the error direction signal to determine whether the attenuation value is accumulated or subtracted, and then, together with the step size control signal, generates a complete target step control signal and sends it to the CNC attenuator to drive the CNC attenuator to perform accumulation or subtraction operations, ultimately achieving precise adjustment of the transmit link gain. Traditional digital ALC MCU control algorithms are mostly integrated designs, making it difficult to pinpoint whether the problem lies in error calculation, amplitude judgment, or execution control when adjustment deviations occur. Traditional digital ALCs often use fixed step adjustments; too large a step can lead to overshoot, while too small a step results in slow response. This embodiment solves the problem of fixed steps being unable to adapt to different error scenarios by dynamically matching the step size through a threshold judgment module. In analog ALCs, error processing and adjustment control are integrated into the analog circuit, and temperature drift can simultaneously interfere with multiple components. In this embodiment, each module has a clear division of labor, and digital processing can specifically avoid the interference of temperature drift on individual modules, and it is easy to compensate through algorithms, solving the problem of the cascading effects of temperature drift in analog architectures. This embodiment, through the explicit definition of the error direction and dynamic matching of the step size, makes the attenuation adjustment of the CNC attenuator more targeted. For example, when the error is large, it quickly approaches the target value, and when the error is small, it makes fine adjustments, effectively avoiding overshoot or under-adjustment caused by fixed steps, and significantly improving the steady-state accuracy of level control. The dynamic stepping mechanism can adapt to the gain changes of the transmitter power amplifier under different operating states. Even when the power amplifier is in the nonlinear region, the output power can be stably controlled through flexible step adjustments. At the same time, the digital modular design reduces hardware circuit dependence and is less affected by environmental factors such as temperature drift compared to analog ALC, thus improving the overall working stability of the device.
[0036] In an optional embodiment, the preset threshold values include a first set of threshold values and a second set of threshold values, wherein the first set of threshold values is used when the error direction signal indicates that the error value is positive, and the second set of threshold values is used when the error direction signal indicates that the error value is negative.
[0037] In the above embodiments, different groups of threshold values are used to judge the error value based on whether it is positive or negative, so that the automatic level control device can output step size control signals more accurately according to different error conditions, thereby more reasonably controlling the digital attenuator to adjust the gain of the transmission link and improving the accuracy and adaptability of automatic level control.
[0038] This implementation addresses asymmetric control for two states: "too high" and "too low" actual power. Pulling power back from an excessively high state (handling positive errors) and increasing power from an insufficient state (handling negative errors) represent two asymmetrical control scenarios involving physical processes. This embodiment no longer uses a single set of threshold standards. Instead, it dynamically selects two independent sets of threshold values based on the error direction signal output by the error calculation module: a first set of threshold values (for positive errors, i.e., power too high) and a second set of threshold values (for negative errors, i.e., power too low). The threshold judgment module compares the corresponding set of threshold values with the absolute value of the error based on the error direction signal, and then outputs a step size control signal adapted to the current direction. Ultimately, this, in conjunction with the step control module, achieves precise adjustment of the attenuation value. A single threshold can easily lead to mismatched adjustment steps in a certain direction, causing overshoot or adjustment lag. When the power amplifier operates in the saturation region or other nonlinear regions, the gain change patterns corresponding to positive and negative errors are inconsistent. A single threshold will exacerbate the potential risk of "overshoot-undershoot," while bidirectional independent thresholds can be specifically adapted to the gain characteristics of different directions. Continuous control of analog ALC cannot adjust the response characteristics according to the error direction, and factors such as temperature drift will further amplify the imbalance of bidirectional error control. This solution avoids this problem by using digital direction differentiation and threshold switching. This embodiment configures dedicated threshold values for different gain characteristics corresponding to positive and negative errors, so that the step size in the two directions matches their respective error adjustment requirements, avoiding insufficient accuracy in a certain direction caused by a single threshold. In the nonlinear region of the power amplifier, the gain changes of positive and negative errors are asymmetrical. Bidirectional independent thresholds can specifically optimize the convergence rhythm in each direction, further reducing the risk of iterative oscillation. The two sets of threshold values can be independently debugged and optimized, adapting to the differences in bidirectional gain characteristics of different types of power amplifiers, expanding the applicable scenarios of the device.
[0039] In an optional embodiment, the first set of threshold values includes a first threshold value and a second threshold value, and the second set of threshold values includes a third threshold value and a fourth threshold value. When the error value is positive and the absolute value of the error is less than the first threshold value, or when the error value is negative and the absolute value of the error is less than the third threshold value, a no-step control signal is output. When the error value is positive, the absolute value of the error is greater than or equal to the first threshold value and less than the second threshold value, a small-step control signal is output. When the error value is negative, the absolute value of the error is greater than or equal to the third threshold value and less than the fourth threshold value, a small-step control signal is output. When the error value is positive, the absolute value of the error is greater than or equal to the second threshold value, a large-step control signal is output. When the error value is negative, the absolute value of the error is greater than or equal to the fourth threshold value, a large-step control signal is output. The step size control signal includes a no-step control signal, a small-step control signal, and a large-step control signal, and the step size corresponding to the large-step control signal is greater than the step size corresponding to the small-step control signal.
[0040] In the above embodiments, two different threshold values are set, and different step size control signals are output according to the sign of the error value and the relationship between the absolute value of the error and the threshold value. This allows for more precise control of the step size of the digitally controlled attenuator based on the error situation, enabling flexible adjustment of the transmit link gain. When the error is small, no step control signal is output to avoid unnecessary adjustments. When the error is moderate, a small step control signal is output for fine adjustment. When the error is large, a large step control signal is output for rapid adjustment, thus balancing the speed and accuracy of control.
[0041] First, the preset threshold values are divided into two groups. The first group includes the first and second threshold values, used to determine the case where the error value is positive. The second group includes the third and fourth threshold values, used to determine the case where the error value is negative. Then, based on the sign of the error indicated by the error direction signal and the comparison results between the absolute value of the error and different threshold values, different step size control signals are output, including no step control signal, small step control signal, and large step control signal. The step size corresponding to the large step control signal is greater than that corresponding to the small step control signal. The specific rules are as follows: when the error value is positive and the absolute value of the error is less than the first threshold value, or when the error value is negative and the absolute value of the error is less than the third threshold value, it indicates that the current error is small and the system is in a stable state close to the target power. At this time, no step control signal is output, that is, the attenuation value of the numerically controlled attenuator is not adjusted. When the error value is positive and its absolute value is greater than or equal to the first threshold and less than the second threshold, or when the error value is negative and its absolute value is greater than or equal to the third threshold and less than the fourth threshold, it indicates that the error is within a moderate range. A small-step control signal is output to adjust the attenuation value of the digitally controlled attenuator in small increments, achieving relatively fine power regulation. When the error value is positive and its absolute value is greater than or equal to the second threshold, or when the error value is negative and its absolute value is greater than or equal to the fourth threshold, it means that the error is large and rapid power adjustment is required. In this case, a large-step control signal is output to adjust the attenuation value of the digitally controlled attenuator in large increments, accelerating the system's approach to the target power. This embodiment achieves precise, tiered control of power adjustment by setting multiple threshold values based on the magnitude of the absolute error and outputting control signals of different step sizes. No adjustment is made in cases of small errors to avoid unnecessary interference; small-step adjustments are made in cases of moderate errors to achieve fine power regulation; and large-step adjustments are made in cases of large errors to accelerate the adjustment speed, thereby improving control accuracy. This embodiment can flexibly select an appropriate step size according to different error states. When the error is large, it can quickly adjust to improve the response speed, and when the error is small, it can make small steps or stop adjusting to ensure steady-state accuracy. This adaptive adjustment method enables the system to achieve a good balance between response speed and steady-state accuracy under different operating conditions, thereby improving the overall performance of the system.
[0042] In an optional embodiment, the judgment logic of the threshold judgment module is configured as asymmetric judgment logic, wherein the step judgment interval for positive error values defined by the first threshold value and the second threshold value, and the step judgment interval for negative error values defined by the third threshold value and the fourth threshold value are asymmetrically set to compensate for the gain compression characteristics of the transmitter power amplifier when it operates in the nonlinear region, wherein the third threshold value is greater than the first threshold value, and the fourth threshold value is greater than the second threshold value.
[0043] In the above embodiments, the threshold judgment module will asymmetrically set the step judgment intervals for positive and negative error values, which can compensate for the gain compression characteristics of the transmitter power amplifier when it is operating in the nonlinear region. Through asymmetrical judgment logic, the step judgment intervals for positive and negative errors are set differently according to the gain compression characteristics of the power amplifier when it is operating in the nonlinear region. This can effectively compensate for the impact of power amplifier gain compression, so that the power can be adjusted more accurately under both positive and negative error conditions, thereby improving the accuracy of power control.
[0044] In an automatic level control device, the threshold judgment module originally judges and outputs corresponding step control signals based on different threshold ranges according to the positive or negative error value. Different threshold ranges are set for positive and negative error values to determine whether to output no-step, small-step, or large-step control signals. The step judgment range defined by the first and second threshold values for positive error values is asymmetrically set with the step judgment range defined by the third and fourth threshold values for negative error values. When the power amplifier operates in the nonlinear region (such as the saturation region), gain compression occurs; that is, as the input power increases, the increase in output power gradually decreases. This nonlinear characteristic has different effects on positive errors (output power higher than the target power) and negative errors (output power lower than the target power). The asymmetrical judgment logic takes this characteristic into account, and by adjusting the threshold ranges corresponding to positive and negative errors, it compensates for the gain compression characteristic of the power amplifier when judging whether to adjust the step and the step size. For example, when amplifier gain compression makes it more difficult to reduce power to the target value with positive errors, the step judgment interval for positive errors can be appropriately widened, allowing for step adjustments in more situations. For negative errors, the judgment interval can be reasonably set according to the amplifier characteristics to more precisely control power increase. Asymmetric judgment logic allows the system to make decisions that are more consistent with actual conditions when adjusting power. It can more effectively reduce power with positive errors and more precisely increase power with negative errors, thus achieving precise power control even in the amplifier's nonlinear region, making the output power closer to the target power.
[0045] In an optional embodiment, the step control module is configured to output a target step control signal to the numerically controlled attenuator in at least one of the following ways: when the error direction signal indicates that the error value is positive and the step size control signal is a small step control signal, outputting a first control signal to the numerically controlled attenuator, the first control signal instructing the numerically controlled attenuator to increase the attenuation value by a first step amount, wherein the target step control signal includes the first control signal; when the error direction signal indicates that the error value is positive and the step size control signal is a large step control signal, outputting a second control signal to the numerically controlled attenuator, the second control signal instructing the numerically controlled attenuator to increase the attenuation value by a second step amount, wherein the first step amount and the second step amount are... All step sizes are greater than 0, and the second step size is greater than the first step size. The target step control signal includes the second control signal. When the error direction signal indicates that the error value is negative and the step size control signal is a small step control signal, a third control signal is output to the numerically controlled attenuator. The third control signal is used to instruct the numerically controlled attenuator to reduce the attenuation value according to the first step size. The target step control signal includes the third control signal. When the error direction signal indicates that the error value is negative and the step size control signal is a large step control signal, a fourth control signal is output to the numerically controlled attenuator. The fourth control signal is used to instruct the numerically controlled attenuator to reduce the attenuation value according to the second step size. The target step control signal includes the fourth control signal.
[0046] In the above embodiments, different control signals are output according to the error direction signal and the step size control signal, which can instruct the digitally controlled attenuator to increase or decrease the attenuation value according to different step sizes, thereby realizing precise adjustment of the transmit link gain. This effectively solves the iterative problems of "overshoot" and "undershoot" that occur when the power amplifier is working in the nonlinear region in the traditional digital ALC algorithm, and takes into account both fast response and high steady-state accuracy.
[0047] This embodiment outputs different control signals to the numerically controlled attenuator based on different combinations of the error direction signal and the step size control signal, thereby achieving precise adjustment of the transmit link gain. Specifically, the error direction signal indicates whether the error value is positive or negative, i.e., whether the current real-time sampled level is higher (positive error value) or lower (negative error value) than the target level. The step size control signal is divided into small step control signal and large step control signal, used to represent different adjustment ranges. When the error value is positive, it means that the current output power is higher than the target power, and the power needs to be reduced, i.e., the attenuation value needs to be increased. If the step size control signal is a small step control signal, the step control module outputs a first control signal to the numerically controlled attenuator, instructing the numerically controlled attenuator to increase the attenuation value by the first step amount. If the step size control signal is a large step control signal, the step control module outputs a second control signal, instructing the numerically controlled attenuator to increase the attenuation value by the second step amount, and the second step amount is greater than the first step amount, so as to achieve a larger power adjustment range. When the error value is negative, it indicates that the current output power is lower than the target power, requiring an increase in power, i.e., a decrease in attenuation. If the step size control signal is a small step control signal, the step control module outputs a third control signal, instructing the digitally controlled attenuator to reduce the attenuation by the first step amount. If the step size control signal is a large step control signal, the step control module outputs a fourth control signal, instructing the digitally controlled attenuator to reduce the attenuation by the second step amount, where the second step amount is greater than the first step amount. This embodiment achieves precise hierarchical step control of the digitally controlled attenuator by outputting different control signals based on different combinations of error direction and magnitude. It can flexibly control the adjustment direction and amplitude of the digitally controlled attenuator according to the specific circumstances of the error direction (positive or negative) and magnitude, achieving precise adjustment of the transmit link gain. Whether the output power is higher or lower than the target power, appropriate adjustments can be made according to the actual situation, improving the system's adaptability and control accuracy. By employing precise step-by-step control and flexible adjustment methods, overshoot, undershoot, and repeated adjustments during power adjustment can be reduced, enabling the system to operate more stably near the target power, thereby improving communication quality and enhancing system reliability and stability.
[0048] In an optional embodiment, the step control module further includes a carry unit, wherein the second step amount is equal to N times the first step amount, where N is a positive integer; when the cumulative number of adjustments according to the first step amount reaches N times, the carry unit triggers the second step amount to carry over, and the number of adjustments of the first step amount is cleared to zero, ensuring the continuity of the transmit link gain adjustment.
[0049] In the above embodiment, a carry unit is set and the second step amount is equal to N times the first step amount. When the cumulative number of adjustments to the first step amount reaches N times, the second step amount is carried over and the number of adjustments to the first step amount is cleared, which can ensure the continuity of the transmit link gain adjustment.
[0050] The carry unit ensures the continuity of transmit link gain adjustment. When adjusting according to the first step increment, the carry unit counts the cumulative number of adjustments. When the cumulative number of adjustments according to the first step increment reaches N, the carry unit triggers a second step carry, effectively completing the adjustment effect of N first step increments at once, while resetting the first step increment adjustment count to zero (e.g., N=10, or other values). In this way, from the perspective of overall gain adjustment, it allows for fine-tuning of local adjustments using small steps, and after accumulating a certain number of adjustments, it achieves an adjustment equivalent to a large step through carry, ensuring the continuity and consistency of the gain adjustment process. Accumulating N small steps is equivalent to a single large step, avoiding abrupt gain changes during step switching. Integer multiple correlation ensures controllable adjustment amplitude, adapting to the smooth gain changes required in the linear / nonlinear regions of the power amplifier. The carry unit, by triggering a second step carry after accumulating a certain number of small step adjustments, makes the transmit link gain adjustment process more continuous and smooth. This avoids the problem of sudden gain changes caused by improper connection between small and large step adjustments, helps maintain system stability, and reduces the adverse effects of sudden gain changes on communication quality.
[0051] In an optional embodiment, the error calculation module obtains the difference between the real-time sampled level value and the target level value through subtraction, determines the error direction signal using the overflow flag of the calculation result, and obtains the absolute error signal by converting the absolute value of the difference.
[0052] In the above embodiments, the error direction signal is determined by subtraction and overflow flag, and the absolute value of the error signal is obtained by converting the absolute value of the difference. This can accurately calculate the error between the real-time sampling level value and the target level value, providing a precise basis for the subsequent generation of the target step control signal. This helps the automatic level control device to adjust the transmission link gain more accurately, taking into account both fast response and high steady-state accuracy.
[0053] By subtracting the target power level from the real-time sampled power level, the difference is obtained. This difference reflects the deviation between the actual output power of the transmitter amplifier and the desired target power. The overflow flag of the subtraction result is used to determine the error direction signal. The overflow flag is a feature in computer operations; when the subtraction result overflows, the overflow flag will exhibit a specific state. By detecting this overflow flag, it can be determined whether the difference is positive or negative, thus determining the error direction signal. If the difference is positive, it means the real-time sampled power level is greater than the target power level, i.e., the current output power is higher than the target power; if the difference is negative, it means the real-time sampled power level is less than the target power level, i.e., the current output power is lower than the target power. The absolute value of the difference obtained from the subtraction is taken and converted into an absolute error signal. The absolute error signal represents the magnitude of the deviation between the current output power and the target power, without considering the direction of the deviation. Using the overflow flag of the subtraction result to determine the error direction signal avoids complex comparator and other logic judgment circuits, simplifying the hardware design and logic flow of the error calculation module. Meanwhile, by directly obtaining the difference through subtraction and further calculating the absolute value of the error, the entire error calculation process becomes simpler and more efficient, reducing system complexity and cost. This error calculation method has low hardware resource requirements, enabling the automatic level control device to be flexibly applied in different hardware platforms and application scenarios. Whether in resource-constrained embedded systems or in more complex communication devices, accurate error calculation can be achieved through this simple subtraction operation and overflow flag judgment method, enhancing the system's adaptability and flexibility.
[0054] In an optional embodiment, the above-mentioned device further includes: a directional coupler, which is connected in series between the transmitter power amplifier and the transmitter output terminal, for coupling a preset ratio of a coupling signal from the main signal output by the transmitter power amplifier and transmitting it to the detector; the output signal sampled by the detector is the coupling signal, and the power of the coupling signal is in a fixed ratio relationship with that of the main signal.
[0055] In the above embodiments, the directional coupler couples a preset ratio of coupling signal from the main signal output by the power amplifier to the detector, which facilitates the detector sampling. The coupling signal and the main signal power have a fixed ratio relationship. The fixed ratio coupling characteristic of the directional coupler allows the coupling signal to accurately reflect the main signal power, providing a reliable data foundation for detection, digitization and subsequent MCU control, and indirectly improving the overall control accuracy of ALC.
[0056] A directional coupler is connected in series between the transmitter's power amplifier and its output. Its main function is to couple a predetermined proportion of the main signal from the amplifier's output and transmit this coupled signal to a detector. The detector samples the received coupled signal and outputs a detected voltage signal, which is then converted into a real-time sampled level by a subsequent analog-to-digital converter. Here, the power of the coupled signal and the main signal are in a fixed ratio, meaning that by measuring the power of the coupled signal, the power of the main signal can be calculated according to this fixed ratio. Using a directional coupler to couple the amplifier signal and using a detector to sample and obtain the detected voltage signal are both mature technologies and will not be elaborated upon further. In practical applications, directional couplers are designed to meet two important characteristics: first, the main link insertion loss is ≤0.1dB, which means that most of the energy of the main signal can pass smoothly to the transmitter output with only minimal energy loss when passing through the directional coupler; second, the main link impedance is matched with the transmitter link impedance. This impedance matching design ensures that the main signal will not have problems such as reflection due to impedance inconsistency during transmission, thereby avoiding the impact on the power transmission and phase characteristics of the main signal and ensuring that the main signal can be transmitted normally and stably to the transmitter output.
[0057] This application also provides an automatic level control method, applied to the automatic level control device of any of the foregoing embodiments, the process including: Step 1: The detector samples the output signal of the transmitter power amplifier and outputs a detector voltage signal; Step 2: The analog-to-digital converter digitizes the detected voltage signal to obtain and output the real-time sampling level value; Step 3: The MCU receives the real-time sampled level value and calculates the error value between the real-time sampled level value and the target level value, where the target level value is the level value corresponding to the target output power; Step 4: The MCU generates a target step control signal based on the error value. The target step control signal includes an attenuation adjustment direction signal and a step size signal. Step 5: The MCU outputs the target step control signal to the numerically controlled attenuator, so that the numerically controlled attenuator adjusts its own attenuation value unidirectionally and monotonically based on the target step control signal to change the gain of the transmission link; wherein, the MCU executes steps 3 to 5 in a loop with its own clock cycle as a fixed time interval until the error between the real-time sampled level value and the target level value is within the preset range.
[0058] This embodiment provides a closed-loop digital automatic level control method adapted to a specific automatic level control device. The core of this method is to achieve precise and stable control of the transmitter power amplifier output level through multi-stage orderly collaboration and cyclic feedback. The specific process is as follows: First, a detector acquires the power amplifier output signal and converts it into a detector voltage signal; then, an analog-to-digital converter converts the analog signal to a digital signal, obtaining a real-time sampled level value that can be processed by the MCU; the MCU, as the core control unit, calculates the error between this real-time sampled level value and the target level value, and then generates a target step control signal containing the attenuation adjustment direction and step size; finally, the signal is sent to the digitally controlled attenuator, which unidirectionally and monotonically adjusts the attenuation value to change the transmit link gain. Simultaneously, the MCU repeats the entire process according to its own clock cycle until the level error meets the preset standard, forming a continuous closed-loop control. This closed-loop cyclic control continuously corrects the error between the real-time sampled level and the target level. Combined with the precise step adjustment of the digitally controlled attenuator, it can stabilize the transmitter power amplifier output level within the target range, significantly reducing level deviations caused by device fluctuations and external interference, and ensuring the accuracy of the output power. The entire control process relies on MCU digital processing, reducing the use of analog circuits. This lowers hardware costs and circuit layout complexity, and avoids the complex parameter debugging work found in analog circuits. Subsequent maintenance only requires adjustments to the MCU control logic and parameters, making maintenance easier. Furthermore, the MCU's cyclic control based on its own clock cycle ensures stable frequency for level detection and adjustment. Compared to the uncertain delays of analog circuits, it can quickly respond to changes in output signal levels, preventing signal distortion due to untimely adjustments. Additionally, the unidirectional monotonic adjustment of the digitally controlled attenuator avoids repeated gain fluctuations, ensuring the continuity and stability of the transmission link signal.
[0059] Furthermore, the apparatus and method embodiments provided in the above embodiments belong to the same concept, and their specific implementation methods can be found in other apparatus embodiments, which will not be repeated here.
[0060] This application also provides a transmitter that includes the automatic level control device in any of the foregoing embodiments.
[0061] Integrating the automatic level control device from the aforementioned embodiments into the transmitter as a standard configuration or key component allows the transmitter's power amplifier output signal to be sampled and detected by relevant components within the automatic level control device (such as the previously mentioned directional coupler and detector). After the device completes a series of processes including signal conversion, error calculation, and step control, it outputs corresponding control signals to adjust the attenuation and gain of the transmission link, ultimately achieving stable control of the transmitter's output level and ensuring that the transmitter always transmits signals at the required power. This gives the transmitter all the characteristics, functions, and performance advantages of the ALC device it utilizes.
[0062] It should be noted that the embodiments described above are only some embodiments of this application, and not all embodiments. The present application will be described in detail below with reference to specific embodiments.
[0063] This application provides a fast ALC control device based on a digital architecture capacitor integration mode. Following the implementation concept of analog ALC, to avoid the difficulty of selecting analog ALC circuits, the control section adopts a master-controlled digital architecture. The voltage value output from the loop detector is digitized by an ADC and then provided to the MCU. The MCU internally samples the digital quantization level, compares it with the target value, and then outputs at equal intervals to control the digitally controlled attenuator, fitting it into the integration circuit form of the analog signal, ultimately achieving the target value.
[0064] In principle, the output voltage relationship of an analog integrator circuit satisfies the following: ; Figure 3 This is a schematic diagram of the relationship between the integrator circuit and the output voltage in the analog architecture of related technologies.
[0065] The output voltage can reach the preset value linearly, so the integrator circuit can achieve accurate tracking of the output voltage.
[0066] If in an MCU, each cycle of the internal clock is used as the basic time displacement t, that is... t1, t2, ... t n ; If the step x of the numerically controlled attenuator is equivalent to the capacitance value, then the basic integration requirement is met: ∆x=dx, .
[0067] According to the above relationship, a digitally controlled attenuator can achieve the same effect as an analog integrator circuit by stepping through time. In the analog integrator circuit, V... i In the CNC architecture, the real-time ADC detection level value reflects the actual value of the current output power (corresponding to the aforementioned real-time sampling level value); Vt in the analog integrator circuit represents the final desired output power level (target level value) in the CNC architecture; V in the analog integrator circuit o In a CNC architecture, this refers to the output value of the CNC attenuator.
[0068] Figure 4This is a hardware block diagram of a digital ALC device provided in this application embodiment. In the MCU, the digitally controlled attenuator changes at a fixed delay in each clock cycle. The direction of change is determined by the error judgment module inside the MCU. The error judgment module compares the input ADC detection level value with the preset output power level value (i.e., the target level value) by subtraction. In the MCU subtraction representation, there is no negative sign. When the minuend is less than the subtrahend, an overflow flag is generated. Judging the overflow flag determines the attenuation direction of the digitally controlled attenuator. The difference generated by the subtraction calculation needs to be converted into an absolute value, and then a threshold judgment is performed based on the absolute value to determine whether the digitally controlled attenuator takes a large or small step. Both large and small steps are accumulated. The step obtained in each clock cycle is accumulated to the previous result and provided to the digitally controlled attenuator. When the small step is fully accumulated, a carry is required, that is, the small step is cleared to zero, and the large step is carried over by one bit to ensure the gain continuity of the digitally controlled attenuator. In the MCU, error judgment, threshold judgment, and incremental increment are performed cyclically for each clock cycle until the value of the digitally controlled attenuator makes the actual value of the real-time output power reach the preset output power level. Figure 5 This is a block diagram of the MCU implementation in the digital ALC device provided in the embodiments of this application.
[0069] The main idea of this application's embodiment is to utilize the integral effect. In the implementation of the negative feedback circuit, the negative feedback capacitor is equivalent to an integral over time. The integral value increases linearly with time, and the capacitance value determines the slope of the integral value's growth. The integral value will eventually reach a preset value. In the digital circuit framework, the equal-interval growth of the clock can be understood as the dx step of the integral. Each clock cycle is equivalent to a step increase of dx, thus satisfying the condition of equivalent integration. If the power amplifier gain value in the digital circuit changes at equal intervals according to the clock growth cycle, it is equivalent to the capacitor integral effect. The step change of the power amplifier gain value is the capacitance value, which determines the slope of the change. As time integrates, the power amplifier gain value gradually approaches the target value step by step. Even in the gain compression region of the power amplifier nonlinearity, the gain will gradually reach the target value step by step. Since this gain step is monotonic with time, it will not repeatedly iterate around the final output power, thus ensuring both time and accuracy. Its circuit model is equivalent to an analog ALC architecture.
[0070] The control flow of the digital ALC device in this application embodiment is as follows: Figure 6 As shown, Figure 6 The step chart at the top center uses the example of gain increasing monotonically with time steps. Figure 6 The intermediate interval represents the increase in clock cycle, and the vertical axis represents the step change in gain, controlled by a digitally controlled attenuator. The entire device is equivalent to a capacitor-integrating analog circuit architecture, overcoming the limitations of complex analog circuit hardware and the need for high operational amplifier output drive capability to achieve fast tracking. The tracking performance of the entire device is as follows: Figure 7 As shown, since it operates in the nonlinear region of the power amplifier, the tracking effect of the entire device is a nonlinear curve in the nonlinear region.
[0071] Figure 6 Block diagram of the implementation of the medium-sized CNC attenuator in this device ( Figure 4 The front-end digitally controlled attenuator and directional coupler in ) Figure 6 The block diagram of the detection and AD converter corresponding to this device is shown below. Figure 4 The loop detector and ADC in ) Figure 6 The block diagram of the implementation of error judgment and equally spaced linear stepping in this device is shown below. Figure 4 MCU in ).
[0072] This design implements the "error judgment" and "equal-interval linear stepping" functions in the block diagram above within the MCU, represented as program modules. The "error judgment" function compares the voltage value from the AD conversion with a preset value in the program, calculates the difference, and if the difference is too large, it first compensates with a large step. If the difference falls within a certain range, a small step is used. If the small step setting to its maximum cannot meet the requirement, a carry is needed: the large step is incremented by one bit, the small step is cleared, and then the small step is incremented again until the error judgment module considers the error to be 0, thus completing power point tracking. The "equal-interval linear stepping" function uses the clock cycle in the MCU to generate equal-interval time steps, operating the digitally controlled attenuator within each clock cycle. The step value of the digitally controlled attenuator is determined by the "error judgment" function.
[0073] MCU program implementation architecture as follows Figure 8 , Figure 8 The block diagram shows the implementation within a single clock cycle. The conversion relationship between small and large steps is as follows: Figure 9 A large step is equal to n small steps (corresponding to the aforementioned N times).
[0074] (1) Due to the characteristics of MCU, each step of the program will automatically align with each clock delay, so the clock module does not need to be described.
[0075] (2) Error calculation program module: compare the real-time level value of AD sampling (corresponding to the aforementioned real-time sampling level value) with the output power level value (corresponding to the aforementioned target level value) to determine whether to increase or decrease the gain.
[0076] The procedure is as follows: assign{carry1,result1}=(dst_power_en_flag2)?pa_vf-ref_volt[11:0]:'d0; Determine the ± and difference values of the calculation results. `carry1` determines the ± value of the subtraction operation, `result1` is the subtraction result, `pa_vf` is the real-time AD sampling level in this case, and `ref_volt[11:0]` is the output power level in this case. A positive value for `carry1` indicates that the real-time AD sampling level is greater than the output power level, requiring an increase in the digitally controlled attenuator value; a negative value for `carry1` indicates that the real-time AD sampling level is less than the output power level, requiring a decrease in the digitally controlled attenuator value.
[0077] (3) Threshold judgment program module: Based on the calculation results of the above error calculation program module, if the result1 value is large, it enters the large step state; if the result1 value is small, it enters the small step state.
[0078] if(flagcarryfor8142andifatt) statesetatt <= statesetatt; else if ((comparethreshold1>= result1)&&(carry1 == 0)) statesetatt <= 0; else if((comparethreshold3>= result1)&&(carry1 == 1)) statesetatt <= 0; else if((comparethreshold2>= result1)&&(result1>comparethreshold1)&&(carry1 == 0)) statesetatt <= 4'd1; else if((comparethreshold4>= result1)&&(result1>comparethreshold3)&&(carry1 == 1)) statesetatt <= 4'd1; else if((result1>comparethreshold2)&&(carry1 == 0)) statesetatt <= 4'd2; else if((result1>comparethreshold4)&&(carry1 == 1)) statesetatt <= 4'd2; else statesetatt <= statesetatt; Figure 10 This is a schematic diagram of the threshold values provided in the embodiments of this application. Figure 11 This is a schematic diagram of the step carry provided in the embodiments of this application. comparethreshold1 (threshold 1), comparethreshold2 (threshold 2), comparethreshold3 (threshold 3), and comparethreshold4 (threshold 4) are judgment thresholds. comparethreshold1 corresponds to the upper limit of the output target value. comparethreshold2 corresponds to the upper limit of the small step interval when the real-time level value of AD sampling is greater than the output target value, thus requiring an increase in the value of the digital control attenuator. comparethreshold3 corresponds to the lower limit of the output target value. comparethreshold4 corresponds to the lower limit of the small step interval when the real-time level value of AD sampling is less than the output target value, thus requiring a decrease in the value of the digital control attenuator. For example, assuming the target level is 3.0V, threshold 1 = 0.1V (equivalent to an actual sampled level of 3.1V), threshold 2 = 0.4V (equivalent to an actual sampled level of 3.4V), threshold 3 = 0.15V (equivalent to an actual sampled level of 2.85V), and threshold 4 = 0.45V (equivalent to an actual sampled level of 2.55V). It should be noted that this is only one example. `statesetatt` is the step state variable. Assigning `statesetatt` a value of 0 indicates that the real-time AD sampling level equals the output power, and no further attenuator adjustment is needed. Assigning `statesetatt` a value of 1 indicates a small step range; assigning `statesetatt` a value of 2 indicates a large step range, which is in the regions greater than `comparethreshold2` and greater than `comparethreshold4`. The threshold values are asymmetrical because in the range where the power amplifier output is greater than the target output value, nonlinear compression is severe, and the gain change is smaller. In the range where the power amplifier output is less than the target output value, nonlinear compression is relatively small. Properly setting the threshold values can optimize and improve tracking accuracy and response speed. When the threshold 1 and threshold 3 ranges are set relatively small, achieving the target power amplifier output value requires greater precision. When threshold 2 and threshold 4 are set relatively close to threshold 1 and threshold 3, the small step range is smaller, and the large step range is larger, which can improve the response speed. The large step is the large step attenuation setting for the digitally controlled attenuator, which has a large adjustment range. When the subtraction calculation result of result1 obtained from the above error calculation program module is large, using a large step change can quickly enter the small step range.
[0079] Determine if all small steps are used: If all small steps are used, then the large step is incremented by one bit, and the small step is cleared to zero.
[0080] assign{carry2,cx8142_alc_wr_wire1}=cx8142_alc_wr[15:0]+cx8142addreg; assign{carry3,cx8142_alc_wr_wire2}=cx8142_alc_wr[15:0]-cx8142subreg1-16'h2020; assign{carry4,cx8142_alc_wr_wire3}=cx8142_alc_wr[15:0]-cx8142subreg1; `cx8142_alc_wr` is the current attenuation value of the CNC attenuator, represented by a single variable for easy addition and subtraction operations. `cx8142addreg` is the small addition step value of the CNC attenuator, set when the attenuation value needs to be increased. `cx8142subreg1` is the small subtraction step value of the CNC attenuator, set when the attenuation value needs to be decreased.
[0081] Carry2 is a carry flag indicating whether small-step addition overflows; carry3 is a carry flag indicating whether small-step subtraction overflows (since the difference between this and the target value needs to be calculated), two's complement arithmetic is used; carry4 is a carry flag indicating whether small-step subtraction overflows. The above calculation determines whether small-step operations overflow. If overflow occurs, a large-step carry is needed, and the small-step value is cleared. Each calculated attenuator value overwrites the previous attenuator value, and is updated in real-time based on the calculation. The strategy used here is that 10 small steps equal 1 large step, in decimal form, for ease of understanding the calculations.
[0082] Compared to existing digital architectures, the embodiments of this application overcome the problem of repeated circuit gain iterations due to power amplifier nonlinear gain compression, and have the advantages of fast tracking and stable output power while maintaining high accuracy. Compared to existing analog architectures, the hardware circuits of the embodiments of this application are simpler, more convenient to adjust, and most functions are implemented in the program, thus exhibiting better temperature characteristics and functional stability, and faster tracking and stable output power.
[0083] The above description is merely an exemplary embodiment of this disclosure and should not be construed as limiting the scope of this disclosure. Any equivalent changes and modifications made in accordance with the teachings of this disclosure shall still fall within the scope of this disclosure. Other embodiments of this disclosure will be readily apparent to those skilled in the art upon consideration of the disclosure herein.
[0084] This application is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art that are not described in this disclosure.
Claims
1. An automatic level control device, characterized in that, Used in transmitters, including: A detector is used to sample the output signal of the transmitter power amplifier and output a detector voltage signal; An analog-to-digital converter, electrically connected to the detector, is used to digitize the detected voltage signal and output a real-time sampling level value. A numerically controlled attenuator, installed in the transmission link, is used to adjust the gain of the transmission link; The MCU is electrically connected to both the analog-to-digital converter and the numerically controlled attenuator. The MCU is used to perform the following operations: Receive the real-time sampled level value and calculate the error value between the real-time sampled level value and the target level value, wherein the target level value is the level value corresponding to the target output power; A target step control signal is generated based on the error value and output to the numerically controlled attenuator, so that the numerically controlled attenuator adjusts its own attenuation value unidirectionally and monotonically based on the target step control signal to change the gain of the transmission link. The target step control signal includes an attenuation adjustment direction signal and a step size signal. The MCU generates the target step control signal cyclically at a fixed time interval using the MCU's clock cycle until the error between the real-time sampled level value and the target level value is within a preset range.
2. The automatic level control device according to claim 1, characterized in that, The MCU includes: an error calculation module, a threshold judgment module, and a step control module. The target step control signal is generated collaboratively by the error calculation module, the threshold judgment module, and the step control module. An error calculation module is used to calculate the error value between the real-time sampling level value and the target level value. The error value includes an error direction signal and an error absolute value. The error direction signal is used to indicate whether the error value is positive or negative. The threshold judgment module is used to compare the absolute value of the error with a preset threshold value and output a step size control signal based on the comparison result. The step control module is used to output the target step control signal to the numerically controlled attenuator according to the error direction signal and the step size control signal, so as to perform step control to accumulate or subtract the attenuation value of the numerically controlled attenuator.
3. The automatic level control device according to claim 2, characterized in that, The preset threshold values include a first set of threshold values and a second set of threshold values. When the error direction signal indicates that the error value is positive, the first set of threshold values is used, and when the error direction signal indicates that the error value is negative, the second set of threshold values is used.
4. The automatic level control device according to claim 3, characterized in that, The first set of threshold values includes a first threshold value and a second threshold value, and the second set of threshold values includes a third threshold value and a fourth threshold value; When the error value is positive and the absolute value of the error is less than the first threshold value, or when the error value is negative and the absolute value of the error is less than the third threshold value, a no-step control signal is output. When the error value is positive, and the absolute value of the error is greater than or equal to the first threshold value and less than the second threshold value, a small step control signal is output. When the error value is negative, and the absolute value of the error is greater than or equal to the third threshold value and less than the fourth threshold value, a small step control signal is output. When the error value is positive and the absolute value of the error is greater than or equal to the second threshold value, a large step control signal is output. When the error value is negative and the absolute value of the error is greater than or equal to the fourth threshold value, a large step control signal is output. The step size control signal includes the no-step control signal, the small-step control signal, and the large-step control signal, wherein the step size corresponding to the large-step control signal is greater than the step size corresponding to the small-step control signal.
5. The automatic level control device according to claim 2, characterized in that, The step control module is used to output the target step control signal to the numerically controlled attenuator in at least one of the following ways: When the error direction signal indicates that the error value is positive and the step size control signal is a small step control signal, a first control signal is output to the numerically controlled attenuator. The first control signal is used to instruct the numerically controlled attenuator to increase the attenuation value by the first step amount. The target step control signal includes the first control signal. When the error direction signal indicates that the error value is positive and the step size control signal is a large step control signal, a second control signal is output to the numerically controlled attenuator. The second control signal is used to instruct the numerically controlled attenuator to increase the attenuation value according to the second step amount. The first step amount and the second step amount are both greater than 0, and the second step amount is greater than the first step amount. The target step control signal includes the second control signal. When the error direction signal indicates that the error value is negative and the step size control signal is a small step control signal, a third control signal is output to the numerically controlled attenuator. The third control signal is used to instruct the numerically controlled attenuator to reduce the attenuation value according to the first step amount. The target step control signal includes the third control signal. When the error direction signal indicates that the error value is negative and the step size control signal is a large step control signal, a fourth control signal is output to the numerically controlled attenuator. The fourth control signal is used to instruct the numerically controlled attenuator to reduce the attenuation value according to the second step amount, wherein the target step control signal includes the fourth control signal.
6. The automatic level control device according to claim 5, characterized in that, The step control module further includes a carry unit, where the second step amount is equal to N times the first step amount, and N is a positive integer. When the cumulative number of adjustments according to the first step amount reaches N times, the carry unit triggers the second step amount to carry over, and the number of adjustments for the first step amount is cleared to zero, ensuring the continuity of the transmit link gain adjustment.
7. The automatic level control device according to claim 2, characterized in that, The error calculation module obtains the difference between the real-time sampled level value and the target level value through subtraction, determines the error direction signal using the overflow flag of the calculation result, and obtains the absolute error signal by converting the absolute value of the difference.
8. The automatic level control device according to claim 1, characterized in that, The device further includes a directional coupler connected in series between the transmitter power amplifier and the transmitter output terminal, used to couple a preset ratio of a coupling signal from the main signal output by the transmitter power amplifier and transmit it to the detector; the output signal sampled by the detector is the coupling signal, and the power of the coupling signal is in a fixed ratio with that of the main signal.
9. An automatic level control method, characterized in that, The automatic level control device applied in any one of claims 1 to 8 comprises: Step 1: The detector samples the output signal of the transmitter power amplifier and outputs a detector voltage signal; Step 2: The analog-to-digital converter digitizes the detected voltage signal to obtain and output the real-time sampling level value; Step 3: The MCU receives the real-time sampled level value and calculates the error value between the real-time sampled level value and the target level value, wherein the target level value is the level value corresponding to the target output power; Step 4: The MCU generates a target step control signal based on the error value. The target step control signal includes an attenuation adjustment direction signal and a step size signal. Step 5: The MCU outputs the target step control signal to the numerically controlled attenuator, so that the numerically controlled attenuator adjusts its own attenuation value unidirectionally and monotonically based on the target step control signal to change the gain of the transmission link; wherein, the MCU executes steps 3 to 5 in a loop with its own clock cycle as a fixed time interval until the error between the real-time sampled level value and the target level value is within a preset range.
10. A transmitter, characterized in that, Includes the automatic level control device according to any one of claims 1 to 8.