Unleaded or Regular

Solder that is…

About a year back, I finally ran out of what had been a one pound spool of 60/40 solder.  After debating it for a bit, I decided to refill my supply with lead free solder.

Before I continue…

It is important to understand that I am very skilled at soldering, having had a long and extensive career in the electronics industry.  Indeed, in my younger days I instructed people on proper soldering technique.  Likewise, I have a decent, temperature controlled, soldering station. Ergo, I’m anything but a novice at soldering.

Moving on…

As noted, I had replaced the 60/40 leaded solder with a lead free spool from a major and, I might add, well respected solder manufacturer (who shall remain nameless).  Since that day, I had started to think that my soldering skills had suddenly eroded.

Using the same, proven, techniques and processes that had always resulted in perfect connections with leaded solder, just didn’t work with the lead free stuff.  The really upsetting thing to me was that, in order to even have a chance of a decent connection, it was necessary to apply heat longer and/or use a far higher tip temperature.

Neither of those necessities was appealing to me and, as if that wasn’t enough, I found unsoldering to be next to impossible.  Circuit boards were being damaged, almost 50% of the time, due to the need for additional time and/or heat on a given connection.

Eventually, I came to the conclusion that my skills had not eroded.  This lead free solder was simply crap.

As this spool of lead free solder was finally running out, I also noted that it had become next to impossible to keep a clean/tinned tip on the iron.  I was about to consider replacing the tip, but waited.

A few days ago, a new, one pound spool of 60/40 leaded solder arrived.  I still have about three feet of the lead free left, but I set it aside to test my theory.  One of the first things I did was attempt to tin the seemingly fried tip on my iron…

As Chef Emeril Lagasse would exclaim… BAM!

The once deceased looking tip of my iron took to the lead like the proverbial duck to water.

It tinned right up, something it was all but impossible do with the lead free stuff. After a couple of wipes across the damp sponge and another tinning it once again looked clean and new.  I grabbed a project board and made a couple of ‘test connections’.  Tip temp set to 750f, a temperature derived from experience… I had no issues at all making a perfect connection and, my 2A2 rule worked as well as it ever had!

2A2 means apply a (clean and tinned) iron to the joint, count to 2 (one Mississippi, two Mississippi), Apply solder, count to 2 again, and remove iron (and don’t bump/jar the joint).  All of the connections cooled to a shiny silvery color, not the cold brittle appearance of the lead free stuff.  Also do-able once again, easy unsoldering.

As I don’t like to waste anything, I’ll find a use for the remaining couple of feet of lead free solder. However, until I find something that works better than 60/40 leaded or, a better process comes along for using lead free solder that makes for clean connections and doesn’t fry circuit boards, I’ll stick with good ventilation and 60/40 leaded solder.

To be sure, I would genuinely like to stop using leaded solder.  It is why I purchased the spool of lead free in the first place.

I am also open to the possibility that a different process may be needed to make use of lead free solder.

Unfortunately, I have yet to find any instructions and/or articles touting the benefits of lead free solder, beyond the environmental/health standpoint.

Advertisements

If It Ain’t Broke…

Or is it don’t reinvent the wheel?

Well, actually it is ‘broke’…

I have been troubleshooting a low output power problem on my QCX transceiver this week.  I was fairly confident that I had the problem identified as a bad BS170 MOSFET, one of three that QRP-Labs uses in its Class E power amplifier to get 5 watts out. Anyway, it turns out I was wrong so I will look deeper into that problem later.  For now, I can live with a watt and a half for 40M CW.

I’ve always been a fan of these MOSFET amplifiers, especially given I enjoy CW so much, as they make for very efficient use of battery power.  The downside to Class E amplifiers, unfortunately, is they are both easier and at the same time, more difficult to design.  They are, essentially, just high speed switches.  Indeed, it might be better to call them switches that are being operated at very high speeds.  What they are actually are is neither RF devices nor linear, but they do at times mimic such operations, within limits.

I build a lot of QRP stuff for fun, so I wanted to delve into a MOSFET PA project.  My goal is to use a DDS (si5351) as the exciter and link it to a MOSFET amplifier for the power.  For many of MOSFET amplifiers, getting them to operate at an output impedance of 50 ohms is an exercise in mathematics.  In truth, it isn’t really that difficult, but it’s not for the uninspired.

Whilst digging into the schematic for the QCX, I got to wondering how QRP-Labs designed the finals amplifiers in some of their other offerings.  Specifically the U3S WSPR transmitter.  It actually does more than WSPR, but that seems to be its primary application.

Unlike the QCX, which uses a TTL logic device to buffer the DDS output into something that will directly drive the gate of the BS170(s) without biasing said gate, the U3S PA does bias the the BS170 gate.  I found this both interesting and appealing.

However, whereas the QCX is basically a CW rig, the U3S supports multiple protocols.  Given that, I could see why they might need to bias the gate, providing the ability to set the MOSFET in a semi-on state, permitting a linear like operation, further permitting a lower-level/not quite a square-wave input signal.  Basically, mimicking (and I use that term loosely) something akin to Class A/AB operation in an analog device.

Reading through the manual it became clear to me that this particular amplifier could easily suit my desire for a very simple QRP transmitter, with possibilities beyond CW.

Linear1

Figure 1. My ultra ugly, one hour, slapped together MOSFET ‘test amplifier’.

QRP-LABS_U3S_PA
Figure 2. Snippet from the QRP-Labs U3S schematic. Remove two of the BS170 devices and that is what you see in Figure1.

I constructed the amplifier with a single BS170, as described in the manual, and powered it off a 5V supply along with the gate bias, the latter via an adjustable level potentiometer.  Indeed, I followed the U3S amplifier description to the letter in order to set a benchmark.

The amp was connected to a si5351/Arduino test setup I use frequently, and each clock output set to a discrete frequency from one of the amateur HF bands and, the amplifier terminated with a 50 ohm load (2x 100 ohm in parallel).  In my si5351 breadboard, I can quickly switch clock outputs to see the amplifier’s performance on different frequencies,

As with many MOSFET amplifiers, I started with the bias turned off, because doing it the other way around usually results in a loud pop.  Flipping on the 5V supply, I monitored the output on an oscilloscope.  With the bias off, there was no visible output.  The si5351 alone provides around 3V peak to peak (~22.5 milliwatts), which typically isn’t enough to really turn on even a lowly BS170.  Here again is a likely contributor to why the QCX buffers the si5351 clock with a TTL driver, and why this design (and many others) partially turns on a MOSFET with some bias on the gate.  As I SLOWLY increase the bias, a perfect replica of the DDS output starts to appear and increase in level.  I continued to increase the bias until the amplitude of the signal peaks, at which point I then backed off the setting by just a hair.

A quick count of the scope divisions and the final number was 302 milliwatts.  I have to say that I was impressed.  Indeed, the U3S manual states the expectation should be ~250 milliwatts, so not bad for a junk box version of that amplifier.

BTW, the math here is peak to peak voltage times 0.3535, then square that number and divide by the load resistor (i.e. 50 ohms).

I measured 11 volts peak to peak, so…

11 times 0.3535 = 3.8885

The square of 3.8885 = 15.12043225

15.12043225  divided by 50 (ohm) = 0.302408645 Watts

AB4OJ has a very good article on measuring RF power which can be found here.

Back to the amplifier circuit… keep in mind, this measurement was made with only 5Vdc feeding the drain of a single BS170.  The U3S PCB, like the QCX, has provisions to stack/parallel a total of three BS170 devices (you can do that with MOSFETS), to increase the output power by spreading the load.  If you want to know the deep details on how that works, read the numerous Class E amplifier design guides.

The QCX is rated at 5W output using three BS170 devices fed with 12Vdc on the drains and the gates driven hard with a 5V Peak to Peak TTL device (74ACT00) fed by/buffering a clock output from the si5351.

Given the differences in the two amplifier designs, I don’t expect to see 5W out of this one. However, my feeling is that adding/stacking two more BS170 devices and, increasing the drain voltage to 12 Vdc will hopefully provide an easy three watts output.  That of course, will be tempered by the, absolutely required, 7-element Chebyshev output filter.

One of the biggest obstacles of  using a DDS and a Class E amplifier, IMHO, is harmonic content!  However, most of the time it can be brought into compliance with a decent low pass filter.  At least that’s the thinking.

Only further real world testing will determine that, but I am optimistic.

Back to Basics

It’s no secret, to those who know me, that my first love of the hobby is building stuff.  OK, so I do really really like CW too, but…

One of my many projects is a dual conversion receiver.  Among the many options I’ve included in that effort is a 3-4 section crystal filter for the IF.  In order to do that correctly, ideally resulting in a decent performance receiver, I need to first match up some crystals.

Lacking a high tech solution, I’m resorting to the semi-high tech method of frequency counter with oscilloscope.  However, before I get to that point, I need to make something to permit the oscillation of said crystals, that I might actually be able to analyze them.

Enter the crystal test oscillator…

Xtal_Test_Schema

The circuit isn’t anything new and it’s linage is reported to hail from Wes Hayward’s book, Experimental Methods in RF Design. The original printing is quite expensive, if you can find it, but the reprint is more reasonably priced.  Eventually I might even get a copy for my library.  At the moment, however, I can buy a lot of project components for the current price of that book.

In any event, it is a ‘known good design’, as in it has actually been proven to work by many others, so this is what I went with.  The result of which is as follows…

Osc_n_Rocks

As can be seen, I am a fan of MeSquares construction, although I’ve considered switching to using the ‘island cutter’ method.  A bit more difficult to see, I used half of a higher quality (machined) DIP socket for quick plug and play of different crystals.

You might also notice that I lay out the majority of the parts  flat.  My personal opinion is that, albeit takes a bit more space, I have neither exposed component leads nor the worry of them being broken off in a drawer, save for perhaps the transistors.  I also find it much easier to solder and, place probes onto pads for taking measurements.  Again, just my opinion.

After completing the construction, I tested several crystals with the output connected to both  the oscilloscope and a frequency counter.  In addition to actually seeing the circuit operate, I also discovered that I had mislabeled a couple of crystals, as they did not oscillate as marked.  Basically, I screwed up when I pulled them out of an old 23 channel CB radio ( A wealth of crystals can be found in old CB radios).

One thing I did note, as can be seen in the  following oscilloscope traces, the oscillator as configure seems to get better output, as in more sinusoidal, when the crystal frequency is above about 9 MHz.  Perhaps I may have some bad 40M crystals, but certainly not all of them or,  perhaps I need to consider that C1 and C2 maybe need to be changed from 470pf to something in the area of 120pf.

That said, as ‘they say’, close enough for horseshoes and hand grenades!
7040k7040 KHz crystal output on the oscilloscope (about 2.0V peak to peak).

 

10240K10240 KHz crystal output on the oscilloscope (about 3.5V peak to peak)

Overall this circuit does what I need it to do.  It seems to cover a wide range of crystal frequencies and has more than enough output to easily drive, but not overload, my oscilloscope or frequency counter.

I have a box of 12000 KHz crystals purchased for the specific purpose of being used in several filters.  That is, after they get sorted out (matched).

The most important thing here, is that I am having fun!

Putty – RTFM?

As I do a LOT of remote and embedded programming, one of my favorite tools is the terminal emulator application known as Putty.  It is available for nearly every operating system in use today.

Putty1

Now I have used this application for years and never had to read a manual to do so.  Indeed, I had no idea a manual even existed until a couple of days ago.  However again, in defense of myself, I never needed to consult a ‘Putty manual’ until recently.

My problems stems from the degradation of my eyesight as I age and quite frankly, I despise reading glasses.  So I needed to be able to change the default font setting in the application.  I had figured out how to do it for the current session I was in, but not how to save the setting to a saved session.  Not horribly aggravating, but a PIA nonetheless.

Needing to consult the manual (RTFM), and given my preferred OS is Unix/Linux, I typed ‘man putty’ in a terminal window and was treated to page after page of stuff I really didn’t want to know.  Basically, it was ‘too much information’.  So I made up my mind I would figure it out on my own.  That might surprise some of you guys, a woman who doesn’t (always) read the manual.  I don’t ask for directions sometimes too. LOL!

Long story short, because I’m not really in a typing mood today…

After about 30 minutes of looking for the save button mentioned in what I did read in the manual, I discovered the ‘trick’.

PuttySession

You must first load a previously saved terminal session, but do not open it yet.

Then, select whatever parameter it is you wish to change, in my case the font and font size.  When you are in these parameter screens you will notice that there is neither a save or back button.  The only choices are ‘About’, ‘Open’, or ‘Close’. It appears you are stuck at this point, but fear not.

PuttyFont

Pressing the ‘Open’ button will open the session that was loaded as described above.  However, the changes you just made will not be saved to the session, hence my initial aggravation.

What you need to do after changing the desired parameters, is to click on the session selection at the top of the list.  This will display the Putty start screen with the previously loaded session still there.

PuttySession

Simply click the ‘Save’ button again.

The next time time you load that session, all of your terminal preferences will also be loaded!

Where The *** Am I? (Part 2b)

I’m back with the final installment of ‘Where The *** Am I?’, Calculating a Grid Square.

I’m assuming that you’ve read and understand the information in Part 1 and Part 2b.

For this example, I’ll continue to use the same coordinates as in the previous segments.

Latitude:      41.8820670
Longitude: -87.6278160

As with the previous examples in parts 1 and 2b, these coordinates should come back to the intersection of State and Madison in the heart of Chicago’s Loop.

There are six digits in a typical Grid Square location.  To be accurate, typical Grid Squares can be four or six digits in length.  Actually, a “grid square” can be comprised of the first two digits alone, but you might as well say somewhere really big on planet earth.  At best, here in ‘the vicinity’ of the United States, a two digit grid square might narrow your location down to somewhere in North America.

The grid resolution you choose to use depends on how detailed you wish to be regarding your location.  It is possible to actually drill down as deep as an 8 digit Grid Square,  even 10 theoretically.  That, however, is overkill for the vast majority of Amateur Radio operations.

Getting Started

The First Digit.

For our first digit, we simply take our Decimal Longitude and add 180 to it, then divided by 20.  If one is in the western hemisphere, longitude will be a negative number (i.e. preceded with a minus (-) sign.

-87.627816 plus 180 equals 92.32184               ( -87.627816 + 180 = 92.32184 )

Now, divide the result, 92.32184 by 20:

92.32184 divided by 20 equals 4.6186092    ( 92.3218400/20 = 4.6186092 )

The number to the left of the decimal point, 4, is the integer value of 4.6186092 derived in the previous step.  That integer, 4, is a place-holder value for our first Grid Square digit.  More on that in a bit.

OK great, but we’re not done yet! We need to derive another value  to be used later when we calculate our third Grid Square digit.

To obtain that value we must perform Modulo Division on 4.6186092, the value we obtained in the previous step.  Remember, however, the goal is to do this calculation manually.

So, to perform modulo division manually, we start by dropping the number to the left of the decimal point, 4, which we’ve already identified as the integer of 4.6186092.  This leaves us with 0.6186092, the leftover digits after the initial divide by 20 in the previous step.

Since we are not using a scientific calculator or spreadsheet with a Modulo function in this exercise we, again, do it manually.

Multiply 0.6186092, by the same divisor used to obtain  4.6186092.  We had divided 92.32184 by 20, so now we’ll multiply 0.6186092 by that same divisor, 20.

0.6186092 times 20 equals 12.327184      ( 0.6186092 * 20 = 12.327184 )

File that number, 12.327184, away for use later on in the process.

The Second Digit.

This process is identical to the first, except that we will be using our Decimal Latitude, adding 90 to that value, and then dividing that number by 10.

41.882067 plus 90 equals 131.882067                 ( 41.882067 + 90 = 131.882067 )

Now divide that result,  131.882067, by 10:

131.882067 divided by 10 equals 13.1882067     ( 131.882067/10 = 13.1882067 )

As with the first digit, the number to the left of the decimal point, 13, is the place-holder value for our Second Grid Square digit.

As with the first digit calculation, we’re not done yet, We again need another value to be used later to calculating our fourth Grid Square digit.

Just as we did in the first digit calculation, we must perform Modulo Division on 13.1882067, the value we obtained in the previous step.

So, we start by dropping the number to the left of the decimal point, 13, which we’ve already identified as the integer of 13.1882067.  This leaves us with 0.1882067, the leftover digits after the initial divide by 10 in the previous step.

We now multiply 0.1882067 by the same divisor used to obtain 13.1882067.  We divided 131.8820670 by 10, so now we’ll multiply 0.1882067 by that same divisor, 10.

0.1882067 times 10 equals 1.882067      ( 0.1882067 * 10 = 1.882067 )

File that number, 1.882067, away for use later on in the process.

The Third Digit.

This is where we start to use the secondary results derived during the calculations for the first two digits to obtain our third and fourth Grid Square digits

Start by taking the results of the Modulo Division (which we did manually) derived while calculating our first digit, 12.327184. In this process, we will start by dividing this value by 2.

12.327184 divided by 2 equals 6.186092          (  12.327184 /2 = 6.186092 )

As in previous calculations, we need the integer of 6.186092, which is the same as simply taking the number to the left of the decimal point, 6.  Not a place-holder, this is the actual value for third Grid Square digit.

However, as with the preceding processes, we’re not done yet. We again have to do some Modulo Division to later obtain, in this case, the fifth digit of our Grid Square.

Take the digits to the right of the decimal point, 0.186092, we use Modulo Division by multiplying this value by the original divisor in this section, 2.  This gives us a value to save for use later, 0.372184, as we calculate our fifth Grid Square Digit.

The Forth Digit.

Start by taking the results of the Modulo Division (which we did manually) derived while calculating our second Grid Square Digit, 1.882067.

In this process, there is really no need to go through the process of division, because anything divided by one is the same number. We do require the integer of 1.882067, which is, 1.  As with the third digit, it’s not a place-holder, this is the actual value for our Forth Grid Square digit, 1.

However, as with the preceding processes, we’re not done yet. We again have to do some Modulo Division to later obtain, in this case, the sixth digit of our Grid Square.

Take the digits to the right of the decimal point, 0.186092, we use Modulo Division by multiplying this value by the original divisor in this section, 1.  This gives us our value to save for later, 0.372184.

Now before we continue, it is important to note that we have all but completed 4 digit grid square which is a common/general locator.  To complete that, we need to map our place-holder values to alpha characters.  We do this by correlating the numerical values to letters of the alphabet or, as I jokingly refer to it, our ‘Little Orphan Annie Secret Decoder Ring’. Don’t worry if you don’t get the reference…

0 (zero) correlates to the letter “A”, 1 (one) to the letter “B”, 3 (three) to the letter “C”, and so on until we end up at 25 (twenty-five), which correlates to the letter “Z”

With that in mind, we convert digits one and two, 4 and 13, which become E and N.  Remember that digits three and four, 6 and 1, were not ‘place-holder’, but the actual digit.

Putting all four together in order, we get a Grid Square of EN61

This four digit grid square represents a geographical area of 20 degrees of longitude by 10 degrees of latitude. This particular grid, EN61, is depicted in the image below, taken from the website QTH Locator.

EN61

As can be seen in the image, this is a fairly large geographical area but is, nonetheless, a common reference in amateur radio communications.  When you are talking about HF  (High Frequency), a.k.a. ‘short wave’ propagation, this is enough in most cases to see how far your signal is traveling or, how far away another station is from your location.

We can, however, do better.  A four digit grid square can be further divided into twenty-four, 5 minute (0.083333 degrees) of longitude and Ten, 15 second (0.00416665 degrees) of latitude.

The  Fifth Digit.

Start by using the result of the Modulo Division (which we did manually) while calculating our Third Grid Square Digit, 0.372184.

We divide this value by 0.08333, representing five minutes of longitude.

0.372184 divided by 0.083333 equals 4.66225865
( 0.372184/0.083333 = 4.66225865 )

Taking the integer of 4.66225865, gives us, 4, which is  a ‘place-holder’ value for our fourth grid square digit.  If we run that past our previously discussed “decoder ring”, we get the letter, E.

Note: It is simply a coincidence of this example, that our first and forth grid square digits are the same.

The Sixth Digit.

Here we do the same as we did with the fifth digit, taking the result of our modulo division, except in this case, from the Forth Grid Square Digit calculations, 0.882067.

We divide this value by 0.0416665, representing 15 degrees of latitude.

0.882067 divided by 0.0416665 equals 21.16969268
( 0.882067/0.0416665 = 21.16869268 )

Taking the integer of 21.16969268, gives us, 21, which is  a ‘place-holder’ value for our forth grid square digit.  If we run that past our previously discussed “decoder ring”, we get the letter, V.

Putting it all together, we now have a 6 digit Grid Square: EN61EV.

Once again using the website QTHLocator, it can be easily seen that the new grid square covers a geographical area that is substantially smaller.

EN61EV

Generally speaking, a 6 digit Grid Square is about as tight of resolution as anyone typically goes.

That said, in researching this topic deeper, I discovered a paper written by Les Peters, N1SV, on calculating a forth pair, further reducing down the geographical area under the Maidenhead system.

Les explains the fourth pair this way:

‘Each field can be further subdivided into (10) 30 seconds (0.008333 degrees) longitudinal by (10) 15 seconds (0.004166) latitudinal zones. The first character encodes the longitude and the second encodes the latitude with numbers “0” through “9”.’

Source: Les Peters, N1SF…How to calculate your 8-digit grid square

The Seventh Digit.

To begin, we have to return to the fifth digit calculations. We need to process the leftover part of 4.466225865, the integer of which, 4, was our fifth digit.  Specifically, we need to process that number 0.466225865 by multiplying it by 0.008333, the original divisor from that same ste, (modulo division) gives us 0.38852

0.038852 divided by 0.008333 equals 4.662426497
( 0.038852/0.008333 = 4.662426497 )

Taking the integer of 4.662426497, we obtain our seventh Grid Square Digit, 4.

The Eighth Digit.

The process used in the seventh digit is repeated except that our leftover via modulo division is 0.007075, taken from the sixth digit calculations, and our divisor is 0.004166.

0.007075 divided by 0.004166 equals 1.697191551
( 0.007075/0.004166 = 1.697191551 )

Taking the integer of 1.697191551, we obtain our eighth Grid Square Digit, 1.

Putting it all together now results in an eight digit grid square of. EN61EV41.

To see the results of these extra digits, we must use a different mapping web site,  k7fry.com.

Plugging in the eight digit grid square, we can see the results in the following image.

EN61EV41

As can be seen, the total geographical area is once again reduced.  This time to a few square blocks.  Looking closely at the image, we can see that our original coordinates, which resolve to the intersection on State and Madison, located in Chicago’s ‘Loop’, are in fact located within this grid square.

Beyond the scope of this posting…

Astounding to me, I discovered through the use of the K7FRY website, a ten digit grid square is possible.   Unfortunately, I have been unable to find any clear documentation on the process,  other than it might be another iteration such as that used in calculating the seventh and eight digits.

However, the K7FRY website also featured a click on a location, and so it was possible to learn ones ninth and tenth grid square digits.  The results were interesting as can be seen in the following image.

EN61EVPG

The geographical area has gone from several square blocks, to perhaps something less than a couple of hundred square feet.  This would, in many cases, permit one person to actually see another, even in a crowded urban setting such as the Chicago Loop.

To be sure, I don’t know anyone who uses an eight, let alone a ten, digit grid square.  It is, nonetheless, interesting to know it is possible and, how to obtain them with a little basic math. Well, eight digits at least.

That’s it! If I have screwed up somewhere with the math, please let me know.

Until next topic…

 

 

 

Where The *** Am I? (Part 2a)

I am aware that, in the previous post, I stated the actual calculation of a Grid Square would be next.  However, that was before it dawned on me that there is a bit of odd math involved in that process and, my intention is to explain the process without advanced tools.

As such, an explanation of one particular process is in order… Modulo Division.

These days, even a crappy spreadsheet application provides a formula for Modulo Division or simply, Mod.  Typically, a spreadsheet formula takes the form of ‘=mod(number, divisor)’.  Many (not all) modern scientific calculators also provide a ‘Mod’ function.

Example:

Modulo division of 7 divided by 3:

Entering ‘=mod(7,3)’ into a spreadsheet cell, returns a value of 1.

This is because with Modulo Division, in this example, the result of the Modulo division of 7 by 3 results in a value of  1.  Visualize it this way, if I have 7 sticks and I can only remove sticks in groups of 3, I can do that 2 times before there will be one stick left over.  Essentially, that is Modulo Division, we only care about the remaining stick (OK, sorry for the first grade math example).

As previously noted, Modulo Division can be done with a push of a button because that, is the magic a spreadsheet or advanced calculator provides.  However, what if you don’t have such tools? Where, did that 1 come from?

Manually dividing 7 by 3, or entering that equation into a regular calculator, should result in a value of 2.333333333.  The number to the right of the decimal point ‘.333333333’ is the the leftover piece, the decimal fraction of dividing one number by another that doesn’t result in a whole number

So, that decimal fraction doesn’t much look like ‘1’, does it?  How do we resolve that?

The first thing we want to do is to remove the whole number value, the integer piece, of the result of dividing 7 by 3, which again, is 2.333333333.  We do this by simply dropping the number to the left of the decimal point, the ‘2’, which is the integer value, resulting from dividing 7  by 3.  This leaves us with 0.333333333.

Now, we take that 0.333333333 and multiply it by our original divisor, ‘3’.

0.333333333 * 3 = … wait for it… ‘1’.  How about that?!

Congratulations!  You just performed Modulo Division!

As always, try it out. Use different values, etc… and have fun.

Keep this process in mind for the next post, because performing Modulo Division is required to calculate a Grid Square!

Where The *** Am I? (Part 1)

Well here I am in a new location!

One of the first things I want to know in general (no pun intended), and as an amateur radio operator, is ‘where am I?’  Obviously I know where I am in the same manner as most people do… Address, City, State, etc…   But for radio work, it’s a bit more involved.

Among many other aspects of the Amateur Radio hobby, one of my favorites is VHF CW/SSB work.  That’s Morse code and Single Side Band on Very High Frequencies (VHF) to the uninitiated.  By VHF CW/SSB, I am referring to such operations in the lower segments of the 6 Meter (50-54 MHz) and the 2 Meter (144-148 MHz) bands.

Note: If the above description doesn’t help clarify things, perhaps I’ll  write a blog on ‘radio modes and frequencies’ at some later date. Or, you can simply Google those terms! LOL!  (Seriously, Google will provide answers and I despise being redundant).

Moving On…

In VHF CW/SSB operations, one of the primary location identifiers exchanged during contacts with other amateurs is a ‘Grid Square’, technically referred to as the ‘Maidenhead Locator System’.   To be sure, these days one can actually just go to a variety of websites where you simply click on your location and you are magically be provided with your latitude and longitude as well as your ‘grid square’.

As a programmer, hobbyist, indeed as an engineer by profession, I like to know the math behind the magic when clicking on a map or simply plugging numbers into a calculator.  I am not apposed to using ‘tools’, but I’ve always been of the mindset that one should be able to perform a process manually before becoming dependent on ‘automation’, e.g. the aforementioned tools.

So I went looking for said math and found several articles written by other who clearly assumed that the reader was completely following their thought process without them providing the ‘fine details’.  The frustration in the lack of those ‘fine details’ will become quite evident in part2.

It was initially quite frustrating. However, after reading multiple articles multiple times and selectively picking through the coherent sections, I finally derived the missing pieces… in a nutshell, I ‘figured it out’.

Oddly enough, once one figures out the missing details in the respective articles, it actually is easy.  Indeed, this may very well be why other authors glossed over these ‘fine details’.

I hope not to do that here.

This is Part 1 of my own attempt at explaining the math of coordinate conversion…

The first thing required to get started is a latitude and longitude in decimal format.  I will once again point out that the results from any of the following processes can be had with a mouse click using a variety of online mapping sites.  However…

While I still can use a 7.5 minute quadrangle and a ‘jiffy stick’ (a ruler like stencil calibrated in minutes and seconds to derive latitude and longitude from USGS topographical maps), these days I usually derive my decimal latitude and longitude directly from a GPS receiver. However, it isn’t a problem if your coordinate data is in DMS (Degrees Minutes and Seconds) off a map or other reference, as conversion is easy and so I’ll start there.

Degrees Minutes and Seconds (DMS) to Decimal

Example Location:
Latitude: 41 Degrees 52 Minutes and 55.4016 seconds
Longitude: 87 Degrees 37 Minutes and 40.1376 seconds

Latitude:

Leave degrees as is, 41
Divide minutes by 60,  (52/60 = 0.866666667)
Divide seconds by 3600, (55.4016/3600 = 0.015389333)
Then add 41 + 0.8866666667 + 0.015389333 =  41.882056 (Decimal Latitude)

Longitude:

Leave degrees as is 87
Divide your minutes by 60, (37/60 = 0.61666667)
Divide your seconds by 3600, (40.1376/3600 = 0.011149333)
Then add 87 + 0.616666667 + 0.011149333 =  87.627816 (Decimal Longitude)

To check your math, plug those values into Google Maps, be sure to put a minus (-) sign in front of the longitude if you are in the western hemisphere.  If you did it correct, these example coordinates should display as the intersection of State and Madison in the heart of the Chicago Loop.

Another way to check your math is to simply run the process in reverse by respectively multiplying the resultant values derived in each step of the previous conversion process, i.e. multiply the decimal seconds by 3600 and the decimal minutes by 60.

0.015389333 * 3600 = 55.4016 (DMS Latitude Seconds)
0.866666667 * 60 = 52 (DMS Latitude Minutes)
41 (DMS Latitude Degrees)

End Result: 41 Degrees 52 Minutes 55.4016 Seconds, right where we started!
Simply repeat the process to convert the Longitude back to decimal.

All of this was ‘the easy stuff’!

BTW, I highly recommend doing all of this in a spreadsheet (paper or electronic).  No, it’s not a necessity, but it does help maintain and keep track of the calculated values in each step of the process, because they will be called upon from time to time, making it easier to observe and understand what is going on and, to be able to repeat the process.

Try it with your own coordinates and see how this works!

Decimal to DMS (Degrees Minutes Seconds)

Despite most of the math behind the end process of calculating a Grid Square being performed using decimal coordinates, lets explore the relatively easy task of converting Decimal coordinates to Degrees Minutes and Second (DMS).

For this example and, to make things easier to check progress, I’ll use the same coordinates as the previous example.

Decimal Latitude:    41.882067
Decimal Longitude: 87.627816

As with the previous conversion, there is no need to do anything with the degree, other than separating it from the remaining values by stating it to be an integer, which we will henceforth refer to as ‘DD’

In this example:
DD = the integer of 41.882067
Therefore: Integer (41.882067) = 41 = ‘D’

i.e. int(41.882067) = 41

Now that we have DD and D, we can derive our minutes ‘M’

M equals the integer of (DD minus D) times 60.
Therefore: Integer ((41.882967 minus 41) times 60) = 52 = ‘M’

i.e. int((41.882967-41)*60) = 52

Finally, with M calculated, we can derive the last value, our seconds ‘S’

S equals (DD minus D minus M divided by 60) times 3600
Therefore: (41.882067 minus 41 minus 52 divided by 60) times 3600 = 55.4412 = ‘S’

i.e. (41.882067-41-52/60)*3600 = 55.4412

Our end result for latitude is 41 Degrees, 52 Minutes and 55.4412 Seconds.
Note: this result is slightly different in the seconds calculation (post decimal point). That said, once you get past a tenth of a second, it’s almost irrelevant.  Unless of course your intention is to put a missile through a keyhole. Indeed, if you use just the first decimal point (i.e. 55.4) on the seconds, you still end up in the same spot as the decimal degree.

OK. so much for Decimal to DMS and DMS to Decimal. As with the first conversion, play with it, check your results and then have fun with it!

In Part 2 I will get into the heart of the matter, deriving a 6 digit Grid Square from coordinates.