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
48struct ForceActuatorNeighbors {
49 ForceActuatorNeighbors();
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:
60 ForceActuatorSettings(token);
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 std::vector<float> VelocityXYTable;
131
132 std::vector<Limit> AberrationLimitZTable;
133 std::vector<Limit> AccelerationLimitXTable;
134 std::vector<Limit> AccelerationLimitYTable;
135 std::vector<Limit> AccelerationLimitZTable;
136 std::vector<Limit> ActiveOpticLimitZTable;
137 std::vector<Limit> AzimuthLimitXTable;
138 std::vector<Limit> AzimuthLimitYTable;
139 std::vector<Limit> AzimuthLimitZTable;
140 std::vector<Limit> BalanceLimitXTable;
141 std::vector<Limit> BalanceLimitYTable;
142 std::vector<Limit> BalanceLimitZTable;
143 std::vector<Limit> ElevationLimitXTable;
144 std::vector<Limit> ElevationLimitYTable;
145 std::vector<Limit> ElevationLimitZTable;
146 std::vector<Limit> OffsetLimitXTable;
147 std::vector<Limit> OffsetLimitYTable;
148 std::vector<Limit> OffsetLimitZTable;
149 std::vector<Limit> StaticLimitXTable;
150 std::vector<Limit> StaticLimitYTable;
151 std::vector<Limit> StaticLimitZTable;
152 std::vector<Limit> ThermalLimitXTable;
153 std::vector<Limit> ThermalLimitYTable;
154 std::vector<Limit> ThermalLimitZTable;
155 std::vector<Limit> VelocityLimitXTable;
156 std::vector<Limit> VelocityLimitYTable;
157 std::vector<Limit> VelocityLimitZTable;
158 std::vector<Limit> CylinderLimitPrimaryTable;
159 std::vector<Limit> CylinderLimitSecondaryTable;
160
161 ForceActuatorNeighbors Neighbors[FA_COUNT];
162
163 ForceComponentSettings AberrationComponentSettings;
164 ForceComponentSettings AccelerationComponentSettings;
165 ForceComponentSettings ActiveOpticComponentSettings;
166 ForceComponentSettings AzimuthComponentSettings;
167 ForceComponentSettings BalanceComponentSettings;
168 ForceComponentSettings ElevationComponentSettings;
169 ForceComponentSettings OffsetComponentSettings;
170 ForceComponentSettings StaticComponentSettings;
171 ForceComponentSettings ThermalComponentSettings;
172 ForceComponentSettings VelocityComponentSettings;
173 ForceComponentSettings FinalComponentSettings;
174
179
184
185 bool hardpointBalanceForcesOnInActiveState;
186
187private:
188 void _loadNearNeighborZTable(const std::string &filename);
189 void _loadNeighborsTable(const std::string &filename);
190 void _loadFollowingErrorTables(const std::string &primaryFilename, const std::string &secondaryFilename);
191
192 float _measuredForceWarningRatio;
193};
194
195} // namespace SS
196} // namespace M1M3
197} // namespace LSST
198
199#endif /* FORCEACTUATORSETTINGS_H_ */
(Almost) constant force actuator values.
Definition ForceActuatorApplicationSettings.h:87
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:178
ForceActuatorBumpTestSettings NonTestedTolerances
Tolerances for actuators not tested.
Definition ForceActuatorSettings.h:183
void log()
Sends updates through SAL/DDS.
Definition ForceActuatorSettings.cpp:469
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