MotorControlModuleSDFM_TMS3.../Projects/EFC_Communication/UMLibrary/processing/acs/SpeedControlProcess.hh
2024-06-07 11:12:56 +03:00

126 lines
3.3 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
* SpeedControlProcess.h
*
* Created on: 5 сент. 2019 г.
* Author: titov
*/
#ifndef SOURCE_PROCESSING_ACS_SPEEDCONTROLPROCESS_H_
#define SOURCE_PROCESSING_ACS_SPEEDCONTROLPROCESS_H_
#include "ControlSystemInterface.hh"
#include "../../systemic/ISignal.hh"
#include "../../systemic/IProcess.hh"
#include "../../common/ShadowGuard.hh"
#include "../../control/regulator/SpeedController.hh"
namespace processing { namespace acs {
//!
class SpeedControlProcess : public PhaseSpaceToPhaseSpaceUnitInterface, public systemic::IProcess {
public:
void set( TypeInput );
TypeOutput get() const;
void set_output( SetInterface * );
vector::ITechValue & getTorqueUpLimit();
vector::ITechValue & getTorqueDownLimit();
vector::ITechValue & getInertiaValue();
void setSampleTime( float ts_in_second );
void process();
void reset();
vector::IPhaseSpaceValue & getFeedforwardTract();
const float & demand() const;
SpeedControlProcess( control::regulator::SpeedController & speed_reg, systemic::ISignal & speed_fdb );
~SpeedControlProcess() noexcept {}
private:
struct TorqueUpLimit : public vector::ITechValue {
void set( float torque ) {
speed_control.setUpperTorque(torque);
}
float get() const {
return speed_control.getUpperTorque();
}
control::regulator::SpeedController & speed_control;
TorqueUpLimit( control::regulator::SpeedController & speed_control ) :
speed_control(speed_control) {}
} torque_up_limit;
struct TorqueDownLimit : public vector::ITechValue {
void set( float torque ) {
speed_control.setLowerTorque(torque);
}
float get() const {
return speed_control.getLowerTorque();
}
control::regulator::SpeedController & speed_control;
TorqueDownLimit( control::regulator::SpeedController & speed_control ) :
speed_control(speed_control) {}
} torque_down_limit;
struct InertiaValue : public vector::ITechValue {
void set( float moment_of_inertia ) {
speed_control.setInertia(moment_of_inertia);
}
float get() const {
return speed_control.getInertia();
}
control::regulator::SpeedController & speed_control;
InertiaValue( control::regulator::SpeedController & speed_control ) :
speed_control(speed_control) {}
} inertia_value;
struct FeedforwardTract : public vector::IPhaseSpaceValue {
void set( control::PhaseSpaceValue new_value ) {
stp = new_value;
}
control::PhaseSpaceValue get() const {
return stp;
}
ShadowGuard< control::PhaseSpaceValue > stp; //!<Вход: задание скорости.
FeedforwardTract() : stp( control::PhaseSpaceValue(0.0f, 0.0f) ) {}
} feedforward;
bool proc_enable;
bool isConnected() const;
SetInterface * output;
ShadowGuard< control::PhaseSpaceValue > speed_stp; //!<Вход: задание скорости.
control::PhaseSpaceValue torque_stp; //!<Выход: заданное напряжение.
control::regulator::SpeedController & speed_control;
systemic::ISignal & speed_fdb; //!<Cкорость.
};
}}
#endif /* SOURCE_PROCESSING_ACS_SPEEDCONTROLPROCESS_H_ */