Go round and round and round

smith001

O.K. We go round on the circle, but which circle? There are so many circles on the chart.

We have two families of circles, circles of constant resistance (blue) and circles of constant reactance (red).

Which family is more interesting to us, red or blue?

Well, it is definitely the bule.

Why?

Because, you do not want to introduce any resistance into the circuit. The resistors consume power, you know.

So all we can do is to introduce reactance while keeping the resistance constant, which means we can go around only on blue circles, right?

The Circle Game

Kennywood_Carousel_DSCN2827
(the picture from wikipedia.)

“The Circle Game” (<- click here for a YouTube video) is a song witten by Joni Mitchell. The song was popularized by Buffy Saint-Marie, and was used in a 1970 film "The Strawberry Statement".

I did not notice when I was a high school kid, but the lyrics of the song seem to be quite interesting to me now.

We can’t return we can only look behind
From where we came
And go round and round and round
In the circle game

Any relationship with ham radio? The song popped up in my mind when I was looking at a Smith Chart, which is full of circles.

capture_002_29092013_213333

My First eQSLs

capture_001_28092013_070006

In old days, it was a big joy to receive an envelope from a QSL bureau. I was not eager enough to send my cards direct, so that was the only way to get QSL cards.

Time has passed, and now the age of electronic mail, electronic logbook, and electronic cards. Even during QSOs, we sometimes become absent minded by trying to get more information from qrz.com than from listening to the morse music coming all the long way to you bouncing several times between the earth and the ionosphere.

capture_001_26092013_213721

capture_003_26092013_213816

VSWR less than 2.0?

capture_002_22092013_191716

The position (d1) and the length (d2) of the stub are the same as before, but the overall arrangement is modified to avoid cable spaghetti, which resulted in a slightly better match.

Dipole40mstubmatch1

The green arc in the Smith chart corresponds to the d1 in the first figure, and the orange arc to the d2. By adjusting both parameters, any antenna radiation impedance, Zant, can be perfectly matched, which of course as far as a single frequency is concerned.

Dipole40m41

Dipole40m42

capture_001_22092013_164540

gnuplot&gt; load &quot;gnuplot1.txt&quot;
Freq [MHz]=7.026
V1=2.925
V2=2.386
Cursor 1=7.6e-009
Cursor 2=4.96e-008

vratio=0.815726495726496
phase1 [deg]=19.223136
phase2 [deg]=125.456256

abs(gamma)=0.35344142063807
swr=2.09330053585205
cz={27.6149176604425, 16.9509508914556}

Dipole40m43

Dipole40m45

Changing the frequency between 7001kHz and 7060kHz, the following graph is obtained. The VSWR values are computed by measuring the forward and the reflected power with CMX-200.

capture_001_22092013_171429

Looks reasonable?

Stub Matching (2)

For a single band, stub matching is relatively an easy job. A short wire of length 30cm, described in my previous post (A little bit longer), is removed from each far end of the element, and Zant should be aound 14.025-49.337j [ohm]. (See Folded Weirdly for the detail.)

Dipole40mstubmatch1

Now let’s try single stub matching using two 75 ohm coax cables, which I have in abundance. (Of course, you can use 50 ohm coax cables, if you prefer.)

Dipole40m31

Dipole40m32

capture_001_21092013_173428

gnuplot&gt; load &quot;gnuplot1.txt&quot;
Freq [MHz]=7.026
V1=3.008
V2=3.731
Cursor 1=8.4e-009
Cursor 2=2.72e-008

vratio=1.24035904255319
phase1 [deg]=21.246624
phase2 [deg]=68.798592

abs(gamma)=0.47580332514932
swr=2.8153618593054
cz={42.3068002762323, 49.1623697140194}

The VSWR now becomes 2.81. Note that the length of 75 ohm coax cables is not adjusted yet, and is somewhat longer for both the cables than the values shown in the Smith chart.

Dipole40m33

A little bit longer

Dipole40m21s1

Dipole40m22s1

A short wire of length 30cm is added at each far end of the element.

capture_001_21092013_075828

gnuplot&gt; load &quot;gnuplot1.txt&quot;
Freq [MHz]=7.026
V1=3.653
V2=6.169
Cursor 1=1e-009
Cursor 2=2e-009

vratio=1.68874897344648
phase1 [deg]=2.52936
phase2 [deg]=5.05872

abs(gamma)=0.69113364433374
swr=5.47529251182366
cz={252.437028893358, 72.0354980323906}

The VSWR is now estimated to be 5.475, which coincides well with the measurement by CMX-200 SWR meter.

Dipole40m23s1

Considering the coax cable length of 20m, Zant is estimated to be 9.491+9.744j [ohm].

Dipole40m23s1

Folded Weirdly

capture_002_19092013_195620

The elements are now folded somewhat more artistically for my 40m band dipole.

Dipole40m11

Dipole40m12

Dipole40m13

gnuplot&gt; load &quot;gnuplot1.txt&quot;
Freq [MHz]=7.026
V1=2.836
V2=2.544
Cursor 1=1.84e-008
Cursor 2=4.52e-008

vratio=0.89703808180536
phase1 [deg]=46.540224
phase2 [deg]=114.327072

abs(gamma)=0.755401024840705
swr=7.17664914048597
cz={9.18797000120047, 27.8663957175412}

Dipole40m14

This time Zant is estimated to be 14.025-49.337j [ohm].

Using the internal antenna tuner of ICOM IC-7410, the VSWR becomes close to 1.0 after tuning.

New Dipole Antenna for 40m band

I removed the elements of my old dipole antenna for 17m band, and build a new dipole antenna for 40m band. The elements are Al wires with 1.5mm diameter, each around 10m length. Since I only have a limited space for my antennas, the far ends of the elements are folded in a weird manner.

Impedance measurement results are:

Dipole40m1

Dipole40m2

gnuplot&gt; load gnuplot1.txt&quot;
Freq [MHz]=7.026
V1=2.384
V2=0.272
Cursor 1=0.0
Cursor 2=0.0

vratio=0.114093959731544
phase1 [deg]=0.0
phase2 [deg]=0.0

abs(gamma)=0.885906040268456
swr=16.5294117647059
cz=3.02491103202847

Dipole40m3

# gnuplot1.txt
set object 1 rectangle from screen 0,0 to screen 1,1 fillcolor rgb &quot;#f0f0f0&quot; behind
set size square
set xrange[-0.5:2.5]
set yrange[-1.5:1.5]
set zeroaxis
set parametric

# input data from measurement
freq=7.026e6
v1=2.384
v2=0.272
cursor1=+0.000e-9
cursor2=+0.000e-9

vratio=v2/v1
period=1/freq
phase1=2.0*pi*(cursor1/period)
phase2=2.0*pi*(cursor2/period)
phasedeg1=360*(cursor1/period)
phasedeg2=360*(cursor2/period)

I={0,1}
z0=50.0
cv1=1+I*0;
cv2=vratio*(cos(phase1)+I*sin(phase1))
cvfwd=cv1
cvrfl=cv2-cv1
cvr=2*cv1-cv2
cz=z0*(cv2/cvr)
gamma=cvrfl/cvfwd
swr=(1+abs(gamma))/(1-abs(gamma))

print &quot;Freq [MHz]=&quot;, freq/1e6
print &quot;V1=&quot;, v1
print &quot;V2=&quot;, v2
print &quot;Cursor 1=&quot;, cursor1
print &quot;Cursor 2=&quot;, cursor2
print &quot;&quot;
print &quot;vratio=&quot;, vratio
print &quot;phase1 [deg]=&quot;, phasedeg1
print &quot;phase2 [deg]=&quot;, phasedeg2
print &quot;&quot;
print &quot;abs(gamma)=&quot;, abs(gamma)
print &quot;swr=&quot;, swr
print &quot;cz=&quot;, cz

set arrow 1 from 0,0 to 1,0 lw 2 lt 1
set arrow 2 from 0,0 to 2,0 lw 1 lt -1
set arrow 3 from 0,0 to real(cv2),imag(cv2) lw 2 lt 6
set arrow 4 from 1,0 to real(cv2),imag(cv2) lw 2 lt 2
set arrow 5 from real(cv2),imag(cv2) to 2,0 lw 2 lt 3
plot [0:2*pi] 1+abs(gamma)*cos(t),abs(gamma)*sin(t) lw 1 lt -1 notitle

pause -1

The length of the coax cable is about 20m, the same as before. Please also see my previou post,
Cable Lenght Measurement (5).

Dipole40m4

Dipole40m5

Dipole40m6

Dipole40m7

Considering the coax cable length, the antenna impedance shall be around Zant=45.695-182.527j [ohm]. Sounds reasonable?

CW Keyboard (2)

cwkb1

Minor improvement to my old program adding menus for speed change and fixed messages.

cwkb2

The following is the source code.

/* file name = ic7410.c */
/* % gcc ic7410.c -o ic7410 -lncurses */
#include &lt;ncurses.h&gt;
#include &lt;stdlib.h&gt;
#include &lt;unistd.h&gt;
#include &lt;termios.h&gt;
#include &lt;string.h&gt;
#include &lt;fcntl.h&gt;
#include &lt;ctype.h&gt;
#define  ENTER      10
#define  ESCAPE     27
#define  NROWMIN    30
#define  NCOLMIN    80
#define  BUFSIZE  1024
#define  BAUDRATE B19200
#define  MYRIG    &quot;/dev/ttyUSB0&quot;

static int speed[]={15,20,25,30,35,40,45,50};
static int nspeed =sizeof(speed) / sizeof(speed[0]);

static char *text_array[]={
  &quot;cq cq cq de jh1ood jh1ood jh1ood k &quot;,
  &quot;de jh1ood jh1ood jh1ood k &quot;,
  &quot;qrz? de jh1ood k &quot;,
  &quot;ur 5nn ^bk &quot;,
  &quot;73 tu e e &quot;};
static int ntext =sizeof(text_array) / sizeof(text_array[0]);

int fd=-1;


void init_curses()
{
    initscr    ();
    start_color();
    noecho     ();
    raw        ();
    keypad     (stdscr, TRUE);
    scrollok   (stdscr, TRUE);
    curs_set   (0);
    init_pair  (1,COLOR_WHITE,COLOR_BLUE);
    init_pair  (2,COLOR_BLUE,COLOR_WHITE);
    init_pair  (3,COLOR_RED,COLOR_WHITE);
    init_pair  (4,COLOR_BLACK,COLOR_GREEN);
}

void draw_menubar(WINDOW *menubar)
{
    wbkgd(menubar,COLOR_PAIR(2));
    waddstr(menubar,&quot; WPM &quot;);
    wattron(menubar,COLOR_PAIR(3));
    waddstr(menubar,&quot;(F1)&quot;);
    wattroff(menubar,COLOR_PAIR(3));
    wmove(menubar,0,20);
    waddstr(menubar,&quot; Messages &quot;);
    wattron(menubar,COLOR_PAIR(3));
    waddstr(menubar,&quot;(F2)&quot;);
    wattroff(menubar,COLOR_PAIR(3));
}

WINDOW **draw_menu1(int start_col)
{
    int i;
    WINDOW **items;
    items=(WINDOW **)malloc((nspeed+1)*sizeof(WINDOW *));

    items[0]=newwin(nspeed+2,9,1,start_col);
    wbkgd(items[0],COLOR_PAIR(2));
    box(items[0],ACS_VLINE,ACS_HLINE);
    for (i=1;i&lt;=nspeed;i++) {
    	items[i]=subwin(items[0],1,7,i+1,start_col+1);
        wprintw(items[i],&quot;%2d WPM&quot;,speed[i-1]);
    }
    wbkgd(items[1],COLOR_PAIR(1));
    wrefresh(items[0]);
    return items;
}

WINDOW **draw_menu2(int start_col)
{

    int i;
    WINDOW **items;
    items=(WINDOW **)malloc((ntext+1)*sizeof(WINDOW *));

    items[0]=newwin(ntext+2,49,1,start_col);
    wbkgd(items[0],COLOR_PAIR(2));
    box(items[0],ACS_VLINE,ACS_HLINE);
    for (i=1;i&lt;=ntext;i++) {
    	items[i]=subwin(items[0],1,47,i+1,start_col+1);
        wprintw(items[i],&quot;%s&quot;,text_array[i-1]);
    }
    wbkgd(items[1],COLOR_PAIR(1));
    wrefresh(items[0]);
    return items;
}

void delete_menu(WINDOW **items,int count)
{
    int i;
    for (i=0;i&lt;count;i++)
        delwin(items[i]);
    free(items);
}

int scroll_menu(WINDOW **items,int count)
{
    int key;
    int selected=0;
    while (1) {
        key=getch();
        if (key==KEY_DOWN || key==KEY_UP) {
            wbkgd(items[selected+1],COLOR_PAIR(2));
            wnoutrefresh(items[selected+1]);
            if (key==KEY_DOWN) {
                selected=(selected+1) % count;
            } else {
                selected=(selected+count-1) % count;
            }
            wbkgd(items[selected+1],COLOR_PAIR(1));
            wnoutrefresh(items[selected+1]);
            doupdate();
        } else if (key==ESCAPE) {
            return -1;
        } else if (key==ENTER) {
            return selected;
        }
    }
}

void send_cw(char* text);

/* IC-7410 key speed set */
/* the parameter 0-255 relates to 6wpm-48wpm */

void send_keyspeed(int wpm) {
  static char output_ks [9] =
   {0xfe, 0xfe, 0x80, 0x00, 0x14, 0x0c,
    0x01, 0x28, /* from 0x00,0x00 to 0x02,0x55 */
    0xfd};
  int param, p0, p1, p2;

  if(wpm &lt;  6) wpm =  6;
  if(wpm &gt; 48) wpm = 48;
  param = 255.0 * ((double)wpm - 6.0) / (48.0 - 6.0) + 0.0;
  p0 =  param      % 10;
  p1 = (param/ 10) % 10;
  p2 = (param/100) % 10;
  output_ks[6] = p2;
  output_ks[7] = 16*p1+p0;
/* because param=123 goes as 0x01, 0x23 (BCD) */
  write(fd, output_ks, 9);
}

void send_cw(char* text) {       /* IC-7410 send CW */
  static char output [BUFSIZE] = {0xfe, 0xfe, 0x80, 0x00, 0x17};
  char *p;
  int  count;

  count=0; p=output+5;
  while((*p++ = *text++)) {
    count++;
    if(count == 30) {            /* IC-7410 max CW text length */
      *p = 0xfd;                 /* IC-7410 postamble */
      write(fd, output, 5+count+1);
      count=0; p=output+5;
    }
  }
  if(count) {
    *(--p) = 0xfd;               /* replace zero with postamble */
    write(fd, output, 5+count+1);
  }
}

void send_stored_text(int id) {  /* use Function Keys */
  send_cw(text_array[id-1]); /* id=1, 2, ... */
  attron(COLOR_PAIR(2)); printw (text_array[id-1]); attroff(COLOR_PAIR(2));
}

void serial_init(void) {
  struct termios tio;
  memset(&amp;tio, 0, sizeof(tio));
  tio.c_cflag     = CS8 | CLOCAL | CREAD;
  tio.c_cc[VTIME] = 0;
  tio.c_cc[VEOL ] = 0xfd; /* IC-7410 postamble */
  tio.c_lflag     = ICANON;
  tio.c_iflag     = IGNPAR | ICRNL;
  cfsetispeed(&amp;tio, BAUDRATE);
  cfsetospeed(&amp;tio, BAUDRATE);
  tcsetattr  (fd, TCSANOW, &amp;tio);
}

int main(void) {
  int    c, count=0, nrow, ncol, row=0, col=0;
  char   word[BUFSIZE];
  struct termios oldtio;
  int selected_item;
  WINDOW *menubar,*messagebar, **menu_items;

/* IC-7410 USB I/F initialize */
  fd = open(MYRIG, O_RDWR | O_NOCTTY);
  if (fd &lt; 0) {
    fprintf(stderr,&quot;Error: can not open %s \n&quot;, MYRIG);
    return (-1);
  }
  tcgetattr  (fd, &amp;oldtio);
  serial_init();

/* ncurses initialize */
  init_curses();
  getmaxyx   (stdscr,nrow,ncol);
  if(nrow&lt;NROWMIN || ncol &lt; NCOLMIN) {
     row=1; col=0; move(row, col);
     printw(&quot;Current Window size is %d rows, %d columns. \n\n&quot;
            ,nrow, ncol);
     printw(&quot;Please make the Window size greater than %d rows, %d columns. \n&quot;
            ,NROWMIN, NCOLMIN);
     printw(&quot;Hit anykey.. \n&quot;);
     getch();
     endwin();
     return EXIT_FAILURE;
  }
  bkgd(COLOR_PAIR(4));
  menubar   =subwin(stdscr,1,40,0, 0);
  messagebar=subwin(stdscr,1,10,0,ncol-10); /* 10chars */
  wattron(messagebar, COLOR_PAIR(2));
  draw_menubar(menubar);
  row=5; col=0; move(row, col);
  refresh();

  while ( (c=getch()) != 0x04) { /* ^d, EOT */
    switch (c) {
      case KEY_F(1):
            menu_items=draw_menu1(0);
            selected_item=scroll_menu(menu_items,nspeed);
            delete_menu(menu_items,nspeed);
            if (selected_item&lt;0)
                ;
            else {
	        wclear(messagebar);
                wprintw(messagebar,
                  &quot;Now %2d WPM&quot;,speed[selected_item]); /* 10chars */
		send_keyspeed(speed[selected_item]);
	    }
            touchwin(stdscr);
            refresh();
	    break;
      case KEY_F(2):
            menu_items=draw_menu2(20);
            selected_item=scroll_menu(menu_items,ntext);
            delete_menu(menu_items,ntext);
            if (selected_item&lt;0)
                ;
            else
		send_stored_text(selected_item+1);
            touchwin(stdscr);
            refresh();
	    break;
      case KEY_BACKSPACE:
        if(count) {              /* only within a word */
          getyx  (stdscr, row, col);
          count--; col--;        /* only within the same line */
          mvaddch(row, col, ' ');
          move   (row, col);     /* cursor goes back */
        }
        break;
      default:
        if(isprint(c)) {
          addch(c);
          word[count++] = c;
        }
        break;
    }

    getyx(stdscr, row, col);
    if(c == 0x0a || (c==' ' &amp;&amp; (col &gt;= ncol-10 || col == ncol)))
      printw(&quot;\n&quot;);
    refresh();

    if(c == 0x0a || c == ' ' || c == '.' || c == ',') {
      word[count] = 0; count=0;
      send_cw(word);
    }
  }

  tcsetattr(fd, TCSANOW, &amp;oldtio); /* reset serial terminal */
  endwin   ();                     /* reset ncurses */
  return EXIT_SUCCESS;
}

Note: The menu part of the code is from
http://www.linuxfocus.org/English/March2002/article233.shtml