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

80 lines
2.5 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.

/*
* TorqueLimitation.hh
*
* Created on: 29 дек. 2020 г.
* Author: titov
*/
#ifndef UMLIBRARY_PROCESSING_TORQUELIMITATION_HH_
#define UMLIBRARY_PROCESSING_TORQUELIMITATION_HH_
#include "../systemic/ISignal.hh"
#include "../systemic/IProcess.hh"
#include "acs/VectorAsyncInterface.hh"
namespace processing {
//!Модуль ограничивает момент двигателя для обеспечения ограничения усилия на штоке.
class TorqueLimitation : public systemic::IProcess, public vector::ITechValue {
public:
struct Setting {
float max_torque; //!<Максимальное задаваемое ограничение усилия.
float overload_coefficient; //!<Коэффициент перегрузки.
float positive_force_offset_k; //!<Смещение положительного усилия, мультипликативный коэффициент.
float positive_force_offset_b; //!<Смещение положительного усилия, аддитивный коэффициент.
float negative_force_offset_k; //!<Смещение отрицательного усилия, мультипликативный коэффициент.
float negative_force_offset_b; //!<Смещение отрицательного усилия, аддитивный коэффициент.
bool isValid();
Setting();
};
void configure( const Setting & setting );
void process();
void setSampleTime( float ts_in_second );
void set( control::Value );
control::Value get() const;
TorqueLimitation( vector::ITechValue & up_limit, vector::ITechValue & down_limit,
systemic::ISignal & friction, systemic::ISignal & dynamic_torque, systemic::ISignal & load );
const float & getActualUpLimit() const;
const float & getActualDownLimit() const;
private:
vector::ITechValue & torque_up_limit;
vector::ITechValue & torque_down_limit;
systemic::ISignal & friction;
systemic::ISignal & dynamic_torque;
systemic::ISignal & load;
float demand_limit;
float actual_up_limit;
float actual_down_limit;
float lim_act_up;
float lim_act_down;
float torque_lim_act_up;
float torque_lim_act_down;
float _max_torque;
float _K;
float _Kp1;
float _OffsetUp_k;
float _OffsetUp_b;
float _OffsetDown_k;
float _OffsetDown_b;
};
}
#endif /* UMLIBRARY_PROCESSING_TORQUELIMITATION_HH_ */