Package: pectrainer
PECTrainerPECTraineris a python tool to train Periodic Error Correction (PEC) on Celestron telescope mounts.  It is similar to the earlier PECTool but with some additional features.  It works together with an autoguider to record and average multiple worm cycles of the mount behavior to provide a reliable table of corrections to improve tracking.CaveatsOnly works with Celestron mounts and only those that support PECOnly works with computer connection through the handcontrol (not directly into the mount's USB port)Does not work when connecting to the mount through CPWI as the ASCOM driverRequires an autoguider (app, device, or human making corrections) to guide on a starRequirementsPython 3.7+Most likely requires Windows currentlyInstallationExecutepython -m pip install pectrainerat a command line(If you are familiar with python environments you may create one specifically forPECTraineror choose an existing one)Preparation for useConnect the computer to the mount through the handcontrolStart and align the mount using the handcontrolMake sure the mount is polar aligned to within a few arc-minutes (nothing crazy)Prepare the autoguider so it is able to guide, but don't start guiding yetUse the handcontrol to find the PEC index (recommended at this point but can be done later)Performing the PEC trainingUse the command line to go to a directory where you want to run and store PEC logsStartpectrainerat a command line by typing the commandpectrainerConnect to the mount's ASCOM driver (probablyCelestron Telescope Driver)Select the number of cycles to train (the average of all cycles will be automatically loaded to the mount when the cycles complete)Confirm theSeek indexis checked.  If not, click the checkbox to have the mount move a bit in RA to find the index and approximately return - hence the recommendation to do it immediately after aligning the mountChoose a star to guide on and enable autoguiding with the guiding app or device (or manually guide with either the handcontrol or the ASCOM slew controls set to 0.5x sidereal rate)PressStart trainingto begin the trainingWhile the first cycle is recorded no graph will be shown but the progress gauge will begin to increaseAt the end of each cycle the graph will be updated with all previous curves, plus the current average in blackEach worm period will take a few minutes - with time dependent on the type of mountWhen complete the average curve will automatically be uploaded to the mountTo start playback of the recorded PEC curve, pressEnable mount PEC playback, or enable playback using the handcontrolYou are now done and can exitThe PEC graph may be displayed either as a normal PE curve in arc-sec, or as a changing rate over time in arc-sec/s.  Here is a view as rate.  Note that the gearbox term shows clearly as a sinusoid with approximately 21 second period.  Other mounts will show different periodsAdditional featuresYou may download and view the current PEC curve in the mount usingDownload from mountA newPEC_*.jsonfile is created in the current directory every time you pressStart trainingand it is updated with data for each cycle as it comes inThe storedPEC*.jsonfiles may be loaded and viewed later, and optionally uploaded to the mountYou may pressStop trainingif the accumulated curves look good enough and pressUploadto manually load the current average to the mountFor best resultsPolar align the mount well, but no need for perfection.  Within a few arc-minutes is fine.Autoguide on a star high up but reasonably near the equator - within 20 degrees perhaps.  You want to be close to the equator so the star is moving across the sky quickly, and high up so the seeing is better.Use a short guide period of 1 second or so if possible.MetaGuideworks well for this.  Each PEC measurement is a few seconds long, and for a mount such as theCGX-Lthe gearbox terms around 21 seconds long are in phase on each cycle.  This means the PEC table can capture and correct such fast terms, but only if the guide exposures are short enough and the guide corrections happen around once per second.For best results record and average 6 or more cycles on a night with good seeing.TheCelestron StarSense Autoguidershould also work well for PEC training because it makes rapid guide corrections.If the mount has gearbox terms that have the same phase on each cycle, they will stack on top of each other and show clearly in the average.  This is good and it means the PEC can smooth out the gearbox term.... But in contrast, if the gearbox terms are not in phase they will be different in each cycle and they won't stack in the average.  This means you should average many cycles so that the gearbox terms average out.  The PEC won't be able to smooth out the gearbox term - but at the same time the PEC curve won't have a residual gearbox term that would make tracking worse.NotesMake sure your mount is Celestron and has support for PECBehavior on SynScan mounts is unknown, but it may workOnce the mount is trained you can use the mount normally and you don't need to connect through the handcontrol.  You can also remove the handcontrol and use a different alignment app such as CPWIThere are issues with knowing if PEC playback is currently enabled, so the state is not displayed in the GUI.  When done with training, make sure the PEC playback is really happening by enabling it with the handcontrol or CPWIAny drift in the PEC curves will be removed from the displayed plot and from the curve loaded to the mountDeclination guide corrections have no impact on the recorded curveSome mounts don't guide well when PEC playback is enabled, but for Celestron mounts it can greatly improve guiding - particularly if the gearbox term is smoothed out