Robotic Foucault Tester with USB Camera and Motor Control

September 12th, 2024 (web page only) Update

We have been updating and testing the Robo Foucault 2.0 since mid June, 2023. The test results using the new motor controller match the test with the classic robo Foucault using the parallel port and 'scope' hardware to control the motors. We have posted the most current software here to help get more robo Foucault testers running. What is here works but we may make some minor tweaks and I'll update this info as we make progress. The small hamburger menu at top the left is a quick way to locate the major topics or go back to the top or home page.

Robo USB during a test run

The Robotic Foucault tester (referred to as Robo from here on) was the brain child of James Lerch in 2001 and became functional in 2002. James, with the input of the ATM list wrote RTAFT (Real Time Automated Foucault Test) in Visual Basic 6 for use at the St. Petersburg Astronomy's Mirror Lab. Having experience with Mel Bartels' computer parallel port to stepper motor interface for telescope control James used a similar interface to control Robo.

With a few minor tweaks the program has continued to work on our Windows XP, Windows 7 and Windows Vista PCs. At its peak were were running a couple of dozen Foucault tests during each mirror lab session. Here is some info on the old, parallel port RTAFT. Newer desktop PCs, generally, do not have parallel ports and I don't know of any modern notebook PCs with one built in. A USB to parallel port adapter cannot be used. It was past time for Robo to get an update. Robo 2.0, the USB version is the result.

The Goal

Get the RTAFT software running under Windows 10 and Windows 11. Remove the code parts that talk to the parallel port and replace them with communication to the USB port that is connected to a new off-the-shelf motor controller. Ideally, allow it to also use a USB video camera. Keep the new motor controller backwards compatible with the existing Foucault camera stand motors.

Mirror Lab Brain Storming Session, May 2023

The knife edge camera stand was rebuilt by Ralph Craig and a modern USB camera was used instead of the 1987 RCA VHS camera that had composite video output. This allowed the stand to be much smaller and lighter. The camera works like the old composite video input except the video capture isn't needed. Not every camera will work. More on this in the camera stand area. If you can make a mirror or a telescope you can build this. I updated the RTAFT software by removing the parallel port code and replacing it with code that talks to an SMT Arduino Uno R3 with a motor shield via a USB port. This involves installing the Arduino development program, programming your Arduino Uno (only need to do this once). Then install RTAFT_USB and telling it to use the com port that the Arduino is using. More on this later also.

The Arduino will need an off-the-shelf motor controller shield (Adafruit Motor Shield v2.3). The boards that I linked to on this page did not require any soldering although other vendors may require you to solder the header to the board. While RTAFT is still developed in VB6 SP6 on a Windows XP virtual PC the program that it creates is supported on Windows 10 and 11.

⚠️ Do not use the Arduino Uno R4 Minima or an Arduino R3 with DIP chips with RTAFT. The Arduino R4 does not communicate with RTAFT with the Adafruit V2 controller library. This appears to be a serial communication issue and not a motor control library issue. We may dig into this in the future, but for now use Arduino Uno R3 boards. The features of the Arduino R4 do not offer any advantage in this set-up even if it did work. The DIP mounted R3 Arduino would start fine and then go into a super slow mode requiring a power cycle.


Foucault Tester

The heart of any Foucault tester is the knife edge. By carefully aligning the camera to the optical axis of the mirror a series of zones the left and right side of each zone are compared until they are equal and the distance from the knife edge to the mirror is carefully noted. A series of these measurements will give a profile of the mirror to better than 1/10th of a wave of green/yellow light. This measurement is from a horizontal strip bisecting the center of the mirror.

For more info about how the Foucault test works check out the Stellafane Understanding Foucault Testing and Measuring Parabolas pages.

No one involved with Robo 2.0 receive any benefit from links on this web site. The links to Amazon and other sites are for products that I purchased and tested and they worked for this project.

Robo Front View

Robo Side View

Laser Box

Robo Rear View

The Test Stand

The test stand is made of four levels. Separating three layers are linear bearings that slide about 6”. The lower level is the 'ground board' and allows the rest of the stand to be angled up or down from a knob in the back end (opposite where the camera is pointing. The stand needs to be tall enough so that the mirror isn’t angled down risking a fall or adding stress if a safety clip is used.

Between the second and third level the sliders move the camera forward and backwards using a 1/4” x 20 threaded rod. Between the third and fourth levels the sliders move the camera side to side using a 1/4” x 28 threaded rod. The RTAFT software controls the stepper motors through the Arduino and keeps track of their motion as well as resetting the platform to its starting position at the end of the test.

The Motors

The motors are 12v .4A Unipolar stepper motors with a 1.8 degree step angle, jameco part #155433. The test is preformed using the motors in half step mode for 0.9 degrees per step.

The Camera

The Camera used here is a UVC (USB) web camera with 5-50mm manual zoom lens that has manual brightness and focus control. You cannot use auto focus or exposure with this system. Camcorder cameras with manual controls may be used also as long as you can get the video stream into RTAFT at around 320x240 to 640x480 resolution, depending on your display size. Usually this option requires a composite video USB capture dongle, which we have used for years. We have successfully tested mirrors down to f/4.4 (we haven't tried any faster than that yet with the USB camera)

If you have an older camera you may use most USB video capture adapters as long as they will allow the incoming image to be made small enough to fit in the robo window and leave room for the rest of the application. Most HDMI capture cards do not allow the video to be small enough. Once the camera is selected there is a menu option in robo to select the video size. The sizes are controlled by the camera or capture dongle.

The Laser and LED

The white tube next to the camera contains a 5v laser (USB powered) that is used for initial alignment. The laser's beam returns from the mirror about an inch from the other side of the camera. We will place a small card there with a bulls-eye on it in the future.

You will notice that there are two knife blades. The one in front of the lens is used for testing the mirror, the lower one is used to make a narrow slit that a green LED is used to illuminate the mirror during the test. Make the bottom of the lower mirror save by taping the blade side or you will bleed on your tester.

The LED is also powered by 5V and has an inline potentiometer (small black box with the knob) that allows some brightness control illuminating the mirror. Do not use Pulse Width Modulation (very fast blinking of the LED) to control the visual brightness of the LED because the video capture will grab frames when the LED is fully on or off but not actually dimmer.

We found that the camera was sensitive to the laser being on during the test. An on/off switch was added to the POT box. Now we turn off the laser before any test begins. The box has 5v coming in from the Arduino and two 5v outputs, one attached to the potentiometer that goes to the illumination LED and another 5v output that goes through the on/off switch and goes to the alignment laser.

Motor Controller

Motor Connector

Arduino and Motor Controller

3D Motor Controller Box

Arduino 5v Power

USB Motor Controller

The motor controller is an SMT Arduino R3 Uno (this clone did not require any soldering) with an Adafruit motor controller board v2.3 (shield) added to it. These are both commercially available items and reasonably priced. The shield comes with some header pins that will need to be soldered to the shield so that it will connect to the Ardunio.

The combination of a SMT Arduino R3 and the Adafruit R2.3 motor controller have worked in every test that we have thrown at it.

If you have access to a 3D printer the STL (link in the downloads near the end of this page) file will allow you to print a case for the Arduino with the motor shield attached. You may also access it in TinkerCad. The photo shows it with the USB and 12v power connected to a barrel connected added to the side. Note that the jumper above the 12v power input is removed.

Plug in the USB cable to the computer and Arduino (with or without the motor shield attached)

Install the Arduino development environment - I'm using v2.1.1 when I was working on this project

Click yes to everything so that it can also install the USB drivers.

From within the Arduino IDE:

Install the Adafruit Motors Shield V2.3 Library (from the 'Sketch' menu → Include Library → Manage Libraries and search for "Adafruit Motors') and install it and allow its dependencies.

There is a jumper on the motor board next to the power inout that must be removed if it is there. The motor needs 12v DC power at at least 1A, although I recommend 1.5A or higher (I use 2A). A power supply. The Arduino will get its power from the USB connection.

Select the Arduino Uno board from within the Arduino software. (Tools → Board -> Arduino Uno)

Select the Arduino's Com port, usually it's the last one in the list. (Tools → Port → Port x). The Arduino's com port is only available if the Arduino is plugged into the USB port of the computer.

Unzip and load the Arduino RoboMultiStepper sketch (source code) from this page into the Arduino IDE

Click on the check in the upper left corner to make sure that the code compiles.

If it does click on the arrow next to the check to compile and install the code on the Arduino Uno.

If this fails check your serial port and any connections between the motor controller and the motor.

We tested using a 5v laser module and the green illumination LED from the Arduino Uno v3 and it appears to work well. Draw power from the 5v and GND pins near the 12V input on the motor shield. This power is passed through from the Arduino's USB input.

⚠️ Avoid the Ardiono Uno R4 or the DIP Arduino R3 with this project.

L293D Motor Controller

Alternate Motor Controller - The L293D

⚠️ This controller is not reliable ⚠️

After much testing we have concluded that the L293D motor controller shield does not work reliably with the Robo Foucault tester. Do not use the L293D motor controller, use the Adafruit v2.3 motor controller.

If you want to give the L293D a try, and there may be a tweak that will get this to work, contact me and I'll give you the Arduino software that we were testing.

Zerodur Mirror

Zerodur Mirror 7 tests

Zerodur Mirror 15 tests

Zerodur Mirror 7 test figure

The Mirror Test

When you test a mirror you will select a number of zones. Fewer zones test faster but result in less detail. The images show a 12" Zerodur mirror with a slightly turned up edge. The 7 zone test (second test image) doesn't quite show the turned up edge like the 15 zone test does (the third test image).

Other than the number of zones nothing else changed between the tests. The resulting FigureXP plot and results go from a 1/9th wave mirror to a 1/5th wave mirror due to the more zones 'seeing' the edge better.

You may set up two (or more) mirror profiles for the same mirror and only change the zone count. For frequent test use the low zone count and occasionally during polishing and frequently during figuring run a high zone test.

Before the test starts get the mirror's face fully illuminated as evenly as possible from the illumination LED between the blade slit. If you turn on the mirror brightness meter the average for each side should be between 75 and 100. Your setup may vary considerably from this due to camera sensitivity, LED brightness and color and testing area conditions.

Then cut out the knife so that the shadow on the right is thin and symmetrical top to bottom. Cut the knife in so that Zone 1, the inner zone's blue and red bars are about the same height and about 1/3 to 1/2 of the way their scale. The mirror's image will be similar to how it looks in the the first test image (that is testing zone 5).

Since this test is against a horizontal strip of the mirror you may want to mark your mirror on the side ('A' axis) and preform multiple test with a 45 degree or 90 degree rotation between each. After figuring allow the mirror to cool off for at least 10 minutes and release any friction heat absorbed before testing.

👉 For FigureXP to open after the test you must first associate *.fig files with FigureXP. We recommend associating Sixtests with its *.set files also. The Sixtests output is good but the app doesn't like opening automatically from RTAFT. We're working on this.

It is important that the mirror being tested is significantly polished before it is tested. The mirror shown below is polished enough to test although not fully polished. We recommend using a laser on the surface (never look onto the return beam) and see if it is visible on the mirror's surface. If it is there is either something on the surface, like dust or cerium, or the surface itself is rough at the microscopic level. If the mirror is fully polished the laser will be seen only on the bottom of the mirror where it passed through, on internal bubbles and on the ceiling where it bounced off. You will find that moving the laser from the mirror's edge towards the center often shows different levels of polish. If the laser light scatters so will star light reducing contrast by making stars dimmer and the background brighter. Laser Surface test

Dots & Numbers

Numbers Green Box

The Mirror Brightness Values

The mirror brightness display is only available during the mirror's setup. It turns off during the test. The most basic part displays a box in the lower right of the mirror's video image. In it there are two numbers. The one on the left is the average of the pixels tested on the mirror's left side. The right numbers are the average for the right side.

If both numbers are within the range that you set in the setup the box's background becomes green. The intent is to make it easier to adjust the illumination LED's brightness for more consistent results.

The total range for each pixel is 0 (zero), which is black, to 255, which is white. If the pixel squares or values are enabled they will display in white for values 128 or less and in black for values 129 and greater.

When you start the test the illumination meter is disabled. Additionally you may enable and disable it when not testing from the Test Options → Mirror Brightness Value menu.

Arduino Board Testing

Good Arduino, Good Controller 1

Testing RTAFT and the Motor Controllers

Here are seven of the nine (sorry Star Trek) Arduino boards that I tested and six of the eight motor controllers. Only one combination proved to be reliable.

Each Arduino was tested with both motor controllers. First as a bench test where the motors and power were connected to an Arduino and motor controller but not to a full Foucault stand. RTAFT was started and dozens of motor tests were run from within the Arduino (RTAFT menu option), from RTAFT (another RTAFT menu option) and through RTAFT using the keyboard.

Pass or fail was noted and another combination was tested to confirm the results. In the case of using the R4 Arduino and the DIP Arduino R3 the failures were consistent. If the bench testing was successful that Arduino and motor controller were tested using the Foucault stand with a mirror of known zone values.

While in RTAFT we tested the settings options and verified that they were being saved and loaded in the ini file. After each mirror test we compared the results with what the parallel port RTAFT had for this same mirror as well as consistency with previous Robo 2 tests both with raw numbers and in FigureXP.

In the end the SMT Arduino Uno worked reliably with the Adafruit Motor Controller V2.3 was the only combination that worked every time.

RTAFT is developed on a Windows XP VMWare virtual PC & bench tested on a Windows 11 PC with an AMD Ryzen CPU. The Foucault mirror testing notebook is running Windows 10 with an Intel i7 CPU. Both AMD and Intel CPUs had the same successes and failures with the Arduino combinations.

🍎 8-17-23 RTAFT on a Mac update 🍎

We have successfully run RTAFT in a Windows 10 Parallels virtual machine running on a i7 MacBook Pro. The results matched the native Windows notebook and the speed, while not timed, seemed about the same. Only two mirrors, a 12” and a 6”, were tested.

SPAC Logo
Mirror Lab Logo

The Downloads Are Here

Download the RTAFT Windows installer v2.0.5


Download the Arduino IDE.


Arduino source code (sketch) for the Adafruit Motor Controller V2.x shield.

Download the 3D printer file (STL) for a case for the Arduino with the Adafruit v2 motor shield.


Download the PDF to create the robo Foucault camera stand and motor controller. Create your own. This is just a starting point.

The Basics of Using RTAFT and the Robo Foucault Tester.  Some notes to get you started.

Here are Some of the changes in the new version.

Contact me if you need the RTAFT VB6 source code. You will need the VB 6 compiler with SP3 and a Windows XP machine to run the compiler on (a virtual PC works). Include in the email the reason for the request, your real name, and the astronomy club that you are a member of. I don't want to give the source code to scammers and I would like to limit the different versions of Robo that are in the wild.


Email

Go Back To The Main Page