Wiki source code of Patune utilty - fine tuning of PA
Hide last authors
| author | version | line-number | content |
|---|---|---|---|
![]() |
1.1 | 1 | The **patune** utility is an interactive console program for calibrating and configuring the parameters of the Power Amplifier (PA) in the Ermak TT transceiver. The program provides bias control of the amplifier, stage current calibration, monitoring, and cooling system configuration. |
| 2 | |||
| 3 | ## Purpose of the Utility | ||
| 4 | |||
| 5 | The program is designed for engineers and technicians for: | ||
| 6 | |||
| 7 | * Automatic calibration of driver and output stage bias | ||
| 8 | * Setting target idle currents for each stage | ||
| 9 | * Monitoring the current status of the power amplifier | ||
| 10 | * Managing thermal compensation | ||
| 11 | * Configuring alarm parameters (temperature and current alarms) | ||
| 12 | * Setting up the fan control table (cooling) | ||
| 13 | * Saving configuration to non-volatile memory (NVMEM) | ||
| 14 | |||
| 15 | ### Operating Modes | ||
| 16 | |||
| 17 | The utility is organized as a hierarchical menu system: | ||
| 18 | |||
| 19 | ## Command Line Parameters | ||
| 20 | |||
| 21 | The utility does not accept command line parameters. All control is performed through the interactive console menu. | ||
| 22 | |||
| 23 | ### Starting the Program | ||
| 24 | |||
| 25 | At startup the program: | ||
| 26 | |||
| 27 | 1. Connects to PA Manager | ||
| 28 | 1. Requests the current PA configuration | ||
| 29 | 1. Requests the current bias table | ||
| 30 | 1. Displays the main menu | ||
| 31 | 1. Waits for user input | ||
| 32 | |||
| 33 | ## Input Format | ||
| 34 | |||
| 35 | ### User Input | ||
| 36 | |||
| 37 | #### Numeric Input | ||
| 38 | |||
| 39 | When a numeric value is requested, the program expects: | ||
| 40 | |||
| 41 | * A positive integer within the specified range | ||
| 42 | * Or the q character to cancel the operation | ||
| 43 | * Or q and Enter to exit | ||
| 44 | |||
| 45 | Example of entering a current value: | ||
| 46 | |||
| 47 | **Validation:** | ||
| 48 | |||
| 49 | * The value must be within the range [min, max] | ||
| 50 | * If a value outside the range is entered, the program will display an error and repeat the prompt | ||
| 51 | * Maximum 1 attempt per second (1 sec delay) | ||
| 52 | |||
| 53 | #### Signed Numeric Values | ||
| 54 | |||
| 55 | Signed values are used for thermal compensation: | ||
| 56 | |||
| 57 | **Valid value ranges:** | ||
| 58 | |||
| 59 | * Thermal compensation: -100 to +100 DAC/°C | ||
| 60 | * Temperature: -40 to 126 °C | ||
| 61 | * Fan speed: 0 to 100 % | ||
| 62 | |||
| 63 | #### Cancelling an Operation | ||
| 64 | |||
| 65 | Press q at any input prompt to cancel the current operation without saving. | ||
| 66 | |||
| 67 | ### Menu Navigation | ||
| 68 | |||
| 69 | * Digits 0-9 to select a menu item | ||
| 70 | * Enter to confirm | ||
| 71 | * q to return to the previous menu | ||
| 72 | |||
| 73 | ## Output Format | ||
| 74 | |||
| 75 | ### PA Status | ||
| 76 | |||
| 77 | | Field | Description | Unit | | ||
| 78 | | -------------------- | --------------------------------- | ---- | | ||
| 79 | | Heat temp | Heatsink temperature | °C | | ||
| 80 | | Int temp | Internal temperature | °C | | ||
| 81 | | VSWR alarm | VSWR alarm flag | 0/1 | | ||
| 82 | | Extra current alarm | Overcurrent alarm flag | 0/1 | | ||
| 83 | | Temperature alarm | Temperature alarm flag | 0/1 | | ||
| 84 | | Bias enable | Bias enable status | 0/1 | | ||
| 85 | | Bus voltage | Supply voltage | mV | | ||
| 86 | | Output stage current | Output stage current | mA | | ||
| 87 | | Driver stage current | Driver current | mA | | ||
| 88 | | Output bias | Output bias voltage (channel 0/1) | mV | | ||
| 89 | | Driver bias | Driver bias voltage (channel 0/1) | mV | | ||
| 90 | | Fan speed | Fan speed | % | | ||
| 91 | |||
| 92 | ### PA Configuration | ||
| 93 | |||
| 94 | | Field | Description | Default value | | ||
| 95 | | ------------------ | ------------------------------------ | ------------- | | ||
| 96 | | High limit temp | Maximum temperature (alarm) | 80°C | | ||
| 97 | | Low limit temp | Minimum temperature (restore) | 75°C | | ||
| 98 | | Max driver current | Max driver current (alarm threshold) | 1200mA | | ||
| 99 | | Max output current | Max output current (alarm threshold) | 2000mA | | ||
| 100 | |||
| 101 | ### Bias Table | ||
| 102 | |||
| 103 | | Field | Description | Range | | ||
| 104 | | -------------------------- | ---------------------------------------------- | ------------------- | | ||
| 105 | | Bias DAC output [0/1] | DAC bias value for output channels 0 and 1 | 0-4095 | | ||
| 106 | | Bias DAC driver [0/1] | DAC bias value for driver channels 0 and 1 | 0-4096 | | ||
| 107 | | Target driver current | Target idle current for driver stage | 1-1000 mA | | ||
| 108 | | Target output current | Target idle current for output stage | 1-2000 mA | | ||
| 109 | | Driver thermo compensation | Driver thermal compensation | -100 to +100 DAC/°C | | ||
| 110 | | Output thermo compensation | Output thermal compensation | -100 to +100 DAC/°C | | ||
| 111 | | Temperature of calibration | Temperature at which calibration was performed | °C | | ||
| 112 | |||
| 113 | ### Fan Control Table | ||
| 114 | |||
| 115 | The table contains 8 interpolation points. Each row contains: | ||
| 116 | |||
| 117 | * **Index**: sequence number (0-7) | ||
| 118 | * **Temperature**: threshold temperature in °C | ||
| 119 | * **Fan Speed**: fan speed in % | ||
| 120 | |||
| 121 | Speed is calculated by interpolating between points based on the current temperature. | ||
| 122 | |||
| 123 | ### Calibration Progress | ||
| 124 | |||
| 125 | During automatic calibration a progress bar is displayed: | ||
| 126 | |||
| 127 | Components: | ||
| 128 | |||
| 129 | * **DAC**: current DAC value and maximum | ||
| 130 | * First progress bar: DAC progress (yellow) | ||
| 131 | * **Current**: current measured current and target current | ||
| 132 | * Second progress bar: progress toward target current (green) | ||
| 133 | |||
| 134 | ### Error Messages | ||
| 135 | |||
| 136 | An error message in red indicates a communication failure with PA Manager or an unexpected state. | ||
| 137 | |||
| 138 | ### Success Messages | ||
| 139 | |||
| 140 | Successful operations are displayed in yellow. | ||
| 141 | |||
| 142 | ## Usage Examples | ||
| 143 | |||
| 144 | ### Example 1: Checking Amplifier Status | ||
| 145 | |||
| 146 | ### Example 2: Setting Target Driver Current | ||
| 147 | |||
| 148 | ### Example 3: Automatic Driver Calibration | ||
| 149 | |||
| 150 | ### Example 4: Editing a Fan Table Entry | ||
| 151 | |||
| 152 | ### Example 5: Saving Configuration | ||
| 153 | |||
| 154 | ## Error Diagnostics | ||
| 155 | |||
| 156 | ### Calibration Error | ||
| 157 | |||
| 158 | **Message:** | ||
| 159 | |||
| 160 | **Causes:** | ||
| 161 | |||
| 162 | * Amplifier is not functioning | ||
| 163 | * No power supply to the stage | ||
| 164 | * Current sensor is faulty | ||
| 165 | * Bias circuit is incorrectly configured | ||
| 166 | |||
| 167 | **Solution:** | ||
| 168 | |||
| 169 | 1. Check PA power supply | ||
| 170 | 1. Check load connectors | ||
| 171 | 1. Make sure bias can be adjusted | ||
| 172 | 1. Check the DAC coefficient value | ||
| 173 | |||
| 174 | ### Configuration Write Error | ||
| 175 | |||
| 176 | **Message:** | ||
| 177 | |||
| 178 | **Causes:** | ||
| 179 | |||
| 180 | * NVMEM is full | ||
| 181 | * Hardware write error | ||
| 182 | * Loss of connection with PA Manager | ||
| 183 | |||
| 184 | **Solution:** | ||
| 185 | |||
| 186 | 1. Repeat the write operation | ||
| 187 | 1. Try resetting the configuration: "Reset all bias to default value" | ||
| 188 | 1. Reboot and try again | ||
| 189 | |||
| 190 | ## Practical Application Scenarios | ||
| 191 | |||
| 192 | ### Scenario 1: Initial Setup of a New Amplifier | ||
| 193 | |||
| 194 | ### Scenario 2: Fan Control Setup | ||
| 195 | |||
| 196 | ### Scenario 3: Maintenance and Diagnostics | ||
| 197 | |||
| 198 | ## Limitations and Implementation Notes | ||
| 199 | |||
| 200 | ### Parameter Limits | ||
| 201 | |||
| 202 | | Parameter | Minimum | Maximum | Note | | ||
| 203 | | -------------------------- | ------- | ----------------------------- | ----------------------- | | ||
| 204 | | Driver current | 1 mA | 1000 mA | Target value | | ||
| 205 | | Output current | 1 mA | 2000 mA | Target value | | ||
| 206 | | Max alarm current (driver) | - | 6000 mA | Threshold value | | ||
| 207 | | Max alarm current (output) | - | 26000 mA | Threshold value | | ||
| 208 | | Heatsink temperature | -40°C | 126°C | Sensor range | | ||
| 209 | | Maximum alarm temperature | - | 80°C | Limited | | ||
| 210 | | Bias DAC | 0 | 4095 (output) / 4096 (driver) | 12-bit resolution | | ||
| 211 | | Thermal compensation | -100 | +100 | DAC/°C | | ||
| 212 | | Fan speed | 0% | 100% | Corresponds to DAC 0-63 | | ||
| 213 | |||
| 214 | **Utility version:** 1.2 |
