ModelSpace
All Classes Namespaces Functions Variables Enumerations Pages
PidTranslationalControl.h
1/******************************************************************************
2* Copyright (c) ATTX LLC 2024. All Rights Reserved.
3*
4* This software and associated documentation (the "Software") are the
5* proprietary and confidential information of ATTX, LLC. 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, LLC.
15******************************************************************************/
16/*
17Simple PID header file
18
19Author: Alex Reynolds
20*/
21
22#ifndef GNC_CONTROL_PID_TRANSLATIONAL_CONTROL_H
23#define GNC_CONTROL_PID_TRANSLATIONAL_CONTROL_H
24
25#include "core/macros.h"
26#include "architecture/Tasks.h"
27#include "six_dof_dynamics/Frame.hpp"
28#include "utils/frameutils.hpp"
29
30namespace clockwerk {
31
32 /**
33 * @brief Simple PID controller header file
34 *
35 *
36 */
37 class PidTranslationalControl : public clockwerk::Task {
38 public:
39 // Model params
40 // NAME TYPE DEFAULT VALUE
42 /** The proportional weight in the PID controller */
43 SIGNAL(P, double, 0.0)
44 /** The integral weight in the PID controller */
45 SIGNAL(I, double, 0.0)
46 /** The derivative weight in the PID controller */
47 SIGNAL(D, double, 0.0)
49
50 // Model inputs
51 // NAME TYPE DEFAULT VALUE
53 /** The commanded vector. This is the desired state for the system to achieve */
55 /** The actual state vector. This is the current state of the system */
57 /** The rate of change in the state vector. This is the current rate of change in the system */
60
61 // Model outputs
62 // NAME TYPE DEFAULT VALUE
64 /** The control command provided by the controller */
66 /** The current error in the system - actual - cmd */
68 /** The integrated error in the system -- summation of error over time */
71
72 // Model dependencies
73 struct Dependency { } dependency;
74
75 // Model-specific implementations of startup and derivative
76 PidTranslationalControl() : clockwerk::Task() {}
77 PidTranslationalControl(clockwerk::Task &pnt, int schedule_slot=0, const std::string &m_name="simple_pid_task")
78 : clockwerk::Task(pnt, schedule_slot, m_name) {}
79 PidTranslationalControl(clockwerk::Executive &e, int schedule_slot=0, const std::string &m_name="simple_pid_task")
80 : clockwerk::Task(e, schedule_slot, m_name) {}
81 virtual ~PidTranslationalControl() {}
82 protected:
83 int execute();
84 };
85
86}
87
88#endif
Central control mechanism to run simulations and software.
Definition Executive.h:43
Simple PID controller header file.
Definition PidTranslationalControl.h:37
int execute()
Function to execute the task. All math and calculations should be here.
Definition PidTranslationalControl.cpp:20
This is the base implementation of the task class.
Definition Tasks.h:68
Task()
Default constructor for the task object for simplicity. Note: Masks some functionality and should not...
Definition Tasks.cpp:21
Task(Task &pnt, int slot, const std::string &m_name="Unnamed")
Task-based constructor for the task. Auto-assigns executive.
Definition Tasks.cpp:47
Task(Executive &executive, int slot, const std::string &m_name="Unnamed")
Executive-based constructor for the task.
Definition Tasks.cpp:62
#define SIGNAL(NAME, TYPE, INITIAL_VALUE)
Definition macros.h:87
#define START_PARAMS
Definition macros.h:96
#define CartesianVector3D
Definition macros.h:54
#define END_OUTPUTS
Definition macros.h:90
#define END_PARAMS
Definition macros.h:98
#define START_OUTPUTS
Definition macros.h:88
#define END_INPUTS
Definition macros.h:94
#define START_INPUTS
Definition macros.h:92
Definition PidTranslationalControl.h:73
clockwerk::DataIO< clockwerk::CartesianVector< double, 3 > > deriv_state
Definition PidTranslationalControl.h:58
clockwerk::DataIO< clockwerk::CartesianVector< double, 3 > > cmd_state
Definition PidTranslationalControl.h:54
clockwerk::DataIO< clockwerk::CartesianVector< double, 3 > > act_state
Definition PidTranslationalControl.h:56
clockwerk::DataIO< clockwerk::CartesianVector< double, 3 > > error
Definition PidTranslationalControl.h:67
clockwerk::DataIO< clockwerk::CartesianVector< double, 3 > > integrated_error
Definition PidTranslationalControl.h:69
clockwerk::DataIO< clockwerk::CartesianVector< double, 3 > > control_cmd
Definition PidTranslationalControl.h:65
clockwerk::DataIO< double > D
Definition PidTranslationalControl.h:47
clockwerk::DataIO< double > P
Definition PidTranslationalControl.h:43
clockwerk::DataIO< double > I
Definition PidTranslationalControl.h:45