Monday, 23 June 2014

First contact

I have built many things, some projects even successful!! But very very few of those success' have been in analog electronics.

When I heard a Ukraine station calling CQ, a distance of around 2000km, I knew my little set with its 5 Watts of power, plugged into my vertical sloping 5 meters of wire antenna would not make it... 

... But what the heck. Let's see what happens. I might as well see how hot the linear amp might get in normal operation if nothing else.

"...UT5FN this is G4UFS/QRP..." ...

"QRZ the QRP station ..."

What followed in the next few minutes, I can only describe as euphoric. A feeling I have not experienced since I was so very young when I wired a battery, a transistor radio loud speaker and a carbon microphone - scavenged by my father from an old underground colliery telephone receiver. From a distance of one end of our garden to the other, I heard the voice of a friend talking to me on something that "I" had made! I was instantly transported back to that moment in time when life was so simple and carefree.






I don't claim to have made a time machine with my little BiTX20 but I do claim to have made the next best thing. . .

Sunday, 22 June 2014

Ridding the click

If like me, you find yourself testing your new projects late at night when the house is quiet with everyone sleeping and you are not about to be disturbed and can concentrate on soldering components to boards rather than your fingertips (there's a lot to be said for this time of day...), then you will know the value of headphones in order to maintain that peace. 

Headphones are great when you are operating your IC706 or FTwhatever but the BiTX will happily punch a hole in your eardrum when you key the PTT. Some audio amplifier chips have a mute pin that can be grounded and can be controlled by the PTT and a handful of bits, to drop the audio slightly before the transmitter keys up. This reduces the click as the transmit circuit is picked up briefly by the receive circuitry. Unfortunately, in my case, I was using a TDA2003 audio amp with no such mute pin. 

Out of all the little foibles of this set, ridding the audio click was the most difficult to tame. I tried a few methods but eventually settled on a compromise, using a relay directly controlled by the PTT line and in parallel with the 12 Volt TX/RX changeover relay. The idea being that as both relays energised, the speaker would be disconnected slightly before the changeover relay was able to power up the transmitter electronics. It worked a treat! With the exception of only a little clunk as the reverse process turned the speaker back on again. Still, it wasn't worth the effort to take this further.

The audio shutoff relay that prevents the bleeding of ears

Friday, 6 June 2014

A new band pass filter

Having verified that no magic smoke wafted from the installation of the linear amplifier, and that it suffered from the feedback experienced by many other constructors, I started the rebuild of the bandpass filter to incorporate the addition of a small relay that would disconnect it's direct feed to the antenna when going into transmit. 

The artwork for the board was thankfully simple and it wasn't long before I was soaking the pcb in ferric chloride. My junk box running low on the required trimmers, I decided to transfer the components from the working BPF to the new board. All soldered in, I checked the operation of the new relay and was happy it was working as designed however on installation, the rig was deaf!!!

The rig was so deaf I suspected one of the IF amplifiers had gone faulty during the BPF transplant but poking the input of each and hearing noise increase confirmed they were good. How could it be the BPF? I checked the little board for shorts and open circuits but found nothing. The board was electrically identical to the previous one that had worked, the only difference being I had bunched the toroids together a little to enable the addition of the relay on the same real estate.

Several tests later, I decided to use a totally different design of band pass filter. I had in my junk box a couple of 5.5uH Spectrum coils and a quick reference to the GQRP clubs website gave me the capacitor values for a 20m filter. I modified the artwork, etched and built a new board and transplanted once again. Bingo! Nice bright audio. Maybe I will find out one day why the toroidal version didn't work...

New band pass filter complete with isolation relay, installed and working.



Monday, 2 June 2014

"Watt"? No power?

Ok, new photo pcb arrived and board etched!

As I described in an earlier post, I prefer to construct projects using a Manhattan style but rather than using glued on copper islands, I etch the copper island and then connect them together rather than using wires. This is exactly like "through hole" construction but mounting the components on the track side just by soldering to the copper island as if there were surface mount devices. This method of building has two main advantages; one is the negation of having to drill the board - time consuming, fiddley and requires fine drill bits that snap and blunt. The other advantage is that you don't have to worry about tracks on the underside of the board shorting with anything.

Unfortunately, the PA or more accurately, linear amplifier, was best built using the through hole method. This was because I had decided that the MOSFET would be bolted to a heat sink that would be soldered straight to the PCB. It might have been possible to use surface mount Manhattan construction but the heat sink would have had to be mounted proud of the PCB and would look uglier than "less ugly". I managed not to break a drill bit and not to make too bad a job of ensuring the holes were drilled straight.

In order to avoid the problem of shorting I constructed standoffs of brass nuts that were soldered directly to the mother board. This allowed the linear PCB to be slightly raised from the mother board and secured using the nuts.


Through hole construction of the linear amplifier.


Coil winding
The original design of the BiTX called for coils to be wound on tap washers and TV baluns. I have not seen a definitive answer to the type of core the TV baluns are but I know there are several designs that convert the baluns and taps washers into toroid cores. I purchased a few FT50-43 cores for the transformers and RF choke and already had some 50-2s for the low pass filter and set about winding them. Make sure that when you have finished winding the bifilar turns that you connect the right wires - more on that later.

The layout loosely follows the design by Farhan but modified slightly to make it fit into the real estate I had made available for the linear (Actually, the real estate I had left after the rest of the build - Remember, think big, you never have enough space). I had heard horror stories of the amplifier with self oscillations and feedback with MOSFETS getting too hot and blowing up. I didn't know if the layout was critical and if I was going to come up against all those woes. I just had to hope a little.

The board was populated with as many junk box items as I could muster, in fact the only specifically purchased items were the transistors and the MOSFET heat sink. one of the relays has been in my stock for over 20 years - I knew it would come in handy one day!

All populated, I mounted and wired the linear into the rest of the set complete with dummy load at its output. The PTT resulted in the clicking of the relays and measuring the voltages to them, everything was in order but no output and the receive was very quiet :(

It took me a little time to track down my errors. The first was straight forward. Measuring voltages, I noted that 12 Volts was not present at the MOSFET from the transformer. It turned out that I had not connected the windings to provide a centre tap and the end of one coil back on itself. Once corrected and power!!! but what of the quiet receiver? This was not so easy to find. I noted that when the antenna was connected straight to the bandpass filter, receive was loud. This pointed to either the circuit, a short or the low pass filter. The board checked ok and no shorts so I started to pull apart the LPF. Eventually, I noticed that with a single inductor in the LPF, the receive was very quiet. I had wound the coils aiming for 0.55uH as prescribed by the design and measured it with my LC meter. According the meter, 24 windings had given me the required inductance. Perhaps the meter was wrong? Google is most definitely your friend. A quick search to a coil winding calculator showed that I should have about half the number of windings! I did a few tests on my LC meter and concluded, that I should make it my next project to fix it. The coils rewound and nice bright audio on the receiver.

Feedback
OK, everything seemed to be working but looking in more detail, I could see on my scope that I had an output from the linear when I wasn't speaking and the MOSFET was getting hot. During my research readings, I had heard of this issue from many constructors. There were two main causes for this. The first was the balanced modulator. This needed adjusting to suppress the the carrier. If there was carrier getting through then the linear would amplify it and cause exactly what I was seeing on the scope. The other issue could be feedback of the linear output into the input via loose coupling of the bandpass filter. The BPF is connected to the LPF on receive, bypassing the linear electronics. On transmit, the BPF is disconnected from the LPF by a relay but the wire connecting the BPF to the relay acts like a little antenna, even though its coax and shielded. The solution as prescribed by Dr Bill Meara, is to add a second relay at the BPF so that the coax link is disconnected at both ends. I unsoldered the coax from the BPF and lifted it free. The receive obviously went quiet but on transmit, no feedback! 

Enough for one night, I shutdown. Now I need to feel a little pain in making up the artwork for a little relay board down by the band pass filter. Did I mention I don't like designing the artwork? :(

Board populated and installed



Monday, 26 May 2014

Killing bugs

Whilst not being able to build up the linear amplifier as I had planned, I decided to do a little update to the firmware. Whilst the frequency control and display were all working nicely as designed, I had yet to write the code to allow the set to remember the last frequency before turning off. This is a little annoying since the default is set to 14.000MHz requiring a good tune up the band to get to the SSB segments.

The PIC16f877 is a very capable device and incorporates non-volitile memory. I had yet to acquire the necessary knowledge to write to the memory area of this device. The first part of getting the feature to work though should have been straight forward.

Rule number one - Nothing is straight forward.

Having decided on the method that would be used to save the frequency, by simply detecting a change of the frequency and then waiting for a couple of seconds of no buttons being pressed or knobs turned, I wrote code to toggle the LED back light to represent what would later be the NV RAM write. With that done, I located the necessary areas that would hold off the write - namely the routines that dtetect button presses and knob turns, and inserted code just to reset the countdown counter. The countdown being triggered by the change of frequency. This would ensure that the write to NV RAM wouldn't interfere with the fluid graphics.

Once done a quick test of the rest of the functions and I would be ready to move on to learning the skills to write to NV RAM.

The first hurdle
It seems that somehow, my PIC would not allow itself to be programmed. For some reason, each time I tried, it would throw an error when verifying the rewrite. At £3 each, it can get expensive, I had one do the same to me previously and I managed to pop one during the "de-demonising" stage. Nothing for it, I had to insert a new one.

The second hurdle
All programmed up and the back light flashing nicely after turning the dial and waiting a couple of seconds. But wait, why wouldn't the volume control work? Something wrong with my new code? Hmmm

After a lengthy read through the associated code, I could see nothing I might have done that would stop the volume control from working! Nothing! I decided to flash the chip with the previous version that I knew to work and see if there might be something wrong with the new chip. Backing out of a change is always a good idea if you experience issues. With the new chip flashed with the previous version of the code the volume control still didn't want to work! Hmmm a faulty digipot perhaps?  Easily tested by putting the previous chip back in ( although it wouldn't accept a reprogramming, it still worked with the previous code). It worked!!?????

It took me a full day of debugging, sniffing and scoping the outputs to the digipot until I finaly found the fault. If you ever do any programming, always always always, declare your variables and then initialise them!!!! Most languages force you to declare a variable and unless you initialise it to something else, default the value to zero or null. Not so the PIC. I program in assembler, it allows me greater control of the hardware. The problem in this world of binary and hex is that you get exactly what you ask for but If you don't ask, you get what the PIC offers and that can be anything that was left in there by either your program or when it was manufactured. In my case a particular variable I had thought was at 0x00 was in fact at 0x07, simply because I hadn't initialised it. In the previous chip it had worked simply because that location had been written to by a zero in the past. A simple single line of code to correct it and I can now move on. A setback of a whole day, just because I didn't follow a rule I was taught in programming 101. Builder beware.

Sunday, 25 May 2014

No pain, no "gain". The linear amplifier


Ideally a hobby should never be painful but anyone who has ever had a passion for anything will know that there is an indescribable drive to carry on even when the going is so though, it causes physical and mental side affects. Perhaps this is "the wall" that runners talk of or "the bug" or maybe "the knack".

One of the biggest pains for me is making the PCB. I quite like designing a circuit, I don't mind the etching and I love melting solder but I find PCB artwork from scratch to be a pain in the backside. So much so that projects will stall because I have to make up a board. That said, it does have it's positives. During the time I struggle with the mental torture of forcing my brain to use the PCB CAD application, as I continue to put off the stage many times over, I tend to refine what's there already. Be it electronically, by maybe improving audio or logically by adding a new software feature, the project gets a little better. These small additions seem to reach a tipping point where it becomes attractive enough for my mind to view the benefits outweighing the negatives of enduring the process.

...The linear amplifier PCB was no different. 

With the exception of the PIC control board, design and etching of the various circuit boards was very easy. All I had to do was to decide where I wanted to put my pads of copper on a board and then click (See my previous post on "Build Method"), just like building manhattan style but less ugly. But because I know people have had trouble with the linear build, I wanted to make it as close as possible to that described in Farhan's circuit. So with the board layout closely following his, I finished the artwork in the small hours and knowing that I had all the components required to populate the board over the weekend and maybe even make that first contact?...

It was not to be. Despite being happy with the layout of the artwork and having checked it several times, I discovered that I had no presensitised copper clad board! Maplin have stopped selling a large selection of their overpriced components and associated hobby electronic items, unless it's remotely associated with adding coloured LEDs to the dashboard of a car, in which case, you can buy anything you like so long as you don't mind expensive tack. So with no quick way of attaining the required goods, I turned to ebay. What would I do without ebay. A quick search and several hits showed the best value for money lay with Spiratronics, a company I have used before and who have a quick turnaround time. 'Order placed and an annoying wait. That's the trouble with your brain making you do something you don't like, when it does, you are invariably not ready for it :(

But wait! What about that can of spray on photoresist from Electrolube that's been in the garage since the last time I unsuccessfully used it. Maybe if I read the instructions again and was very careful, it might just work for me? Hmmm...

If anyone has successfully used this stuff, please get in contact with me. Having spent the best part of yet another day cleaning, spraying, drying and exposing the copper board, all I get is a green layer with a very feint image of the circuit when I develop it. I know I am used to the commercial stuff that needs only two minutes of UV exposure and a dilute developer but try as I might to experiment with exposure time and developer strength, I still can't get a good print! Hopefully the photoresist PCB will be here by Wednesday or Thursday

Ok enough, I need to clean up and get ready to go out with my lovely wife and try and be less obsessed with the project. Yeah right...

'Doesn't look like a complicated pain in the backside...


Saturday, 17 May 2014

De-demonising the beast

Programming the PIC
So, I have designed digital projects before, made LCDs display all manner of information, interfaced different chips, programmed PIC micro controllers. All the skills I needed to meet my objectives were already there...

Hmmm, the trouble with setting objectives for me is that there seem to be so many more secondary ones that even I didn't realise I had. The frequency display had to be able to select the stepping speed, the volume control had to display it's current setting, the signal strength meter had to be dampened to make it display just the way I wanted it and all this had to be done without being "jerky". (The term "jerky" is a technical one, used frequently in the G4UFS shack to describe the fluidity or rather non-fluidity of a display's responsiveness to a control button or knob)

Needless to say, the programming of the PIC took considerably longer than expected...


Noise!!!
The trouble with digital electronics is the considerable noise that can be generated on the power supply to the rest of the circuit. When a project is fully digital and not running at very high speed, you can get away with minimal filtering, a couple of millivolts isn't going to make much difference when you're switching between 0 and 5 Volts. However it's a very different story when interfacing with analog circuitry, especially audio circuitry. 

The first power up with the DDS VFO was impressive. It worked!! Trust me, there was no one more surprised than I when it did! I heard stations from Europe calling CQ - a little muffled until I adjusted the BFO but nevertheless it was obvious that I was listening to Ham Radio signals. Feeling pretty smug with myself, I proceeded to refine the audio and become a little obsessed with how I might make it less noisy. The LM386 is not noted for its HiFi qualities, perhaps a different audio amplifier might do the trick? 

Not a problem, just swap out the audio stage for another audio amplifier of better quality. I could do this due to the modular design I had incorporated. - another smug moment :)

I decided to use the TDA2003, a device I had used before in a great sounding internet radio build and one of which was sitting in my spares box. At the same time, I had worked out how to rectify the audio signal from the LM386 into something I could pass to the ADC of the PIC and display signal strength. A redesign of the audio board later and Presto! Another noisy audio circuit :(

Actually, the sound of the audio was a little better. The LM386 has quite a harsh sound with little bass frequencies. The TDA2003 was doing the best it could but I could detect a high pitch buzzing in the background and realised I was listening to the sound of my code running on the PIC, rapidly turning on and off all of those transistors as it attempted to meet all those secondary objectives :(

Having identified that noise was present on the power rail, I added capacitance to to the power feed and noted a significant reduction - great but not perfect. There is a limit to the number of 1000uF capacitors you can reasonably place on a board before you realise the law of diminishing returns. 

Noise of this type is hard to trace through the circuit even with an oscilloscope. The best method I have found so far is to take a 100nF capacitor and start placing it at strategic points along the power line. If you have never experienced power line noise before, you might be forgiven for thinking that a capacitor placed at one end of a wire is the same as placing it at the other. It isn't. The power line will pickup and radiate noise at different points along its length depending on what it's connected to. I found that placing a 100nF capacitor in the feed to the BFO significantly reduced the noise and then traced the remaining squeaks to the pull-up resistors supplying the rotary encoders. Both points being fed with a solid regulated and smoothed DC voltage. Probing these two points, it was difficult to see the spikes of noise with the scope but dropping in a small capacitor and listening to the audio it was obvious and at the end of the day, it doesn't matter what the scope says, it's your ear that does the listening.