Wednesday, June 19, 2024

Hitachi Employing Artificial Intelligence Since 2015 | AI/ML in the Wild

- Science Fiction has become a Business Fact

Hitachi has been generating work orders using artificial intelligence and machine learning since at least 2015, according to an article from Hitachi's website. The press release refers to this system as an example of human and AI cooperation and they claim to be able to demonstrate an 8% efficiency improvement.

"...artificial intelligence technology … provides appropriate work orders based on an understanding of demand fluctuation and on-site kaizen activity derived from big data..."

The technology described by Hitachi and the manner in which the company employs this exciting new resource is reminiscent of the Machines explored within one of Isaac Asimov's short stories, The Evitable Conflict from the "I, Robot" collection. 

If you have not read the "I, Robot" collection, consider checking it out. In particular, the last two stories may grant some insight into the economic use cases for intelligent machines.

In the final story, four powerful systems, known simply as the Machines, manage all world resources, economies, and labor. Feel free to comment below if you can see any potential problems with that idea. Asimov's story is a great read and it highlights the potential dangers of implementing such a system. Remember, always, that Artificial Intelligence, like Soylent Green, is people.

While it is interesting to witness the rapid evolution that this technology has experienced in recent times, it can become especially enlightening to take a peak into the recent past and see where it has already been put to gainful use. 

Where will we go from here?

Use the resources below to check out the Hitachi article and then read the short story.😉

RESOURCES


Sunday, June 9, 2024

Linux on Windows with WSL | How to Install

PROBLEM

A long time Windows user needs to run linux applications and development tools. The user does not wish to dual boot and must retain the ability to run Windows as their "daily driver" to ensure compatibility with customer and/or employer needs. Traditional virtual machines are also not an option for this user because of performance concerns.


RESOLUTION

Install Windows Subsystem for Linux! This is a feature of Microsoft Windows 10 & 11 that allows developers to run a Linux environment without needing a separate virtual machine and without exposing themselves to the possible risks of dual booting. 

PREREQUISITES

Note: the author was using Windows 11 21H2 (Build 22000.2538) at the time of this writing.

  • Windows 10
    version 2004 and higher (Build 19041 and higher)
  • Windows 11
    all versions

PROCEDURE

STEP 1: Start Windows PowerShell with Administrator privileges.

STEP 2: Execute "wsl -l -v" to list the version and status of any installed WSL2 Linux distributions. 

NOTE: there may appear to be a Windows Subsystem for Linux distribution installed if you are already a user of Docker Desktop for Windows. If this is the case you might be able to run WSL and get a linux command prompt, but it will not be a full distribution.

Even if "docker-desktop" or something like it appears in the list of installed distributions (see sample output below), a full linux distribution will need to be installed.

PS C:\Users\Dj> wsl -l -v
  NAME                   STATE           VERSION
  docker-desktop         Stopped         2
  docker-desktop-data    Stopped         2

STEP 3: With the latest Windows releases, it is possible to configure your Windows machine using a single command. Use the following command to instruct Windows to install WSL2 with Ubuntu (by default).

PS C:\Users\Dj> wsl --install

STEP 4: Execute "wsl -l -v" to show the status of the installed WSL2 linux distributions.  

PS C:\Users\Dj> wsl -l -v
  NAME                   STATE           VERSION
* Ubuntu                 Stopped         2
  docker-desktop         Stopped         2
  docker-desktop-data    Stopped         2

STEP 5: Ubuntu should now be ready to run on your Windows machine. This is not a virtual machine in the traditional sense. This virtual machine is not emulated by Windows. The linux kernel executes alongside Windows and is a "true" machine that has full, yet properly partitioned, access to system hardware.

NOTE: Some users that already have Docker Desktop installed may need to specify Ubuntu as the distribution of choice. In this situation, the "-d" option must be used to indicate the desired distribution.

Execute "wsl --list --online" (or, more simply, "wsl -l -o") to see a list of available distributions.

PS C:\Users\Dj> wsl --list --online
The following is a list of valid distributions that can be installed.
Install using 'wsl.exe --install <Distro>'.

NAME                                   FRIENDLY NAME
Ubuntu                                 Ubuntu
Debian                                 Debian GNU/Linux
kali-linux                             Kali Linux Rolling
Ubuntu-18.04                           Ubuntu 18.04 LTS
Ubuntu-20.04                           Ubuntu 20.04 LTS
Ubuntu-22.04                           Ubuntu 22.04 LTS
Ubuntu-24.04                           Ubuntu 24.04 LTS
OracleLinux_7_9                        Oracle Linux 7.9
OracleLinux_8_7                        Oracle Linux 8.7
OracleLinux_9_1                        Oracle Linux 9.1
openSUSE-Leap-15.5                     openSUSE Leap 15.5
...

Execute "wsl --install -d Ubuntu-24.04" to instruct Windows to install the latest LTS version of Ubuntu under WSL.

PS C:\Users\Dj> wsl --install -d Ubuntu-24.04

STEP 6: After the installation has completed, try out the distribution by typing "wsl" at the PowerShell command prompt.

PS C:\Users\Dj> wsl
dj@KC7ZXY-5950X:/mnt/c/Users/Dj$ cd ~
dj@KC7ZXY-5950X:~$

TIP: For more efficient use of WSL, explore "Windows Terminal" from the Windows Store. It was developed as a replacement for Windows Console and it has a lot more power behind it. It can be configured to run Windows command shells, PowerShell prompts, and any of the installed WSL/Linux distributions in "real" terminals, simultaneously, side-by-side, in multi-tabbed windows.

 Everything, everywhere, all-at-once!


STEP 7:
 Execute "wsl -l -v" again to show the status of the installed WSL2 Linux distributions. Now you should see that Ubuntu is in a Running state.

PS C:\Users\Dj> wsl -l -v
  NAME                   STATE           VERSION
* Ubuntu                 Running         2
  docker-desktop         Stopped         2
  docker-desktop-data    Stopped         2
  kali-linux             Stopped         2

SPECIAL BONUS: When installing GUI applications within one of your linux distros, the application will show up as a Windows application within the normal Windows menus and the Taskbar.

STEP 8: If you have reached this point and were able to execute the wsl commands and get the Linux kernel running, grab another cup and enjoy the rest of the day!


CONCLUSION

While it is preferrable when a full desktop or laptop computer can be dedicated to a barebones installation of linux, the partnership between Microsoft and Canonical has produced something with WSL (and WSL2) that, quite frankly, astounds me. I have found it so useful to have WSL2 allowing both Ubuntu and Kali running alongside Windows (and each other!) that it is difficult to imagine operating any other way.

Command List:

wsl -l -v
wsl --install
wsl --list --online
wsl -l -o
wsl --install -d Ubuntu-24.04
wsl
cd ~
sudo apt install gimp
gimp

Helpful Resources:


Sunday, May 26, 2024

Unresponsive WSL2 Linux Kernel Binary | How to Safely Restart

PROBLEM 

WSL2 service can become unresponsive after Microsoft Windows 11 version 21H2 recovers from a system sleep. This problem persists across warm and cold restarts.

SYMPTOMS

  • No response from Linux applications running under Win11 version 21H2.
  • No response when using wsl commands under Windows PowerShell. 
  • The VmmemWSL process appears to be consuming all spare CPU cycles. 
  • Docker Containers appear frozen, hung, or crashed. 
  • Linux Subsystem machines appear frozen, hung, or crashed. 
  • WSL2 service appears frozen, hung, or crashed.

RESOLUTION

STEP 1: Start Windows PowerShell with Administrator privileges.

STEP 2: Execute "wsl -l -v" to show the status of the installed WSL2 Linux distributions. 

Note: if WSL2 is completely unresponsive, this command will appear to stall indefinitely. If this happens, then the use of 'taskkill' in step 3 should address the problem by killing the WSL2 service and allowing a new shell to be launched. 

Restart the Administrator PowerShell and skip to STEP 3 if the following command does not respond within a few seconds.

PS C:\Users\Dj> wsl -l -v
  NAME                   STATE           VERSION
* Ubuntu                 Running         2
  docker-desktop         Stopped         2
  docker-desktop-data    Stopped         2
  kali-linux             Running         2

STEP 3: Execute "taskkill" as shown below to stop the WSL2 Service.

PS C:\Users\Dj> taskkill /F /im wslservice.exe
SUCCESS: The process "wslservice.exe" with PID 17856 has been terminated. 

STEP 4: Execute "wsl -l -v" to show the status of the installed WSL2 Linux distributions. If the WSL2 service was stopped successfully as a result of the previous step, the wsl commands should now become responsive. 

PS C:\Users\Dj> wsl -l -v
  NAME                   STATE           VERSION
* Ubuntu                 Stopped         2
  docker-desktop         Stopped         2
  docker-desktop-data    Stopped         2
  kali-linux             Stopped         2

STEP 5: Test the WSL2 Service by launching a Linux shell using your preferred method. For a quick check, simply execute "wsl" from the Windows PowerShell prompt and you should find yourself at the prompt of your default Linux distribution. 

PS C:\Users\Dj> wsl
dj@KC7ZXY-5950X:/mnt/c/Users/Dj$

STEP 6: Exit out of the Linux shell, and then execute "wsl -l -v" back at the Windows PowerShell prompt, as shown below, to list the status of the installed WSL2 Linux distributions.

dj@KC7ZXY-5950X:/mnt/c/Users/Dj$ exit
logout

PS C:\Users\Dj> wsl -l -v
  NAME                   STATE           VERSION
* Ubuntu                 Running         2
  docker-desktop         Stopped         2
  docker-desktop-data    Stopped         2
  kali-linux             Stopped         2

STEP 7: If you have reached this point and were able to execute the wsl commands and get the Linux kernel running again, breathe easy and relax. …then grab another coffee (or any other favorite beverage) and go do all the things!

CONCLUSION

While the root cause is not yet known to me, the WSL2 service can become unresponsive after the system recovers from a system sleep. Using the tools provided within Windows PowerShell, the status of the Linux binaries can be inspected and the WSL2 service can be restarted when necessary. 

Sunday, September 1, 2013

Basic Stamp BOE Based Robotics Platform

This is an older autonomous robotics platform that I was experimenting with more than a few years ago. Some people may recognize it as being based on the Parallax BOE-BOT or "Board of Education" robot. That observation will prove correct. The BOE-BOT can be a wonderful platform on which to turn your ideas into real-life robotics experiments.

I thought it would be fun to dig up some of the old photos and videos of this project so that I could document the experiment and share it with others.

Starting with the Parallax "Board of Education" (BOE) development board, I learned to integrate the Basic Stamp microcontroller with various sensors and servos. Once I felt comfortable working with these devices, I purchased the standard Parallax BOE-BOT chassis and supporting hardware. To this I added a sonar module to measure distance toward obstacles, a standard servo to rotate the sonar module, two continuous rotation servos to be used for locomotion, a digital compass, an accelerometer, a piezo speaker, and Parallax Inc's LCD AppMod module w/ integrated buttons, and a nice set of tank tracks.

Later, a Parallax PING))) Sensor was added and allowed the use of sonar for distance and ranging measurements. The PING))) Sensor can be identified by the fact that it resembles a set of "robot eyes" not unlike the classic "Johnny Five" from the movie "Short Circuit". I guess it also somewhat resembles the eyes of the more recently famous "Wall-E" robot. Either way, it is not there for decorative purposes. The module is actually extremely useful for navigating a room.

Take a look at the video on the left to watch the sonar sensor sweeping across its forward field of view to determine the distance to nearby objects.

In the past, I have experimented with Infrared (IR) sensors and have had much success. In fact, I still use them today. However, like many things, IR sensors have their shortcomings where ambient light and surface reflectivity are concerned and this lead me to decide on using sonar for this particular project. There are ways to mitigate the problems with IR but I've found that using ultrasonic emitters and detectors is a better solution for most applications. Others may find the opposite to be true. As is often said, "Your mileage may vary."

In the photo on the right, you can see a handy user interface module which provides a liquid crystal display (LCD) and four tactile push-buttons. This was one of the later additions which greatly enhanced the debug/testing process as well as made the robot much more user friendly for public demonstrations.
The entire platform runs on just four AA sized batteries. While the small continuous rotation servos are not the most powerful motors nor are they the fastest option for locomotion, they more than sufficed for enabling this robot to explore indoor areas including those with carpeting and uneven surfaces.


I was not able to dig up the Basic Stamp PBASIC source code that I used for this project in time for this post. However, I do plan to resurrect the robot and that source code will be very handy to have around. Therefore, I will be locating and posting that code in the future. Considering all of the things that I had been trying to accomplish with this platform, I found that the memory space of the Basic Stamp was too limited to continue adding features and behaviors. In fact, the accelerometer was only able to be used when I removed other features. Similar limitations presented themselves when using the digital compass. Earlier, I had a goal of upgrading to the Parallax Propeller microcontroller with it's greater memory reserves and its ability to multitask using the eight internal processing cores. It seems, however, that I was easily distracted by other projects and other processors. It's all fun and I learn from each and every "distraction".

Below are three admittedly grainy videos which show the Watkins BOE-BOT navigating a living room environment. The robot was not programmed with a specific goal in mind other than random exploration. It safely roams the given space without running into objects such as walls, doors, people, and pets. Take a look at the videos to see the robot doing what it does best. Please forgive the low image quality as it was the best I could do at the time using what would now be considered an "ancient" cell phone.

 
Short video of the first object avoidance test.


Navigating a corner.


Robot being watched by another creature.

Thank you for visiting the site and checking out this small yet fully autonomous robot. Below is a partial parts list with links to sources. The list does not represent the exact kits or combinations of items originally purchased but you can recreate most of this project using the links below (with the exception of the LCD AppMod which appears to have been discontinued). 

Check back for source code and further updates!

Parts List with Source Links
Board of Education (BOE) - http://www.parallax.com/product/28150
Continuous Rotation Servos - http://www.parallax.com/product/900-00008
PING))) Sensor/Bracket/Servo Kit - http://www.parallax.com/product/910-28015a

BOE-BOT Starter Kit
Another option is to start with the full BOE-BOT Kit from Parallax. This may be a good starting point for a beginner if this is your first robot.

Potential Upgrades

Build something! You can do it!

Friday, May 24, 2013

Quick Build Mood Lamp with Remote Control

While not a robot this nifty project employs the kind of components and resourcefulness that can be very useful when converting your own ideas into reality.  

Why build a remote controlled, tabletop, mood lamp that can produce over 16 million vibrant colors?
Why not?

It might be the ideal conversation piece for that table that needs just one more decoration.


The lamp was assembled from a ceiling mounted lighting fixture, a 9 volt battery, and just two electronic components from ThingM's BlinkM line of products.

It consists of a single BlinkM RGB module slotted onto the top socket of a FreeM device. These mated modules are then placed on top of a 9 volt battery which supplies power.

The FreeM conveniently includes a 9 volt battery connector built into the bottom of the board and this makes the electrical work quite easy. The BlinkM, FreeM, and the battery all fit snugly together without requiring any soldering.


As often happens with scientific experiments, art projects, and other sorts of creative endeavors, a very delightful feature arose quite unexpectedly. These welcome surprises are often called "emergent properties" and tend to result more from the inherent properties of the particular materials chosen for the implementation than from anything described in the original design.

For instance, the image to the right shows the lamp set to produce a solid "blueish" output. The expected outcome was to light the globe one specific color. However, the result was a wonderfully natural blending of blue and green that combined to generate something which strongly resembles a gas planet.

The magic that makes this happen arises due to the combined properties of the translucent glass globe and the design of the BlinkM. The globe has inherent imperfections which go largely unnoticed when used for its intended purpose attached to the ceiling of a closet or hallway. Meanwhile, the BlinkM uses three very tiny LEDs arranged in a triangular fashion.

Because these individual LEDs are slightly offset from one another, they generate slightly offset brightness curves. These offset light curves combine with the imperfections in the diffusing layer of the glass and produce the beautifully organic designs.


The BlinkM generates 24 bit color at a reasonably bright 8,000 mcd while the FreeM acts as both a voltage regulator and an IR receiver. Lighting effects can be controlled by using nearly any "Sony-style" TV remote control. The BlinkM houses and on-board micro-controller and ships with a default set of operating modes which can be activated via the number keys on the remote control unit. Brightness can be controlled using the volume keys. The scripts which define the operating modes can be altered by an end user who has a basic familiarity working with micro-controllers  The module can also accept "live" serial commands via its I2C pins (more on that in a future post).

Everything is tucked away inside of a standard, ceiling mounted, lighting fixture that has had its 120 volt parts replaced with the BlinkM/FreeM/battery combo and then turned upside down so it sits as a tabletop globe. Enjoy!

See the product line's datasheet for more information about the components:

I purchased my BlinkM components from SparkFun.com:
BlinkM
FreeM

Thank you for visiting.

Build something! You can do it!

Tuesday, April 30, 2013

Simple Arduino Robotics Platform

An inexpensive remote controlled toy vehicle, a handful of well supported electronics, and an afternoon of fun can result in you having built your own expandable Arduino based robotics platform for less than $80.  While this project describes a "sensor-less" platform it offers a great base on which to stage future experiments. A variety of sensors, servos and other types of actuators can easily be added to this roving chassis and integrated into the Arduino based software to expand and enhance your autonomous robot's capabilities.

This simple robotics platform was built from a radio controlled vehicle that can be purchased online for about $20 or less (check your favorite toy shops). The electronics added at this stage include an Arduino UNO and a top mounted DFRobot L298P Motor Shield. These items should cost around $30 for the Arduino and under $20 for the motor shield.  Both of these components, their datasheets, tutorials and sample code are available from a variety of online sources including Adafruit, Digi-key, and SparkFun.


The process began with the slow deconstruction of the toy vehicle and the careful saving of all the screws, springs, and tiny structural pieces. It was soon found that this little vehicle employs just two small, low current, electric motors. One motor is used for driving the rear wheels and the other is used for steering the front end. Having just two motors is fortunate because the particular Arduino shield being used has the capacity to control precisely two motors of this type.

Also fortunate for this project, a single, small circuit board housing the original radio receiver and all of the motor control electronics was discovered. Conversion of this simple radio controlled toy vehicle into a programmable robotics platform could therefore be accomplished by simply removing this existing circuit board and replacing it with an Arduino and an attached motor shield.

Once the existing controller board was located and removed, it was replaced with a sturdy wiring harness that was designed to bring the motor control lines and battery power to the outside of the vehicle. The harness was then connected to a terminal block that had been secured to a central location on the top of the vehicle's body using double-sided tape. A second set of wires was then routed from the terminal block to the rear of the toy vehicle where it was connected directly to the Arduino and the motor shield. Being that this toy vehicle mimics the body style of a classic all-terrain utility vehicle, it has a convenient "bed" area at the rear which offers a perfect place to secure the Arduino and its attached motor shield.

Initially, there was no intention to preserve the vehicle's outer body or existing LED lighting. However, because the toy was easily disassembled, saving these pieces became an option. There are LED headlights on the front of the vehicle as well as very bright overhead spotlights on the roll bar. At this time, all of these LED's are connected in series to pin 13 of the Arduino. Simple digitalWrite() instructions in the Arduino code allow for versatile control of these surprisingly bright LED's. In the future, the overhead spotlights and the front headlights may be given their own separate control lines so they can be used independently. There are also red LED's that serve as backup lights but those are not connected at this time.

Conveniently, the toy vehicle also contains a battery compartment that holds five AA batteries. This 7.5 volt battery pack supplies plenty of current to the motors while also providing power to the platform's electronics payload. There is even a small slide switch on this built-in battery box that helps to give the entire package a more professional look and feel. While very handy at this stage of development, future experiments may test the limits this single source power supply.

This robotics platform will evolve over time and is intended to grow in complexity. My parts collection contains a good variety of sensors that have gone unused for far too long and many of those devices will be incorporated into this platform as time permits.

The software currently loops through a familiar design pattern which can be described as "scan/plan/animate".  At this time, the data gathered during the "scan" phase is actually simulated by generating random values for the sensor readings.  This allows the "plan" and "animate" phases to be developed in the absence of real sensors.  As can be expected, the resulting behavior can be rather chaotic but it certainly provides for a lively demonstration!

In future posts I will be adding a set of ultrasonic and infrared distance rangers that will be used to sense the environment and provide the feedback required to support autonomous and intelligent behavior.

Reproducing this project can be a great way to get started on your own autonomous rover designs. Follow the links below for hardware resources, the Arduino IDE, and the source code used in this project.

SOFTWARE RESOURCES
ArduinoSafari_X1_Instrumented.ino
ArduinoSafari_X1_Instrumented.txt
Arduino IDE from Arduino.cc

HARDWARE RESOURCES
Arduino UNO R3
DFRobot L298P Motor Shield
RC Safari Vehicles

Please feel free to post comments, questions, suggestions and concerns in the space provided.

Thanks for visiting!

Build something! You can do it!