Changes

SiTech

6,344 bytes added, 13 March
/* Starting Autoguider software */
== Purpose == This wiki is for technical staff - the contents are not to be followed by observers. If you are an observer needing assistance with Lesedi, please see the [[Lesedi|Lesedi wiki]] or call a technician. == Changes == Dec 2022: 1ms1 has been replaced with lesedis2 (username & password unchanged) and lesedi-nuc has been replaced with ioserver1. The autoguider functionality is now intrinsically linked to Mookodi, so the startup procedure involves multiple PCs. '''Anyone observing in the dome will use lesedi-nuc to operate the telescope and instrument via the web GUIs. SiTech and the autoguider backend are running on ioserver1, so to safeguard them from interference, observers should only use ioserver1 to view the weather page.''' == SiTech == The SiTech software runs Lesedi the telescope (except mirror covers) on 1ms1 lesedis2 (="1-metre lesedi server 12", i.e. Lesedi's TCS PC). 1ms2 is Lesedi's backup machine. There is a main GUI for the telescope (SiTechExe.exe), a communications GUI (ServoSCommunicator.exe), a GUI for each rotator (SiTechRotatorTCP.exe and "SiTechRotatorTCP.exe left"), one for the secondary and tertiary mirrors (SiTechFocuserTCP.exe), one for the dome (DomeControlTCP.exe) and a GUI that communicates with each subsystem's software (ObservatoryControlSAAO.exe). All of these GUIs must be running for the telescope to function fully, and only one instance of each can be run at a time, else problems will arise.
'''Leave the SiTech software running at all times during normal operations. It is vital to ensure that no parameter is changed in any of these GUIs.'''
To prevent accidental interference, and to provide a streamlined user experience, a [[Lesedi#TCS Overview|browser-based TCS]] has been developed for the user. It is intended that users will interact with the browser and not with SiTech. This page details engineering tasks and should not be available to general users.
'''Note that the SiTech software cannot control the mirror covers since we put them under PLC control. These must can only be operated from the browser TCS.''' In case of software failure, they can be closed by pressing the button on each cover motor, being careful to take the weight of the cover (which will otherwise fall under gravity).
== Starting SiTech software ==
'''N.B. These instructions have been updated in Feb 2023 - changes include the switch from 1ms1 to lesedis2. To start up Lesedi you must also follow the next section to set up the autoguider for Mookodi.''' These steps involve opening multiple terminals. It is much more manageable to open multiple tabs in the same terminal, than to have many terminal windows to switch between. To do this, open one new terminal, then press '''CTRL-SHIFT-T''' in that window each time the instructions say to open a new terminal. The software should be opened on lesedi-nucioserver1, by connecting by ssh to lesedis2 and running the software using the mono libraries. If in Sutherland, you can do this from the lesedi-nuc ioserver1 PC in the warm room, else if working remotely from Cape Town, VNC to lesedi-nucioserver1 (VNC does not currently work for all users for this PC, in which case use Teamviewer):
1. Open Remmina Remote Desktop Client, select "VNC" from the dropdown menu and double click on Lesedi_Nuc ioserver1 from the list of servers. Enter the password and the lesedi-nuc ioserver1 desktop will be displayed on the screen.
2. Look for an existing terminal on lesedi-nucioserver1, else open a new one, and log in to lesedis2(we'll call this terminal #1):
ssh -Y observer@lesedis2.suth.saao.ac.za (you shouldn't need the full path from inside the network, just observer@lesedis2)
3. Then run this command to get the display to work:  sudo xauth merge ~/.Xauthority 4. Check for existing instances of the software already running:
ps aux | grep SiTech
ps aux | grep Obs
45. If any existing jobs are listed -- and you are sure they are not in use by someone working elsewhere -- kill them all. Note that there will be two jobs each to kill for SiTechExe and ServoSCommunicator, so nine jobs in total if all GUIs are running:
sudo kill -9 xxxxx (where xxxxx is the relevant process ID)
56.(a) All the SiTech software can be opened using a startup script in the home directory, then leave the terminal running:
cd
sudo ./startup.sh
56.(b) or opened individually in the following order, putting each task in the background (the first two must use "sudo", and don't respond well to "&"):
cd bin
sudo mono SiTechExe.exe ''(always open this one first, and wait until the GUI has loaded and the message window has closed)''
CTRL-Z
bg
sudo mono ServoSCommunicator.exe ''(always open this one second, and wait for the GUI to fully populate and values start updating)''
CTRL-Z
bg
mono SiTechRotatorTCP.exe &
mono SiTechFocuserTCP.exe &
mono ObservatoryControlSAAO.exe & ''(always open this one lastas it has to connect to all the others)''
67. '''Important''': every time the SiTech software is restarted, you also need to do the following:* Navigate to the Dome tab of ServoSCommunicator restart Lesedi's web server and tick the box called "Read PLC Comms" (this logs dome comms to help us track down an ongoing & evasive bug)backend. * In a new terminal, restart Lesedi's web server and backendtab (terminal #2 - press CTRL-SHIFT-T in the terminal to open a new tab):
ssh observer@lesedis2.suth.saao.ac.za
sudo systemctl restart lesedi
sudo systemctl restart lesedi-web
exit (to leave the ssh session)
exit (to close the terminal)
* Restart 8. If you ever need to restart either ServoSCommunicator or SiTechExe, you will first need to close all the autoguider backend softwareother subsystem GUIs, and reopen them in the order above (or just run the start-up script).  9. If working in the dome, bundle all the GUIs onto the left-hand monitor (it's open makes it has probably hung and easier to find them if someone needs to VNC from a smaller screen) then minimise them - they won't respond need to be accessed during the red EXIT buttonnight unless something goes wrong. If working in Cape Town, so kill it you can close the VNC session with ioserver1 by clicking the right-hand "Disconnect" button on the Remmina tool bar (or by pressing the X in the Teamviewer menu). == Starting the LCU == The Local Control Unit (LCU) should be running during normal operations. In terminal #2 (lesedis2) check its status and then restart start itif necessary:  sudo systemctl status lesedi-lcu sudo systemctl start lesedi-lcu If you need to stop or restart the LCU for any reason, the commands are:  sudo systemctl stop lesedi-lcu The LCU logs to /var/log/lesedi-lcu.log - if you need to check the logs, in a terminal use the command:  less /var/log/lesedi-lcu.log == Starting Autoguider software == '''These steps must be followed if SiTech has been restarted,''' hence the numbering continues from the section above. There are now autoguider-related programmes on both lesedis2 and the Mookodi PC, so the process involves both PCs. 10. From ioserver1, in the terminal tab connected to lesedis2 (terminal #2), run following commands: 
ssh observer@lesedis2.suth.saao.ac.za
systemctl stop lodestar_source_extr.service
systemctl start lodestar_source_extr.service
 
11. Open another terminal tab (terminal #3) on ioserver1 and log in to lesedis2. If the autoguider backend software was open when SiTech shutdown then it has probably hung and won't respond to the red EXIT button. We need to kill it:
 
ssh -Y observer@lesedis2.suth.saao.ac.za
ps aux | grep readPLC
kill -9 xxxxx ''(where xxxxx is the process ID reported from the ps aux task - kill all such processes)'' 12. Then start the autoguider backend software (still in terminal #3):  cd sudo xauth merge ~/home/observer.Xauthority p9e cd ~/srcdevelopment/xyslides2ports
sudo ./main_prog -depth 24
13. Open another terminal tab (terminal #4) on ioserver1 and start the guider web server:
 
ssh observer@lesedis2.suth.saao.ac.za
p9e
cd ~/development/lesedi-guider-web
gunicorn -k gevent 'app:create_app()' -b 0.0.0.0:5001 
 
If this step fails (symptom "Socket connected is False"), close the autoguider GUI and repeat steps 12 and 13.
 
14. Open a final terminal tab (terminal #5) ssh to mookodi and start the autoguider comms/catalogue services:
 
ssh mookodi@mookodi.suth.saao.ac.za
systemctl stop gaia_list.service
systemctl start gaia_list.service
sudo systemctl stop Mookodi_source_extract
sudo systemctl start Mookodi_source_extract
15. Test the browsers: * Point a browser to http://lesedis2.suth.saao.ac.za:5000 to load the TCS. If it loads ok, '''close the browser''' so the observer can log in from elsewhere. If it fails, repeat step 7. If you ever need to restart either ServoSCommunicator or SiTechExeit still fails, you will first need start again from step 4. * Point a browser to close all 10.2.2.32:5001 to load the other subsystem GUIsautoguider. If it loads ok, reset and reopen them initialise the XY slides, then '''close the browser''' so the observer can log in from elsewhere - '''there must never be more than one instance of the order aboveautoguider open'''. If it fails, start again from step 10.
816. If working in the dome, bundle all the GUIs onto the leftLeave terminal tabs #1 -hand monitor (it makes it easier #5 open to find them if someone needs to VNC from a smaller screen) then minimise them - they won't need to be accessed during the night unless something goes wrong. If working in Cape Town, you can close the VNC session with lesedi-nuc by clicking the right-hand "Disconnect" button on make the Remmina tool barnext restart quicker.
== Stopping SiTech Software ==
== Making a pointing model using SHOC ==
1. Open Remmina and VNC into lesedi-nucioserver1.
2. Make sure all the usual SiTech software is running and ready the telescope for observing, then in /home/observer/bin open the programme that connects to SHOC and run astrometry:
9. '''Save the model''' by clicking "Save Text Calibration File" on the Main PXP tab of the PointXP6 window. The naming convention is '''YYYYMMDD_SHOC_Right_NorthUp_150points.PXP''' for a 150 point model made with SHOC on the right-hand rotator tracking the parallactic angle. If you intend to use the model, '''also save it as AutoLoadRight.PXP''' (overwrite existing file) so that it is loaded automatically when selecting the SHOC port. The model file selected for each port is set on the Tertiary Mirror tab of the SiTech TCP Focuser GUI (currently /usr/share/SiTech/SiTechExe/AutoLoadRight.PXP - if you change this, remember to click "SAVE Settings" on the Configuration tab).
10. Close the Script, PointXP6 and Astrometry windows, the SiTechCamera GUI and CTRL-C in the terminal to stop running the astrometry programme. If going back to normal operations, stop all SiTech software and reopen from lesedi-nucioserver1, then do a "sudo systemctl restart lesedi" and "sudo systemctl restart lesedi-web" from lesedis2 and restart the autoguider software. == "SiTech Ready" config: illustrated guide == This section illustrates how the SiTech GUIs will look if there are no issues, and points out potential problems to look out for.<br clear=all>[[File:SiTechExe.png|800px|left]]<br clear=all>[[File:rightrotator.png|800px|left]]<br clear=all>[[File:rightrotatorconfig.png|800px|left]]<br clear=all>[[File:focuser.png|800px|left]]<br clear=all>[[File:dome.png|800px|left]]<br clear=all>
== Troubleshooting ==
1. If the '''web GUI is unresponsive''', showing a status that you don't believe, or reporting errors, the first thing to try is to reload the browser. If that doesn't solve the problem, restart the web server and backend using the following commands in a terminal:
ssh observer@1ms1lesedis2.suth.saao.ac.za
sudo systemctl restart lesedi
sudo systemctl restart lesedi-web
The pink warning box will disappear from the relevant GUI if the problem is resolved. If the problem persists, see point 3 below.
3. If clicking on a "Bad comms" warning button does not fix the problem, the SiTech software will need to be stopped and restarted. It is vital that all the SiTech GUIs are closed, and that they are reopened in the correct order, so follow [[#Starting SiTech software| this procedure.]] then restart all the other Lesedi/Mookodi services.
4. The most common issue is '''loss of dome commsDome and mirror covers close unexpectedly, telescope and rotators park.'''. The symptom will A full shutdown like this can only be that triggered by the dome won't move to a new target, or that it has closed without warning (the telescope will not park, mirror covers will not close: those actions suggest an LCU shutdown). A red warning button will appear labelled "Bad Dome Comms" in Perhaps the Dome GUI - clicking it should solve the problem. If it does, go weather is bad (or mistakenly thought to the browser TCS Advanced tabbe bad), and in or the central panel click "TAKE CONTROL", then turn dome "Tracking" ON LCU has crashed and OPEN if the dome had closed without good reason everything to keep it safe in the middle of observingits absence. If comms are not restored this way, then press Shutdown on the browser TCS and follow the full instructions on [[#Starting SiTech softwarethe LCU| starting SiTech softwareRestart the LCU]] to restart. Then reload the browser TCS and run the a telescope startup procedure.
5. '''Focus Dome closes unexpectedly and no other subsystem is unresponsiveaffected'''(mirror covers stay open, telescope keeps tracking, etc.). This is typically a comms loss to Check the SiTech focuser dome GUI and doesn't respond to the instructions for a "watchdog timeout" in point 2the small font list of statuses. Follow If this is listed, power cycle the full instructions on dome muscle box, then close the autoguider software, close the SiTech software, and [[#Starting SiTech software| starting restart SiTech software]] to restartand all subsequent services.
6. '''Loss of dome comms'''. The symptom will be that the dome won't move to a new target, or that it has closed without warning (without parking the telescope or closing the mirror covers: those actions suggest an LCU shutdown). A red warning button will appear labelled "Bad Dome Comms" in the Dome GUI - clicking it should solve the problem. If it does, go to the browser TCS Advanced tab, and in the central panel click "TAKE CONTROL". If the dome had closed without good reason in the middle of observing, CLOSE the mirror covers, then turn dome "Tracking" ON, OPEN the dome then the mirror covers. If comms are not restored this way, then press Shutdown on the browser TCS and follow the full instructions on [[#Starting SiTech software| starting SiTech software]] to restart. Then reload the browser TCS and [[#Starting SiTech software| run the telescope startup procedure]]. 7. '''Focus is unresponsive'''. This is typically a comms loss to the SiTech focuser GUI and doesn't respond to the instructions in point 2. Follow the full instructions on [[#Starting SiTech software| starting SiTech software]] to restart. 8. '''No rotator comms'''. First try shutting down and restarting all SiTech. If that doesn't work, log into 1ms1 lesedis2 and do the following: ssh observer@1ms1lesedis2.suth.saao.ac.za
ls -l /dev/ttyU*
Look for the USB port associated with ttyUSBRot2 - in this case it is ttyUSB1. Check the serial number of the device on port ttyUSB1:
observer@sa1lesedis2:~$ udevadm info -a -n /dev/ttyUSB1 | grep '{serial}'
ATTRS{serial}=="A603G14W"
ATTRS{serial}=="0000:00:14.0"
The serial number of the rotator controller is A603G14W, so this confirms that the rotators are communicating on port ttyUSB1. If the above command gives you a different serial number, edit the command to try each port from ttyUSB0 to ttyUSB5 until you find A603G14W. Now go to the ServoSCommunicator GUI and select the Rotators tab. In the dropdown menu, select the appropriate port - in this case ttyUSB1. Go to each of the Left Rotator GUI and the Right Rotator GUI and click on the pink warning complaining of no comms. If the warning doesn't clear, shutdown and restart all SiTech. ServoSCommunicator should wake up with the ttyUSB1 port selected, and communications to the rotator GUIs should be restored.
79. '''The telescope won't slew''' - in robotic mode this is likely discovered as '''telescope isn't in the park position in the morning'''. First check that the telescope is "unparked " in the software and -- if trying to point -- that the target is within the visibility window(the TCS web GUI has a visibility calculator). If those things are fine, the telescope may have triggered the hardware azimuth hardware limit switch. This sometimes happens if the telescope is at azimuth ~165163-175 degrees. Go to the SiTechExe GUI (the long, thin one) and at the top of the "Scope " tab, check if any of the arrows are red or orange. If they are, click the "STOP" button toward the bottom of the GUI, then click the opposite arrow a few times to move nudge the telescope out of the limit. If the motors are in "blinky", you may need to click the button at the bottom to switch the motors to automatic. 10. '''Telescope won't slew: motors are in "blinky" mode and won't switch to auto.''' There is likely an error on the alt and/or az controller board which will need to be reset. Find the SiTechExe GUI (the long, thin one) and try pressing the button at the very bottom to switch the motors to Auto. If it does nothing, select the "Features" tab on the same GUI. Press the "Controller Stuff" button, which will open the "Controller Information Window". There are two columns in this GUI, one for alt, one for az. There is a text box about two-thirds of the way down each column, which will either say "No Errors", or list some errors. If there is an error in the box, click the "Reset Errors" button directly underneath that text box. '''Be very careful not to click any other button.''' If that has fixed the problem, the motors will now be in Auto mode - the button in the top left corner will say "To Manual (Blinky)", and the long, thin SiTechExe button will say "Motors Automatic" at the bottom. Close the Controller Information Window and resume operations. This almost always solves the problem, but if it persists, go to 10a).
8. '''Telescope motors are in "blinky" mode and won10a) If point 10 didn't switch to auto.''' There is likely an error on the alt and/or az controller board which will need to be reset. Find the SiTechExe GUI (the long, thin one) and try pressing the button at the very bottom to switch get the telescope motors back to Auto. If it does nothingmode, select the "Features" tab on the same GUI. Press the "Controller Stuff" buttonclose all SiTech software, which will open power cycle the "Controller Information Window". There are two columns raspberry Pi in this GUI, one for alt, one for az. There is a text the altaz controller box about two-thirds of under the way down each columnNorth pier, which will either say "No Errors", or list some errorsthen restart SiTech. If there is an error in the box, click the "Reset Errors" button directly underneath that text box. motors aren't in Auto and can''Be very careful not t be switched to click any other button.''' If that has fixed the problem, the motors will now be in Auto mode - the button in the top left corner will say "To Manual (Blinky)"on startup, and the long, thin SiTechExe button will say "Motors Automatic" at the bottomcheck for errors as per point 10 above. Still got trouble? Close the Controller Information Window and resume operations. This almost always solves the problem, but if it persists, go Go to 8a)10b.
8a10b) If point 8 didn10 & 10a) don't get solve the telescope motors back to Auto modeproblem, close all SiTech software, power cycle the raspberry Pi in and reset the SiTech altaz controller box under the North pier, then restart the SiTechsoftware. If the motors aren't in Auto and can't be switched to Auto on startup, check for errors as per point 8 above. Still got trouble? Go to 8b.
8b) If 8 & 8a) don11. 't solve ''North-South on the problem, close all SiTech software and reset image is not aligned with columns on the instrument detector.''' On the SiTech altaz controller under rotator GUI, on the North pier"Config Page 1" tab, then restart there are two boxes that need to be ticked to keep North aligned with either "up" or "down" on the SiTech softwaredetector. If the motors aren't in Auto and can't be switched to Auto Tick these two boxes on startupthe SiTech Right Rotator Control GUI for Mookodi, check or the Left Rotator for errors as per point 8 above.Sibonise:* "Track PA (Parallactic Angle) (Keep North Up)"* "If PA is out of range, Track PA+-180"
1,054
edits