Patune utilty - fine tuning of PA

Last modified by UT2UK on 2026/03/02 10:55

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:

Main menu  
├── 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

patune

At startup the program:

  1. Connects to PA Manager
  2. Requests the current PA configuration
  3. Requests the current bias table
  4. Displays the main menu
  5. 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:

Enter driver stage current, mA (1-1000), press 'q' to cancel: 600

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:

Enter driver stage thermo compensation, C/dac (-100 - 100), press 'q' to cancel: -5

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

Print PA info.
    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
FieldDescriptionUnit
Heat tempHeatsink temperature°C
Int tempInternal temperature°C
VSWR alarmVSWR alarm flag0/1
Extra current alarmOvercurrent alarm flag0/1
Temperature alarmTemperature alarm flag0/1
Bias enableBias enable status0/1
Bus voltageSupply voltagemV
Output stage currentOutput stage currentmA
Driver stage currentDriver currentmA
Output biasOutput bias voltage (channel 0/1)mV
Driver biasDriver bias voltage (channel 0/1)mV
Fan speedFan speed%

PA Configuration

Print PA config.
    High limit temp:        80C  
    Low limit temp:            75C  
    Max driver current:        1200mA  
    Max output current:        2000mA
FieldDescriptionDefault value
High limit tempMaximum temperature (alarm)80°C
Low limit tempMinimum temperature (restore)75°C
Max driver currentMax driver current (alarm threshold)1200mA
Max output currentMax output current (alarm threshold)2000mA

Bias Table

Bias DAC output 0:                2450  
    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
FieldDescriptionRange
Bias DAC output [0/1]DAC bias value for output channels 0 and 10-4095
Bias DAC driver [0/1]DAC bias value for driver channels 0 and 10-4096
Target driver currentTarget idle current for driver stage1-1000 mA
Target output currentTarget idle current for output stage1-2000 mA
Driver thermo compensationDriver thermal compensation-100 to +100 DAC/°C
Output thermo compensationOutput thermal compensation-100 to +100 DAC/°C
Temperature of calibrationTemperature at which calibration was performed°C

Fan Control Table

Index | Temperature (°C) | Fan Speed (%)  
  ------|------------------|---------------  
   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:

Tuning Driver Channel 0  
  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

Set bias ON ERROR  
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

✓ Finished OK
  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

$ patune  
************************************************************  
|     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

Enter your choice: 3
[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

Enter your choice: 4
  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

Enter your choice: 5
[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

Enter your choice: 9
New settings were recorder to NVMEM - OK.

Error Diagnostics

Calibration Error

Message:

✗ Unable to tune bias for Driver channel 0

Causes:

  • Amplifier is not functioning
  • No power supply to the stage
  • Current sensor is faulty
  • Bias circuit is incorrectly configured

Solution:

  1. Check PA power supply
  2. Check load connectors
  3. Make sure bias can be adjusted
  4. Check the DAC coefficient value

Configuration Write Error

Message:

Write config ERROR

Causes:

  • NVMEM is full
  • Hardware write error
  • Loss of connection with PA Manager

Solution:

  1. Repeat the write operation
  2. Try resetting the configuration: "Reset all bias to default value"
  3. Reboot and try again

Practical Application Scenarios

Scenario 1: Initial Setup of a New Amplifier

Step 1: Check status  
 - 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

Step 1: View current table  
  - 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

Step 1: Check configuration integrity  
 - 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

ParameterMinimumMaximumNote
Driver current1 mA1000 mATarget value
Output current1 mA2000 mATarget value
Max alarm current (driver)-6000 mAThreshold value
Max alarm current (output)-26000 mAThreshold value
Heatsink temperature-40°C126°CSensor range
Maximum alarm temperature-80°CLimited
Bias DAC04095 (output) / 4096 (driver)12-bit resolution
Thermal compensation-100+100DAC/°C
Fan speed0%100%Corresponds to DAC 0-63

Utility version: 1.2