M1M3 Support System
Loading...
Searching...
No Matches
ForceActuatorSettings.h
1/*
2 * This file is part of LSST M1M3 support system package.
3 *
4 * Developed for the Vera C. Rubin Telescope and Site System.
5 * This product includes software developed by the LSST Project
6 * (https://www.lsst.org).
7 * See the COPYRIGHT file at the top-level directory of this distribution
8 * for details of code ownership.
9 *
10 * This program is free software: you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation, either version 3 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program. If not, see <https://www.gnu.org/licenses/>.
22 */
23
24#ifndef FORCEACTUATORSETTINGS_H_
25#define FORCEACTUATORSETTINGS_H_
26
27#include <string>
28#include <vector>
29
30#include <yaml-cpp/yaml.h>
31
32#include <SAL_MTM1M3.h>
33
34#include <cRIO/Singleton.h>
35
36#include <DistributedForces.h>
37#include <ForceActuatorApplicationSettings.h>
38#include <ForceActuatorBumpTestSettings.h>
39#include <ForceComponentSettings.h>
40#include <ForcesAndMoments.h>
41#include <Limit.h>
42#include <cRIO/DataTypes.h>
43
44namespace LSST {
45namespace M1M3 {
46namespace SS {
47
50 int NearZIDs[FA_MAX_NEAR_COUNT];
51 int FarIDs[FA_FAR_COUNT];
52};
53
57class ForceActuatorSettings : public MTM1M3_logevent_forceActuatorSettingsC,
58 public cRIO::Singleton<ForceActuatorSettings> {
59public:
61
62 void load(YAML::Node doc);
63
71 bool isActuatorDisabled(int32_t actIndex) { return enabledActuators[actIndex] == false; }
72
73 ForcesAndMoments calculateForcesAndMoments(
74 ForceActuatorApplicationSettings *forceActuatorApplicationSettings, float *xForces,
75 float *yForces, float *zForces);
76
79 ForcesAndMoments calculateForcesAndMoments(
80 ForceActuatorApplicationSettings *forceActuatorApplicationSettings, float *zForces);
81
82 DistributedForces calculateForceFromAngularAcceleration(float angularAccelerationX,
83 float angularAccelerationY,
84 float angularAccelerationZ);
85
86 DistributedForces calculateForceFromAngularVelocity(float angularVelocityX, float angularVelocityY,
87 float angularVelocityZ);
88
89 DistributedForces calculateForceFromAzimuthAngle(float azimuthAngle);
90
91 DistributedForces calculateForceFromElevationAngle(float elevationAngle);
92
93 DistributedForces calculateForceFromTemperature(float temperature);
94
95 DistributedForces calculateForceDistribution(float xForce, float yForce, float zForce, float xMoment,
96 float yMoment, float zMoment);
97
101 void log();
102
103 std::vector<float> AccelerationXTable;
104 std::vector<float> AccelerationYTable;
105 std::vector<float> AccelerationZTable;
106 std::vector<float> AzimuthXTable;
107 std::vector<float> AzimuthYTable;
108 std::vector<float> AzimuthZTable;
109 std::vector<float> HardpointForceMomentTable;
110 std::vector<float> ForceDistributionXTable;
111 std::vector<float> ForceDistributionYTable;
112 std::vector<float> ForceDistributionZTable;
113 std::vector<float> MomentDistributionXTable;
114 std::vector<float> MomentDistributionYTable;
115 std::vector<float> MomentDistributionZTable;
116 std::vector<float> ElevationXTable;
117 std::vector<float> ElevationYTable;
118 std::vector<float> ElevationZTable;
119 std::vector<float> StaticXTable;
120 std::vector<float> StaticYTable;
121 std::vector<float> StaticZTable;
122 std::vector<float> ThermalXTable;
123 std::vector<float> ThermalYTable;
124 std::vector<float> ThermalZTable;
125 std::vector<float> VelocityXTable;
126 std::vector<float> VelocityYTable;
127 std::vector<float> VelocityZTable;
128 std::vector<float> VelocityXZTable;
129 std::vector<float> VelocityYZTable;
130
131 std::vector<Limit> AberrationLimitZTable;
132 std::vector<Limit> AccelerationLimitXTable;
133 std::vector<Limit> AccelerationLimitYTable;
134 std::vector<Limit> AccelerationLimitZTable;
135 std::vector<Limit> ActiveOpticLimitZTable;
136 std::vector<Limit> AzimuthLimitXTable;
137 std::vector<Limit> AzimuthLimitYTable;
138 std::vector<Limit> AzimuthLimitZTable;
139 std::vector<Limit> BalanceLimitXTable;
140 std::vector<Limit> BalanceLimitYTable;
141 std::vector<Limit> BalanceLimitZTable;
142 std::vector<Limit> ElevationLimitXTable;
143 std::vector<Limit> ElevationLimitYTable;
144 std::vector<Limit> ElevationLimitZTable;
145 std::vector<Limit> OffsetLimitXTable;
146 std::vector<Limit> OffsetLimitYTable;
147 std::vector<Limit> OffsetLimitZTable;
148 std::vector<Limit> StaticLimitXTable;
149 std::vector<Limit> StaticLimitYTable;
150 std::vector<Limit> StaticLimitZTable;
151 std::vector<Limit> ThermalLimitXTable;
152 std::vector<Limit> ThermalLimitYTable;
153 std::vector<Limit> ThermalLimitZTable;
154 std::vector<Limit> VelocityLimitXTable;
155 std::vector<Limit> VelocityLimitYTable;
156 std::vector<Limit> VelocityLimitZTable;
157 std::vector<Limit> CylinderLimitPrimaryTable;
158 std::vector<Limit> CylinderLimitSecondaryTable;
159
160 ForceActuatorNeighbors Neighbors[FA_COUNT];
161
162 ForceComponentSettings AberrationComponentSettings;
163 ForceComponentSettings AccelerationComponentSettings;
164 ForceComponentSettings ActiveOpticComponentSettings;
165 ForceComponentSettings AzimuthComponentSettings;
166 ForceComponentSettings BalanceComponentSettings;
167 ForceComponentSettings ElevationComponentSettings;
168 ForceComponentSettings OffsetComponentSettings;
169 ForceComponentSettings StaticComponentSettings;
170 ForceComponentSettings ThermalComponentSettings;
171 ForceComponentSettings VelocityComponentSettings;
172 ForceComponentSettings FinalComponentSettings;
173
178
183
184private:
185 void _loadNearNeighborZTable(const std::string &filename);
186 void _loadNeighborsTable(const std::string &filename);
187 void _loadFollowingErrorTables(const std::string &primaryFilename, const std::string &secondaryFilename);
188
189 float _measuredForceWarningRatio;
190};
191
192} // namespace SS
193} // namespace M1M3
194} // namespace LSST
195
196#endif /* FORCEACTUATORSETTINGS_H_ */
(Almost) constant force actuator values.
Definition ForceActuatorApplicationSettings.h:87
Stores force actuator settings.
Definition ForceActuatorSettings.h:58
bool isActuatorDisabled(int32_t actIndex)
Returns true if actuator with given ID is disabled in configuration file.
Definition ForceActuatorSettings.h:71
ForceActuatorBumpTestSettings TestedTolerances
Tolerances for actuators being tested.
Definition ForceActuatorSettings.h:177
ForceActuatorBumpTestSettings NonTestedTolerances
Tolerances for actuators not tested.
Definition ForceActuatorSettings.h:182
void log()
Sends updates through SAL/DDS.
Definition ForceActuatorSettings.cpp:466
Definition DistributedForces.h:33
Store settings for force actuator bump test.
Definition ForceActuatorBumpTestSettings.h:36
Definition ForceActuatorSettings.h:48
Definition ForceComponentSettings.h:33
Definition ForcesAndMoments.h:31