Skip to content
Snippets Groups Projects
Commit d90015c3 authored by Andrea Orlati's avatar Andrea Orlati
Browse files

fix issue #655: feature implemented but a test is required before merging into the repository

parent c8379f52
No related branches found
No related tags found
No related merge requests found
Showing with 65 additions and 8 deletions
......@@ -97,6 +97,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/
## [next release]
## Added
issue 655 - ACU Component for Noto and Medicina is now capble to prevent seldom mode changes coming from ACU reset
## Fixed
issue #448 - Added Sky Offsets to calibration tool client
issue #585 - Fixed misshandled schedule with NULL as backend (Dry Run)
......
......@@ -15,6 +15,7 @@
ControlThreadPeriod="200000"
RepetitionCacheTime="2000000"
RepetitionExpireTime="5000000"
CheckMode="false"
CheckOscillation="true"
OscillationThreshold="0.01"
OscillationAlarmDuration="2000000"
......
......@@ -15,6 +15,7 @@
ControlThreadPeriod="200000"
RepetitionCacheTime="2000000"
RepetitionExpireTime="5000000"
CheckMode="false"
CheckOscillation="true"
OscillationThreshold="0.01"
OscillationAlarmDuration="2000000"
......
......@@ -101,6 +101,8 @@
<xs:attribute name="RepetitionCacheTime" type="xs:unsignedLong" use="required" />
<!-- the expire time (microseconds) for logging repetition filter -->
<xs:attribute name="RepetitionExpireTime" type="xs:unsignedLong" use="required" />
<!-- This flag is "true" or "false" to enable the check of the ACU mode -->
<xs:attribute name="CheckMode" type="xs:boolean" use="required" />
<!-- This flag is "true" or "false" to control the oscillattion check is active or not -->
<xs:attribute name="CheckOscillation" type="xs:boolean" use="required" />
<!-- the oscillation threshold as azimuth tracking error (degrees) -->
......
......@@ -99,9 +99,12 @@ public:
/** Gets the number of times the oscillation has to be hit before an oscillation is declared*/
inline DWORD oscillationNumberThreashold() const { return m_dwoscNumberThreshold; }
/** Flag that indicates whether the oscillation chek must performed or not. */
/** Flag that indicates whether the oscillation check must performed or not. */
inline bool checkForOscillation() const { return m_checkOsc; }
/** Flag that indicates whether the ACU check mode must performed or not. */
inline bool checkForMode() const { return m_checkMode; }
/**
* This member function is used to configure component by reading the configuration parameter from the CDB.
* This must be the first call before using any other function of this class.
......@@ -139,9 +142,9 @@ private:
DWORD m_dwcontrolThreadPeriod;
/** This is the precision (degree) of the antenna */
//double m_dtrackingPrecision;
/** This indicates the cache time for the repetion log filter */
/** This indicates the cache time for the repetition log filter */
DDWORD m_dwrepetitionCacheTime;
/** This indicates the expire time for the repetion log filter */
/** This indicates the expire time for the repetition log filter */
DDWORD m_dwexpireCacheTime;
/** this number is the separation value between the CW and CCW, if the azimuth is greater than this the section is CW */
double m_cwLimit;
......@@ -151,6 +154,7 @@ private:
WORD m_dwoscNumberThreshold;
DDWORD m_dwoscRecoverTime;
bool m_checkOsc;
bool m_checkMode;
};
......
......@@ -447,10 +447,22 @@ public:
* 1) if the tracking error is beyond a threashold an alarm condition is triggered. This condition has a certain validity time.
* 2) If more than a number of direction changes (of the tracking error with respect to the zero error) are detected during the alarm time window, the oscillation is declared-
* 3) The alarm condition is cleared if the time validity window of the alarm elapsed and the tracking error is again under the threshold.
* In case of detection counter mesures are immediately taken.
* In case of detection counter measures are immediately taken.
*/
void detectOscillation() throw (AntennaErrors::ConnectionExImpl,ComponentErrors::SocketErrorExImpl,ComponentErrors::TimeoutExImpl,AntennaErrors::NakExImpl,AntennaErrors::AntennaBusyExImpl);
/**
* This method has been added to detect the event the ACU mode differs from previously commanded. In case it tries to
* recover from this event by commandind the correct mode.
* @throw AntennaErrors::ConnectionExImpl
* @throw ComponentErrors::SocketErrorExImpl
* @throw ComponentErrors::TimeoutExImpl
* @throw AntennaErrors::NakExImpl
* @throwAntennaErrors::AntennaBusyExImpl
*/
void checkCommandedMode() throw (AntennaErrors::ConnectionExImpl,ComponentErrors::SocketErrorExImpl,
ComponentErrors::TimeoutExImpl,AntennaErrors::NakExImpl,AntennaErrors::AntennaBusyExImpl);
/**
* This member function is used by the control thread in order to check if a long job that was started as completed or not.
* @param job job identifier
......@@ -607,6 +619,11 @@ private:
*/
CACUInterface::TAxeModes m_oscMode;
/**
* this flag indicates that a recovery from mode check in ongoing.....
*/
bool m_modeCheckRecover;
/**
* Stores the epoch of the last scan. Used in oscillation prevention
*/
......
......@@ -66,6 +66,11 @@ void CConfiguration::Init(maci::ContainerServices *Services) throw (ComponentErr
_GET_DOUBLE_ATTRIBUTE("cw_ccw_limit","CW/CCW limit (degrees):",m_cwLimit,"DataBlock/Mount");
_GET_STRING_ATTRIBUTE("CheckOscillation","Check oscillation during tracking: ",check,"");
m_checkOsc=(check=="TRUE");
_GET_STRING_ATTRIBUTE("CheckMode","Check ACU mode enabled: ",check,"");
m_checkMode=(check=="TRUE");
_GET_DOUBLE_ATTRIBUTE("OscillationThreshold","Oscillation theshold (deg):",m_doscThreashold,"");
_GET_DWORD_ATTRIBUTE("OscillationAlarmDuration","Oscillation alarm duration (uSec):",m_dwoscAlarmDuration,"");
_GET_DWORD_ATTRIBUTE("OscillationNumberThreshold","Oscillation number threashold:",m_dwoscNumberThreshold,"");
......@@ -74,5 +79,5 @@ void CConfiguration::Init(maci::ContainerServices *Services) throw (ComponentErr
m_dwoscRecoverTime*=10;
m_dwcontrolThreadPeriod*=10;
check.MakeUpper();
m_checkOsc=(check=="TRUE");
}
......@@ -130,6 +130,7 @@ void CMedicinaMountSocket::Init(CConfiguration *config,maci::ContainerServices *
m_oscStopTime=0;
m_oscMode=CACUInterface::STANDBY;
m_lastScanEpoch=0;
m_modeCheckRecover=false;
}
CACUInterface::TAxeModes CMedicinaMountSocket::getAzimuthMode() throw (ConnectionExImpl,SocketErrorExImpl,TimeoutExImpl)
......@@ -587,8 +588,11 @@ void CMedicinaMountSocket::Mode(CACUInterface::TAxeModes azMode,CACUInterface::T
TIMEVALUE now;
IRA::CIRATools::getTime(now);
m_Data.setLastCommandedMode(azMode);
if (!m_modeCheckRecover) { // need to keep current offsets in case a recovery procedure is ongoing.....
m_Data.setAzimuthOffset(0.0);
m_Data.setElevationOffset(0.0);
m_modeCheckRecover=false;
}
m_lastScanEpoch=now.value().value;
}
......@@ -844,6 +848,25 @@ double CMedicinaMountSocket::getHWAzimuth(double destination,const CACUInterface
return CIRATools::getHWAzimuth(pos,dest,m_configuration->azimuthLowerLimit(),m_configuration->azimuthUpperLimit(),section,m_configuration->cwLimit());
}
void CMedicinaMountSocket::checkCommandedMode() throw (ConnectionExImpl,SocketErrorExImpl,TimeoutExImpl,AntennaErrors::NakExImpl,AntennaBusyExImpl)
{
CACUInterface::TAxeModes commandedMode, mode;
if (!m_configuration->checkForMode()) return;
commandedMode=m_Data.getLastCommandedMode();
if ((commandedMode!=CACUInterface::STANDBY) && (commandedMode!=CACUInterface::UNSTOW) &&
(commandedMode!=CACUInterface::STOW) && (commandedMode!=CACUInterface::STOP)) {
mode=getAzimuthMode(); // throw (ConnectionExImpl,SocketErrorExImpl,TimeoutExImpl)
if ((mode!=CACUInterface::UNKNOWN)) {
if ((commandedMode!=mode)) {
CUSTOM_LOG(LM_FULL_INFO,"CMedicinaMountSocket::checkCommandedMode()",
(LM_WARNING,"ACU operation mode differs from commanded one, trying to recover..."));
m_modeCheckRecover=true;
Mode(commandedMode,commandedMode);
}
}
}
}
void CMedicinaMountSocket::detectOscillation() throw (ConnectionExImpl,SocketErrorExImpl,TimeoutExImpl,AntennaErrors::NakExImpl,AntennaBusyExImpl)
{
TIMEVALUE now;
......
......@@ -51,6 +51,7 @@ void CMedicinaMountControlThread::runLoop()
CSecAreaResourceWrapper<CMedicinaMountSocket> socket=m_pACUControl->Get();
socket->updateComponent(); // before commenting out or deleting consider that inside this method the flushing of pending event of the log dike object is called
socket->detectOscillation();
socket->checkCommandedMode();
if (currentJobID!=0) {
ACSErr::Completion_var comp;
if (socket->updateLongJobs(currentJobID,comp.out())) {
......
......@@ -15,6 +15,7 @@
ControlThreadPeriod="200000"
RepetitionCacheTime="2000000"
RepetitionExpireTime="5000000"
CheckMode="true"
CheckOscillation="true"
OscillationThreshold="0.01"
OscillationAlarmDuration="2000000"
......
......@@ -15,6 +15,7 @@
ControlThreadPeriod="200000"
RepetitionCacheTime="2000000"
RepetitionExpireTime="5000000"
CheckMode="true"
CheckOscillation="true"
OscillationThreshold="0.01"
OscillationAlarmDuration="2000000"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment