"... and no one shall work for money, and no one shall work for fame; But each for the joy of the working, and each, in his separate star, shall draw the thing as he sees it, for the god of things as they are"

-Kipling

 

FPath_Ex003: 2D Motion

Background

FPath is a project to explore the possibilities of the Feynman Path to Nanotechnology. Essentially this means using tools to make small tools which then make smaller tools. See the main FPath Project page for more details.

This page documents FPath Experiment 003 (FPath_Ex003). The purpose of this experiment is to further develop the Walnut control software, create a library of code which uses the pulse width modulation ports on the Beagle Bone Black and to improve the hardware platform on which the experiments take place. This is all necessary because all of these components will probably be needed in order to move further down the Feynman path.

The Goal

In order to properly exercise the hardware and software improvements, the target goal of this experiment is to:

Move a red colored square attached to the head of an XY platform onto the position of a green colored square.

This experiment improves the platform used by FPath Experiment 001 which developed the initial hardware and software and also uses the video injection capabilities demonstrated in FPath Experiment 002.

Achieving the Goal

The physical infrastructure used is much improved over Experiment 001 and significant changes were also made to the Walnut software. The starting point for this experiment is Walnut Server/Client version 00.02.04 and the changes made have been released as version 00.02.05.

The basic structure of the hardware is identical to that used in Experiment 001 except that the bed has been replaced and now incorporates fixed LEGO plates as mounting points. The physical experimental apparatus uses various LEGO bricks extensively as the mobile apparatus and also for things like mounting the electronics and cable routing. LEGO bricks work very well for this sort of mechanism because they are extremely precise, commonly available online in many sizes and are relatively inexpensive. They are easily strong enough for the purposes of this experiment. See the separate documentation of the Steggo Project for more information.

Below are some images of the experimental apparatus. Click on any image to enlarge - the enlarged image has annotations.

FPath Ex_003 Apparatus 1 FPath Ex_003 Apparatus 2 FPath Ex_003 Apparatus 3

Below is a specific list of the steps involved in reaching the goal.

  1. Adapt the Walnut Software version 00.02.04 to inject four suitably sized green squares into the webcam stream and get those squares to display in various positions within the webcam view. Only one square should be visible at any one time.
  2. Implement the code which can control the speed of two 200 rpm DC gear motors via pulse width modulation.
  3. Write the software behaviors which can move a red square mounted on an XY axis (made of LEGO) onto the position of the green square. It might be necessary to "turn off" the green square in order to get the green square to fully move into position.
  4. Create the Steggo Modules necessary to physically implement the XY axis.

The Result

The experiment was successful. The appearance of a virtual green square injected into the webcam stream caused the motorized XY axis to track the red square to that position. As demonstrated in Experiment 002, the Walnut Software reacted to the appearance of the virtual green square as if it were a physical entity. The changes made to the Walnut software behaviors exhibited quite fine control and, because the software is closed loop, the absolute position of any particular entity is irrelevant. The control of the motors using pulse width modulation also worked very well.

Video of the red square tracking onto a virtual green squares position.

This experiment is now complete. The Walnut software associated with this experiment can be found under Commit ID: ae0b457 on the GitHub repo.

Future Use

The Walnut software uses image recognition to indentify the red and green squares. Once the red square began to move underneath the green square the image recognition algorythm would loose track of it and the movement would halt. Removing the green square caused the red square to again be recognised and tracking resumed to the last known green square position. This issue is easily remedied by changing the image recognition system to recognize the red square before the green square is injected into the video stream (and is in turn recognized). This is not hard to do and is probably not worth of a separate experiment. Any such changes in the Walnut software will be released as a separate GitHub Commit.

The implementation of the Pulse Width Modulation code to precisely control DC Motors will be generally applicable in a number of areas.  

License

The intellectual property rights to all new and/or original ideas and technologies documented under the FPath project and sub-projects are claimed in full by the author and are immediately released into the public domain under the terms of the MIT License. Any ideas, techniques, processes or methods of work documented in the FPath project and sub-projects must be considered to be prior art and must be cited in any patent applications.

The contents of the FPath project and sub-projects are provided "as is" without any warranty of any kind and without any claim to accuracy. Please be aware that the information provided may be out-of-date, incomplete, erroneous or simply unsuitable for your purposes. Any use you make of the information is entirely at your discretion and any consequences of that use are entirely your responsibility.