As a dedicated fantasy hockey sports fan, I try to get an edge on the competition by analyzing player performance statistics for my initial draft and player trades during the season. This often involves sorting or ranking players in scoring categories (e.g. goals, assists …). It turns out that there are several ways of sorting and some may be more applicable than others for judging performance statistics. For example, suppose we’re ranking goals in a league where 10 players have each scored 5 goals. A simple sort may order these players in ranks from 21 – 30. Even though 10 players score the same performance statistic (5 goals) their ranks can differ by 10 places. Not only that but typically a sort operation is non-deterministic i.e. the same 10 players can be ranked in any order, all between 21 – 30. One way to resolve ties (draws) is to assign an average rank (i.e. 25.5) for all 10 players. Rank averaging maintains “sum-of-ranks” which is important for a defined sample size and fairer when comparing to other statistics, in my opinion. A rank averaging method is commonly used in Yahoo Fantasy Hockey and other fantasy sports.

I looked far and wide on the Internet for a computer algorithm to automate average ranks. Unable to find a suitable routine, I made my own. Using the Perl programming language I show how to sort a performance category and calculate the average ranks. No doubt a more elegant solution exists but at least mine works.

The annotated Perl script below should explain the average rank problem. It takes an unsorted hash of player scoring data and outputs a hash with an average rank for each player. The script’s print output shows the (complicated) averaging steps in action. I’ve tested this on sets of ~900 players and it works perfectly. Some lines of code below are truncated, be careful with copy-and-paste.

It is my contention that a team composed of the top ranked players in each position would win any league. But in a head-to-head match-up, there may exist combinations of players that could win 6 of 10 scoring categories and thus the match. I’m not a statistician and can’t prove it, but you’re welcome to educate me.

A procedure for tuning Standing Wave Ratio (SWR) of a simple dipole antenna, by trimming wire length, is presented here with empirical data. This is a follow-up to a previous post about design and construction of an off-center fed dipole antenna for the HF Amateur Ham radio bands. ocf-hf-dipole-antenna-diy

Antenna Analyzer

To aid the tuning process I acquired a RigExpert AA-54 Antenna Analyzer. This instrument can easily log Freq, R, X data, over a USB cable, using the AntScope product application software. Then CSV formatted data is imported into an Excel spreadsheet for VSWR calculation and plotting.

Trim Length

SWR tuning is performed by snipping short lengths of antenna wire, at the farthest ends, in order to raise the resonant frequency to within a desired frequency range. Fortunately there is a simple, accurate, formula to calculate the trim lengths. Consider:

c = L1 * F1 = L0 * F0

Where c is the speed of light, F is Frequency and L is Wavelength, 0 subscript is the initial and 1 is the target case. Using some algebra we derive Trim_Length:

Trim_Length = L0 – L1 = L0 * ( F1 – F0) / F1

For example, raising the resonant frequency of a 65 ft. dipole from 7.0 to 7.3 MHz:

Trim_Length = 65 ft. * (7.3 – 7.0) / 7.3 = 2.67 ft.

For this case, where the antenna is fed in a 1/3, 2/3 off center ratio, the trim lengths at each end are respectively:

short_side_trim = 2.67 ft. / 3 = 0.89 ft.

long_side_trim = 2 * 2.67 ft. / 3 = 1.78 ft.

Trim Results

I’m somewhat risk averse because shortening wires is easier than lengthening them. Optimizing performance on several bands can be tricky so I trim the wires in small increments, and measure the results across the relevant bands at each step.

The plot below shows the SWR performance across the entire frequency range for the AA-54 Analyzer (i.e. 0-54MHz). Note the original length “1st” and trim lengths of -6, -15 and -17 inches

Local SWR minimums are noted at the 40m, 20m, 15m and 10m bands. Local minimums are observed around 43 and 50 MHz as well. 43 MHz is not usable for Amateur operators and 50MHz (6m) is somewhat marginal and not interesting to me now.

Focusing on the 40m band, the effect of trimming can be measured at each step. Each incremental trim raised the resonant frequency and after trimming 17 inches, SWR ranges from 1.4:1 to 1.8:1 across the 40m band (7.0 – 7.3 MHz) (yellow).

Similar results are shown for the 20m band. After 21 inches trimming VSWR is a nearly ideal (1.4:1) across the entire band. Considering the effect of trimming on other bands I stopped trimming here. 21 inches is somewhat less than the predicted 2.67 ft. (32″) but close enough for practical purposes.

A Z-normalized Smith Chart below shows the impedance across a range of frequencies in the 40m and 20m bands. Black markers are at mid band. The lowest SWR, nearest the center, for both bands, is found at about twelve-o’clock in the chart.

A circle of constant 2:1 SWR is shown in red.

SWR vs. Reflected Power

The motivation for trimming dipole wires is to match the antenna’s impedance to the transmitter output impedance, in this case 50 ohms real resistance. When matched, the reflected wave is minimized and power radiated by the antenna is maximized. So how low a SWR is good enough? Below is a plot of SWR versus reflected power.

As shown, a 3:1 SWR reflects 25% power, 2:1 SWR reflect about 11% and 1.5:1 reflects just 4%. Therefore a 2:1 SWR or better is generally regarded as “tuned”.

Conclusion

An Antenna Analyzer was a useful tool for measuring complex impedance across a wide range of frequencies (outside amateur bands). With this data, VSWR was calculated and a strategy formulated to improve performance.

I discovered a new usable amateur band on 15m. This bonus band was not anticipated in the original design. In fact I have made several QSOs throughout the USA using this band.

As initially constructed, the length-measured antenna wires were close to the design goal but SWR improved substantially after trimming.

As a ham radio enthusiast, I take great pride in designing, building and testing my own antennas. I’m not an expert but I’ve had success at VHF, UHF frequencies and I wanted to try longer range communications possible on HF bands. A full blown HF tower 60 ft. in the air is not practical at my humble suburban abode. Nevertheless, a row of trees in the backyard provided space to explore the capabilities of a homemade antenna.

The antenna described here is commonly known as a Half-Wave Off Center Fed (OCF) Dipole or it’s cousin the Windom antenna. It is designed to resonate on a fundamental frequency and its even harmonics, in this case the 40, 20 and 10m amateur radio HF bands. The form is similar to other dipole antennas i.e. long wires suspended horizontally with a balanced electrical feed. Except for the ferrite toroid cores, all the components are commonly available at your local hardware store.

Design

Referring to my ARRL Amateur Radio Handbook, for #14 insulated Cu wire, a half-wave length for 40m (7MHz) was 68 feet according to the formula below.

Length[ft.] = 468/(Vf * Freq) = 468/(0.98*7) = 68 ft.

where Vf is velocity factor (0.98 here) and Freq = Frequency in MHz

I determined that erecting a horizontal 68 ft. antenna was feasible in my backyard. There is much debate about feedpoint location but I chose 2 nominal segment lengths of 23 and 46 feet for a 1/3 to 2/3 split. A major compromise to performance would be that the maximum height of the antenna is limited to about 20ft. as shown in diagram below,

Indeed 3 resonant frequencies are shown, the fundamental, 2nd and 4th harmonics. While SWR is not perfectly 1:1 at all 3 frequencies I took the EZNEC results as a 1st order guide. The real physical antenna would be optimized on-site by manual pruning. This situation illustrates the purpose of an Antenna Tuner but alas, not in my budget.

More EZNEC results are shown below. Max. field angle is about 19 degrees, pretty close to 15 degrees, considered ideal.

Elevation radiation pattern

The Azimuth radiation pattern is not perfectly circular but much more omni-directional than a dipole in free space. I suspect part of the omni-directionality is due to the vertical vector components of the inverted-V configuration.

Azimuth radiation pattern

Guanella 4:1 Dual Core Current Balun

The balun transforms the 50 Ohm coax feedline impedance to 200 Ohm at the dipole offset feed point. It also transforms the unbalanced coax to a balanced feed. This 4:1 current balun is implemented using 2 pcs. 1.4×2.4″ ferrite cores of type 61 material. This is the most expensive component of the antenna. Using these large size ferrite cores and #14 Cu wire give the antenna a transmit power capability of 1.5KW I estimate. This is the legal limit for any Amateur broadcaster. The circuit diagram is shown below.

4:1 guanella current balun

Note that the copper wire windings are in opposite directions for transformer 1-2-3-4 versus 5-6-7-8. Fourteen windings were used for each. Using different colored insulated wire helps avoid winding mistakes.

Guanella toroid core transformers

Assembly

Below is a brief Bill of Materials:

ferrite toroid core, 2 pcs. P/N FT-240-61, ebay.com $20 each

SO-239 bulkhead mount female UHF connector, 1 piece, ebay.com, $2

100ft. #14 stranded THHN insulated copper wire, Home Depot, $22

Plastic electrical utility box, 1 piece, Home Depot, $12

Strain relief hardware, 2 sets, Home Deport, $4

Miscellaneous 8-32 eye-hook hardware, $5, Home Depot

Total cost: $85

Antenna Components

Assembly is very straight forward. I used a long table and tape measure to measure wire lengths. A magic marker was used to mark-off each foot with longer marks for each 10 ft. and a double mark for the theoretical ideal length. An extra 1 ft. was added for strain relief and 1 or 2 ft. for length margin. Two wire ends are soldered to tabs and connect to separate through-hole assemblies.

Simple drilled PVC pipe Antenna End Cap

Testing/Results

After erecting the antenna and connecting to my transmitter, I characterized SWR values using the built-in meter by sweeping amateur frequencies across 3 bands. Typical values are shown below. To my delight SWR range was reasonably low across all three bands.

SWR Plot for 40, 20, 10m Amateur Frequencies

Again, SWR being slightly high and variable is a good reason to use an Antenna Tuner. But this minor mismatch is good enough for my transmitter. I wish I could characterize SWR over a wider frequency range, but something like a VNA or Antenna Analyzer is way beyond my means.

I am able to hear SSB voice stations from Alaska to Costa Rica to Hawaii to Pennsylvania and make voice contacts about 2,000 miles away. Low-power digital modes (e.g.FT8, JT65) using just 30W of power yielded QSOs as far as 5,000 miles distance.

Conclusion

Due to physical area constraints at my home I was trapped in VHF/UHF world for too long. But I found a way to construct this HF antenna and have enjoyed continent-wide communications ever since.

Although this antenna’s performance is highly compromised at my site, it was still one of the most successful and gratifying amateur radio projects I’ve completed. With no antenna analysis capability, I had faith that employing good design and construction technique would get me close and that would be good enough. If you’ve been holding off getting on the HF bands because building a grand ideal antenna is not feasible or too expensive, I encourage you to try such a low cost solution .

Being a dedicated nerd, I’m always fascinated by Proportional Integral Derivative (PID) process control. So when a local farmer asked me to automate a vegetable canning process, I took it as a challenge to physically realize a PID temperature control device. Of course many fine industrial controllers already exist, say from Omega, but I’d already done that so I strived to do it smaller, cheaper. The Arduino product line provides inexpensive hardware for the home Maker. Also, the Arduino development environment is easy to install and remarkably easy to use. For this reason, I decided to build an Arduino PID Temperature Control unit.

PID Temperature Sampling

About PID
The PID process control method is well researched and commonly applied in modern industry. PID mathematics can be complicated, but (within limits) PID can compensate for thermal resistance and thermal capacitance in a system for precise temperature control. Ideal PID temperature control assumes both a heating and cooling source (with same linear thermal forcing gain). This can be difficult to achieve practically due to different heat/cool technologies. Under-sampling temperature frequently will also increase errors. There are many ways to go wrong. Even when operating correctly, wild oscillations in temperature are possible. Nevertheless PID control can be adapted to many situations.

Many PID controllers claim to autotune the Kp, Ki, Kd PID coefficients to achieve optimal performance. But I suspect these methods are often home-grown and apply only to a narrow set of conditions. PID mathematics is very complicated. Fortunately there are practical manual methods and online simulations to aid in setting these important PID parameters.

For this controller, the PID proportional output uses Pulse Width Modulation(PWM) on 2 pins. Often PWM is used to create a (time-averaged) variable DC voltage, but here the digital signal duty-cycle modulates a SSR power cycle. One pin outputs the plus(+) and a second pin the minus(-) PID output. The PWM resolution for this microcontroller is 8 bits (0-255 values) for each pin.

Program Features
Using the LCD Keypad Display it would be possible to control every function but this is beyond the project’s scope. So the best way to experiment is through the Arduino IDE environment.

PID output range has units of degrees per sample period . It’s very important to set min/max PID limits for actual physical temperature forcing capability. For example, in a heat-only system the negative PID output is theoretically zero, or perhaps slightly negative (-2 degrees/minute maybe) for an ambient cooling system.

An over/under temperature Alarm is programmed to terminate execution immediately if min/max temperature limits are exceeded.

If either +/- PID output limit is reached an error is displayed on the LCD screen. While not fatal, this should be a clue that K coefficients may need adjusting.

The Arduino Serial Monitor tool displays PID data in progress

Commenting one line of code switches between PID simulation and live operation

SSR and PWM Problem
A Solid State Relay (SSR) is capable of switching on/off a 120V heavy load. But, like electromechanical relays, the switching speed is slow. Because common, low-cost SSRs use a TRIAC Thyrister element, the power is not actually switched until the voltage phase of AC power crosses zero. The zero-crossing effect is shown in graphic below.

zero-crossing timing diagram

At a frequency of 60Hz the maximum delay is 1/2 cycle or 8.33ms. Considering that our PWM duty-cycle ranges from 0-255, a single bit of resolution at 8.33ms would imply a full range PWM switching period of 256 * 8.33ms = 2.133 sec. By selecting a PWM switching frequency, the control resolution is determined because the SSR only responds to higher order bits. See table below.

60Hz PWM Table

Because the ATmega328P master clock operates at 16MHz and the maximum TIMER2 divisor is 1024, the minimum PWM sampling frequency is ~30Hz yielding 4 levels of resolution control. However if we further divide the ATmega328P master clock frequency by 8, then PWM frequency is 3.75Hz with 5 bit (32 level resolution) is achieved.

Considering many practical applications, a sampling rate of ~4Hz with 5 bit resolution was an acceptable trade-off. Implementing both TIMER2 pre-scalar 1024 and master clock divisor 8 is required to reach a PWM frequency of 16MHz/(1024*256*8*2) = 3.83 Hz. The master clock was divided in software with the clock_prescale_set(clock_div_8); instruction which of course has a similar affect on the delay(); instruction and delay values must be divided proportionally. The Arduino standard PID_v1 library was also edited for the same reason and a modified PID_v1R library is included in zip archive link below.

Testing
To debug and validate this design an Arduino Nano and breadboard was used with 2 LEDs, SSR and 60W incandescent light bulb. It was easy to see the LEDs flash at a slow rate (PWM cycle time) and the LED brightness change (PWM duty-cycle). The definitive test was using an SSR to switch a 120V resistive load (60W light bulb) and to my joy, flashing and variable brightness was observed. This was the extent of testing.

Arduino Nano Test Platform

Discussion
This was a satisfying project because I learned a lot about PID and made a practical PID temperature control unit for very cheap ($20). Almost all the Arduino I/O pins are used and SSR-PWM problems were overcome to a reasonable degree. Adding a menu structure to edit run-time variables from the existing keypad would approach the functionality of a real commercial unit. Adding timer functions could create temperature profiles and recipes(EEPROM). Some practical applications might include a Rice Cooker, Slow Cooker, alcohol fermentation. Some day I’m going to turn the PID problem around and make a device that senses meat temperature and indicates the remaining cooking time. Mom’s Thanksgiving turkey will be cooked perfectly every time.

Today I completed my MongoDB C100DBA database administration certificate exam. This proctored exam is taken remotely online through Examity. The exam session duration was 90 minutes which consisted of 60 multiple choice and all-that-apply questions. The way I study is to condense a summary of my knowledge into a single document. Just the act of writing coherent paragraphs about a subject aids in my memory and understanding. For this purpose I prepared MongoDB_C100DBA_Exam_Study_Guide

This study guide expands on topics referenced in MongoDB’s own C100DBA study guide, and the MongoDB online documentation. My exam was related to database v3.2. I passed my exam and my certificate license is #295-0761-259.

In my opinion, the exam is rather difficult, requiring deeper knowledge and practical experience than what is nominally presented in M102, M202 online courses. Of course the good student will expand on these introductory courses and establish a working platform to explore the syntax, properties and exceptions of CRUD, indexes, replication, sharding, administration etc. of various possible test cases.

This guide is especially recommended for M102 students to find condensed detail notes and documentation links on this subject.

For the DIY Amateur Radio enthusiast, few things in life are as satisfying as designing, building and testing your own homemade radio antenna. A 2 meter J pole antenna, constructed of 1/2″ copper tubing, is easy and cheap to make and almost guarantees practical success. With simple modifications, and careful SWR measurements, I was able to improve my j pole antenna swr performance.

Jpole Design

Many online web sites provide help on designing a 2 meter J-pole antenna and almost all designs are very close in configuration and dimensions (see References) which yield confidence for success. The 10 foot copper length of 1/2″ tubing and plumbing fittings cost $25 at the Home Depot store. The SO-239 connector was obtained from a local Surplus Electronics store for $3.50. For cutting the Cu tubing lengths, I marked a wooden “Story Stick” for possible reproductions. Using propane torch, solder flux and solder, the antenna with connector was assembled.

Connector, SO-239

My new antenna seemed to work fine. But, in spite of my best accurate construction techniques, when I tested the assembled antenna, the SWR was too high (>3) at the 148 MHz end of the 2m band. So I decided to modify the main pole and j-pole tips with adjustable screws. Turning the screws tunes the effective electrical length.

Brass 6×32 Tuning Screw

To my delight I found that adjusting the screws would control the SWR, at least within a small range, I turned the screws to tune for the lowest SWR in the middle of the 2m band range (146 MHz). My modified antenna works very well Tx and Rx. The improved SWR profile (shown below) is attributed to screw modification and careful SWR tuning. I was satisfied with the screw modifications.

I grew up with a boy’s natural curiosity about Firearms. Considering to purchase Firearms, I searched for a way to compare and contrast ballistic characteristics from the wide variety of calibers available. Once I began to shoot, I wanted to sight a gun for accuracy. At last I found a complete computer rifle ballistics calculator program (technically, G1 projectiles). Not only was this program adaptable to a personal computer but it was developed by a career U.S. military ballistics researcher. Furthermore the calculation method relies on empirical results rather than heavy theoretical considerations often associated with fluid dynamics. After programming these routines I referenced manufacturer’s ammunition ballistic data and found a high degree of correlation with bullet velocity at range. This gave me confidence to develop a general ballistic application. I created the following webpage to graphically show ballistic results.

To use the webpage, the user begins by entering a name for their rifle load, then enters several initial ballistic quantities related to their ammunition (muzzle velocity, bullet weight, bullet ballistic coefficient), their firearm (scope/sight height) and environmental conditions (temperature, altitude). The user can also compare their load to one or more common firearm calibers.

One of the more difficult required entry quantities is the bullet ballistic coefficient. This coefficient is a measure of the bullet’s ability to resist the de-accelerating forces of air resistance. Physically, ballistic coefficient is related to bullet diameter, shape (cross section) and mass (weight). The larger the coefficient value, the longer/farther the bullet retains its velocity and energy. Ammunition manufacturers often publish this value and these values can be found online. Typically any caliber ammunition can be loaded with a variety of bullet types and coefficients, so careful selection is required. If a bullet coefficient cannot be found, the coefficient can be calculated using the link below. Enter 2 velocity, range data pairs from the manufacturer’s data. The most most accurate results can be obtained by measuring bullet velocity at 2 ranges using a chronometer.

Ballistics Output

After clicking the “Fire” button, several graphs display the ballistic results (Trajectory, Kinetic Energy, Velocity and Time of Flight). As always, the trajectory of the bullet is exactly on target at the range specified by user input. An example plot is shown below.

Trajectory Plot for 3 common Calibers

Also on this page is a link to a custom target created from the user’s input data. An example target is shown below.

Custom Sighting Target

This target is in PDF format and can be printed on normal 8.5×11″ paper. To sight a rifle, mount the target at 100 yds. distance and aim for the center circle. The horizontal arrows indicate the impact point at various ranges. Adjust your sights in order to impact the line at the desired range. In other words if you want the bullet to be on-target at 200 yds. aim for the center and adjust your sights until the bullet impacts to 200 yd. horizontal line (slightly above the 100 yd. line). The horizontal range of the arrows shows the +/-3″ accuracy at each corresponding range.

After upgrading my Amateur Radio license class from General to Amateur Extra, I contemplated applying for a Vanity Callsign. But what Callsigns were available to me? For amateur radio operators, Callsigns are as personal as names and I wanted something special. After searching online I couldn’t find a website or webpage that really showed, in a concise manner, available Callsigns. So, I created the webpage noted by the link below.

The main table is arranged by license class, format, region code that helps the user find appropriate Callsigns fast. Of course competition for the most exclusive Callsigns is fierce but you may want a Vanity Callsign that reflects your name, or your Amateur Radio Club name or location. Refer to the FCC (Federal Communications Commission) website for Vanity Callsign eligibility and application process. For example, an Amateur Extra class license holder is eligible for just about any available Callsign without regard to region or other license classes. The ARRL (Amateur Radio Relay League) website offers a concise explanation regarding Vanity Callsigns.

Here, available Callsigns are sourced from publicly-available data at the FCC. It is automatically updated every week (Sunday midnight). So the best time to reference new data is every Monday morning. The FCC website allows you query information about the status of particular Callsigns. According to FCC regulation 97.19(2), cancelled callsigns are available 2 years after the cancellation date. This is often different from the official expired date displayed at the FCC license search. Use the available_date shown here to find your callsign. Only callsigns existing within the FCC’s ULS are shown here. Many callsigns are yet to be assigned, or sequential gaps exist. Verify callsign availability at the FCC website. Submit an online or written application and fee.

As a HAM Radio enthusiast I like to think I can design, build and evaluate RF Antennas. To help me calibrate my SWR meter I decided to build a VHF 50 ohm dummy load. Naturally, an ideal dummy load is purely resistive (no reactive component).

I visited my local Electronics Surplus Store to purchase a 50 Ohm, thin film Beryllium Oxide (BeO) resistive load. Ceramic wire-wound resistors were cheaper but they react more like RF inductors. In general, BeO loads are rated for 3-20GHz and 5-200W, but of course we must never exceed the max rated temperature, 100C (?), so a Heatsink is required. My surplus shop also sold an SO-239 panel mount connector. This is a common VHF/UHF (0-300MHz) connector used in radio communications. Resistor, connector and heatsink component cost was about $15.

Front View note: SO-239 Connector

The heatsink is resourced from an SSR (Solid State Relay). SSRs are rated for 40W continuous. Be careful. Watch the temperature! A nearby fan may marginally cool. A flexible thermal pad is installed between resistor body and heatsink for better thermal contact.