Patune utilty - fine tuning of PA
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.
Purpose of the Utility
The program is designed for engineers and technicians for:
- Automatic calibration of driver and output stage bias
- Setting target idle currents for each stage
- Monitoring the current status of the power amplifier
- Managing thermal compensation
- Configuring alarm parameters (temperature and current alarms)
- Setting up the fan control table (cooling)
- Saving configuration to non-volatile memory (NVMEM)
Operating Modes
The utility is organized as a hierarchical menu system:
├── View information
│ ├── Print PA info (status)
│ ├── Print PA config (configuration)
│ ├── Print PA bias table (bias table)
│ └── Print total current (current consumption)
├── Edit bias table
│ ├── Print PA bias table
│ ├── Reset all bias to defaults
│ ├── Enter driver stage current
│ ├── Enter output stage current
│ ├── Autotune DAC bias for driver stage
│ ├── Autotune DAC bias for output stage
│ ├── Enter driver stage thermo compensation
│ └── Enter output stage thermo compensation
├── Edit PA configuration
│ ├── Print PA config
│ ├── Edit max temperature ALARM
│ ├── Edit restore temperature ALARM
│ ├── Edit max driver current
│ ├── Edit max output stage current
│ └── Fan Table Editor
│ ├── Print fan lookup table
│ ├── Reset fan table to defaults
│ └── Edit entries 0-7
├── Quick commands
│ ├── Bias switch ON
│ ├── Bias switch OFF
│ ├── Reset overcurrent
│ └── Write all settings
Command Line Parameters
The utility does not accept command line parameters. All control is performed through the interactive console menu.
Starting the Program
At startup the program:
- Connects to PA Manager
- Requests the current PA configuration
- Requests the current bias table
- Displays the main menu
- Waits for user input
Input Format
User Input
Numeric Input
When a numeric value is requested, the program expects:
- A positive integer within the specified range
- Or the q character to cancel the operation
- Or q and Enter to exit
Example of entering a current value:
Validation:
- The value must be within the range [min, max]
- If a value outside the range is entered, the program will display an error and repeat the prompt
- Maximum 1 attempt per second (1 sec delay)
Signed Numeric Values
Signed values are used for thermal compensation:
Valid value ranges:
- Thermal compensation: -100 to +100 DAC/°C
- Temperature: -40 to 126 °C
- Fan speed: 0 to 100 %
Cancelling an Operation
Press q at any input prompt to cancel the current operation without saving.
Menu Navigation
- Digits 0-9 to select a menu item
- Enter to confirm
- q to return to the previous menu
Output Format
PA Status
Heat temp: 75C
Int temp: 65C
VSWR alarm : 0
Extra current alarm : 0
Temperature alarm : 0
Bias enable: 1
Bus voltage: 48mV
Output stage current: 1050mA
Driver stage current: 620mA
Output bias: 2450/2460mV
Driver bias: 1850/1855mV
Fan speed: 45
| Field | Description | Unit |
|---|---|---|
| Heat temp | Heatsink temperature | °C |
| Int temp | Internal temperature | °C |
| VSWR alarm | VSWR alarm flag | 0/1 |
| Extra current alarm | Overcurrent alarm flag | 0/1 |
| Temperature alarm | Temperature alarm flag | 0/1 |
| Bias enable | Bias enable status | 0/1 |
| Bus voltage | Supply voltage | mV |
| Output stage current | Output stage current | mA |
| Driver stage current | Driver current | mA |
| Output bias | Output bias voltage (channel 0/1) | mV |
| Driver bias | Driver bias voltage (channel 0/1) | mV |
| Fan speed | Fan speed | % |
PA Configuration
High limit temp: 80C
Low limit temp: 75C
Max driver current: 1200mA
Max output current: 2000mA
| Field | Description | Default value |
|---|---|---|
| High limit temp | Maximum temperature (alarm) | 80°C |
| Low limit temp | Minimum temperature (restore) | 75°C |
| Max driver current | Max driver current (alarm threshold) | 1200mA |
| Max output current | Max output current (alarm threshold) | 2000mA |
Bias Table
Bias DAC output 1: 2460
Bias DAC driver 0: 1850
Bias DAC driver 1: 1855
Target driver current,mA: 600
Target output current,mA: 1000
Driver thermo compensation,dac/C: -2
Output thermo compensation,dac/C: -3
Temprature of calibration,C: 25
| Field | Description | Range |
|---|---|---|
| Bias DAC output [0/1] | DAC bias value for output channels 0 and 1 | 0-4095 |
| Bias DAC driver [0/1] | DAC bias value for driver channels 0 and 1 | 0-4096 |
| Target driver current | Target idle current for driver stage | 1-1000 mA |
| Target output current | Target idle current for output stage | 1-2000 mA |
| Driver thermo compensation | Driver thermal compensation | -100 to +100 DAC/°C |
| Output thermo compensation | Output thermal compensation | -100 to +100 DAC/°C |
| Temperature of calibration | Temperature at which calibration was performed | °C |
Fan Control Table
------|------------------|---------------
0 | 10 | 0%
1 | 20 | 7%
2 | 35 | 31%
3 | 40 | 63%
4 | 50 | 79%
5 | 60 | 100%
6 | 70 | 100%
7 | 126 | 100%
The table contains 8 interpolation points. Each row contains:
- Index: sequence number (0-7)
- Temperature: threshold temperature in °C
- Fan Speed: fan speed in %
Speed is calculated by interpolating between points based on the current temperature.
Calibration Progress
During automatic calibration a progress bar is displayed:
Target Current: 600mA
DAC: 1800/4095 [***** ] 12% | Current: 150mA/600mA [**** ] 25%
Components:
- DAC: current DAC value and maximum
- First progress bar: DAC progress (yellow)
- Current: current measured current and target current
- Second progress bar: progress toward target current (green)
Error Messages
Get driver current ERROR
Request PA config ERROR
Connect/Disconnect loading ERROR
Unable to tune bias for Driver channel 0
An error message in red indicates a communication failure with PA Manager or an unexpected state.
Success Messages
Channel: 0
Final DAC Value: 1850
Final Current: 600mA
Bias switched ON.
New settings were recorder to NVMEM - OK.
Overcurrent flag reseted OK.
Successful operations are displayed in yellow.
Usage Examples
Example 1: Checking Amplifier Status
************************************************************
| Power amplifier service utility version 1.2 |
************************************************************
[Main menu]
0 - Print PA info.
1 - Print PA config.
2 - Print PA bias table.
3 - [Edit bias table]
4 - [Edit PA configs]
5 - [Edit fan table]
6 - Bias switch ON.
7 - Bias switch OFF.
8 - Reset overcurrent.
9 - Write all settings.
q - Quit
Enter your choice: 0
Print PA info.
Heat temp: 45C
Int temp: 38C
VSWR alarm : 0
Extra current alarm : 0
Temperature alarm : 0
Bias enable: 1
Bus voltage: 48mV
Output stage current: 1050mA
Driver stage current: 620mA
Output bias: 2450/2460mV
Driver bias: 1850/1855mV
Fan speed: 35
Example 2: Setting Target Driver Current
[Bias table editor]
0 - Print PA bias table.
1 - Reset all bias to default value.
2 - Enter driver stage current.
3 - Enter output stage current.
4 - Autotune DAC bias for driver stage.
5 - Autotune DAC bias for output stage.
6 - Print power consumption for all stages.
7 - Enter driver stage thermo compensation.
8 - Enter output stage thermo compensation.
q - Quit
Enter your choice: 2
Enter driver stage current, mA (1-1000), press 'q' to cancel: 650
Example 3: Automatic Driver Calibration
Tuning Driver Channel 1
Target Current: 600mA
DAC: 800/4096 [** ] 19% | Current: 0mA/600mA [ ] 0%
DAC: 1200/4096 [**** ] 29% | Current: 100mA/600mA [***** ] 16%
DAC: 1500/4096 [**** ] 36% | Current: 250mA/600mA [******* ] 41%
DAC: 1700/4096 [***** ] 41% | Current: 450mA/600mA [***** *** ] 75%
DAC: 1750/4096 [***** ] 42% | Current: 590mA/600mA [***** **** ] 98%
DAC: 1751/4096 [***** ] 42% | Current: 600mA/600mA [***** ***** ] 100%
✓ Finished OK
Channel: 1
Final DAC Value: 1751
Final Current: 600mA
Example 4: Editing a Fan Table Entry
[Fan Table Editor]
0 - Print fan lookup table.
1 - Reset fan table to defaults.
2 - Edit entry 0 (10°C / 0%).
3 - Edit entry 1 (20°C / 7%).
...
Enter your choice: 3
Edit Fan Table Entry 2
Current settings:
Temperature: 35°C
Fan Speed: 31%
Enter new temperature (C) (-40 - 126), press 'q' to cancel: 30
Enter new fan speed (0-100%) (0-100), press 'q' to cancel: 25
Entry 2 updated:
Temperature: 30°C
Fan Speed: 25%
Example 5: Saving Configuration
New settings were recorder to NVMEM - OK.
Error Diagnostics
Calibration Error
Message:
Causes:
- Amplifier is not functioning
- No power supply to the stage
- Current sensor is faulty
- Bias circuit is incorrectly configured
Solution:
- Check PA power supply
- Check load connectors
- Make sure bias can be adjusted
- Check the DAC coefficient value
Configuration Write Error
Message:
Causes:
- NVMEM is full
- Hardware write error
- Loss of connection with PA Manager
Solution:
- Repeat the write operation
- Try resetting the configuration: "Reset all bias to default value"
- Reboot and try again
Practical Application Scenarios
Scenario 1: Initial Setup of a New Amplifier
- Select "Print PA info"
- Make sure the sensors are working
Step 2: Set target currents
- Select "Edit bias table" → "Enter driver stage current"
- Enter 600 mA (typical value)
- Select "Enter output stage current"
- Enter 1000 mA (typical value)
Step 3: Automatic calibration
- Select "Autotune DAC bias for driver stage"
- Wait for completion (both channels sequentially)
- Select "Autotune DAC bias for output stage"
- Wait for completion
Step 4: Verify results
- Select "Print PA info"
- Make sure currents are within target values
Step 5: Save
- Select "Write all settings"
Scenario 2: Fan Control Setup
- Select "Edit fan table" → "Print fan lookup table"
Step 2: Edit interpolation points
- For each entry:
- Select "Edit entry N"
- Set the trigger temperature
- Set fan speed in %
Step 3: Save
- Select "Write all settings"
Example table for cold climate:
Entry 0: 15°C / 0%
Entry 1: 25°C / 10%
Entry 2: 40°C / 30%
Entry 3: 50°C / 60%
Entry 4: 60°C / 80%
Entry 5: 70°C /100%
Entry 6: 80°C /100%
Entry 7: 126°C /100%
Scenario 3: Maintenance and Diagnostics
- Select "Print PA bias table"
- Make sure all values are within acceptable limits
- Select "Print PA config"
Step 2: Check current consumption
- Select "Print power consumption for all stages"
- Compare with expected values
Step 3: Test the amplifier
- Select "Bias switch ON"
- Check "Print PA info"
- Make sure all alarms are in zero state
- Select "Bias switch OFF"
Step 4: Reset alarm (if required)
- Select "Reset overcurrent"
Limitations and Implementation Notes
Parameter Limits
| Parameter | Minimum | Maximum | Note |
|---|---|---|---|
| Driver current | 1 mA | 1000 mA | Target value |
| Output current | 1 mA | 2000 mA | Target value |
| Max alarm current (driver) | - | 6000 mA | Threshold value |
| Max alarm current (output) | - | 26000 mA | Threshold value |
| Heatsink temperature | -40°C | 126°C | Sensor range |
| Maximum alarm temperature | - | 80°C | Limited |
| Bias DAC | 0 | 4095 (output) / 4096 (driver) | 12-bit resolution |
| Thermal compensation | -100 | +100 | DAC/°C |
| Fan speed | 0% | 100% | Corresponds to DAC 0-63 |
Utility version: 1.2