Antenna Analyzer: Time for some wire-wraping fix

After the successful signal tone generation module was working, it was time to write all the code to read the ADC voltages in the Wheatstone Bridge to calculate the SWR, Z and other parameters. So far I have gone to a problem solving and trying to figure out what was wrong, since the measurements were not coherent. I will explore some of the mistakes that I made and solutions that I found, at the end I will post some of the progress.

Fix 1: Signal generator maximum current

Mistake: I remove the 50 Ohm resistor present between the op-amp output and the Wheatstone bridge.

I had problem with the output signal at low impedances in the Wheatstone bridge. The theory tells you that when you connect a low impedance in the bridge, the total impedance will be lower than 50 Ohm ( 33 Ohm minimum). At the beginning I though It was a problem of the Charge-pump circuit that supply the -5v and it wasn’t supplying enough power, so I increased the capacitor values and an extra charge-pump circuit in parallel, but of course; it didn’t solve the problem, the signal was distortion at low impedances. I have to note that the circuit was modified from the original design, to support +5v and -5v with ground at 0v.

I substitute the charge pump circuitry to a 0 to 10v with ground at 5v, but the problem was still happening. Then It was when I realized that may be the output current was too big for the op-amp, so I place the 50 Ohm in series resistor and everything was solved. Of course by adding a in series resistor, the bridge voltage will be different for different impedance loads, but that’s why this circuit will be software calibrated to account for those changes.

Conclusion: Never remove resistors that looks stupid to you, if someone place them, must be for a reason 😉

Fix 2: Calibration dummies

Mistake: Make sure you made a proper solder union.

Resistors were needed to perform the system calibration, so some SMA connectors and SMD resistors were used; 50, 150 and 255 Ohms. The idea it is that for those resistors you know the SWR values, and also you could extract relationships for the bridge voltages Vf, Va, Vz and Vr. Edge PCB SMA connectors were used, their legs were cut and resistors were soldered. For the 50 Ohm load two resistors of 100 Ohms were used. One resistor was used for 150 Ohm load and two resistors of 510 Ohms were used for the 255 Ohm load. Next picture shows the dummies resistors

wpid-dsc_0408.jpg
Dummies loads for calibration

One problem was discovered on the 150 Ohm load, the resistor was doing a bad contact and when it was screwed to the meter, the resistor was disconnected. Using a multimeter the resistance was correct, but using an oscilloscope and measuring the Vf bridge voltage, when the load was screwed to the meter the voltage dramatically increased as the load was screwed. So I could see that the calibration values were a bit strange to me, giving random values; luckily now it is fixed.

Current status

The calibration measuring functions has been implemented. Right now I use an Hyperterminal software to control the meter, any Display menus has not been implemented yet. On the following code, you can see the Hyperterminal output were the following commands has been sent to the meter: display the help menu, display the calibration values, perform a measurement and display the measurement output.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
help
---HELP SCREEN---
 
 xy        Display the Touch XY coordinates.
 test      Run a test function
 touch     Calibrate the touch screen
 
 clear     Clear the hyperterminal screen
 sts       Display status of the device
 don/doff  Toggle Debug messages on/off
 eon/eoff  Toggle Echo of characters on/off
 
 Reset      Reset the board
 
---Antenna Analyzer---
 
 fstart   Get/Set start frequency, in kHz
 finc     Get/Set frequency increment, in kHz
 fnum     Get/Set number of frequency points
 fdelay   Get/Set delay between freq points, in ms
 frange      Get frequency range info.
 
 sweep     Run a Z measurement sweep.
 zcal      Run the Z calibration from the Serial.
 
 rawswr    Display the raw measurements from ADC.
 calbuf    Display the Calibration Buffer
 calbufraw Display the RAW Calibration values
 calbufhex Display the C HEX Calibration Buffer
OK
>calbufraw
RAW Variables for extraction of m and b
Freq,Va_x0,Va_y0,Va_x1,Va_y1, ...,Vz,Vr,Vf
1000,396,896,225,914,343,1034,613,1006,250,823,367,1587,710,823,867
2000,397,890,226,904,341,1036,610,1005,250,818,362,1609,707,818,867
3000,401,899,226,920,350,1030,621,1004,252,825,370,1593,721,832,877
4000,403,895,227,918,351,1028,623,1004,253,824,370,1594,722,834,878
5000,402,900,227,918,352,1028,624,1002,254,820,371,1592,724,834,879
6000,403,897,228,915,352,1026,624,1003,253,825,370,1596,723,835,879
7000,404,898,228,915,353,1028,624,1003,254,821,371,1594,726,835,880
8000,404,898,228,915,352,1031,625,1002,253,825,372,1589,726,835,880
9000,405,896,228,916,354,1025,625,1003,255,819,372,1591,726,836,881
10000,406,900,229,914,356,1026,627,1002,255,821,372,1591,731,838,881
11000,408,899,230,913,358,1025,629,1001,256,820,374,1586,734,840,883
12000,410,897,231,912,360,1022,631,1001,256,823,372,1599,736,843,885
13000,410,897,231,913,360,1022,633,1000,257,821,373,1596,736,844,886
14000,409,898,231,914,360,1020,633,1001,257,821,375,1591,735,845,888
15000,409,896,232,910,360,1018,633,1001,258,818,375,1591,733,845,888
16000,410,896,231,913,361,1018,633,1000,258,817,375,1589,735,844,887
17000,410,897,232,909,362,1016,633,1000,258,817,376,1587,736,844,888
18000,410,895,233,904,361,1016,633,998,259,813,374,1592,734,843,886
19000,409,898,232,907,362,1015,633,997,258,815,375,1588,735,842,886
20000,411,894,232,908,362,1015,634,997,259,813,375,1586,735,843,885
21000,410,897,234,903,364,1010,637,996,259,816,376,1583,736,846,886
22000,411,895,234,907,364,1010,639,996,260,816,377,1583,736,849,888
23000,411,894,234,911,363,1012,640,999,260,820,378,1584,735,853,891
24000,409,897,234,912,363,1011,642,997,262,814,378,1589,734,854,894
25000,408,894,235,908,361,1011,643,996,261,818,378,1594,730,854,897
26000,406,895,236,904,360,1009,642,997,260,821,379,1594,727,854,899
27000,406,892,235,907,360,1006,641,998,261,817,380,1591,725,853,900
28000,403,893,234,909,359,1002,641,995,261,815,380,1591,720,851,900
29000,375,901,235,904,342,988,640,996,261,814,380,1591,676,850,900
30000,371,907,235,903,340,989,639,996,261,813,380,1590,673,849,899
31000,369,913,235,902,342,985,638,996,261,812,380,1591,674,848,900
32000,364,925,236,899,343,982,639,996,262,810,382,1583,674,849,900
33000,357,942,235,904,346,972,640,996,263,807,382,1585,673,850,901
34000,349,962,236,901,348,965,640,997,263,808,383,1582,672,851,902
35000,346,975,236,902,352,958,642,995,263,809,385,1578,675,852,904
36000,326,980,236,903,345,926,642,996,264,807,385,1579,639,853,905
37000,328,978,234,913,348,922,643,997,264,809,386,1581,642,855,908
38000,330,980,231,918,349,926,640,994,262,810,386,1581,647,849,908
39000,331,980,215,962,349,929,628,988,248,834,385,1581,649,828,906
40000,336,979,197,1007,352,934,611,974,231,859,382,1587,658,794,902
41000,337,980,197,1032,354,933,624,978,234,869,376,1596,661,814,893
42000,339,979,196,1017,356,932,614,974,232,859,369,1613,664,798,886
43000,338,985,197,1016,356,935,616,975,232,863,356,1621,666,801,859
44000,336,985,196,1022,356,929,615,978,230,871,355,1632,662,802,862
45000,337,983,197,1020,357,928,617,977,231,870,354,1636,663,804,862
46000,339,982,197,1016,359,927,617,973,230,870,352,1640,666,801,859
47000,341,982,199,1007,364,920,617,974,231,867,353,1633,670,802,858
48000,341,985,199,1008,367,915,620,971,230,872,351,1642,672,803,858
49000,342,985,199,1011,367,918,621,972,230,875,352,1640,674,805,859
50000,342,985,198,1018,368,915,623,971,229,881,351,1648,674,807,861
51000,343,983,198,1020,368,917,623,972,229,882,351,1646,675,808,860
52000,344,984,199,1017,369,917,625,972,230,880,351,1650,677,810,862
53000,345,982,201,1008,367,923,624,974,231,877,352,1647,678,811,863
54000,346,984,202,1006,368,925,624,977,232,876,353,1645,681,813,864
55000,347,982,202,1006,366,931,623,978,232,876,351,1656,682,813,865
56000,346,978,199,1015,364,929,621,975,231,874,344,1672,677,808,856
57000,345,975,198,1016,361,932,618,976,229,878,342,1678,673,805,854
58000,342,976,189,1051,358,932,611,975,221,899,341,1679,668,795,852
59000,339,979,188,1053,355,935,608,976,220,900,343,1671,664,792,853
60000,334,980,189,1042,351,933,607,973,221,891,344,1662,655,788,851
61000,332,981,193,1040,350,931,611,985,225,892,351,1667,652,803,871
62000,336,977,196,1036,350,938,617,988,229,887,353,1660,657,813,872
63000,344,975,199,1023,353,950,621,984,231,882,351,1664,671,815,869
64000,348,972,199,1021,355,953,620,983,229,887,344,1678,677,813,859
EOFOK
>calbuf
Calibration Buffer, m and R values
Freq    Va_m    Va_r    Vz_m    Vz_b    Vr_m    Vr_b
1000    -105    937     -103    1069    -191    870
2000    -81     922     -115    1075    40      808
3000    -120    947     -95     1063    -156    864
4000    -130    947     -88     1058    -140    859
5000    -102    941     -95     1061    -123    851
6000    -102    938     -84     1055    -131    858
7000    -96     936     -92     1060    -114    849
8000    -96     936     -106    1068    -188    872
9000    -112    941     -81     1053    -123    850
10000   -79     932     -88     1057    -140    856
11000   -78     930     -88     1056    -173    864
12000   -83     931     -77     1049    -89     845
13000   -89     933     -80     1050    -98     846
14000   -89     934     -69     1044    -139    856
15000   -79     928     -62     1040    -114    847
16000   -94     934     -66     1041    -123    848
17000   -67     924     -59     1037    -139    852
18000   -50     915     -66     1039    -64     829
19000   -50     918     -66     1038    -114    844
20000   -78     926     -66     1038    -115    842
21000   -34     910     -51     1028    -166    858
22000   -67     922     -50     1028    -166    859
23000   -96     933     -46     1028    -190    869
24000   -85     931     -50     1029    -98     839
25000   -80     926     -53     1030    -89     841
26000   -52     916     -42     1024    -112    850
27000   -87     927     -28     1016    -104    844
28000   -94     930     -24     1010    -87     837
29000   -21     908     26      980     -79     834
30000   29      897     23      982     -79     833
31000   82      883     37      973     -62     828
32000   203     852     47      966     -111    839
33000   -225    1022    81      944     -70     825
34000   -40     975     109     928     -103    835
35000   67      952     -98     992     -142    846
36000   127     939     15      921     -119    838
37000   -5      979     32      911     -118    840
38000   -35     991     8       924     -124    842
39000   155     929     -23     937     190     787
40000   -201    1046    -98     968     47      849
41000   96      948     -76     959     42      860
42000   192     914     -91     964     -236    913
43000   -219    1059    -98     969     -229    916
44000   203     917     -63     951     -203    917
45000   203     915     -63     950     -166    908
46000   222     907     -75     953     -134    900
47000   -176    1042    -45     936     -167    905
48000   -161    1039    -37     928     -135    903
49000   -181    1046    -45     934     -175    915
50000   225     909     -37     928     -159    917
51000   196     916     -41     932     -183    923
52000   224     907     -41     932     -135    911
53000   -180    1044    -56     943     -135    908
54000   -152    1036    -52     944     -144    909
55000   -165    1039    -72     957     -54     888
56000   194     911     -76     956     102     851
57000   166     918     -83     961     120     851
58000   -61     996     -89     963     -53     910
59000   -56     997     -96     969     -125    927
60000   24      972     -99     967     -125    918
61000   47      966     -44     946     -90     912
62000   46      962     -58     958     -108    911
63000   120     934     -117    991     -36     890
64000   110     934     113     913     39      879
OK
>sweep
Impedance Frequency Sweep
1000 - 65000 kHz, every 1000 kHz, 64 points, every 0 ms
 
Press any key to exit measurement
................................................................
Measurement Done!
 
Impedance Measured
Freq,Va,Vz,Vr,Vf,SWR,Z,R,X,Ind,Cap
1000,26,944,473,968,291,1815,20265,0,0,0
2000,19,937,498,964,999,1999,7925,0,0,0
3000,26,946,502,973,999,1819,6563,0,0,0
4000,35,944,501,973,999,1348,3606,0,0,0
5000,46,942,500,972,999,1023,2079,0,0,0
6000,54,938,496,968,999,868,1498,0,0,0
7000,64,934,494,966,999,729,1058,0,0,0
8000,75,929,491,962,999,619,764,0,0,0
9000,85,924,487,959,999,543,589,0,0,0
10000,97,917,484,956,999,472,446,154,24,954
11000,109,909,480,952,999,416,347,229,33,0
12000,121,902,474,947,999,372,279,246,32,0
13000,132,892,468,943,297,337,702,0,0,0
14000,145,882,460,937,292,304,581,0,0,0
15000,158,869,452,932,288,275,484,0,0,0
16000,172,856,443,926,283,248,402,0,0,0
17000,187,842,432,919,277,225,339,0,0,0
18000,202,826,420,912,270,204,287,0,0,0
19000,216,807,406,904,263,186,246,0,0,0
20000,231,785,391,893,255,169,211,0,0,0
21000,249,762,372,884,245,153,181,0,0,0
22000,264,738,352,873,235,139,157,0,0,0
23000,280,711,330,862,224,126,136,0,0,0
24000,295,681,304,852,210,115,122,0,0,0
25000,309,651,276,842,197,105,109,0,0,0
26000,320,623,246,828,184,97,99,0,0,0
27000,328,593,218,814,173,90,91,0,0,0
28000,334,567,196,798,165,84,84,0,0,0
29000,337,543,181,783,160,80,80,0,0,0
30000,337,523,173,767,158,77,76,0,0,0
31000,332,502,154,752,151,75,74,0,0,0
32000,321,501,141,735,147,78,79,0,0,0
33000,318,539,151,738,151,84,87,0,0,0
34000,317,597,189,757,166,94,100,0,0,0
35000,312,645,225,779,181,103,110,0,0,0
36000,308,690,262,797,197,112,121,0,0,0
37000,299,740,299,815,215,123,134,0,0,0
38000,288,829,385,845,267,143,150,0,0,0
39000,281,870,420,868,287,154,162,0,0,0
40000,270,906,443,892,297,167,183,0,0,0
41000,263,939,471,911,999,178,67,164,6,0
42000,265,983,527,950,999,185,72,170,6,0
43000,266,983,551,954,999,184,72,169,6,0
44000,265,983,570,956,999,185,72,170,6,0
45000,260,983,567,962,999,189,75,173,6,0
46000,259,983,573,964,999,189,75,173,5,0
47000,250,983,570,970,999,196,81,178,6,0
48000,241,983,565,968,999,203,86,183,6,0
49000,234,983,547,969,999,210,92,188,6,0
50000,211,983,528,973,999,232,111,203,6,0
51000,191,983,522,973,999,257,135,218,6,0
52000,176,983,514,973,999,279,159,229,6,0
53000,166,983,507,971,999,296,178,236,7,0
54000,152,983,498,966,999,323,211,244,7,0
55000,132,982,494,969,999,371,277,246,7,0
56000,108,981,487,974,300,454,1251,0,0,0
57000,79,971,478,972,293,614,2320,0,0,0
58000,53,960,469,969,287,905,5105,0,0,0
59000,33,949,461,965,282,1437,13025,0,0,0
60000,23,927,449,944,281,1999,25260,0,0,0
61000,16,918,444,940,279,1999,25400,0,0,0
62000,9,895,433,914,280,1999,25329,0,0,0
63000,3,865,420,883,281,1999,25260,0,0,0
64000,0,840,410,856,283,1999,25121,0,0,0
OK

The measurement was performed on a RLC circuit simulating an antenna with R = 49 Ohms, C = 47 pF and L = 4.7 uH. The impedance value seems to work well, but the other values are not very trustful, so I took the measurement results import them to MATLAB and from the bridge voltages calculate the values and compare them. Following picture shows the plots for the different values, where “measured” represent the data from the meter and “calculated” the data obtained with Matlab.

MATLAB
Comparison of data calculated by the meter vs. MATLAB

From the figure, the SWR value obtained is wrong for SWR higher from 3:1. Since the value of X is calculated from SWR and Z, the value is not correct. I have to debug the code, because I am having some overload on the variables.

Next steps in the project are going to be: Fix the calculation of Z parameters, implement the display functions for Z analysis and hopefully continue researching for VHF and UHF measurements.

 

 

Leave a Reply