10#include <nlohmann/json.hpp>
99 act_bw, vel_cl, noise_resp, max_KS)
149 gm_v, pm_v, msens_v, noise_resp, max_KS,
150 bw_p, bw_v, act_st, pos_cl)
173 double demanded_zeta;
180 demanded_bw, demanded_zeta, state)
203 double demanded_zeta;
210 demanded_st, demanded_zeta, state)
223 std::vector<double> numerators;
226 std::vector<double> denominators;
242 std::string programPath;
248 std::string pipeAddress;
254 PROCESS_INFORMATION pi;
285 const std::string& pipeAddress);
367 bool send(
const nlohmann::json& jsonObj);
386 nlohmann::json
receive(
unsigned int timeoutMilliseconds = 5000);
448 const nlohmann::json& data);
470 const nlohmann::json& data);
Holds the gains resulting from the autotuning process.
Definition: standalone_autotuning.h:58
ControllerGains gains
The resulting controller gains for velocity and position.
Definition: standalone_autotuning.h:61
Holds position and velocity PID gains for a controller.
Definition: standalone_autotuning.h:41
PIDGains velocity
PID gains for the velocity controller.
Definition: standalone_autotuning.h:47
PIDGains position
PID gains for the position controller.
Definition: standalone_autotuning.h:44
Represents the result of a full position autotuning process.
Definition: standalone_autotuning.h:179
Represents the result of a full velocity autotuning process.
Definition: standalone_autotuning.h:148
Represents the gains for a PID controller.
Definition: standalone_autotuning.h:20
double ki
Integral gain.
Definition: standalone_autotuning.h:26
double kd
Derivative gain.
Definition: standalone_autotuning.h:29
double kp
Proportional gain.
Definition: standalone_autotuning.h:23
Represents the result of a plant model identification process.
Definition: standalone_autotuning.h:209
Represents the state of the position autotuning process.
Definition: standalone_autotuning.h:98
Manages communication and control for an external autotuning process.
Definition: standalone_autotuning.h:239
FullVelocityAutoTuningResult full_auto_tune_velocity_controller(const nlohmann::json &data)
Performs a full velocity controller autotuning sequence using external autotuning program.
Definition: standalone_autotuning.cc:381
ControllerGains auto_tune_position_controller(const nlohmann::json &data)
Performs position controller autotuning using external autotuning program.
Definition: standalone_autotuning.cc:351
PlantModelResult identify_plant_model(const nlohmann::json &data)
Identifies the plant model based on the input data.
Definition: standalone_autotuning.cc:459
~StandaloneAutotuning()
Destroys the StandaloneAutotuning instance.
Definition: standalone_autotuning.cc:32
bool send(const nlohmann::json &jsonObj)
Sends a JSON object to the external autotuning program through the named pipe or Unix domain socket.
Definition: standalone_autotuning.cc:217
nlohmann::json receive(unsigned int timeoutMilliseconds=5000)
Receives a JSON response from the external autotuning program through the named pipe.
Definition: standalone_autotuning.cc:245
ControllerGains compute_position_controller_gains(const nlohmann::json &data)
Computes the position controller gains without performing full autotuning.
Definition: standalone_autotuning.cc:430
bool connect()
Establishes a connection to the named pipe (Windows) or Unix domain socket (Linux) for communication ...
Definition: standalone_autotuning.cc:151
void disconnect()
Disconnects from the named pipe and terminates the communication with the external autotuning program...
Definition: standalone_autotuning.cc:204
void stop()
Stops the external autotuning process.
Definition: standalone_autotuning.cc:125
FullPositionAutoTuningResult full_auto_tune_position_controller(const nlohmann::json &data)
Performs a full position controller autotuning sequence using external autotuning program.
Definition: standalone_autotuning.cc:406
ControllerGains auto_tune_velocity_controller(const nlohmann::json &data)
Performs velocity controller autotuning using external autotuning program.
Definition: standalone_autotuning.cc:322
bool start()
Starts the external autotuning program by creating a new process.
Definition: standalone_autotuning.cc:34
static const int BUFFER_SIZE
Size of the communication buffer for pipe transfers.
Definition: standalone_autotuning.h:271
Represents the state of the velocity autotuning process.
Definition: standalone_autotuning.h:74
double vel_cl
Closed-loop velocity value of the system.
Definition: standalone_autotuning.h:89
double noise_resp
Noise response in the velocity autotuning process.
Definition: standalone_autotuning.h:92
double pm
Phase margin of the velocity system.
Definition: standalone_autotuning.h:80
double act_bw
Active bandwidth of the system.
Definition: standalone_autotuning.h:86
double max_KS
Maximum allowed gain scale factor.
Definition: standalone_autotuning.h:95
double gm
Gain margin of the velocity system.
Definition: standalone_autotuning.h:77
double msens
Measurement sensitivity of the velocity system.
Definition: standalone_autotuning.h:83
NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(PlantModelResult, numerators, denominators)