MotorControlModuleSDFM_TMS3.../Projects/EFC_Communication/UMLibrary/technological/function/NullEstimation.hh
2024-06-07 11:12:56 +03:00

111 lines
3.2 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.

/*
* NullEstimation.h
*
* Created on: 23 нояб. 2016 г.
* Author: titov
*/
#ifndef SOURCE_TECHNOLOGICAL_NULLESTIMATION_H_
#define SOURCE_TECHNOLOGICAL_NULLESTIMATION_H_
#include "../ITechFunction.hh"
#include "../commissioning/ThetaNullEstimate.hh"
#include "../../systemic/ResourceHolder.hpp"
#include "../../driver/IInverter.hh"
#include "../../driver/IBrake.hh"
#include "../../control/function/SpaceVectorPwm.hh"
#include "../../systemic/ISignal.hh"
#include "../../systemic/IProcess.hh"
namespace technological { namespace function {
//!Функция поиска угла коммутации.
class NullEstimation : public ITechFunction {
public:
struct Input {
float amp_modulation; //!<Глубина модуляции, о.е.
float speed; //!<Скорость, рад/с.
float Nc; //!<Количество секторов.
float rise_to_hold; //!<Отношение времени вращения вектора к времени удержания.
float np; //!<Число пар полюсов.
};
struct Output {
float angle; //!<Разница между формируемым электрическим углом и позицией по датчику положения.
};
bool run( const char * value, std::size_t size );
//!Остановка кокнретной процедуры настройки и диагностики.
void stop();
//!Проверка что процедура на данный момент выполняется.
short getState() const;
//!Получение значений конкретной процедуры.
bool getResult( char * value, std::size_t size ) const;
NullEstimation(
ResourceKeeper<driver::IInverter> & rh_inverter, ResourceKeeper<driver::IBrake> & rh_brake,
systemic::ISignal & position,
ResourceKeeper<std::pmr::monotonic_buffer_resource> & rh_memory
);
void setProcessController_Observe( systemic::IProcessControl * proc_ctrl_observe );
void setProcessController_DataCollection( systemic::IProcessControl * proc_ctrl_collection );
protected:
commissioning::ThetaNullEstimate estimator;
commissioning::ThetaNullEstimate::TSetting setting; //настройки для естиматора
systemic::ISignal & position;
Locable<driver::IInverter> inverter;
Locable<driver::IBrake> brake;
Locable<std::pmr::monotonic_buffer_resource> buffer;
control::RotatingVector output;
bool is_run;
static bool validate( Input & );
systemic::IProcessControl * proc_ctrl_observe;
systemic::IProcessControl * proc_ctrl_collection;
public:
struct ObserveAndCalculationProcess {
ObserveAndCalculationProcess( NullEstimation & outer );
NullEstimation & outer;
void setSampleTime( float ts_in_second );
void process();
} observe_and_calculation;
struct DataCollectionProcess {
DataCollectionProcess( NullEstimation & outer );
NullEstimation & outer;
void setSampleTime( float ts_in_second );
void process();
} data_collection;
public:
};
} }
#endif /* SOURCE_TECHNOLOGICAL_NULLESTIMATION_H_ */