WarpTwin
Documentation for WarpTwin models and classes.
Loading...
Searching...
No Matches
ReactionWheelModel.h
Go to the documentation of this file.
1/******************************************************************************
2* Copyright (c) ATTX INC 2025. All Rights Reserved.
3*
4* This software and associated documentation (the "Software") are the
5* proprietary and confidential information of ATTX INC. The Software is
6* furnished under a license agreement between ATTX and the user organization
7* and may be used or copied only in accordance with the terms of the agreement.
8* Refer to 'license/attx_license.adoc' for standard license terms.
9*
10* EXPORT CONTROL NOTICE: THIS SOFTWARE MAY INCLUDE CONTENT CONTROLLED UNDER THE
11* INTERNATIONAL TRAFFIC IN ARMS REGULATIONS (ITAR) OR THE EXPORT ADMINISTRATION
12* REGULATIONS (EAR99). No part of the Software may be used, reproduced, or
13* transmitted in any form or by any means, for any purpose, without the express
14* written permission of ATTX INC.
15******************************************************************************/
16/*
17Reaction wheel model header file
18
19Author: Alex Jackson
20*/
21/*
22Metadata for MS GUI:
23imdata = {"displayname" : "Reaction Wheel",
24 "exclude" : False,
25 "category" : "Actuators"
26}
27aliases = {"sc_body" : "Spacecraft Body",
28 "wheel_location__body" : "Wheel Position",
29 "quat_wheel_body" : "Wheel Orientation",
30 "torque_bias" : "Bias",
31 "torque_noise_std" : "Noise",
32 "seed_value" : "EXCLUDE",
33 "mass" : "Mass",
34 "mom_inertia" : "Moment of Inertia",
35 "operational" : "Operational",
36 "power" : "Power Draw",
37 "rad_tolerance" : "Rad. Tolerance",
38 "peak_torque" : "Peak Torque",
39 "momentum_cap" : "Momentum Cap",
40 "torque_com" : "Torque Cmd",
41 "momentum" : "Momentum",
42 "saturated" : "Saturated",
43 "wheel_speed" : "Wheel RPM",
44 "power_draw" : "Power Draw",
45 "applied_torque" : "Applied Torque",
46}
47*/
48
49#ifndef MODELS_ACTUATORS_REACTION_WHEEL_MODEL_H
50#define MODELS_ACTUATORS_REACTION_WHEEL_MODEL_H
51
52#include "simulation/Model.h"
54#include "frames/Body.h"
55#include "frames/Node.h"
56#include "frames/Joint.h"
58
59namespace warptwin {
74 MODEL(ReactionWheelModel)
75 public:
76 // Model params
77 // NAME TYPE DEFAULT VALUE
81 SIGNAL(sc_body, Body*, nullptr)
83 SIGNAL(wheel_location__body, CartesianVector3, CartesianVector3({0.0, 0.0, 0.0}))
86 SIGNAL(quat_wheel_body, clockwerk::Quaternion, clockwerk::Quaternion({1.0, 0.0, 0.0, 0.0}))
88 SIGNAL(torque_bias, double, 0.0)
91 SIGNAL(torque_noise_std, double, 0.0)
93 SIGNAL(seed_value, int, 0)
95 SIGNAL(mass, double, 0.0)
97 SIGNAL(mom_inertia, double, 0.0)
99 SIGNAL(rad_tolerance, double, 0.0)
101 SIGNAL(peak_torque, double, 0.0)
103 SIGNAL(momentum_cap, double, 0.0)
105 SIGNAL(power, double, 0.0)
107 SIGNAL(operational, bool, true)
109
110 // Model inputs
111 // NAME TYPE DEFAULT VALUE
114 SIGNAL(torque_com, double, 0.0)
116
117 // Model outputs
118 // NAME TYPE DEFAULT VALUE
121 SIGNAL(momentum, double, 0.0)
123 SIGNAL(saturated, bool, false)
125 SIGNAL(wheel_speed, double, 0.0)
127 SIGNAL(power_draw, double, 0.0)
129 SIGNAL(applied_torque, double, 0.0)
131
132 protected:
133 int16 start() override;
134 int16 execute() override;
135
137 BiasNoiseModel _torque_bias_noise;
138
141
144
147
149 double _total_torque = 0.0;
150
152 double _rps_to_rpm = 60.0/(2*M_PI);
153
155 bool _prev_com = false;
156
157 };
158
159}
160
161#endif
#define SIGNAL(NAME, TYPE, INITIAL_VALUE)
Definition appmacros.h:27
#define START_PARAMS
Definition appmacros.h:42
#define END_OUTPUTS
Definition appmacros.h:33
#define END_PARAMS
Definition appmacros.h:47
#define START_OUTPUTS
Definition appmacros.h:28
#define END_INPUTS
Definition appmacros.h:40
#define START_INPUTS
Definition appmacros.h:35
Class to define a body as a frame with mass and inertia.
Definition Body.h:44
Node class to apply forces and moments to frames.
Definition Node.h:44
#define CartesianVector3
Definition mathmacros.h:43
#define Matrix3
Definition mathmacros.h:29
Class to propagate CR3BP dynamics in characteristic units.
Definition statistics.hpp:22
int16 start() override
Class to execute logging.
SIGNAL(_mu, double, warpos::earth_wgs84.mu)
double _total_torque
Value to hold total torque calculation.
Definition ReactionWheelModel.h:149
BiasNoiseModel _torque_bias_noise
The bias and noise model for torque output.
Definition ReactionWheelModel.h:137
double _torque_perturbation
Value to hold perturbation to torque.
Definition ReactionWheelModel.h:146
Matrix3 _mom_inertia_tensor
Matrix to hold the moment of inertia tensor of the wheel.
Definition ReactionWheelModel.h:143
@ MODEL
Simplified dynamics model representing motion in the circular restricted 3 body problem.
Definition ImNode.h:31
double _rps_to_rpm
Conversion between radians per second and revolutions per minute.
Definition ReactionWheelModel.h:152
Node _wheel_node
The reaction wheel node.
Definition ReactionWheelModel.h:140
int16 execute() override
Function to check monitor input conditions and set trigger flag accordingly. Should be implemented in...
bool _prev_com
Boolean to store the previous operational state.
Definition ReactionWheelModel.h:155
const floating_point M_PI
Definition unitutils.h:32