Amateur Radio

Circuit simulation

At university, I’m currently studying a subject entitled “RF & Applied Electromagnetics”, and at the moment, we’re looking at the issue of electromagnetic compatibility.

One thing that has come up both here, and browsing through the ARRL Amateur Radio handbook (I have the 1975 edition) is that above all, circuit layout has some of the most profound effects on how a circuit behaves.

What I did not realise, is just how low in frequency these issues show up.  The physical construction of many electronic components often means that, far from being a “pure” component, they in fact exhibit both resistive and reactive components.  I understood this occurred a lot in the VHF and UHF… which is a good reason why many homebrew radios stop in the lower HF.  These effects in fact, start to become visible as low as 14MHz.

This got me thinking… the typical circuit design workflow is some variant of this:

  1. Draw up the schematic in a schematic capture frontend
  2. Feed this into the circuit analysis package, inspect the simulation results.
  3. If unsatisfied, tweak schematic then go back to step 2.  Else feed into PCB layout package.
  4. Lay out the PCB
  5. Get PCB manufactured and build circuit.
  6. Do testing, tweaking component values… maybe go back to step 3.

It seems to me… the workflow should be more like the following:

  1. Draw up the schematic
  2. Lay out the PCB
  3. Feed the PCB layout and circuit schematic into the simulator, inspect results.
  4. If results are unsatisfactory, tweak layout and schematic, else get PCB manufactured and build the circut.
  5. Test & tweak

One criticism I have of gEDA, it seems to treat the schematic and the PCB as being two different things.  I find it awkward to move from gschem to PCB and back again when designing a circuit.  I also haven’t figured out simulation as yet.

I’d say the behaviour of the circuit has more to do with the way the board is layed out, than with just the components alone, and as such, I feel a modern EDA system should reflect this.  Qucs does seem to be approaching what is going on, in that you can simulate a stripline or similar PCB object in your circut.  I think it has possibly the greatest promise, but alas, it can’t yet do PCB layouts itself.  Time will tell I guess.

The commercial suites… well, I’ve used Electronics Workbench for years… I really must say I find the simulation in that much more intuitive than working with SPICE or Qucs… there is perhaps something worth looking into with its interface.  Multisim is more like traditional SPICE… but still retains some of the old feel of EWB.  However, all of them seem to simulate the schematic… which is fine… but you do miss out on a lot of what goes on in the circuit.

I’ve been getting used to Qucs… and so far, I quite like it.  Once again though, we’re looking at a simulation of an ideal circuit, under ideal conditions.  That is… pass a 100MHz sinusoid through a circuit: the resistors remain resistive, the capacitors store charge as they should and the inductors continue to add inertia.  In the real world, many resistors and capacitors become inductive in nature, and inductors look more like capacitors, depending on the physical construction of the component.  Mutual inductance, and capacitive coupling are also problems in the real world.

With today’s modern hardware, I figure the computing overheads to model how a physical circuit would behave based on the layout, is certainly a lot more feasible than it was when SPICE was first conceived.  SPICE was good for its time… but with the modern world requiring a higher level of engineering for its electronics, I think it has had its day now.

Samuel Morse’s Birthday

Did anyone happen to visit Google today? Those who haven’t… if it isn’t too late, have a squiz now.  Update: Google have reverted back to their old logo… the one they had up is pictured below.

Google celebrating the birthday of Samuel Morse

Yeah… I saw it and said… WTF… then it hit me what I was looking at. You’d think with the number of times I’ve heard CW on the air, I’d have recognised it straight off.

Anyway… happy birthday to you Samuel, and thank-you for providing us with this wonderful low-bandwidth mode that still sees use today. One of these days, I’ll actually get around to having a QSO on this mode. 😉

– – • • •   • • • – –      • • – •   • – •   – – –   – –      • • • –   – • –   • • • • –   – –   • • •   • – • •

Embedded development

Lately I’ve been looking around at microcontrollers.

With my work with Eze Corp, I’ve gotten quite accustomed to the MSP430. It’s a nice little MCU, with a very low power drain, gcc port and is in general, quite easy to drive. At my workplace, I use a Windows XP machine to do development under MSYS, using a MSP FET-430UIF JTAG device for programming and debugging. This is not my preferred mode of development, I’d much rather be doing it on a Linux host (or at least something that properly understands POSIX)… but it’s tolerable.

For my home projects though… this isn’t an option. I do not own a Windows computer any more, and in any case, I dislike working with it at my workplace — to hell with using it in my recreation! (The reasons why are best saved for another rant at some other time. No, I’m not a free-software hippie, I have other reasons.)

There are a number of MCUs available that I’m aware of. The biggest hurdle with many of them is the requirement of some piece of hardware which is either proprietary, expensive and/or unavailable. I like the MCUs that provide a JTAG interface, since it’s a well defined protocol that allows real-time debugging of the device as well as programming. JTAG for what its worth is little more than an SPI bus at the hardware level, it’s what’s layered on top of this that differs between devices.

JTAG can be implemented via GPIO. Since a computer parallel port is merely a specialised form of GPIO port, this enables people to wire up a JTAG port to a parallel port, and bit-bang the signals. There’s a couple of issues with this approach:

  • Parallel ports (I mean real ones) are getting harder to come by, especially on portable computers (understandable on netbooks, but I don’t see why full-size laptops don’t have them…anyway)
  • Most USB Parallel cables only have the smarts to drive a printer, they don’t allow arbitrary bit-banging of data. (e.g. the PL2305. And try explaining the difference to a salesperson…)
  • USB introduces a 1~2msec latency… which stuffs up timing at high speed.

I’ve seen some programmers (for PIC and AVR chips) that use RS-232. Now these are usually specialised devices for a given range of MCUs… that’s fine… but they suffer the same problem as the parallel-port JTAG cables… that is, most modern computers don’t have RS-232 anymore for some silly reason (as I say, understandable on netbooks… but are they saying they can’t cram a mini-din8 somewhere on a 15″ laptop?!)… and the USB latency screws timing up (I suspect this is the issue with the PL2303-based adapters we have here).

That leaves me with native USB devices.

A lot of the ones used by ARM devs are based on a FTDI chip which offers UART (RS-232) and SPI… so you get a serial console and a JTAG in one unit. Nice… In addition, there’s a open framework for debugging with them, OpenOCD. I don’t have the knowledge necessary to port this across to other MCUs… I guess one hope is that a MSP430 guru might contribute an OpenOCD port, but in the short term this isn’t an option.

For many ARM devices, there’s the J-link developed by Segger.  I’ve mentioned this one in past posts.  For MSP430, TI provide their MSP FET430UIF.  Both of these devices are on the nose from a usability point of view.  Both require you to use proprietary software in order to access their device.  This is fine if you’re on a supported platform, and the tool is well maintained.

For the J-link… well, if you’re not on Windows… forget it, that’s all they support.  The advice from them is to just run a Windows computer purely to run their GDB proxy software (which costs too I might add).

TI’s tool is theoretically a little better for support… the userspace drivers are proprietary freeware… but again, if you’re not using Windows or Linux on an i386 PC, forget it.  More to the point, the Linux version doesn’t seem to get updated as often — so the only real option is Windows.  Bad luck for me and my Yeeloong.

For what it’s worth, I do not understand why these things need to be proprietary… it’s a flipping programming cable.  Just moves data from one end to the other.  If they need to load firmware into the RAM of the chip being programmed, fine… but why can’t this be an ELF binary or something that just gets picked up by OpenOCD (or equivalent) and stuffed down the wire?

Devices like the Rabbit Semiconductor series of microcontrollers drive me insane with their non-standard nonsense… they decided to chuck many years of C history down the gurgler and invent their own “wannabe C”. #include <foo.h>? Nah… don’t be silly, we’ll just stuff everything into .lib files and #use them. Urgh!

I’d love to know what low-end microcontrollers exist that don’t exhibit the proprietary nonsense that is outlined above. 8 or 16 bits wide… I like ARM, but I’m not needing something that flashy. I like the low current drain of MSP430, and the fact they use gcc… which I guess pushes me in the direction of AVR and maybe PIC, but I’d be interested in other options. Cheap is important too, I don’t have a lot of cash for expensive tools or chips.

The other thing in the favour of AVR/PIC MCUs, is that there’s a local shop that I can buy them from — no need to order on-line. Farnell and RS have a wide variety, but I have to purchase from their website, which is awkward for me.

The applications I’d have in mind? Well, one idea is a more modern version of my headlamp… some of these MCUs draw less power than the 74HC14 chip used in that project (a few mA in standby mode) and would offer more functionality. Other applications include small controllers for amateur radio projects (not SDR though).

I’m really interested to know what controllers are out there, which are open-source friendly. Once I have a clear picture of what’s on offer, I can look more closely at my applications.

Ultra-Low Bitrate Speex

I just stumbled across this article, discussing the issues behind digital voice encoding at low bitrates.  The use of AMBE in the D-Star protocol really does get up my nose, at best it’s distasteful, at worst, harmful.

I’ve been doing some experimentation with Speex… so far my experimentations have been with bitrates above 12Kbps.  Above this, it is quite intelligible.  This is helped with pre and post filtering with the following filter:

Filter for ultra-low quality Speex

It’s not ideal… it means things do sound rather flat, but it’s similar to existing filters employed on existing SSB and FM transmission systems. On SSB, around 2.2kHz is the maximum upper frequency… and it tends to drop out around 300Hz, give or take a little bit. That filter could do with some fine tuning, but I find for low-bitrate Speex, using it to filter the audio before encoding, and after decoding, helps to reduce the distortion of the codec. Some fine-tuning could allow for better fidelity.

It is interesting to hear though, that DVSI even cuts corners though in an effort to lift perceived clarity by trying to reproduce the bottom end.

A good low-bitrate encoder benefits everyone… VoIP becomes even cheaper when you can send the same quality audio in fewer bits, and the benefits for HF radio communications would be immeasurable.

I guess though, it comes back to the old saying:

The superior man understands what is right; the inferior man understands what will sell. — Confucius

AWNOI

Australia-Wide Night-Owl and Insomnia Net

The AWNOI net is a weekly evening net that starts at 10:00PM UTC+10 (or 9:30PM UTC+10 when daylight savings time is in effect) and continues until the last station falls asleep. This recording is produced by myself using my HF set (Kenwood TS-120S), Yaesu FC-700 tuner and G5RV-like outdoor antenna. My QTH is at The Gap, Brisbane, QLD. Most of the stations participating, bar 3, are VK4 stations (two VK2s and one VK1).

If you’re a licensed amateur with equipment for 80m communications, feel free to join us at any time.

This recording was made 2009-01-30 and is available as Ogg/Speex, Ogg/Vorbis or MPEG4/AAC codecs.
A short highlights recording is also available, in MP3, Ogg/Vorbis or Speex.
Continue reading…

The puzzle of handheld radio antennas

Well, lately I’ve been tinkering around with antennas again for use whilst mobile.  By mobile, I mean public transport mobile, and pedestrian mobile… I don’t own a car.

Most handheld radios come with rubber ducky antennas.  My Kenwood TH-F7E is no exception.  Rubber ducky “dummy loads” as I call them, are quite dismal performers against an efficient and resonant dipole — however they are usually much more convenient size-wise than a resonant antenna.  It’s a similar story for mobile HF antennas… they’re a negative gain antenna.

Naturally, the way I’ve improved it, is to construct my own.  So far, I’ve built a number of these antennas.  The first version was a bit of stainless steel fencing wire with a SMA connector soldered to the botto and a few turns of a coil.  It was about 50cm long… roughly cut, so possibly not that well tuned… but it performed quite well… allowing me to reach repeaters up to 80km away on 2m with minimal line-of-sight.  The SMA->antenna interface proved to be a fragile component however.

A later version attempted to be a half-wave 2m, and could extend (fold out) to become a full-wave 70cm antenna.  This again, had similar mechanical issues to its predicessor, but performed excellent otherwise.

It was pointed out to me that trying to match a full-wave antenna is asking a bit much of the power-amp in my radio, and that an odd multiple of 1/4 wavelength was better.

Thus, the third revision, I made using some surplus solid core electrical copper cable, and a BNC connector, was constructed at a length of 52cm.  52cm was calculated according to the rule v=f?… the frequencies I had in mind were 146.500MHz (2m FM calling frequency)  and 439MHz (near to the input frequency of most 70cm repeaters).  52cm was calculated approximately as being 1/4 wavelength on 2m, and 3/4 wavelength on 70cm.

This antenna performed exceptionally well, and with the BNC connector, showed less mechanical problems than its predicessors.  It did however, put a lot of strain on the BNC->SMA adaptors I was using, and I had to be extra careful with the antennas length.

Using MMANA-GAL, I tried modelling this antenna, just to see how well it infact should work in theory.  Well I was right… about 6dBi gain on 70cm… it wasn’t bad at all! However, SWR was through the roof, 1:several hundred thousand.

I’ve since found a long forgotten RC car remote that operated on 40MHz, which had a 40cm long antenna.  I’ve stretched the base coil out a bit to make it 42cm and added a SMA connector to the bottom of it… I may have to extend it a bit, but this seems like a closer match to what I’m looking for… but my modelling of it is just as dismal in terms of SWR.

Now, as far as improving SWR… the ways I know of to fix this problem are:

  • To make the antenna a dipole, effectively doubling its length
  • Adding a ground plane or counterpoise radial
  • Adding a matching section (like a J-pole)
  • Using some sort of matching network

The thing that has me curious, is the rubber ducky antenna.  Now granted, I know those things do not radiate well.  They must however be doing something to keep the finals from blowing.  My understanding is that they’re little more than a spring in a plastic jacket… I can’t see how that is meant to match to the 50? source impedance.

The antenna design I use is apparently very similar to one used by Motorola for some of their professional radio antennas, according to this post.  Now I’m not sure how 19.5″ is arrived at — it doesn’t fit with the maths I used above, there is something I’ve missed.  Surely though, an antenna of this type would have the same impedance matching issues as the ones I’ve designed.  Either there’s other magic involved, or the finals in many handheld radios are more hardy than I thought.

At some stage I might borrow a SWR meter or antenna analyser for VHF/UHF… it’d be interesting to see just how far off the mark I am.  I haven’t blown my finals…yet.  The radio seems to still have plenty of life in it.  I’d be interested to know however, some of the background on this topic.  There is something I am missing, and I can’t quite put my finger on it.

Sunday’s Storm

Hi all,

I suppose you’re wondering why I’ve been absent from my usual online presence since Sunday afternoon.

Sunday we were at Montville (near the Glasshouse Mountains) doing a bushwalk through Kondalilla National Park on part of the Sunshine Coast Great Walk. On the way back home after stopping with the group for a drink at Landsborough, we drive along the Bruce Highway towards Brisbane when we noticed the huge storm front.

This storm front looked like it had tinges of green in it — which suggested mother nature might make lots of ice cubes and drop them on my father’s 18-month old car. The rain started pelting down as we got in to Carseldine, and eventually we decided to take refuge at Chermside shopping centre and have dinner while the storm passed.

Everything was uneventful on the trip home for the most part, one set of lights were on the flash… also some localised flooding… until we got through to Keperra. We had planned that evening to drop in on some friends (former next door neighbours, husband & wife, the husband dying of terminal cancer). As we drove passed the Mitchelton State School (I think that’s it), we saw that Dawson Parade was blocked off by a fallen tree, and the traffic was crawling. We inched our way towards home along Samford Road to see trees uprooted (not small ones either), massive flooding in parts. The horror story got worse as we headed over the hill from Keperra to our home suburb of The Gap.

Power lines down, trees over the road… we had to park the car some 400m away and walk the remaining distance due to blocked roads. It was about 20 minutes before we could get it home. Apparently our street had about 1m of water down it when the storm was at its peak.

Our house was undamaged, although a couple of trees copped a battering in the storm and had to be pulled down, and the G5RV antenna I had set up for my HF radio was damaged (still is… I’ll get around to it eventually).

We had no power (except for a 2.5kW petrol generator we own that we ran for a few hours yesterday) from when that storm hit, through to about 5PM Tuesday Evening. One UPS is a write-off on the count of knackered batteries, but otherwise, we’re okay. During the outage, mobile phone services were up and down like a yo-yo… my handheld dual-band transceiver, tuned to the Mt. Cotton (VK4RAX 147.075MHz) and Mt. Coot-tha (VK4RBC 438.525MHz) prooved to be more reliable. (Unfortunately though, I was one of the few amateurs in my street).

A few houses copped about 40cm water through their house, destroying carpets and ruining furniture. One house, that was for sale, wound up with a tree landing on its roof, piercing the awning and the roof in a couple of places. A number of fences also were written off.

Damage was worse around Payne Road. I suspect this is where most of the pictures of damage were taken. It appears the storm first came over Mt. Coot-Tha, hit Payne Road, bounced, hit Waterworks Road, rolled down the hill ploughing through The Gap State School and St. Peter Chanel School (this is where I began my schooling) and up Fish Creek (including the bottom end of our street). From there it continued up Settlement road, ploughing through trees along the road, and decimating the tree-line along the ridge between Keperra and The Gap.

Thanks to the help of everyone in our street and the numerous volunteers, we’ve now mostly got our street back into reasonable shape. The following is not an exhaustive list, I’ve possibly overlooked numerous groups and organisations that have helped in some manner. Some of the organisations that have assisted those in The Gap and therefore I’d like to thank (in no particular order):

  • State Emergency Services (some units came from as far away as North Queensland)
  • Queensland Police
  • RoadTek (Department of Main Roads)
  • Queensland National Parks and Wildlife Service
  • Skilled Engineering
  • Energex, Ergon Energy, numerous other companies, some from interstate
  • Rural Fire Brigade (some from as far away as Gatton and beyond)
  • Brisbance City Council

… any other organisations who assisted… and of course the neighbours who pitched in and helped clean up.

I uploaded my pictures here (taken the morning after). Some more pictures of the storm are available from the Triple M Cage (Brisbane) website.

Experiments with wireless headsets and HF

The other day I commented on my recent purchase of a new headset, and my intention to use it on air. The following are some very rough notes on how to set it all up.

There a couple of things I’ve discovered… one being, if you’re not careful with muting the microphone, it’ll generate a DC offset back to the computer… which with Qtel, is mistaken for a signal, so it’ll transmit a carrier indefinitely.  I submitted a hack around that issue, which is now included in the latest SVN release of svxlink… but needless to say, it caused some embarrasment earlier this week.

The other reason why I bought it… was for use with the HF station.  This set gives me the freedom to walk around the house which simply is not possible with a HF rig as big as the TS-120S attached to a full-size G5RV.  The solution?  Use JACK to patch the audio from the onboard sound card, through to the headset, and vice versa… using the VOX function on the HF set to key it up.  Another bonus is the ability to use tools such as FreqTweak for realtime DSP filtering.

Physical wiring: You’ve got a number of options here.  Usually to interface the radio to the computer, one hooks the “Mic” port to an output port on the sound card, and the “Phones” port to the Line-In on the sound card.

In my case, I had a TAD (Telephony Answering Device) port spare — this port normally hooks to a modem.  Since all I need is a mono input/output… I decided to hook to this port instead.  I found the ferrite beads were needed on each end of the cable… without these, I got lots of RF feedback when I tried to transmit.

Audio Routing within the system… well for basic functionality, everything can be achieved using qjackctl and jackd… however, I wanted the ability to use DSP filtering in both directions.  There is a catch however.  jackd will only talk to one sound card input, and one sound card output at a time.

Now… you can muck around with ALSA’s pcm_multi and pcm_route plugins to make a virtual multi-channel sound card.  But there’s a little known option that is a lot easier.  Enable the netjack USE flag and install jack-audio-connection-kit.  This will install two utilities alongside JACK, alsa_in and alsa_out. Also install qjackctl and freqtweak if you have not done so already.

Fire up qjackctl and adjust the properties to suit your setup.  Choose one of the sound cards as your primary device… the other will be hooked up using the alsa_in/alsa_out tools.  In my case, I have the settings shown in the screenshot below.  The exact settings to use will be dependant on your hardware.  In this case, I chose to use the headset as the primary device, specifying plughw:Headset and hw:Headset as the input and output devices.

Once you have that configured… start the JACK sound server. Now open up a couple of terminal windows and type the following… each line in a different window:
$ alsa_in -D hw:YourOtherSoundInterface
$ alsa_out -D hw:YourOtherSoundInterface

In my case, they were named AudioPCI. Go back to qjackctl and bring up the connections. You should see the alsa_in and alsa_out ports as well as the system ports corresponding to your two sound cards. Fire up freqtweak, set it up for two-channel filtering… then set up your connections as shown:

If it’s not clear… the audio feeds should be:

  • alsa_in:capture -> freqtweak:in_1
  • freqtweak:out_1-> system:playback_1 + system:playback_2
  • system:capture -> freqtweak:in_2
  • freqtweak:out_2 -> alsa_out:playback_1

As for keying up the transceiver.  The Kenwood TS-120S features VOX built in, but you’ll find that as you speak, the audio sent to the transceiver gets fed back to the headset — delayed, which throws one’s speech processes.  The workaround here, is to use the mixer mute features to keep the audio going one direction at a time.

Most headsets have two volume up/down buttons… I found it was convenient to bind one of these in KDE to execute the following command:
amixer -q -D hw:AudioPCI sset 'Master Mono' toggle ; amixer -q -D hw:AudioPCI sset 'Capture' toggle

This effectively switches between transmit and receive. Press the button once, you’re transmitting, press again, you’re receiving. Simple. For transceivers that lack a VOX feature… you can also add commands for rig control software that will turn the PTT on and off for you. Alternatively, one can capture the KeyPress/KeyUp using XGrabKey, and thus it behaves like a regular PTT.

This is left as an exercise for the reader — I found the xhkeys source code a help for figuring this out… combining this with hamlib and alsa-lib should allow a decent and usable interface when away from the rig itself.

Improving signals on 80m

I’ve had a 40m inverted-V dipole set up along the side of our house for as long as I’ve had the HF set.  Prior to getting the ATU, I was restricted to 40m and 15m which are the resonant frequency bands.

Once I acquired an ATU, I found I was able to tune up 80m… albeit with some limitations in signal radiation.

The 40m dipole consisted of two 10m lengths of speaker wire running from the antenna mast on the house, running down to two plastic tent pegs hammered into the ground.  I suppose the wire was no steeper than about 40 degrees from the horizontal.  This worked okay, but it had some annoying nulls, a notable one towards Ipswich… I tried a purely horizontal configuration, but found the nulls to be even worse.

The proper dimensions for a G5RV, is about 16m each leg, and about 8m of balanced feeder to form a “matching section”.  Well, I couldn’t do much about the length of the matching section, but I figured I might as well try extending the legs of the antenna a bit — nothing ventured nothing gained.  I added the extra 6m to each leg, moved the legs out as far apart as I can.  I tried tuning it up that afternoon, and things seemed to be okay… so I left the set on 3.600MHz LSB and switched it off ready for the AWNOI net.

On calling in, I asked about my signal strength after explaining the changes made.  Well, apparently my signal was a vast improvement on last week’s signal.  A S8~S9 signal (with the transceiver momentarily cutting back power) is now a S9+20dB to many stations.

I haven’t tried other bands yet… but this is a promising start. 🙂

Update: Tried tuning it up on the other bands… the results:

Band__Test_Frequency__Power__SWR__Notes______________________________________________
80m   3.599MHz        50W    2.5  High SWR is expected for a non-resonant antenna.
40m   7.074MHz        50W    1.2
20m   14.165MHz       50W    1.9  Heard a station at 14.170MHz just as I was going
                                  to tune up, which is promising also.
15m   21.190MHz       15W    1.9  This set does not like these bands (15m & 10m)!
10m   28.450MHz       25W    1.6  Might need to consider using the CB whip for these.
_____________________________________________________________________________________

A week of firsts…

Well… this week for me has been a week of firsts for me.

Last Sunday, I managed to make contact with Jason ZL2FT on the North Island of New Zealand.  We were communicating using SSB on 40m — this is the first time I’ve successfully heard and contacted an overseas station.

Okay, New Zealand isn’t exactly a great distance away, but it’s a great start. 🙂

Tuesday, I was listening on 40m, when Rolf DK2MH came crackling in from Germany.  I didn’t try to make contact this time, but there was an abundance of stations trying to work him locally — mostly eastern VK.

Today, I made my first PSK31 contact … once again, on 40m.  I chatted with Laurie VK3AMA for a few minutes.  Nice to be able to put all the theory I had learned at uni regarding PSK to practical use.  I was using BPSK31, and transmitting up to 80W at one point.  (Overkill I know, I did trim it back a little.)

Guess now it’s time to actually get some work done. 😉