Skip to content
Snippets Groups Projects
Unverified Commit 4b6050eb authored by Giuseppe Carboni's avatar Giuseppe Carboni Committed by GitHub
Browse files

Updated minor servos (#871)

* Fix #865, fix #869, updated SRTMinorServo component

The component now handles correctly a SETUP command.
The component is also capable of commanding the gregorian air blade with the 'setGregorianAirBladeStatus' command.
A few bugs were fixed here and there.
This branch MUST be tested with the real hardware before merging it onto the centos_7_compatibility branch.

* Fixed small bug

* Various upgrades

* Updated _airBlade.py and _servoReset.py

* Updated _servoReset

* Updated telescopePark procedure commands order

With this order, the gregorian cover is started parking when the antenna is already at 89.8 degrees of elevation.
This will avoid getting an error on a gregorian cover axis pre limit.
Unfortunately, this will not fix a change in configuration from primary to gregorian or BWG and vice versa.
That will need to be addressed by opening a ticket.

* Upgraded _servoReset behahviour
parent d8d4b64b
No related branches found
No related tags found
No related merge requests found
Showing
with 114 additions and 20 deletions
...@@ -289,7 +289,7 @@ int main(int argc, char *argv[]) { ...@@ -289,7 +289,7 @@ int main(int argc, char *argv[]) {
status_box->setStatusLook(Management::MNG_OK,CStyle(BLACK_GREEN,CStyle::BOLD)); status_box->setStatusLook(Management::MNG_OK,CStyle(BLACK_GREEN,CStyle::BOLD));
status_box->setStatusLook(Management::MNG_WARNING,CStyle(BLACK_YELLOW,CStyle::BOLD)); status_box->setStatusLook(Management::MNG_WARNING,CStyle(BLACK_YELLOW,CStyle::BOLD));
status_box->setStatusLook(Management::MNG_FAILURE,CStyle(BLACK_RED,CStyle::BOLD)); status_box->setStatusLook(Management::MNG_FAILURE,CStyle(BLACK_RED,CStyle::BOLD));
_TW_SET_COMPONENT(motionInfo_field,18,3,30,1,CColorPair::WHITE_BLACK,CStyle::BOLD,output_label); _TW_SET_COMPONENT(motionInfo_field,18,3,40,1,CColorPair::WHITE_BLACK,CStyle::BOLD,output_label);
/* ****************************************************************** */ /* ****************************************************************** */
_TW_SET_COMPONENT(userInput,0,WINDOW_HEIGHT-6,WINDOW_WIDTH-1,1,USER_INPUT_COLOR_PAIR,USER_INPUT_STYLE,NULL); _TW_SET_COMPONENT(userInput,0,WINDOW_HEIGHT-6,WINDOW_WIDTH-1,1,USER_INPUT_COLOR_PAIR,USER_INPUT_STYLE,NULL);
......
...@@ -2,6 +2,9 @@ from __future__ import print_function ...@@ -2,6 +2,9 @@ from __future__ import print_function
# Marco Buttu <mbuttu@oa-cagliari.inaf.it> # Marco Buttu <mbuttu@oa-cagliari.inaf.it>
# Doctrings from the "Observing at the SRT with Nuraghe, Issue n.8, 21/10/14", # Doctrings from the "Observing at the SRT with Nuraghe, Issue n.8, 21/10/14",
# by Simona Righini and Andrea Orlati" # by Simona Righini and Andrea Orlati"
# 21/05/2024 G. Carboni: commands prependend with SRT_, Medicina_, Noto_ are
# only added to the operator input according to the STATION environment
# variable
def antennaPark(): def antennaPark():
...@@ -538,6 +541,12 @@ def servoSetup(): ...@@ -538,6 +541,12 @@ def servoSetup():
(CCB, KKG, LLP, PLP, PPP) configures the minor servos in ordet to put on focus the receiver (CCB, KKG, LLP, PLP, PPP) configures the minor servos in ordet to put on focus the receiver
""" """
def SRT_servoReset():
"""
servoReset
sends the emergency and alarm reset command to OR7 VBrain server, SRT only
"""
def setAttenuation(): def setAttenuation():
""" """
setAttenuation=sect,att setAttenuation=sect,att
...@@ -584,6 +593,29 @@ def setServoOffset(): ...@@ -584,6 +593,29 @@ def setServoOffset():
setServoOffset=SRP_TY,5 setServoOffset=SRP_TY,5
""" """
def SRT_setGregorianCoverPosition():
"""
setGregorianCoverPosition=POSITION
It sets the gregorian cover position
Allowed POSITIONs
CLOSED, closed
OPEN, open
"""
def SRT_setGregorianAirBladeStatus():
"""
setGregorianAirBladeStatus=STATUS
It sets the gregorian air blade status
Allowed STATUSes:
AUTO, auto
OFF, off
ON, on
If a ON status is commanded, the air blade stays on for 30 seconds.
It can be toggled off manually.
Sending setGregorianAirBladeStatus=ON again will toggle the air blade to
turn on again.
"""
def setupCCB(): def setupCCB():
""" """
The setup command sets the antenna mount, the minor servos, The setup command sets the antenna mount, the minor servos,
...@@ -694,6 +726,9 @@ def wx(): ...@@ -694,6 +726,9 @@ def wx():
atmospheric pressure (hPa), wind speed (km/h). atmospheric pressure (hPa), wind speed (km/h).
""" """
stations = ['SRT', 'Medicina', 'Noto']
import os
station = os.environ.get('STATION')
import copy import copy
myself = __import__(__name__) myself = __import__(__name__)
# Create the commands dictionary # Create the commands dictionary
...@@ -701,10 +736,14 @@ commands = myself.__dict__.copy() # Shallow copy, but we do not mind ...@@ -701,10 +736,14 @@ commands = myself.__dict__.copy() # Shallow copy, but we do not mind
for cmd in list(commands.keys()): for cmd in list(commands.keys()):
if cmd.startswith('__'): if cmd.startswith('__'):
del commands[cmd] del commands[cmd]
elif any(cmd.startswith(s) for s in stations):
command = commands.pop(cmd)
s, cmd = cmd.split('_')
if s == station:
commands[cmd] = command
# Make the setupXXX.__doc__ # Make the setupXXX.__doc__
for cmd in commands: for cmd in commands:
if cmd.startswith('setup'): if cmd.startswith('setup'):
setupXXX = getattr(myself, cmd) setupXXX = getattr(myself, cmd)
setupXXX.__doc__ = setupCCB.__doc__ setupXXX.__doc__ = setupCCB.__doc__
...@@ -217,6 +217,9 @@ void CCore::execute() throw(ComponentErrors::TimerErrorExImpl, ComponentErrors:: ...@@ -217,6 +217,9 @@ void CCore::execute() throw(ComponentErrors::TimerErrorExImpl, ComponentErrors::
m_parser->add("setServoASConfiguration", "minorservo", 4, &CCore::remoteCall); m_parser->add("setServoASConfiguration", "minorservo", 4, &CCore::remoteCall);
m_parser->add("clearServoOffsets", "minorservo", 4, &CCore::remoteCall); m_parser->add("clearServoOffsets", "minorservo", 4, &CCore::remoteCall);
m_parser->add("setServoOffset", "minorservo", 4, &CCore::remoteCall); m_parser->add("setServoOffset", "minorservo", 4, &CCore::remoteCall);
m_parser->add("servoReset", "_servoReset", 0, "SRT");
m_parser->add("setGregorianCoverPosition", "_cover", 1, "SRT");
m_parser->add("setGregorianAirBladeStatus", "_airBlade", 1, "SRT");
// active surface // active surface
m_parser->add("asSetup", "activesurface", 5, &CCore::remoteCall); m_parser->add("asSetup", "activesurface", 5, &CCore::remoteCall);
......
...@@ -23,10 +23,10 @@ ...@@ -23,10 +23,10 @@
<MISTRAL> <axis>ROTATION</axis> <coefficients>-51.821170 </coefficients></MISTRAL> <MISTRAL> <axis>ROTATION</axis> <coefficients>-51.821170 </coefficients></MISTRAL>
<MISTRAL_ASACTIVE> <axis>ROTATION</axis> <coefficients>-51.821170 </coefficients></MISTRAL_ASACTIVE> <MISTRAL_ASACTIVE> <axis>ROTATION</axis> <coefficients>-51.821170 </coefficients></MISTRAL_ASACTIVE>
<!-- BWG - GFR open --> <!-- BWG - GFR open - configurations commented out since the SETUP command takes care of positioning the GFR to 0 -->
<CCB> <axis>ROTATION</axis> <coefficients>0 </coefficients></CCB> <!--CCB> <axis>ROTATION</axis> <coefficients>0 </coefficients></CCB-->
<CCB_ASACTIVE> <axis>ROTATION</axis> <coefficients>0 </coefficients></CCB_ASACTIVE> <!--CCB_ASACTIVE> <axis>ROTATION</axis> <coefficients>0 </coefficients></CCB_ASACTIVE-->
<XB> <axis>ROTATION</axis> <coefficients>0 </coefficients></XB> <!--XB> <axis>ROTATION</axis> <coefficients>0 </coefficients></XB-->
<XB_ASACTIVE> <axis>ROTATION</axis> <coefficients>0 </coefficients></XB_ASACTIVE> <!--XB_ASACTIVE> <axis>ROTATION</axis> <coefficients>0 </coefficients></XB_ASACTIVE-->
</SRTMinorServoLookupTable> </SRTMinorServoLookupTable>
CONFIGURATION;PFP_TX;PFP_TZ;PFP_RTHETA;SRP_TX;SRP_TY;SRP_TZ;SRP_RX;SRP_RY;SRP_RZ;M3R_RZ;GFR_RZ;DR_GFR1;DR_GFR2;DR_GFR3;DR_PFP;GREGORIAN_CAP;
Primario;0;0;0;-5;5;-120;0;0;0;*;*;*;*;*;*;1;
Gregoriano1;0;0;0;-1.5;11.1393650793988;1.08830677049999;0.049894179898239;-0.036111111111111;0;*;-88.70659;*;*;*;*;3;
Gregoriano2;0;0;0;-1.5;11.1393650793988;1.08830677049999;0.049894179898239;-0.036111111111111;0;*;-159.8899;*;*;*;*;3;
Gregoriano3;0;0;0;-1.5;11.1393650793988;1.08830677049999;0.049894179898239;-0.036111111111111;0;*;90.97161;*;*;*;*;3;
Gregoriano4;0;0;0;-1.5;11.1393650793988;1.08830677049999;0.049894179898239;-0.036111111111111;0;*;162.771;*;*;*;*;3;
Gregoriano5;0;0;0;-1.5;11.1393650793988;1.08830677049999;0.049894179898239;-0.036111111111111;0;*;55.373967;*;*;*;*;3;
Gregoriano6;0;0;0;-1.5;11.1393650793988;1.08830677049999;0.049894179898239;-0.036111111111111;0;*;-51.82117;*;*;*;*;3;
Gregoriano7;0;0;0;*;*;*;*;*;*;*;*;*;*;*;*;*;
Gregoriano8;0;0;0;*;*;*;*;*;*;*;*;*;*;*;*;*;
BWG1;0;0;0;-1.5;11.1393650793988;0.358165166130078;0.049894179898239;-0.036111111111111;0;10;0;*;*;*;*;3;
BWG2;0;0;0;*;*;*;*;*;*;*;*;*;*;*;*;*;
BWG3;0;0;0;-1.5;11.1393650793988;-3.77159716192807;0.049894179898239;-0.036111111111111;0;20;0;*;*;*;*;3;
BWG4;0;0;0;*;*;*;*;*;*;*;*;*;*;*;*;*;
...@@ -31,7 +31,9 @@ ...@@ -31,7 +31,9 @@
<control description="Boolean indicating whether the servos are controlled by DISCOS or VBrain" /> <control description="Boolean indicating whether the servos are controlled by DISCOS or VBrain" />
<power description="All drive cabinets power status" /> <power description="All drive cabinets power status" />
<emergency description="Boolean indicating whether there is an emergency button(s) pressed" /> <emergency description="Boolean indicating whether there is an emergency button(s) pressed" />
<gregorian_cover description="Status of the gregorian cover" /> <gregorian_cover description="Position of the gregorian cover" />
<air_blade description="Status of the gregorian air blade" />
<last_executed_command description="UNIX time of the last correctly executed command" /> <last_executed_command description="UNIX time of the last correctly executed command" />
<error_code description="The type of error encountered" />
</SRTMinorServoBoss> </SRTMinorServoBoss>
...@@ -30,5 +30,6 @@ ...@@ -30,5 +30,6 @@
<commanded_virtual_positions description="Sequence, latest commanded (via preset) virtual positions" /> <commanded_virtual_positions description="Sequence, latest commanded (via preset) virtual positions" />
<in_use description="Boolean indicating whether the servo is in use in the current configuration" /> <in_use description="Boolean indicating whether the servo is in use in the current configuration" />
<current_setup description="The name of the current configuration" /> <current_setup description="The name of the current configuration" />
<error_code description="The type of error encountered" />
</SRTGenericMinorServo> </SRTGenericMinorServo>
...@@ -30,5 +30,6 @@ ...@@ -30,5 +30,6 @@
<commanded_virtual_positions description="Sequence, latest commanded (via preset) virtual positions" /> <commanded_virtual_positions description="Sequence, latest commanded (via preset) virtual positions" />
<in_use description="Boolean indicating whether the servo is in use in the current configuration" /> <in_use description="Boolean indicating whether the servo is in use in the current configuration" />
<current_setup description="The name of the current configuration" /> <current_setup description="The name of the current configuration" />
<error_code description="The type of error encountered" />
</SRTGenericMinorServo> </SRTGenericMinorServo>
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
<commanded_virtual_positions description="Sequence, latest commanded (via preset) virtual positions" /> <commanded_virtual_positions description="Sequence, latest commanded (via preset) virtual positions" />
<in_use description="Boolean indicating whether the servo is in use in the current configuration" /> <in_use description="Boolean indicating whether the servo is in use in the current configuration" />
<current_setup description="The name of the current configuration" /> <current_setup description="The name of the current configuration" />
<error_code description="The type of error encountered" />
<tracking description="Boolean indicating whether the servo is tracking the given coordinates" /> <tracking description="Boolean indicating whether the servo is tracking the given coordinates" />
<trajectory_id description="Unsigned int, the UNIX Epoch * 1000 indicating the start time of the current trajectory" /> <trajectory_id description="Unsigned int, the UNIX Epoch * 1000 indicating the start time of the current trajectory" />
<total_trajectory_points description="Number of points sent for the current trajectory" /> <total_trajectory_points description="Number of points sent for the current trajectory" />
......
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
<commanded_virtual_positions description="Sequence, latest commanded (via preset) virtual positions" /> <commanded_virtual_positions description="Sequence, latest commanded (via preset) virtual positions" />
<in_use description="Boolean indicating whether the servo is in use in the current configuration" /> <in_use description="Boolean indicating whether the servo is in use in the current configuration" />
<current_setup description="The name of the current configuration" /> <current_setup description="The name of the current configuration" />
<error_code description="The type of error encountered" />
<tracking description="Boolean indicating whether the servo is tracking the given coordinates" /> <tracking description="Boolean indicating whether the servo is tracking the given coordinates" />
<trajectory_id description="Unsigned int, the UNIX Epoch * 1000 indicating the start time of the current trajectory" /> <trajectory_id description="Unsigned int, the UNIX Epoch * 1000 indicating the start time of the current trajectory" />
<total_trajectory_points description="Number of points sent for the current trajectory" /> <total_trajectory_points description="Number of points sent for the current trajectory" />
......
<?xml version='1.0' encoding='ISO-8859-1'?>
<!--
Giuseppe Carboni, giuseppe.carboni@inaf.it
-->
<SRTMinorServoVBrainConfiguration
xmlns="urn:schemas-cosylab-com:SRTMinorServoVBrainConfiguration:1.0"
xmlns:baci="urn:schemas-cosylab-com:BACI:1.0"
xmlns:cdb="urn:schemas-cosylab-com:CDB:1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
Protocol="http"
IPAddress="127.0.0.1"
Port="12799"/>
...@@ -137,11 +137,11 @@ ...@@ -137,11 +137,11 @@
<Procedure name="telescopePark" args="0"> <Procedure name="telescopePark" args="0">
<body> <body>
goTo=*,89.8d goTo=*,89.8d
receiversPark
servoPark
asPark
waitOnSource waitOnSource
antennaStop antennaStop
servoPark
asPark
receiversPark
wait=1 wait=1
antennaPark antennaPark
logMessage=Telescope is now parked logMessage=Telescope is now parked
......
...@@ -23,10 +23,10 @@ ...@@ -23,10 +23,10 @@
<MISTRAL> <axis>ROTATION</axis> <coefficients>-51.821170 </coefficients></MISTRAL> <MISTRAL> <axis>ROTATION</axis> <coefficients>-51.821170 </coefficients></MISTRAL>
<MISTRAL_ASACTIVE> <axis>ROTATION</axis> <coefficients>-51.821170 </coefficients></MISTRAL_ASACTIVE> <MISTRAL_ASACTIVE> <axis>ROTATION</axis> <coefficients>-51.821170 </coefficients></MISTRAL_ASACTIVE>
<!-- BWG - GFR open --> <!-- BWG - GFR open - configurations commented out since the SETUP command takes care of positioning the GFR to 0 -->
<CCB> <axis>ROTATION</axis> <coefficients>0 </coefficients></CCB> <!--CCB> <axis>ROTATION</axis> <coefficients>0 </coefficients></CCB-->
<CCB_ASACTIVE> <axis>ROTATION</axis> <coefficients>0 </coefficients></CCB_ASACTIVE> <!--CCB_ASACTIVE> <axis>ROTATION</axis> <coefficients>0 </coefficients></CCB_ASACTIVE-->
<XB> <axis>ROTATION</axis> <coefficients>0 </coefficients></XB> <!--XB> <axis>ROTATION</axis> <coefficients>0 </coefficients></XB-->
<XB_ASACTIVE> <axis>ROTATION</axis> <coefficients>0 </coefficients></XB_ASACTIVE> <!--XB_ASACTIVE> <axis>ROTATION</axis> <coefficients>0 </coefficients></XB_ASACTIVE-->
</SRTMinorServoLookupTable> </SRTMinorServoLookupTable>
...@@ -31,7 +31,9 @@ ...@@ -31,7 +31,9 @@
<control description="Boolean indicating whether the servos are controlled by DISCOS or VBrain" /> <control description="Boolean indicating whether the servos are controlled by DISCOS or VBrain" />
<power description="All drive cabinets power status" /> <power description="All drive cabinets power status" />
<emergency description="Boolean indicating whether there is an emergency button(s) pressed" /> <emergency description="Boolean indicating whether there is an emergency button(s) pressed" />
<gregorian_cover description="Status of the gregorian cover" /> <gregorian_cover description="Position of the gregorian cover" />
<air_blade description="Status of the gregorian air blade" />
<last_executed_command description="UNIX time of the last correctly executed command" /> <last_executed_command description="UNIX time of the last correctly executed command" />
<error_code description="The type of error encountered" />
</SRTMinorServoBoss> </SRTMinorServoBoss>
...@@ -30,5 +30,6 @@ ...@@ -30,5 +30,6 @@
<commanded_virtual_positions description="Sequence, latest commanded (via preset) virtual positions" /> <commanded_virtual_positions description="Sequence, latest commanded (via preset) virtual positions" />
<in_use description="Boolean indicating whether the servo is in use in the current configuration" /> <in_use description="Boolean indicating whether the servo is in use in the current configuration" />
<current_setup description="The name of the current configuration" /> <current_setup description="The name of the current configuration" />
<error_code description="The type of error encountered" />
</SRTGenericMinorServo> </SRTGenericMinorServo>
...@@ -30,5 +30,6 @@ ...@@ -30,5 +30,6 @@
<commanded_virtual_positions description="Sequence, latest commanded (via preset) virtual positions" /> <commanded_virtual_positions description="Sequence, latest commanded (via preset) virtual positions" />
<in_use description="Boolean indicating whether the servo is in use in the current configuration" /> <in_use description="Boolean indicating whether the servo is in use in the current configuration" />
<current_setup description="The name of the current configuration" /> <current_setup description="The name of the current configuration" />
<error_code description="The type of error encountered" />
</SRTGenericMinorServo> </SRTGenericMinorServo>
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
<commanded_virtual_positions description="Sequence, latest commanded (via preset) virtual positions" /> <commanded_virtual_positions description="Sequence, latest commanded (via preset) virtual positions" />
<in_use description="Boolean indicating whether the servo is in use in the current configuration" /> <in_use description="Boolean indicating whether the servo is in use in the current configuration" />
<current_setup description="The name of the current configuration" /> <current_setup description="The name of the current configuration" />
<error_code description="The type of error encountered" />
<tracking description="Boolean indicating whether the servo is tracking the given coordinates" /> <tracking description="Boolean indicating whether the servo is tracking the given coordinates" />
<trajectory_id description="Unsigned int, the UNIX Epoch * 1000 indicating the start time of the current trajectory" /> <trajectory_id description="Unsigned int, the UNIX Epoch * 1000 indicating the start time of the current trajectory" />
<total_trajectory_points description="Number of points sent for the current trajectory" /> <total_trajectory_points description="Number of points sent for the current trajectory" />
......
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
<commanded_virtual_positions description="Sequence, latest commanded (via preset) virtual positions" /> <commanded_virtual_positions description="Sequence, latest commanded (via preset) virtual positions" />
<in_use description="Boolean indicating whether the servo is in use in the current configuration" /> <in_use description="Boolean indicating whether the servo is in use in the current configuration" />
<current_setup description="The name of the current configuration" /> <current_setup description="The name of the current configuration" />
<error_code description="The type of error encountered" />
<tracking description="Boolean indicating whether the servo is tracking the given coordinates" /> <tracking description="Boolean indicating whether the servo is tracking the given coordinates" />
<trajectory_id description="Unsigned int, the UNIX Epoch * 1000 indicating the start time of the current trajectory" /> <trajectory_id description="Unsigned int, the UNIX Epoch * 1000 indicating the start time of the current trajectory" />
<total_trajectory_points description="Number of points sent for the current trajectory" /> <total_trajectory_points description="Number of points sent for the current trajectory" />
......
<?xml version='1.0' encoding='ISO-8859-1'?>
<!--
Giuseppe Carboni, giuseppe.carboni@inaf.it
-->
<SRTMinorServoVBrainConfiguration
xmlns="urn:schemas-cosylab-com:SRTMinorServoVBrainConfiguration:1.0"
xmlns:baci="urn:schemas-cosylab-com:BACI:1.0"
xmlns:cdb="urn:schemas-cosylab-com:CDB:1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
Protocol="https"
IPAddress="192.168.200.200"
Port="8194"/>
...@@ -137,11 +137,11 @@ ...@@ -137,11 +137,11 @@
<Procedure name="telescopePark" args="0"> <Procedure name="telescopePark" args="0">
<body> <body>
goTo=*,89.8d goTo=*,89.8d
receiversPark
servoPark
asPark
waitOnSource waitOnSource
antennaStop antennaStop
servoPark
asPark
receiversPark
wait=1 wait=1
antennaPark antennaPark
logMessage=Telescope is now parked logMessage=Telescope is now parked
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment