M1M3 Support System
Loading...
Searching...
No Matches
ForceConverter.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 FORCECONVERTER_H_
25#define FORCECONVERTER_H_
26
27#include <DistributedForces.h>
28#include <ForcesAndMoments.h>
29#include <cRIO/DataTypes.h>
30#include <cmath>
31
32namespace LSST {
33namespace M1M3 {
34namespace SS {
35
36class ForceActuatorApplicationSettings;
37class ForceActuatorSettings;
38
40public:
41 static void daaPositiveXToMirror(float primaryCylinder, float secondaryCylinder, float *xForce,
42 float *yForce, float *zForce) {
43 *xForce = secondaryCylinder * _reciprocalSqrt2;
44 *yForce = 0;
45 *zForce = secondaryCylinder * _reciprocalSqrt2 + primaryCylinder;
46 }
47
48 static void daaNegativeXToMirror(float primaryCylinder, float secondaryCylinder, float *xForce,
49 float *yForce, float *zForce) {
50 *xForce = -secondaryCylinder * _reciprocalSqrt2;
51 *yForce = 0;
52 *zForce = secondaryCylinder * _reciprocalSqrt2 + primaryCylinder;
53 }
54
55 static void daaPositiveYToMirror(float primaryCylinder, float secondaryCylinder, float *xForce,
56 float *yForce, float *zForce) {
57 *xForce = 0;
58 *yForce = secondaryCylinder * _reciprocalSqrt2;
59 *zForce = secondaryCylinder * _reciprocalSqrt2 + primaryCylinder;
60 }
61
62 static void daaNegativeYToMirror(float primaryCylinder, float secondaryCylinder, float *xForce,
63 float *yForce, float *zForce) {
64 *xForce = 0;
65 *yForce = -secondaryCylinder * _reciprocalSqrt2;
66 *zForce = secondaryCylinder * _reciprocalSqrt2 + primaryCylinder;
67 }
68
69 static void saaToMirror(float primaryCylinder, float secondaryCylinder, float *xForce, float *yForce,
70 float *zForce) {
71 *xForce = 0;
72 *yForce = 0;
73 *zForce = primaryCylinder;
74 }
75
76private:
77 static double constexpr _reciprocalSqrt2 = 0.70710678118654752440084436210485;
78};
79
80} /* namespace SS */
81} /* namespace M1M3 */
82} /* namespace LSST */
83
84#endif /* FORCECONVERTER_H_ */
Definition ForceConverter.h:39