MetaGuide  by Frank Freestar8n

Instruction manual and intended goals

MetaGuide is a multi-function telescope tool based on real-time image processing of a web-cam video stream.  It collimates, autoguides, logs periodic error, measures drift, documents the Airy pattern, and measures differential flexure.

MetaGuide has several goals:

1.      Allow precise collimation of a telescope based on high-power views of the in-focus Airy pattern even when seeing is poor. 

2.      Compensate for atmospheric turbulence by doing a real-time, aligned stack of recent video frames, with the worst frames culled from the stack, and provide a true measure of the diffraction-limited FWHM.  You see the diffraction pattern in real time even when it is not visible in the eyepiece.

3.      Allow direct visual comparison with the expected Airy pattern based on diffraction theory – including effects of the secondary obstruction.

4.      Keep the star centered automatically by moving the telescope during collimation.

5.      Save the result as an annotated image in a single .png file for comparison with others.

6.      Use this turbulence-compensated view of the star to autoguide with a cleaner input signal that reduces the chasing of seeing.

7.      Monitor fast (5 - 100 second) periodic error terms, lock onto them, and compensate for them in real-time.

8.      Measure differential flexure in realtime using two web-cams and two linked instances of MetaGuide

9.      Track comets while guiding on a guidestar with shifting at the comet’s rate of motion

10.   Measure drift of the mount and log periodic error accurately while guiding or not

MetaGuide requirements:

1.      Telescope with most any web-cam that supports 640x480.  Or, a video camera feeding through an inexpensive video2usb converter.

2.      Computer with Windows Vista, XP or 2000, and recent DirectX installed

3.      For autoguiding and calibration of image scale, requires connection to telescope mount via ASCOM, GPUSB, GPINT, or other LPT cable.

Support: Join http://groups.yahoo.com/group/AstroGeeks/ .  Or contact freestar8n at yahoo dot com.

     

Chapter

 

1

 


Quick overview of features and functions

Point telescope at star and attach web cam.  Start MetaGuide, set parameters for your telescope, and as long as the star is in the view and is not saturated, you will immediately have good insight into your optics.  You don’t need to click on the star or center it in a region – the star is immediately locked onto once it is in the view.

This is what you will see:

· Figure 1  MetaGuide main screen

The main screen shows a raw (in this case, badly distorted by turbulence) view of a star, while the lower right shows a live, stacked view of the same star magnified four times.  Note that the stacked view shows a very strong and sharp central peak, with a hint of a ring around it. 

This ring is more evident in the plot on the lower left, which shows the radial distribution of  intensity for the star.  The blue line is the live data and the white line is the theoretical shape based on the telescope optics – including the secondary obstruction.  Although the two plots are not identical, the blue line shows a faint hump right at the place where the first diffraction ring should appear, and the central peak is sized comparable to that expected from diffraction theory.  In fact, the full-width-at-half-max (FWHM) shown in the plot at right is about 0.63 arc-seconds – slightly largely than the theoretical value of 0.576.  This demonstrates the ability of MetaGuide to make diffraction-limited measurements of optical performance even when the seeing is poor.

The red dot on the view of the star is an indication of coma present in the image.  If the optics are not collimated, a diffraction ring will not be visible and the red dot will be far from centered on the star.  As the telescope is collimated, the dot should become more centered and the rings should appear.


Chapter

 

2

Installation and setup

Install MetaGuide and test it by launching it without the web cam attached.  You should see a warning dialog that no web cam was found, which should then show the basic screen but with no live view.  If you do not reach this point, you may be missing a dll from the installation, or you may need a more recent version of DirectX from Microsoft.

You may see an error message about IO.SYS when you first run MetaGuide.  Please ignore this error and start it again – it should not appear again.

If things seem ok so far, shut down MetaGuide and plug in your USB web cam (anything that supports 640x480 should work – including a video camera connected to a video2usb adapter).  Now restart MetaGuide and you should see a live view of the web cam video.  If you can attach a small lens to the web-cam and aim it at the scene around you, you will see that the expanded view of the “star” will lock onto the brightest object in the scene.  Sometimes it takes some retries in order to see video for the first time with a new camera.

To adjust the video properties while previewing, click the VidProps button and dismiss the dialog when done.

With the web-cam attached, use this opportunity to enter the properties of your telescope.  Click the Setup button and you will see the dialog below, here configured for a C11 with 3x Barlow and Toucam.  Note that you must know the pixel size of your camera.  If the height and width of the pixels is not the same, enter the width and make sure the RA axis is nearly horizontal when calibrating the guider.

The main parameters to set are the aperture, f/number, and Barlow magnification.  The Cal Factor is a slight adjustment to make the actual focal length correct and may be initially set to 1.  For correct diffraction comparison, set the secondary obstruction to the percentage appropriate for your telescope; for refractors it would be 0.

The remaining terms can be ignored for now – they are used when guiding is enabled via ASCOM, LPT or USB port, and are described in detail later.

Once you have entered the parameters, dismiss the dialog by pressing OK and you may now view simulated results by pressing the Simulate button on the main screen.  This will show a simulated star against a slightly noisy background, with some jitter in its position to simulate turbulence.  This is the appearance you will strive to see once the telescope is collimated.  This is shown in Figure 3, and again in Figure 4 with a larger secondary obstruction to show the increased prominence of rings in the diffraction pattern.  Note that you must have a web-cam attached to see the simulated star.  Also note that the star does not appear properly at f/ratios below 10 – nor can such a small diffraction spot be resolved by current web-cams, and a Barlow must be used to make the spot larger.  (A smaller f/number is fine for the guiding aspects of MetaGuide – but not the diffraction-limited tasks).

 

· Figure 2  Setup Dialog

 

· Figure 3  Simulated view of the star with the current telescope parameters

· Figure 4  Simulated view with larger secondary obstruction and lower gamma

 

 


Chapter

 

3

Usage with a real star

A detailed view of the Airy pattern requires a high effective f/number, which usually means the field of the camera is very small and the mount must be very stable.  Typical f/numbers for a good view of the Airy pattern are in the 25-50 range, and may require a Barlow.  If you have some experience with planetary imaging and your mount is stable at high power, this may pose no difficulties.  Otherwise, you may want to start at lower magnification.

Find a bright star near the zenith – the brighter the better, but it should also be very high up to improve seeing.  Center it with an eyepiece, then substitute the web-cam and focus.  For imaging the diffraction pattern the star must not be saturated, which means extremely short exposures are not only possible, but required.  For an 11” aperture, the exposure may be 1/200 to 1/1000 second.  Once the star is in the field of the web-cam, its zoomed in view should be immediately visible in the lower right, along with its radial profile in the lower left.  You do not need to select the star with a bounding box or click on it – it is found automatically.  Carefully adjust focus and exposure so that the profile height is about 2/3 maximum and as narrow as possible.  Note the FWHM plot on the lower right for reference.

Other video settings may be adjusted, but frames per second should be 10-20 and gamma should be 1.0 so that the radial profile corresponds to linear intensity.  Use the gain setting to place the peak height about 2/3 of maximum.

If you see that the star is clearly not round, try adjusting the collimation screws so that the red dot moves toward the center of the star.  If the star easily goes out of the field, try working without a Barlow – which is fine as long as the magnification is large enough that you can still see the elongation of the star.

One of the goals of MetaGuide is the auto-centering of the star during high-power collimation, which requires that guiding be enabled as described in the next section.

Chapter

 

4

Preparing to autoguide

Guiding with MetaGuide requires either ASCOM, GPUSB, GPINT, or other LPT connection.

To guide with ASCOM, first select ASCOM in the LPT/USB/ASCOM selector, and then use the ASCOM Chooser button to select your telescope driver.  MetaGuide requires drivers with ASCOM “early binding.”  If a driver doesn’t allow connection, try connecting MG to POTH, and then connect POTH to the driver.

For LPT guiding, if you have already guided your telescope via the LPT port, you should be able to guide directly with MetaGuide just by setting the correct LPT port in the Setup dialog.  If you have not already guided your telescope in this manner, you must determine the correct LPT port from the Device Manager (first line of “I/O Range”, as a hex number), and you may need to make sure the port is not in ECP mode – which may involve changing the computer BIOS settings at startup.

It’s important that you set the LPT port correctly in MetaGuide before attaching the guide cable to the parallel port, to ensure that the outputs are disabled and the telescope is not driven away from its current position.

Guiding with the USB port and a GPUSB adapter requires no special setting other than to select USB in the LPT/USB port selector list.

You may test the functioning of the guide setup by pressing the E/W buttons in the Setup dialog, which will provide a 1-second jog to the RA axis.  It is best to do this test with the RA motor in E/W since the Dec. motor may be more affected by backlash.

Once guiding is set up and appears functional, enter the declination of the star you are observing, and the RA/Dec autoguide rates.  (ASCOM will set the declination automatically, and will override the guide rates with values from the driver.)  Then approximately center the star in the field and press Calibrate to calibrate the view orientation and scale.  A dialog and progress bar will appear in the upper left.  Do not interact with the telescope or the application until the calibration completes.  The star should never leave the view; if it does, cancel the calibration.  Make sure the telescope is not bumped or leaned on during this procedure, and that it goes to completion.

Note that the calibration procedure will set the calibration factor so the image scale is exact.  Furthermore, it will determine the orientation of the E/W direction in the field, and whether the N/S direction is inverted.  Although the E/W and N/S alignment of the view does not matter for the calibration, it is convenient to have RA motion nearly along the horizontal axis so that drift in Y corresponds to N/S drift.

Once the telescope is calibrated, the guiding-related features such as Guide and Center will be enabled.

If you ever exit MetaGuide and return to it with no changes at all to the telescope and camera, you may recover the previous calibration by selecting UsePrevCal in the Setup dialog.  You must manually save the setup values in a .ini file using Save or Save As, otherwise the session values will be lost.

To center a star approximately in the field, just press the Center button.  This may take some time if the declination backlash is large.  This behaves differently when guiding, as described below.

To begin guiding, just select Guide and the star location will be stored and maintained.  The location of the star in the field does not matter at the time Guide is pressed.

The Center button takes on a different meaning during guiding.  Instead of simply bringing the star near the center, during guiding, Center will make the target location be the center of the screen.  This will slowly bring the star to the exact center of the screen and keep it there. 

There are many ways to tune guiding, including the usual RA and Dec. aggressiveness (here on a scale to 1.0 rather than 10), along with NFrames, which is the number of previous frames to use in calculating a star location; AccepFrac, which is the fraction of frames that are actually used in the average (the rest of them are lower quality and not included in the centroid calculation); and GuidePeriod, which is the time between corrections.  A final setting, BkgThreshold, specifies the minimum pixel value to be used as a possible star.  This value should be as large as possible for best performance, and should never be 0.

Since MetaGuide relies on small corrections, it may be best to set the RA guide rate on the mount to a small value around 0.25x sidereal.  On the other hand, Dec. motion may be limited by backlash, so its guide rate may be best set at 0.9x sidereal – along with tuning Dec. backlash so that it is somewhat responsive in both directions, but does not overshoot.  But starting values of 0.5 and 0.5 should work.

If the star is faint or there are other stars nearby, use the Lock button to lock onto the selected star.  If the star is faint, use Integrate to sum the frames and reach fainter guide stars.  The total integration time (NFrames/FrameRate) should not exceed the guide period.

Chapter

 

5

MetaGuiding

MetaGuiding refers to dynamically recognizing patterns in the guiding corrections to the mount and locking onto and correcting them in a pro-active rather than reactive manner.  This reduces the amount of reactive guiding corrections, with the potential to produce tighter tracking with more optimally tuned guide parameters.  This does not require any sort of index as with PEC, but it does require that the user know and provide the frequency of interest.

Currently the mount locks onto a single drive period that the user specifies (in seconds) in the Scope Setup Dialog.  A future version will allow the specification of several frequency terms to track.

When guiding is enabled, the RA and Dec. drift rates will be shown, along with an Amplitude and Phase display corresponding to the frequency being monitored.  Once the Amp. and phase values appear stable, you may enable MetaGuiding in the Setup dialog, and that frequency term will be proactively corrected.

In addition to the MetaGuide frequency, there is a MetaAggression parameter, along with an Input Lag time that can be adjusted.  MetaAggression is the same as Dec. and RA aggression, but refers to the proactive corrections at the specified frequencies.  The lag time accommodates the time that the proactive corrections must be applied in advance in order for them not to apply too late.  Typical values for MetaAggression and Lag time are 0.9 and 2.0 respectively.

The desired frequency can be determined from an examination of PE logs taken at intervals of 1 second or so to avoid smoothing out high frequency periodic noise.  MetaGuide is good for creating such logs, by passively logging the star position in time without guiding enabled.  Careful study of the plots may reveal a term in the 5-50 second period range that, if periodic enough, may be removed proactively.

You may need to tune the guide parameters when MetaGuide is enabled.

It may also be beneficial to combine MetaGuiding with PEC.  The combination of PEC with proactive correction of a fast term has the potential greatly to reduce the work done by the autoguider.

In practice, MetaGuiding may not help much as long as you have PEC enabled and you guide aggressively, with corrections every second and an accurate, tight centroid at long focal length, as provided by off-axis guiding.

Chapter

 

6

Collimation at the diffraction limit

There are numerous ways to collimate a telescope, but many concentrate on the appearance of the out-of-focus star and ignore the in-focus shape.  In fact, complex optical designs with several components may show the best stars when the out-of-focus appearance looks misaligned.  Although the out-of-focus appearance (e.g. “centering the donut”) is a good first-step in collimating, it should be followed by careful in-focus collimation at high power.  Normally this requires a night of very steady seeing, but with MetaGuide the diffraction pattern is more readily visible and collimation based on the in-focus diffraction pattern is now easier.

Understanding the nature of the diffraction pattern and how it relates to star size and resolution involves distinguishing the physical size of the diffraction pattern on the image plane from the angular size it corresponds to in the sky.  The former is determined entirely by the f/number of the telescope, while the latter includes the magnifying effect of the telescope’s focal length.

The size of the Airy disk is proportional to the f/number of the telescope, and independent of the focal length.  Thus the size and appearance of the spot formed on a Toucam Pro will be the same for a 5” f/10 as it would be for a 50” f/10 telescope.  Only the irradiance would be different, with the 50” concentrating 100 times as much power into the same size disk.

The angular size of these disks will be quite different, however, and will be 10x smaller, in arc-seconds, for the 50” than for the 5”.

In short, the physical size of the Airy disk depends only on the f/number, and the angular size depends only on the diameter.

For some concrete examples:

The angular resolution of a 6” telescope is twice as good as for a 3”, regardless of focal length.

A 3” f/10 will have the same size (in micrometers) Airy disk as a 6” f/10.

If you have a 3” f/10 and you replace it with a 6” f/5, which has the same focal length, you will quadruple the light-gathering, and you will halve the size of the Airy disk.  This means that for the same detector, the gain in ADU of the central pixel will be roughly a factor of 4x4 = 16!

Of course, this all assumes the seeing and imaging are “diffraction limited” when in fact the measured FWHM of deep sky images is typically much larger due to seeing.

MetaGuide lets you see how your telescope is performing at the diffraction level so that you can collimate it optimally, reduce guiding errors, and keep the net FWHM as low as possible in your final image.

NOTE!  You must use a high enough f/ratio for the Airy disk to be large enough to be resolved with a web-cam’s resolution.  This may require a Barlow, and an effective f/ratio of 20-50.  At lower f/ratios, the star spot is blurred by the bleeding of the pixels and will be artificially much larger than the diffraction limit.  See the examples at the end of this document.

Note that the FWHM reported by MetaGuide does not represent the “seeing” at the site.  In fact, it should be much better than the “seeing” value because motion of the centroid has been removed from the aligned, stacked star image.  Nonetheless, when seeing is better, the reported FWHM will also be better.

 

Chapter

 

7

 

Collimation with MetaGuide

MetaGuide not only lets you see the diffraction-limited performance of your telescope in a live view, but the autoguiding features can automatically keep the star centered as you adjust collimation.  This means that as long as you can see the computer screen, you can focus on adjusting the collimation screws and not have to worry about recentering the star.  This requires you have set up guiding and have the cable connected to the printer port as described in Chapter 4, and calibrate the camera orientation.

To collimate precisely, first make sure you are roughly collimated using standard procedures – then aim at a bright star high overhead as described in Chapter 3.  Adjust the brightness and gamma so that you can see the shape of the star – particularly any comatic or oblong appearance.

Now, center the star and press Guide to begin guiding.  As long as you don’t let the star leave the field, you may now make adjustments to collimation and the mount will recenter the star in response to changes.  With practice this feels natural, and allows you to get immediate feedback on the changes made by a turn of a collimation screw.  If the red dot, indicating coma, is consistently off center of the star, adjust until it is centered.  It is much easier to keep track of the changes and their effects since the star is automatically centering itself after changes.


 

Chapter

 

8

 

Flexure and flop measurement

 

MetaGuide can measure small flexure and flop between two mounted telescopes by looking at drift and shift at the sub-pixel level.  To do this, start two copies of MG on the same computer and associate each with a different camera.  Under the covers the two copies will be communicating with each other.  Then select the copy that goes with the longer focal length telescope, connect it to the mount, and calibrate it.  The other MG need not be associated with the mount or calibrated.

Then press the Flexure button and a screen will appear as below

Now press Calibrate in the flexure dialog and follow the directions to move the telescope a small amount N/S and E/W.  When the flexure dialog is calibrated, begin guiding using the long focal length MG that has already been calibrated and wait a bit as the flexure rate is measured.  The radial dial indicates the instantaneous and averaged flexure rates.

To measure flop, place a star in the center of the field and zero the flexure measurement.  Then either move the telescope and return to the star, or move to a different star and begin guiding again with the star in the center.  The delta value shown, in arc-seconds, corresponds to the flop that has occurred.


 

Chapter

 

9

 

Details of other features

1.       The Dump button creates a small .png image file with annotations that shows  the raw view of the star, along with the stacked view and the radial profile.  This image is annotated with many of the optical parameters.  The image files are named and indexed automatically based on the date.  This allows a single, small image to capture a great deal of information about your telescope, collimation quality, and seeing.  Another image is also created that shows the full screen view, also with annotations.

2.       The image is also annotated with UserName+ScopeDescription on one line, and Location on the next.  These lines are truncated to 30 characters, so keep them succinct so they will appear in the PNG dump.

3.       The Color button on the main dialog allows the stacked star to appear either gray scale or blue-green-red image.

4.       Isolines gives a simple contour view of the stacked star that helps show the shape of the bright region.

5.       The plots show two curves, and the first item shown is white; the second is red.  For example, in the X/Y plot, X is white and Y is red.

6.       The X/Y plot is normalized in each direction, so it goes from left to right and bottom to top for X and Y respectively.

7.       The QuickCal button does a quicker calibration with no N/S motion.  In order for the result to behave properly, the “Invert N/S” checkbox in the setup dialog must be set correctly.

8.       The Logging button starts logging in two separate files.  Each file is given a unique name that combines the user name, scope description, date, and an index.  One log, MG_XXX_XXX.log, is a simple log of 3 columns containing time, NS, EW (pixels) if not guiding, or time, sumE, sumN if guiding.  The former is for passive logging of the star, e.g. for periodic error measurement;  the latter can also be used for PE measurement, but is based on the actual autoguider response.  The other log file, MG_Full_XXX_XXX.log, is a very detailed listing of values associated with the star, including the MetaGuide phase, amplitude, and corrections.  The file has a header line at the top describing the contents in each column.

9.       Note that units of arc-seconds are associated with NS/EW measurements, and units of pixels are used for X/Y screen coordinates.

10.   Dec corrections may be disabled in one or both directions.  This may help avoid backlash in dec.  If Dec. backlash is a problem, try imbalancing the OTA in dec., and adjusting polar alignment so there is a small but monotonic drift in dec – forcing dec. corrections only to happen in one direction, with no backlash.

11.   The Shift button allows tracking a comet or asteroid that moves slowly relative to the stars.  Enter the rate of motion, from a planetarium program, for the object and guide on a star as usual, but with Shift enabled.  The guide star will be tracked as usual, but with a shift that tracks the comet.  If the motion rates are set correctly, the comet can be exposed longer and reveal sharp detail that would otherwise be lost.

12.   Hot pixels can fool the star detection algorithm, but can easily be removed by pressing the Kill Hot Pixels button in the Setup dialog.

13.   Declination guiding can be a challenge with a mid-range mount, so features to reduce the effect of backlash have been added.  Dec. Lash is a software backlash correction applied by MG at declination reversals during autoguiding.  Dec. Reverse provides a buffer zone so that small reversals do not trigger a guide correction.  These values require experimentation to find the optimum settings, but about 100ms for backlash and 0.2 for reversal is reasonable.

14.   Be sure to set the frame rate of the web cam as desired in the Setup dialog.  For faint stars use slow frame rate and a small number of NFrames.  For bright stars, during collimation, use a high frame rate and a large number of frames.

 

Chapter

 

10

 

Known issues, wish list, faq, etc.

1.       MetaGuide should work with any camera that supports 640x480 output.  It will even work with video cameras, when connected through a video2usb converter.  This way, cameras such as AstroVid or P23C should also work.

2.       The gamma value changes the radial plot and fwhm value relative to theory.  Use gamma=1 for direct comparison with theory.

3.       The radial plot is distorted for f/# below 10 or so.

4.       The star detection algorithm requires no user interaction, but assumes there is one bright star in the field.  If two stars of similar brightness are in the field, use the Lock feature.

5.       MetaGuide does not work with “modified” web cams that support long exposure.  As a result, MetaGuide requires relatively bright guide stars.  Many of MetaGuide’s features are defeated without streaming, short exposure video frames.

 

 

Chapter

 

11

 

Acknowledgements

Many thanks to Andre Paquette for extensive beta testing. assistance in packaging the application, and the invitation to use the AstroGeeks site to host MetaGuide.

Thanks to Dave Rowe for valuable suggestions on the phase detection and coma calculation.

Thanks to everyone in the AstroGeeks group for helpful feedback and testing.

Thanks to the iodll folks at geekhideout for the dll that allows direct driving of the LPT port from C++.

Thanks to Shoestring Astronomy for providing low cost PC-Telescope adapters, and for prompt assistance in providing USB control.

Thanks to Mark C. Malburg for his Oscilliscope control on The Code Project, which was the basis for the scrolling charts.

 

 

Chapter

 

12

 

Examples

 

Comparison of Airy patterns from a wide range of apertures.  Thes are all shown at the same arc-second scale, and clearly show the improved resolution with aperture.  Note that the refractor shows a smooth, round star, but it is in fact much larger, in arc-seconds, than the larger telescopes.  This is an objective comparison that sums up a lot of the confusion regarding the benefits of refractors versus SCT’s.

C11 showing coma due to miscollimation

Now aligned

C11 with off axis 75mm aperture – at effective f/30.5

C11 with on-axis 5.5” aperture, showing enhanced ring

C11 with 75mm aperture and 3x Barlow, effective f/100.2

C11 with 3x Barlow, f/32.7

Mak 7” at f/50.6, nearly same f.l. as c11 with 3x.  Note that both are nearly diffraction limited, but disk is larger for the Mak due to its smaller aperture.

Ranger with 3x Barlow, f/22.7