Thursday, April 25, 2019

Power from the wind

     In recent years you may have noticed a lot of talk about the use of wind turbines to generate electricity.  It has even been in the news recently that President Donald Trump believes the “noise” from wind turbines causes cancer. It is not the first time government officials have used scare tactics to stop the use of renewable energy resources, but that’s not really the topic of this week’s article. There is a lot more history behind the use of wind energy than you might believe.
People have been harnessing the power of the wind since around 1000 B.C. The oldest and first known use of wind power was in sailing ships. This led to the development of the earliest sail-type windmills. The first windmills were used to grind, or mill, grains, thus the name windmill. The earliest known wind mills were built in Persia around 500 A.D.; they were used to process grains and pump water. The early windmills were vertical access designs, meaning they rotated parallel to the ground. 
     In the 1300’s some of the first windmills begin to appear in Europe; these were the earliest horizontal access windmills. No one really knows why there was a sudden shift from vertical to horizontal access windmill designs. It probably has a lot to do with the fact that the wind can only strike half the blades of the vertical windmill result in half the power transferred from the wind, rather than being able to strike all the blades on a horizontal design.
     The horizontal mills did add complexity to the design as they required gearing mechanisms to transfer the horizontal rotation of the main shaft into the vertical rotation needed for turning the mill stones. The early mills used the gear mechanisms from horizontal water wheel driven mills. The Dutch were the first to offer new designs from the early post mills to tower mills. The primary difference between the post mills and the tower mills were the additional floors, with equipment powered by the post style mill atop the tower. The top floor of the tower mill could be rotated manually to make the blades face the wind, and the speed of the mill could be controlled by adjusting the angle of the blades in the wind. The sails were removable to protect the mill from strong winds during the stormy season, and the windsmith usually resided in the mill itself.
     Over the course of about 500 years, these mills were incrementally improved, dramatically increasing their efficiency. By the time this process was complete, these early mills from the 1870s had most of the features of modern wind turbines. These mills were the “electric motors” of pre-industrial Europe. The applications of the windmills ranged from water well pumps; irrigation and drainage systems; grinding grain; sawing timber; processing spices, cocoa, paints, dyes, and tobacco; and even operating sewing machines. In the early 1900s, large steam engines began to replace the windmills.
     During the next 120 years, between 1850 and 1970, over six million mostly small (one horsepower or less) mechanical output windmills were installed in the U.S. alone. These were primarily used across the Midwest to pump water from wells and ponds for watering livestock. The larger mills were used to pump water into towers for early steam trains, which provided the primary source of commercial transportation in areas where there were no large rivers. The first windmills to generate electricity began appearing around 1850, nearly 50-years after the invention of the electric light.
     The first commercial wind-farm to generate electricity was built in Cleveland, Ohio, in 1888 by Charles F. Brush. It was a post mill with a multi-blade “picket-fence” rotor that was 56 feet in diameter and featured a large “tail” that was used to turn the rotor out of the wind. It was the first known windmill to use a gearbox to increase the rotational speed of the mill to the 500 RPMs needed to properly turn the generator. The mill was in operation for 20-years and produced 12 kilowatts of power. It was not nearly as efficient as newer turbine designs of equal size that are capable of producing 70 kilowatts, but it goes to show that wind power is not the new kid on the block.

Thursday, April 18, 2019

Rock, Paper, Scissors

     This week we will begin a very short series in programming and let you get started with your new Raspberry Pi, that is if you found last week’s article of any interest. First of all if you do not have a Raspberry Pi, don’t worry, you can skip the first steps and just use any computer you have available for the actual programming part.
     If you want a very detailed, step-by-step process for setting up your Raspberry Pi, head over to http://projects.raspberrypi.org  and look for setting up your Raspberry Pi. There are all kinds of projects on that site to keep you busy for a very long time, but I want to make sure you are able to get started without a computer. This will require a MicroSD Card of at least 6GB in size. A MicroSD card is the little card you can get just about anywhere that is usually used to store photos and video on your phone or camera. You will also need access to a computer to download an image to the SD card. If you don’t have a computer, or access to one, you can order an SD card with Raspbian pre-installed from Amazon. Hopefully you have a TV or computer monitor with an HDMI port, an HDMI cable, and a MicroUSB phone charger. Most TV’s with an HDMI port also have a USB port that actually supplies enough power to run the Raspberry Pi, so you should not need a power supply.
     You can get Raspbian, or any other of several different operating systems for the Pi by downloading a utility called NOOBS from http://www.raspberrypi.org/downloads you will then want to format your SD card using an SD card formatter that you download from https://www.sdcard.org/downloads/formatter_4/index.html. Then unzip the NOOBS archive to your SD card. Next, you will need to connect everything to your Raspberry Pi and turn it on. The photo shows where to connect everything. Connect the power cord last, and if things go well, you will see a red light in the top left corner of your Pi. As it starts up, also called booting, you will see raspberries appear across the top of the screen. The steps are fairly straightforward following prompts on the screen and after a few minutes of software downloads, the Raspbian desktop will appear. It looks very similar to a Windows computer desktop except that the menu is at the top of the screen.
If you made it this far, congratulations, you have a working computer. If you plan to use a different computer for the rest of the steps, you will need to install python 3 on your computer following the instructions at http://www.python.org. The Raspbian Operating System has python installed by default so you are ready to begin learning to program as soon as it successfully boots. You can also use an online version of python for learning at http://trinket.io, which allows you to write and test python code from the internet without installing anything.
     For this week’s project we are going to write a simple game of Rock, Paper Scissors and play against your computer. The rules are simple, just like playing the game against another person. Both you and the computer pick rock, paper, or scissors and the winner is decided by the following rules. Rock breaks the scissors, so rock wins. Paper covers the rock, so paper wins. Scissors cut the paper, so scissors wins.  It might sound hard to get a computer to play a simple game, but it isn’t that difficult, and I’m sure you can do it.
     First you will need to teach the computer to pick rock, paper, or scissors randomly. For this you will need to get a random value. Python has a library called random that does just what we need, but to use a library you have to import it. Only type the stuff between the quotes, not the quotes themselves. Using a single line of computer code: “from random import randint”.
We will let the player go first, which might not seem fair, but I promise the computer does not know what you pick when it picks, unless of course you allow it to cheat. Letting the computer always pick the winning move is a more advanced step you can add. To let the player pick we have to let the computer read what we type. This is done using the following line of code: “player=input(‘rock (r), paper (p), or scissors (s)?’)
     Next just to make sure the computer read it, we will print what the player types: “print(player, ‘ vs ’)”.
     Now for the computer’s turn, it only understands numbers for now so it will pick one, two or three: “chosen = randint(1,3)”. 
     We teach it what the numbers mean using a choice function called “if”; for if to work, python depends on spaces so this will be a sets of two lines, the second one starts with two spaces, “if chosen == 1:” and “  computer = ‘r’”. We then only want to check to see if the computer picked two if it did not pick one, so we use a command called “else if” which gets shortened to elif.  “elif chosen == 2:” and “  computer = ‘p’”. Finally we know that if it was not one or two it must be three so we just use “else” in the next two lines: “else:” and “  computer = ‘s’”.
     Now we can print what the computer chose: “print(computer)”. You can now run your code and decided for yourself who won. It takes 14 more lines of code, using nothing more than you already learned to let the computer tell you who won. To make it a little easier to follow I will show you the whole program.  You can download the sample code from our website at https://www.thelickingnews.com/p/code-samples.html.
from random import randint
player = input(‘rock (r), paper (p) or scissors (s)?’)
print (player, ‘vs’)
chosen = randint(1,3)
if chosen == 1:
  computer = ‘r’
elif chosen == 2:
  computer=’p’
else:
  computer=’s’
print (computer)
if player == computer:
  print(‘DRAW!’)
elif player == ‘r’ and computer == ‘s’:
  print(‘Player wins!’)
elif player == ‘r’ and computer == ‘p’:
  print(‘Computer wins!’)
elif player == ‘p’ and computer == ‘r’:
  print(‘Player wins!’)
elif player == ‘p’ and computer == ‘s’:
  print(‘Computer wins!’)
elif player == ‘s’ and computer == ‘r’:
  print(‘Computer wins!’)
elif player == ‘s’ and computer == ‘p’:
  print(‘Player wins!’)

Thursday, April 11, 2019

Flexible and Affordable Computers

     Have you always wanted a computer to learn programming, surf the internet, check e-mail, or just for fun, but can’t find the extra money? In this week’s Tech Talk I will introduce you to an affordable computer that anyone with a flat screen TV can afford. It is called a Raspberry Pi and can be found online for as little as $35.
Raspberry Pi single board computer from the 
Raspberry Pi Foundation.
     I know what you are thinking: a $35 computer can’t be that great. I personally own three of them and they work great for small everyday things, like checking your e-mail online, watching You-tube videos, viewing most websites and even word-processing. It makes a great media center device connected to your TV for watching videos and listening to online music and radio.
     First let me give you a little background on the Raspberry Pi Foundation. The foundation was formed in the UK as a charity that focused on educating people in computing and creating easier access to computers primarily for educational purposes. In 2012, the foundation launched the first version of the Raspberry Pi for $35 and found very quickly that they could not keep up with the demand. They have partnered now with several manufacturers and can do production runs of 4,000 computers a day.
     They are now in production with the latest model 3 which is roughly four times more powerful than the original system, and they have a goal of keeping the price the same, at $35 or less for every new release.  They even have the Raspberry Pi Zero which is only $5. I would say they achieved their goal as people all over the world use the Raspberry Pi to learn programming, build projects, do home automation, and even for use with industrial applications.
     The nicest feature of the Raspberry Pi is the integrated GPIO (general purpose input/output) pins and controller that let you connect and control external electronic components. This is not possible with your laptop or PC without spending several hundred dollars for additional equipment. One other thing to note is that all the software that runs on the Raspberry Pi is free.
     The Raspberry Pi 3 B+ is a single board computer system with an ARM Cortex-A53 1.4GHz processor, 1GB of memory, 300Mbps wired network connection, WiFi controller and Bluetooth. It runs the Raspbian operating system based off of the popular Debian Linux Operating system.
Over the next several weeks I will cover some Raspberry Pi projects and give you ideas on how you can learn computing with the Raspberry Pi. If you want to follow along and complete the projects, I will provide a list of things you need for the next week. For next week, you will need a Raspberry Pi, with a power supply, keyboard, mouse, HDMI cable and a TV with an HDMI port. If you have questions about what you need, you can come by The Licking Publisher@TheLickingNews.com.
News Office or email me at
     Next week’s lesson can also be done on your computer. Just download from Python.org the Python 3.7 software and follow along as I teach you how to get started with some basics of computer programming using Python. I must give a word of warning about the column over the next weeks. Programming can become very addictive; once you learn how to control the computer, you may never want to stop.  Computers, even inexpensive ones like the Raspberry Pi, can do some pretty amazing things. With a little instruction and practice, you might create the next best thing in technology.

Thursday, April 4, 2019

Impacts of the Global Positioning System


     The Global Positioning System (GPS), in operation since January 6, 1980, was designed to broadcast date and satellite identification information used to determine the position of the receiver on the ground. The position of the receiver is extrapolated from the timestamp of the received signal from each of satellites that are within view of the receiver. Once the receiver knows its exact distance from at least four satellites, it can use geometry to determine its location on earth in three dimensions. As you can see, the time stamp of the signal from the satellite provides critical information for determining your location.
By United States Government
A GPS Block IIR(M) satellite.
     There is a reason an article about GPS, which many of us use regularly, is necessary at this time. In the original design of the system, a week number was included as part of the time stamp to reduce the size of the information packet from the satellite. This was done to improve the overall performance of the system. The week number was set up as a 10-bit binary number, forcing it to roll over back to zero at the end of 1,024 weeks. This happened the first time on Aug. 21, 1999, and there was minimal impact to the system. This roll-over will happen again on April 6, 2019.
     Most of the GPS receiver manufacturers understand what the roll-over means and have software verification code in place to insure that the date remains correct and the equipment can operate without issues. However, if equipment is not running a proper version of the software when the week rolls over on April 6, unpatched GPS receivers will roll back in time to August 21, 1999. This is not expected to be a problem for newer GPS receivers, but older units may experience very unexpected behavior.
     You might be wondering what the impact of a failed time stamp roll-over would be. There is a slight possibility of major impacts to the electrical grid as a result of the inaccurate time information coming from the satellites. How does GPS affect our stationary electric grid? It may seem odd, but the grid depends heavily on GPS for time synchronization of all the control systems in order to keep all the critical components of the system in sync. Currently these systems rely entirely on the timestamp signals from the GPS system that identifies the current week and second within the week. The signal is then converted to a proper date by the receiver. 
     Essentially what is going to happen on April 6 is a reset that will cause the satellites to send a signal of week 0, which is the week beginning August 21, 1999, instead of Week 1025, April 6, 2019. The receivers are responsible for making the adjustment. The electric grid uses these time signals as part of the Phasor Measurement Units and the North American Electric Reliablity Corporations’ (NERC) requirements use these Syncophasers, along with the GPS systems to get real-time snapshots of grid performance to adjust the power levels at the power plants in real-time to create a more stable electric grid. These changes in technology have greatly increased the chances of the GPS rollover event impacting our electric grid.
     Operators of these mission critical systems have been notified of the forth-coming event and been given guidelines to circumvent any problems. Notifications were sent January 25 to all power companies, airline industries, and other critical use industries.
     If you have an older model GPS receiver, now is the time to call your manufacturer and find out if you need to perform a software update, or you might just travel back in time to 1999 on Saturday.