Wednesday, November 26, 2014

Lite Em UP! Setting up for a Totally Tubular Winter Ham Radio Experimentation

I'm building a single tube MOPA. Yes, the same one I seem to almost build every year. :-)
This year, however, I have a plan! When you have a plan, you can win!


The tube is a 10DE7, a higher heater voltage tube version of the 6DE7.
The circuit is a Crystal controlled Colpitts Oscillator. The only reason I'm doing this as a Xtal Colpitts is because I want my first foray into the world of tube design to be easy. I've built somebody else's tube Colpitts (The NoGA Twin Tube 80), so I figure that this will be a matter of scaling the design to the tube. Next I'll try a PTO Hartley. I've got the brass screw and nylon tube to wind a coil on for that!
I will handle this project in three phases:

1. design power supply. This tube has an interesting heater voltage requirement, so I have to solve that lil problem first. Also, need something that will give me around 300vdc for B+. I'm thinking voltage doubling circuit at first, just to see if I can do it. I'd use the same back to back radioshack 12.3v transformers to isolate the AC and then double the result. that should get me around 330v. I can drop voltage with a resistor if necessary. I want to QRV, not optimize right now.

2. Design the Oscillator and make it oscillate. I want to design the circuit in such a fashion that the compenents are accesable, but not dangerous. I'll socket the crystal somehow, and make sure all B+ voltages stay tucked away, shielded from wandering and little fingers. I want the board layout to be identical to the schematic layout, so I can understand how things are working, and I can tinker with values at will.

3. Design and build the final stage, including a way to remotely switch between receive and transmit. If I've done my calculating correctly, I should be able to get 3-4 watts out. High hopes? Yes. But we will do it as we are able.

Once QRV with this radio, I'll work on a receiver, probably something DC, and involving that Hartley oscillator. It will glow in the dark too, and will be used primarily with this transmitter.

Like I said, that's the plan!

Sunday, September 28, 2014

More Late Night Ruby Fun

Late Friday/Early Saturday morning, after the wife and kids found solace in sleep, I sat awake in a fevered pitch to patch my laptops and ruby install. I had to install the bash exploit patch, because security!

I also had to take a good stab at compiling the ruby TK library that comes with it.
No luck there though.

I had an adventure when I updated Ruby to Ruby 2.1.3. Basically, I deleted my whole ruby installation and recompiled from source. This left me with no ruby gems. Fortunately, because of my previous late night ruby thinking session, I had a list of gems. It's a slightly dated list, I'd installed the rubyXL gem a couple of night ago, but it is a good start.
I've automated gem installation before, using a simple script to install the gems from a list. I decided to create a couple of stand alone methods and a short script to 1. Create a list of gems currently installed on the system. 2. Install the list of gems (while determining if a gem has already been installed). 3. Determine if any gems in the list I have are missing without installing any new gems.

Objective 1 was easily accomplished. I took my one-liner from the other night and broke it down into a method using a "do... end" block.

I chose to do the method this way because I believe it makes the method more readable. Plus, the rest of the methods in the file are multiline by necessity and it echoes their format.

Objective 2 provided more of a challenge. The original script I wrote installed all the gems listed whether they were already installed or not. Sometimes one gem depends on another for installation, so it gets installed before a gem further up the list. You can still "install" the gem, even if it's already been installed as a dependency, but this adds to the time the script takes to execute. I decided that if I had already installed a gem, whether as a dependency or as part of a previous installation, then I didn't want to reinstall it.

That was a good enough place to stop for the night.
Some cautionary notes:
I'm doing this on Ubuntu 14.04, and you'll see a sudo in there. A unix purist might say that it would be better to su to the superuser and execute without the sudo. I got no problem with that. Understand what you are doing when you use sudo. I execute this script because I wrote it and I know what it says. Don' t do nothin' with sudo you don't understand. That's how things get borked fast.

Also, I don't check for the existence of the gemlist.txt file. I haven't needed that functionality so I haven't created it.

Last night when I got home from work, I watched a little tv while doing laundry,  and then remembered that I'd left my little script here hanging. I still needed a way to check and see if a gem was in the gemlist.txt file.

The hardest part about writing this script was figuring out how to get two arrays created and then subtracting them. For some reason split wasn't behaving as expected. I chalk it up to general tiredness.

At the bottom of this file, I stitched my methods together using an if else ladder.

Everything works!
I know that choice #2 isn't really doing what it says it does. If a gem is already installed on the system, but not in the gemlist file, then it's not on both lists, and it's not installed, nor is it placed in the gemlist file.

Also, I'm sure that there's a better way to do the menu. Perhaps using a hash or something.
One thing this file won't do is install gems that aren't in your install path. Currently I have one gem installed that's built from the gemspec in the gem itself.
One way around this would be to store the gemlist in a csv file or perhaps a spreadsheet, and carry the installation path in there.
Right now though, the file is useful.
I've saved it as a gist on github.

Maybe you can find it useful too!

Sunday, September 21, 2014

"Way to Commit Soldier!"

I'm not a soldier, but that is one of the funnier lines in Madagascar 3.

The pertinent quote begins about 35 seconds in, but this whole scene is what I would call "high comedy".

I do however, want to commit, especially when it comes to committing more code that is. For 13 of the last 14 days, I've made at least one commit to projects I'm working on under Github. I want better programming skills. I believe that the best way to become a better programmer is to read code every day, and write code every day. Sometimes, the code I write isn't very complicated. Saturday I restructured the way I had some test steps written in a code library that will serve as the math problem generation engine for an application I'm developing for my kids. It wasn't very complicated, didn't change the world, but my habits were shaped into a design where such a refactor becomes automatic in the next code library. Other projects I've been working on are an effort to track student reading habits that reports out to a spreadsheet, and a ruby gem that serves as a wrapper for the EBird API.
I'm practicing and learning several different things at once. In my own code libraries, I'm practicing how to develop using the  "Red, Green, Refactor" methodology of cucumber and RSpec. I'm also learning how to write tests that make sense for code libraries that already exist, and I'm learning how to upgrade a library with the latest implementation of that library's methods and objects.
In short, I'm having fun, lots of challenging fun. It's the sort of fun that leads to more and better opportunities for employment and personal development. Committing every day reminds me of what I love about programming, each solution to a program is a unique implementation of patterns, and I love those patterns. It's like the rotunda in Beethoven's works, not the same, but the same is there when he gets around to it. The Bible says in Ecclesiastes chapter 5:

  18 Behold, what I have seen to be good and fitting is to eat and drink and find enjoyment in all the toil with which one toils under the sun the few days of his life that God has given him, for this is his lot.  19 Everyone also to whom God has given wealth and possessions and power to enjoy them, and to accept his lot and rejoice in his toil—this is the gift of God.
 I hope your work helps you find enjoyment. I know what little bit of programming I do at work helps me enjoy my job. I know it encourages me to seek out further skill so I can advance and enjoy it even more. Committing code every day shows me the enjoyment of my toil, and I believe there's nothing better you can do than enjoy whatever it is you are doing.

Saturday, September 6, 2014

Some Quick Late Night Ruby Fun

I should be asleep, but I'm not. Instead I'm up hacking around with ruby, taking some online classes, and generally having a good time.
In an effort to train myself in one discipline, I'm taking some online classes for ruby/ruby on rails/webdevelopment.

The kids and wife have all gone to bed, so I went through a course level about the ActiveSupport library, and started playing around in IRB with what I had learned. Eventually I found myself exercising one of my favorite ruby "koans" : writing a list of the gems I have installed on my computer into a text file. In the past I wrote this as a script that I would execute shortly before system updates or new ruby builds, so I can quickly install the ruby gems I use.

One of the things I've always wanted to do is "get it on one line" of ruby code. I started by executing the following in irb:

`gem list`

The backticks around gem list tell the interpreter "Go to your native environment (bash in this case) and execute the command gem list". The result is  a list of gems, including all the current versions installed, listed like so:

"twitter (5.11.0, 5.10.0, 5.9.0)\ntzinfo (1.2.2, 1.2.1, 1.1.0)\nuglifier (2.5.3, 2.5.1, 2.5.0)\nwatchr (0.7)\nxpath (2.0.0)\nyajl-ruby (1.2.1)\nzip (2.0.2)\n"

That's cool, but I don't necessarily need to know the versions. So the next step was to remove the versions from gems. I needed a regex and gsub to do that.

`gem list`.gsub(/\s[(].*[)]/, "")

this means, "Give me a string where we substitute everything in between two sets of parentheses including the parentheses and the space in front of the opening parenthesis, with an empty string."
That gave me something that looked like:


This gave me a single string of the list of gems installed. I then rediscovered how to open a file and properly write to the file. Several iterations of using do blocks later, I decide to go ahead and use the script below to write the file all in one line:"gemlist.txt", "w") {|file| file.write `gem list`.gsub(/\s[(].*[)]/, "")}
Now when I use a text editor to view gemlist.txt I see this:


And more importantly, I can use ruby to parse the file, and reload the gems I need to reinstall next time I build ruby!

The end!

Saturday, August 23, 2014

Potentially Problematic Plants

True Story:
As a young confident college freshman, I made my first genuinely certifiably stupid mistake with plant identification. Pride was my downfall. I thought that since I'd studied nature from an early age, been a card carrying member of the Audubon Society since I was 9, that I was pretty well qualified to know what was what when it came to plants.

Yeah, not so much.

Turns out that the central Florida region  where I was going to college, sits on the border between subtropical and temperate climates. This means there is a staggering variety of plants. Plus, many times, plants themselves have a wide variety of appearances, for instance; check out all the different ways that "Virginia Snakeroot" can present itself in FL. I find it hard to believe that all of these plants are from the same species, but then again, don't we show the same sort of variety within the human species? Also you have look alike plants that are not related. Some more than others, especially when it comes to things like say, for instance, castor beans and marijuana.

There I was, innocent, trusting, confident and eager to prove myself, on the way back to my apartment from a shopping trip in St Cloud, when I caught a glimpse of a plant out of the corner of my eye: was that weed?
Murrrrwana, Mary Jane,  Cush, Endo, the Wacky Tobacky.
Growing on the side of the road.
So I thought.
I pulled off the side on highway 192 and backed up. I must confess, I don't have much experience with Cannabis, never have used the stuff, never grown it, and I generally avoid people who do. Rule #1 in my life is "Don't invite The Man into your life", and one of the quickest ways to invite the man into your life is to smoke something The Man says "Don't smoke".
I called the Osceola county sheriff non emergency line and they sent someone right over. I waited on the embankment where the Florida Turnpike crosses over highway 192. The deputy arrived, and I said "I think this is weed"
She says to me "It's not, it's castor bean"
Well that was embarrassing. 
Since then I've learned the clear difference between weed and castor bean.
Any time I find myself wondering, "what is it?" I immediately remember this incident from my college years, and the lesson I learned, take time to know what you see.
Recently, in my own back yard, I had a bit of identification drama while preparing the yard for mowing. Two of my children know the Stinging Nettle plant from experience, and along the back fence a plant grows, and it has a very suspicious appearance.
Don't get me wrong, I'm a big fan of Urtica species, they are among the most useful and tasty plants to have around, I just wanted to make sure the kids knew what was what and where. I picked the grass and weeds from around the plant, being careful not to touch, then took a picture:
Note Stem hairs and on leave

top of the plant

over all plant structure.
The only picture I have of a local Urtica is very blurry, I didn't have the Canon to shoot it with so I used the potato camera on the phone. At the time, I had a kid who was crying because it stung her, so I just pointed, clicked, and then began first aid.

I decided that the best way to id this plant was to go ahead and let it sting me. After brushing against it, it was clear, no sting, no pain at all. What else could it be?
I picked the leaf and crushed it up, no noticable smell, but the closest thing I've seen that doesn't sting is lantana. I picked off a woody part of the plant, and aha! there's that lantana smell!
So it is lantana, probably planted by a mockingbird.

Sunday, June 22, 2014

On That Night

On the night He was betrayed, Jesus ate with His Disciples.
On the night He was betrayed, He washed their feet.
He talked to them.
He scared them.
After giving them the cup and the loaf, he spoke some more to them.
John says that he told them very specifically the reason why they had no reason for fear:
John 16:33 I have said these things to you, that in me you may have peace. In the world you will have tribulation. But take heart; I have overcome the world.
He didn't tell them He was going away to cause them fear, He told them because He went to prepare a place for them. He didn't tell them that they would scatter at His arrest because He wanted to shame them. He wanted them to understand, Jesus came to do God's will, and God's will would be done. In the world we certainly have trouble.
Sin traps us.
We forget who we are.
People let us down.
We walk through the world, and sometimes it seems we are unforgivable because of what we've seen or done.
Sometimes it seems like the world wins every time evil wins. 
Take heart. Jesus overcomes this world, and through this gathering together to partake of the meal He gave us, we remind ourselves that Jesus always overcomes the world.

Tuesday, June 3, 2014

Definately Spartan, but a Sprint?

managed to QRV on 20m for the June Spartan Sprint.
I can hardly believe it!


Working nights is a pain for a lot of reasons, there's stress of not being home when my kids are  home, the stress of not being available for social activities, no time for radio when everyone else is doing things like sprints, or nets. There's stuff during the day too, and I do QRV when I can, but there's not the Spartan Sprints, or NAQCC sprints. There's pluses too, like how I don't have to send my kids to daycare, and the pay is good, and the company I work for is a good company to work for, I'm just looking for the sweetspot where I can have my cake, and eat it too.

Enough bellyaching, let's talk SP!

I took a lot of gear for this operation, too much really, I wanted to use my St Louis Vertical, and when I got to work, I realized that I was missing the jumper that goes from my tuner to my radio. Fortunately, I brought a couple of end fed antennas, and since I wanted to try 20m (20 had been good to me during the WPX contest at night), I decided to put up the homebrew end fed for 20m.
Setup went well, and baring any production issues, I eagerly awaited an opportunity to clock out for "electric lunch".

Close to 21:30 local time (01:30 UTC) I realized that production issues would prevent me from taking a full lunch, but that I needed a break, so I took 10 minutes to go outside for an "electric coffee break". I turned the SW-20 on, spun the dial, and best guessed where 14.060 is. I've got it pretty well pegged on this radio, and it wasn't long before I heard one VERY STRONG signal on 14MHz. It was W3KC, in MD running 5w! The end fed was mostly oriented on a slant, with the bottom end in the North West, and the top end in the South East. The far end was bent over a tree branch, so I don't know how I managed it, other than the antenna was mostly straight, ran to a fairly decent height, and had about a 30 degree pitch or so.
That was the only contact I managed. I did hear some TX station, WA5??? but couldn't grab him, QRN is fierce in the work parking lot.
I went back inside happy to make one QSO.
GB Hoyt