M1M3 Support System
Loading...
Searching...
No Matches
ForceActuatorApplicationSettings.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 FORCEACTUATORAPPLICATIONSETTINGS_H_
25#define FORCEACTUATORAPPLICATIONSETTINGS_H_
26
27#include <vector>
28
29#include <ForceActuatorOrientations.h>
30#include <ForceActuatorTypes.h>
31#include <cRIO/DataTypes.h>
32
33namespace LSST {
34namespace M1M3 {
35namespace SS {
36
49 int32_t ActuatorID;
50
55 double XPosition;
56
61 double YPosition;
62
63 //* Force actuator Z (positive toward M2) position in m. Cartesian system with
64 // origin in mirror center.
65 double ZPosition;
66
67 //* Single or double axis actuator.
68 ForceActuatorTypes Type;
69
70 //* Actuator ILC Modbus subnet (bus) number. 1-4.
71 uint8_t Subnet;
72
73 //* Actuator ILC address on bus. 10-46.
74 uint8_t Address;
75
76 //* Second axis orientation. NA for single axis actuators.
77 ForceActuatorOrientations Orientation;
78};
79
88public:
93
102 static ForceActuatorTableRow Table[FA_COUNT];
103
104 //* Maps X DAA (lateral support) number (0-11) into Z index (0-155).
105 int32_t XIndexToZIndex[FA_X_COUNT];
106
107 //* Maps Y DAA (longitudinal support) number (0-99) into Z index (0-155).
108 int32_t YIndexToZIndex[FA_Y_COUNT];
109
110 //* Maps secondary (DAA) index (0-111) into Z index (0-155).
111 int32_t SecondaryCylinderIndexToZIndex[FA_X_COUNT + FA_Y_COUNT];
112
113 //* Maps Z index (0-155) to X DAA (lateral support, 0-11).
114 int32_t ZIndexToXIndex[FA_Z_COUNT];
115
116 //* Maps Z index (0-155) to Y DAA (longitudinal support, 0-99).
117 int32_t ZIndexToYIndex[FA_Z_COUNT];
118
119 //* Maps Z index (0-155) to secondary (DAA) index (0-111).
120 int32_t ZIndexToSecondaryCylinderIndex[FA_Z_COUNT];
121
130 const int ActuatorIdToZIndex(int actuatorId);
131
132 const int XIndexToActuatorId(int xIndex) { return ZIndexToActuatorId(XIndexToZIndex[xIndex]); }
133 const int YIndexToActuatorId(int yIndex) { return ZIndexToActuatorId(YIndexToZIndex[yIndex]); }
134 const int SecondaryCylinderIndexToActuatorId(int secIndex) {
135 return ZIndexToActuatorId(SecondaryCylinderIndexToZIndex[secIndex]);
136 }
137
138 // indices of XYZ FAs in mirror quadrants. FAs are assigned trivially by
139 // actuator ID (first number depict quadrant), those arrays are there to
140 // simplify operations where FAs in quadrant are needed, notably
141 // distributing forces from disabled FAs.
142 std::vector<int> QuadrantZ[4];
144 std::vector<int> QuadrantY[4];
146 std::vector<int> QuadrantX[4];
148
156 const static int ZIndexToActuatorId(int zIndex);
157};
158
159} /* namespace SS */
160} /* namespace M1M3 */
161} /* namespace LSST */
162
163#endif /* FORCEACTUATORAPPLICATIONSETTINGS_H_ */
(Almost) constant force actuator values.
Definition ForceActuatorApplicationSettings.h:87
const int ActuatorIdToZIndex(int actuatorId)
Returns zIndex of the actuator with give ID.
Definition ForceActuatorApplicationSettings.cpp:407
ForceActuatorApplicationSettings()
Constructor.
Definition ForceActuatorApplicationSettings.cpp:346
static ForceActuatorTableRow Table[FA_COUNT]
Source data.
Definition ForceActuatorApplicationSettings.h:102
std::vector< int > QuadrantX[4]
indices of Z FAs in mirror quadrants.
Definition ForceActuatorApplicationSettings.h:146
static const int ZIndexToActuatorId(int zIndex)
indices of Z FAs in mirror quadrants.
Definition ForceActuatorApplicationSettings.cpp:414
std::vector< int > QuadrantY[4]
indices of Z FAs in mirror quadrants.
Definition ForceActuatorApplicationSettings.h:144
Force actuator data.
Definition ForceActuatorApplicationSettings.h:44
double YPosition
Force actuator Y (vertical when mirror is pointed at horizon) position in m.
Definition ForceActuatorApplicationSettings.h:61
int32_t ActuatorID
Force actuator ID.
Definition ForceActuatorApplicationSettings.h:49
double XPosition
Force actuator X (horizontal when mirror is pointed at horizon) position in m.
Definition ForceActuatorApplicationSettings.h:55