Monday, February 22, 2021

How To Adjust ASIAir Guide Aggression

 V1.5.3

Why do we guide at all during astrophotography?  The ideal situation would be that we have perfect polar alignment (no drift in declination) and perfect RA drive gears (no periodic error in the worm gear).  In this utopian instance we would not need to guide.  Why you ask?  Because the most ideal guide ignores the effects of seeing and just corrects for the error I mentioned previously.  We don't want to make guide corrections when the star jumps around.  This often makes the image worse than doing nothing.  The solution is to tune the guide pulse and we do this by adjusting the guide exposure, guide pulse multiplier and aggression settings.


Lets talk about a few guide camera settings that will help get to the next steps.  Calibration step and Max dec and RA Duration. 

The calibration duration is simply a value that ensures that a star moves enough during guide calibration so that the axis orientation can be determined.   This should really only take a couple of minutes to complete for both axis.  A value too low will result in an error that the star did not move enough. A value too high will result in a star lost or too few steps completed.  The correct value is dependent on a lot of factors.  The largest factor is the focal length of the guide scope.  Wider field guide systems require the value to be higher so that the movement can be detected.  Conversely if your guide system uses a higher magnification such as when you use an off axis guider or use a barlow lens on your guide scope, this must be reduced.  The goal is to get enough movement in 4 or 5 steps to complete the axis test.   To start you can use this as a guide for some common configurations of guide scope focal length:

ZWO Mini Guide Scope (120mm FL) = 8000ms to 10000ms
Orion 60mm helical focuser guide scope (240mm FL) = 1500ms to 3000ms
Off axis guider (FL same as main scope) = 250ms to 500ms

Again these are just starting points and depending on cameras used it could be different. These should be used as starting points and adjusted so the axis completes calibration in 4 or 5 steps.

Max Duration settings should in most cases be left at the default settings.  PHD2 defaults are 2500ms for each.  Remember these values are Maximum values per guide pulse.  Pulses will more often be smaller in actual use.  So why would you want to change this?  The most frequent use case for reducing this value would be when there are transient issues occurring like wind gusts which would give a short term burst sending the guide star off very quickly but temporarily.  By reducing this value you can prevent the guide from over correcting on such events.   Normally I would just leave this at the default or around 2000ms to 2500ms.  On windy days you can try around 1000ms or less but be mindful that it could take more pulses to get the normal correction back on track. Obviously this is a bit of a trade off and focal length of the guide system will have an impact on the degree of change.  Using an OAG this could come way down to 500ms or less depending on the amount of wind.  Just try different values and see how the system recovers from wind or touching the tube for a second to simulate a wind gust. 


Now that you have your mount and guide session calibrated and have selected a star and started guiding, you will notice the guide graph at the bottom of the guide screen.  There is a lot of information here.  You have options to select the Declination Mode (upper left corner of the graph) and Corrections show or hide (upper right corner of the graph).  Dec mode is used to change how asiair corrects for drift in declination.  Options are off, north, south, auto.  If you are using a tracking mount that doesnt have a motor for declination corrections this should be off.  Most will start with Auto which will correct in both north and south directions. However once you figure out which way your declination drift is trending you can set it for north or south.  This will help by avoiding dec corrections in the wrong direction caused by large movement in seeing.   Corrections should

always be set to show.  I can’t think of any reason not to show corrections on the graph.  This is an important visualization to determine if guiding is too aggressive or not aggressive enough. 

Before we get into aggression settings, lets discuss what we can control.  The first thing to set is the guide exposure.  When we have really good seeing on the order of 0.25” we can use a shorter guide exposure on the order of 1-2s.  When seeing is really poor, the only way to help average seeing is to use a longer exposure like 2-4s.  This is because as the star moves around on a longer exposure it will make a larger star blob tracing out the movement of the star on the guide image.  Phd2 which is what ASIAir uses for guiding uses a centroid algorithm that calculates the center of the blob.  This is the best guess of where the star should actually be on average and where the measurement is made from.  This alone can greatly smooth the graph.  Its ok to start at 1s guide exposure to calibrate, get set up, and evaluate seeing.  But when its show time you should increase this 2-4s to get better results.


The next thing we can control is the guiding rate or guide pulse multiplier.  In ASIAir this is found under mount settings as .25x, .5x(default), .75x, and .9x.  The baseline guide pulse is the pulse sent to mount to keep things moving at the sidereal rate.  When a corrective guide pulse is issued, this setting will send a pulse as .25x the sidereal pulse, .5x , etc. Every mount is different and responds differently.  Most will find that .5x is perfect but not always so.  My Orion mount corrects best at .75x.  For some mounts these settings are not offered in the app and must be set on your hand controller.  You can determine which setting is best by setting both RA and Dec aggression to 50%.  Then try each multiplier setting and watch the total rms number.  Wait for the graph to measure the full width of the chart using the selected setting.  You can use 1s guide exposure for this part to speed up the process.  Choose the setting with the lowest rms error.  Note that as of version 1.5.3 this setting is not persistent and will reset to .5x at boot up.  Another thing to file in the back of your mind is to consider the guide pulse multiplier as a course setting and the aggression sliders as a fine tune setting.  As you try larger or smaller guide pulse multipliers you may need to decrease or increase the aggression to get the best guide.  If you find your aggression is too high or low you may need to adjust the multiplier to keep your aggression in the middle of the range.

Before we get too deep into aggression though, lets talk numbers.


Many folks starting out become fixated on RMS numbers.  So what is RMS. Its stands for Root Mean Square and in this instance its a measure of the seeing and mount error from a perfectly still star measured over a particular period of time.   You can Google RMS to learn the mathematical wizardry here.  But we will keep this simple.  RMS error is important but in most cases these numbers are limited by seeing conditions.   They translate to the approximate size of stars to expect over the given period of time. 

For reference there is a practical limit of seeing anywhere on the planet due to the atmosphere.  At high elevations (observatories) it may be possible to obtain seeing below 0.2 seconds of arc or 0.2”.   For most of us though 0.25” is pretty much the absolute lower limit.  Good seeing is about 0.5” to 0.7” and average is between 0.7” and 1.0”.   You can still image up to 2.0” but stars will be larger and you might benefit from binning.  That will be discussed another time. ZWO has a white paper on their site that discusses binning properties with their CMOS cameras. Any time you get seeing below 0.5” consider yourself lucky.

Now that you have an understanding of target numbers note that these can change over hours minutes or even seconds.  Atmospheric seeing is what makes the guide graph move randomly over time.  When we guide we are not correcting for seeing conditions we are correcting for error in Polar Alignment and in periodic error of the main RA worm gear.  Guiding on seeing changes can actually make your stars and image resolution worse. Therefore we want the guide corrections to be effective but not overly so.  To help average seeing we use longer guide exposures over several seconds sometimes to average the blob that is being measured. 


Lets focus on Declination first.  This is because the rms error for dec is that due to Polar alignment, seeing, and corrrections.  At any time if we have dec guiding tuned properly and assume we have good enough polar alignment, this number should be really close to the practical limit we can achieve due to seeing conditions.  Therefore this should be the first parameter to tune and minimize as we will use this as a guide to set RA.  Its important to tune Dec so corrections mostly are made to correct for polar alignment error.  This will ALWAYS be in one direction north or south and will automatically switch after a meridian flip.  Once you figure out the trend you can set the dec mode to north or south to keep the trend in check. You can lower Dec aggression down to the minimum and watch the graph. The red line will eventually drift up or down the rate of which will depend on how good your polar alignment is.  Select north or south dec mode and see if the rate increases or decreases. You may need to put dec aggression back to 50% or more to see this effect more quickly.

Once you have the mode set, now we can focus on aggression.  Remember we just want to correct for the trend.  If the aggression is too low the trend line will drift away slowly as it did before.   If aggression is too high the correction will cause the line to overshoot the zero line.  If dec mode auto were selected we might see a correction in the opposite direction.  For this we just watch the line.  The correction should not cause it to cross zero line by much.  It takes some trial and error to get this right. But take some time to practice and watch what happens when aggression is set really high and really low so you can spot the error quickly.

Once declination is ironed out its time to tackle the RA setting.  There are more things that can go wrong here but the process is similar with a catch.  Note the rms error we previously obtained in Dec tuning.  Don't worry too much about the number. Just note that we want RA to be about the same as close as we can get.  Since RA is always correcting one way or the other we want to start by moving from 50% aggression to 5 or 10%.  If you see that RA pulses are happening in the same direction a lot one after another then it means it can’t get the line back to zero and the aggression needs to be increased.  Work it back up a bit and wait for the line to come back to zero.  If the aggression is too low you will see multiple corrections in the same direction.  If the aggression is too high you will see a corrective pulse and then immediately a pulse in the opposite direction. Its better if the first one falls a bit short and a smaller second one takes it to zero.  You will see the overshoot happen once in a while even on a properly tuned guide.  But it should be random and seldom.  There should be nothing on the guide graph that looks like a pattern.  If there is, your aggression is likely too high. 

So now that you have things tuned, you can now increase your guide exposure to 2-4s.   This takes some trial and error.  A well tuned mount can take 4s or more but some just have too much periodic error or stiction to tolerate that long period without a guide pulse.  As you go from 1s to longer exposures you may need to choose a new guide star or reduce the gain as the bright ones will start to clip.  You will almost certainly notice that as you increase your exposure, the rms error starts to drop as there are fewer corrections due to seeing.

Now the catch.  Nearly every worm gear in existence has what is called periodic error.  The worm gear in the RA axis rotates once every few minutes.  Mine has a 10 minute cycle.  This has an impact on tracking, guiding, and rms error.  Its best to watch the guide graph over a 10 minute period to make sure the aggression is high enough to correct for the error.  This has a limiting effect on the rms error value that you can obtain.  You may not be able to match the Dec rms error because your aggression must be increased to compensate.  To further complicate it, a long guide exposure may not be able to detect the start of this error soon enough to correct in time.  Its something  you have to watch for before you start imaging.  Understand how your RA works over the full cycle of the worm gear so you don't have any surprises. Better mounts have hand picked gears to minimize this effect. 

Some mounts have what is called PPEC or permanent periodic error correction.  This is a learned cycle of the worm and can be played back within the motor controller to correct for periodic error. It requires the hand controller to be operational.  However, PPEC is not compatible with INDI which is what is used on the ASIAir.  Some have had success but its believed to be a disaster waiting to happen.  I have witnessed conflicts using PPEC.  The issues are a matter of timing.  You can either get a double corrected guide pulse or a software glitch which turns tracking off in the hand controller.  Either way its a disaster to any imaging session.  Either use PPEC by itself or just use ASIAir guiding with PPEC disabled.  Just a note that there are some limited ASCOM drivers designed to allow both to work.  ASCOM requires a PC to control everything and at this time there are no INDI drivers that safely allow the use of PPEC with PHD2.

I hope this sheds some light on getting the aggression settings set properly.  With some practice you can quickly get these settings adjusted based on the current seeing conditions.  Just remember we are always seeing limited and one session to the next can have vastly different settings and results. Take some time to practice during full moon and eventually you will master these settings.
 


Modifying the ASIAir Default Startup Settings

 V1.5.3

On occasion some users may need to change the default start up behavior on the ASIAIR or ASIAIR Pro. ZWO has made this possible through the modification of the "ASIAIR_Config.txt" file. The settings are the same across all ASIAIR platforms and versions.

Before attempting to do this there are some things to know. First and foremost, before attempting any manual modification of the config file you should ensure you have made a successful backup image of the card as well as copied off the "zwoair_license" file to a safe place. DO NOT SKIP MAKING A BACKUP FIRST.

The ASIAIR Backup and Restore procedures are located in the ASIAIR users manual located here:

https://astronomy-imaging-camera.com/manuals-guides

Lastly to perform this operation you need to insert the SD card into your PC in order to edit the configuration file. Because ASIAIR uses a linux based operating system all but one of the file systems on the card will show as corrupted or say they need formatting. DO NOT FORMAT ANY OF THESE PARTITIONS. Just click cancel through all of these, there should be only 3 or 4 pop ups to cancel.

Now that you have a backup and have avoided formatting the card, we can begin. On the Boot filesystem, normally assigned to E: but could be something else if E: was already assigned by your operating system, there will be a file called "ASIAIR_Config.txt". You should edit this with only "Notepad". The file contains the following entries:

#ASIAIR boot config file

#ASIAIR boot as 2.4GHZ WiFi if set to 1

AP_boot_24G=0


#ASIAIR 5G channel,36 or 149

AP_5G_channel=36


#ASIAIR 2.4G channel, range: 1-11

AP_24G_channel=11


#AP SSID and password will be reset to default value if set to 1

AP_reset=0

Here is an explanation of each option and when you may find it necessary to change the option. Most people will never need to edit this file.

AP_boot_24G

This option controls what wifi speed is enabled when the device boots up. This is sometimes needed for older phones or tablets that do not support 5ghz wifi. Without changing this setting you would not be able to connect to the ASIAIR. Currently this option is really only useful if you have an Original ASIAIR. The Pro version starts up out of the box in 2.4ghz mode so should not need to be changed. This option however makes it possible to force this setting in the event it is changed to 5ghz accidentally or you always want the device to start up in 2.4ghz.

To force start up in 2.4ghz wifi change this option from 0 to 1.

AP_5G_channel

This option controls what channel the ASIAR uses when running in 5Ghz AP mode. The default is to use channel 36 which uses a lower frequency and therefore penetrates walls a bit better. The other option is to use channel 149. This provides a slightly higher data rate at the expense of needing a clear line of sight between the ASIAR and your phone or tablet.  It is important to note that the 802.11ac specification dictates that the higher frequencies use a higher output power to compensate for the extra weakening of going through walls and some types of coated glass.  If you have a direct line of site to your scope or use extenders you could benefit from using channel 149 instead.  Another possible need for this is if you have multiple 5Ghz wifi in your vicinity.  Changing this will allow them to better coexist in close proximity.

To change 5ghz wifi usage to channel 149 change this option from 36 to 149

AP_24G_channel

This option controls what channel ASIAIR uses when running in 2.4Ghz AP mode. The default is to use channel 11. If there are other 2.4Ghz Access Points in the area using this channel you may need to change this to something else in the range of 1 to 11 to avoid a conflict and connection failures.

To change 2.4ghz channel usage change this option from 11 to anything in the range from 1-11

AP_reset

This option is used to reset the SSID and the Wifi settings back to factory defaults in the event it has been changed and the device is no longer accessible.

To reset the wifi SSID and password back to factory default change this setting from 0 to 1

Once you have made any desired changes, save the file and exit notepad. It is important to make sure the SD card is properly and safely ejected before removing it from the computer. You can do this by right clicking the USB stick icon on your task bar and click "Eject SDHC Card". When prompted that it is safe to remove you can do so.

Carefully replace the SD card back into the ASIAR and the device will now boot with the desired settings. If the new settings enhance your experience, I would recommend making another backup image of the card to save time later if/when the need arises to reimage it.



Friday, February 19, 2021

Why does my ASIAir go nuts after polar alignment?




V1.5.3

ASIAir has a great polar alignment (PA) routine which can get you close enough to alignment with the north or south pole, as close as you could get with a polar scope, maybe better.  However while PA is necessary for great tracking and minimal guiding, you don't need to use the built in PA if you have another way of doing it such as with a polar scope.  For those that use it, you may occasionally notice that after using the PA tool and then do a goto the scope goes nuts and sometimes points down or approaches or hits the tripod or pier. 

While this is a dangerous situation you can either kill power to the mount or release the clutches until the show stops.  Obviously this is a bug that crops up from time to time.  So whats happening?  For some reason at times after PA, the ASIAir and/or mount driver loses track of where it is and a direct goto will send it to some strange location.  This issue has been reported and I encourage you to submit feedback via the app when the issue occurs so ZWO can review the logs. 

However, don't fret.  There is a workaround.  It was discovered if you don't use PA then the issue never surfaces.  You can still boot up and use PA to get your mount squared away.  However, when you have succeeded with PA, return the scope to the home position by hand, shutdown the asiair through the app, then power off the asiair and the mount.  Power everything back up and once connected via the app, go straight to a goto and plate solve a preview image.  The mount should operate as expected from here out. 

Once you obtain PA you don't need to go back in and do it again when restarting asiair.  Once its done, its done until you move or bump the mount enough to knock it off.

With some users we found that they did not have a clear view or Polaris or the automated rotation didn’t  move enough or it would go too far.  ASIAir does not need to see Polaris to work properly. The scope can be up to 30 degrees away from Polaris and PA will work just fine.  If the automated rotation doesn't work fo you, you can also do the rotation manually.  You have to turn off the mount driver in the app first then return to PA.  When the rotation step starts you will get a warning about turning on the mount.  Just cancel the warning and move the scope as instructed in RA then move to the next step.  This can also be done for non goto mounts like the Star Adventurer which only uses the On Camera ST4 driver.  However you also have to turn off the On Camera ST4 driver to complete a manual PA.

Once PA is completed manually return the scope to home position.  At this point i would recommend shutting down ASIAir and powering off both asiair and the mount then power them both back up.  If the mount does not automatically enable in the app you may need to manually turn on the driver.

You dont need to to go into PA again.  Just goto an object and do a plate solve to get things in sync.

We try as we may to squash bugs but this has been elusive.  Fortunately there is a workaround.   I hope this was helpful and look forward to seeing everyones images on the FB ASIAir group. 


ASIAir Exposure Calculation

There are quite a few guides out there that attempt to explain how to choose the optimal exposure for astrophotography.  Most are rather complicated to a beginner.  Since the ASIAir is supposed to make astrophotography easier lets explore this within the context of asiair. 

First though lets go over some basics.  By now you are likely familiar with stacking and with that the calibration frames that go with it, bias, darks, and flats.  For the sake of exposure calculation we will focus on bias.  What is Bias?  In a practical sense this is the absolute noise floor that an imaging sensor produces just to read the data from the sensor.  It has nothing to do with exposure and everything to do with the all of the analog to digital conversions and getting the data read quickly from the sensor.   I wont go into the technical details here.  We use a bias exposure to determine the baseline from which to measure our exposures.  To take a bias frame you simply take an exposure with the shortest exposure time possible and the lens or telescope covered. 


So what?  Well ASIAir makes it easy to measure the noise floor exposure.  We call this the Average ADU value.  Its an average value of all of the pixels in the image.  Since bias is relatively flat across the sensor we can use this as starting point for our exposure. The average ADU value can be read right on the preview information screen as AVG.  This value will change at different gain settings so you may want to make a chart.

We can use this same AVG value to measure our target images or light frames.  In all cases we are all skyglow limited so when we expose our light frame the AVG value is almost always the skyglow with the minimum AVG value being our bias noise.  For some large objects this value can be skewed slightly higher but in general this is the limit of detail that you can record at your location.


The rule of thumb is to expose your target light frames to about 400-600 AVG ADU above the bias level for monochrome cameras abs about 1200 above for color cameras.  Why so much higher for color cams?  Its because of the introduction of the bayer matrix over the mono sensor to create red green and blue pixels.  I wont go into the details here but most CMOS color cams use an RGGB quad of pixels to give your color representation.  There are two green pixels for every red and blue.  We therefore really need to expose for those single color pixels and to compensate for the color filter we have to expose about 2 to 3 times higher in ADU.

Why not just expose much higher and adjust later in processing?  In astro imaging we want to preserve as much dynamic range as possible but expose the image high enough so we can get our skyglow far enough above the bias noise that we can absolutely send that noise to black in our final image and be able to process the fine detail higher above it.  We also want to preserve as much star color as possible so its a balance between preserving star color and getting the bias noise down to black away from our subject.

If you live in highly light polluted areas you will find that using this method gives you really short exposures.  This is about all you can record given the skyglow you have.  In those instances you can add filters to block light pollution.   The same method holds true with filters.  Once you reach your target AVG ADU then recording longer will only clip your stars.

These are just starting values and depending on the filters you may never get to the AVG ADU value for skyglow within a reasonable amount of time.  Trial and error will give you an idea of where you need to be.  Make notes on the AVG ADU values that work best with each filter and use that as your basis.

I hope this helps get you started and gives you an idea of how to determine the optimal exposure for location and setup.  ASIAir makes it easy to calculate exposure and the AVG value should be your goto metric to determine that.




Monday, February 15, 2021

ASIAir Dithering

 



 V1.5.3

So for my first post here I'm going to start with dithering.  We see a lot of questions come up on the FB forum regarding how to set up dithering on the ASIAir.  Dithering is an important tool used to randomize fixed sensor noise and prepare sub frames for better statistical averaging and noise reduction during stacking and processing. Dithering is commonly used to eliminate what is called walking noise but it also helps improve signal to noise in general by ensuring that any fixed noise elements are not part of the signal being recorded. Walking noise is noise in the background that shows as lines or streaks due to poor polar alignment and from minor defects in imaging sensors. It often manifests itself in images that have not been exposed long enough or have low signal to noise due to excessive light pollution. Dedicated astro cameras have much less noise to start with and therefore suffer less from this effect than DSLRs. DSLRs require heavy amounts of dithering to suppress walking noise in final stacked images. Dithering, randomly moves the image by a set number of pixels so that stacking software can better reject the noise when using noise rejection options such as Sigma or Windsorized Sigma Clipping.

Dithering is accessed and configured under "Guide Settings" within the ASIAir app. There are four main settings that require adjustment based on your camera type, degree of mount backlash, and seeing conditions.

Pixels - This is the number of pixels that the image will be randomly shifted between exposures. The range is 1-10 pixels. Most dedicated astro cams can benefit from 1-3 pixels in movement. However DSLRs require the max between each frame to properly eliminate walking noise.

Stability - This setting is the required distance in seconds of arc that the target must be within after a dither before beginning the settlement period. In order to determine this setting you need to watch your guide graph for a while and determine what the current seeing conditions will allow. For example, if your guide graph is regularly swinging between +1" and -1" than your stability would be 2" which is the distance covered between 1 and -1 through the zero line. You should set this parameter just higher than your noted stability. In this example a stability of 3" should be used.

As another example, if the stability on your guide graph is varying between 0.5" and -0.5" then your stability is 1". Your stability setting should be set for 2". One setting higher than what you observed.

You can use a lower setting but in doing so you may not reach a point where guiding will resume as your stability will rarely be within the range selected long enough. It should never be set below your observed stability as shown on your guide graph or imaging may never resume.

Settle Time - This setting is the time that must pass once the guiding is within the stability distance configured. The guide must remain within the stability distance for the set period of time before the imaging sequence will continue. For example the guide graph is regularly varying between 1" and -1" on the guide graph and a stability of 3" is configured along with a settle time of 3s. Once dithering has moved the image by the desired number of pixels, guiding will move out of the range but slowly settle back into the range 1 to -1. Once the guide has moved within that range the settle time will start counting down. If the guide moves back out of the stability range, the countdown will reset and wait for guiding to move back into the range. Once guiding has stabilized between 1" and -1" and has remained there for 3 seconds, the imaging sequence will resume.

The desired settle time is mainly based on how much backlash exists in your mount and how quickly it can recover and stabilize. A well tuned mount can begin guiding after 1s has passed. A poorly tuned mount with a lot of backlash may take longer to clear. If it takes more than 15s to settle then dithering should be disabled until the backlash between the gears can be corrected.

Timeout - If the dither doesn't settle out for one reason or another, this sets the maximum time it will wait before starting the next exposure.  It is always good to set this to something reasonable like 60s.

Interval - This is the number of images that can be taken before dithering is executed. It is always good to dither after every frame but with some astro cams it may not be needed every frame. For DSLRs, the interval should always be set to 1 such that every frame is dithered.

RA Only - This option is really only useful when using a tracking platform that only guides in RA via ST4.  This allows those mounts to dither in one axis which can drastically improve the signal to noise ratio.

Dithering is an important tool to help noise reduction algorithms eliminate fixed noise in stacked images. There is generally no additional consideration needed during processing to benefit from this other than to make sure you are using Sigma Clipping or Windsorized Sigma Clipping during stacking. There is no cost to using it other than a few extra seconds between exposures. The benefits far out way the extra time needed and should be used if your mount allows it every time you image.