@ -14,6 +14,9 @@ AlgorithmWork::AlgorithmWork(SYSCTRL::SystemEnvironment& env):
AlgorithmBase ( ) ,
AlgorithmBase ( ) ,
m_env ( env ) ,
m_env ( env ) ,
m_reference_switcher ( false ) ,
m_reference_switcher ( false ) ,
# if ((TYPECONTROL == SCALARCONTROL)&&(SCALARCONTROL_VOLTAGEREGULATOR == SCALARCONTROL_VOLTAGEREGULATOR_ABC))
m_orts ( ) ,
# endif
_execute ( & SYSCTRL : : AlgorithmWork : : _execute_undef )
_execute ( & SYSCTRL : : AlgorithmWork : : _execute_undef )
//
//
{ } //CONSTRUCTOR
{ } //CONSTRUCTOR
@ -52,6 +55,7 @@ void AlgorithmWork::reset()
m_env . regulator_current_limit_c . set_to_high_saturation ( ) ;
m_env . regulator_current_limit_c . set_to_high_saturation ( ) ;
m_env . regulator_current_pfc_c . reset ( ) ;
m_env . regulator_current_pfc_c . reset ( ) ;
# if SCALARCONTROL_VOLTAGEREGULATOR == SCALARCONTROL_VOLTAGEREGULATOR_ABC
m_env . regulator_voltage_load_a_active . reset ( ) ;
m_env . regulator_voltage_load_a_active . reset ( ) ;
m_env . regulator_voltage_load_a_reactive . reset ( ) ;
m_env . regulator_voltage_load_a_reactive . reset ( ) ;
@ -60,6 +64,10 @@ void AlgorithmWork::reset()
m_env . regulator_voltage_load_c_active . reset ( ) ;
m_env . regulator_voltage_load_c_active . reset ( ) ;
m_env . regulator_voltage_load_c_reactive . reset ( ) ;
m_env . regulator_voltage_load_c_reactive . reset ( ) ;
# endif
# if SCALARCONTROL_VOLTAGEREGULATOR == SCALARCONTROL_VOLTAGEREGULATOR_RMS
m_env . regulator_voltage_load_rms . reset ( ) ;
# endif
//
//
# endif
# endif
@ -175,7 +183,7 @@ void AlgorithmWork::_execute_run()
# if TYPECONTROL == SCALARCONTROL
# if (( TYPECONTROL == SCALARCONTROL)&&(SCALARCONTROL_VOLTAGEREGULATOR == SCALARCONTROL_VOLTAGEREGULATOR_ABC))
# pragma CODE_SECTION("ramfuncs");
# pragma CODE_SECTION("ramfuncs");
void AlgorithmWork : : _execute_run ( )
void AlgorithmWork : : _execute_run ( )
{
{
@ -193,38 +201,101 @@ void AlgorithmWork::_execute_run()
m_env . phase_control . phase_a . reference . current_ampl_pfc_const = m_env . phase_control . common_ref . current_pfc_rms ;
m_env . phase_control . phase_a . reference . current_ampl_pfc_const = m_env . phase_control . common_ref . current_pfc_rms ;
m_env . phase_control . phase_b . reference . current_ampl_pfc_const = m_env . phase_control . common_ref . current_pfc_rms ;
m_env . phase_control . phase_b . reference . current_ampl_pfc_const = m_env . phase_control . common_ref . current_pfc_rms ;
m_env . phase_control . phase_c . reference . current_ampl_pfc_const = m_env . phase_control . common_ref . current_pfc_rms ;
m_env . phase_control . phase_c . reference . current_ampl_pfc_const = m_env . phase_control . common_ref . current_pfc_rms ;
//
# if TYPE_ORTS == TYPE_ORTS_NORMAL
m_orts = m_env . main_abc_orts . phase_a ;
_execute_single_phase ( m_env . phase_control . phase_a ,
_execute_single_phase ( m_env . phase_control . phase_a ,
m_env . projection_voltage_input_a ,
m_env . projection_voltage_input_a ,
m_env . main_abc_orts . phase_a ,
m_env . regulator_current_limit_a ,
m_env . regulator_current_limit_a ,
m_env . regulator_current_pfc_a ,
m_env . regulator_current_pfc_a ,
m_env . regulator_dc_a ,
m_env . cell_dc_voltage_a ,
m_env . cell_dc_voltage_a ,
m_env . regulator_voltage_load_a_active ,
m_env . regulator_voltage_load_a_active ,
m_env . regulator_voltage_load_a_reactive ) ;
m_env . regulator_voltage_load_a_reactive ) ;
//
m_orts = m_env . main_abc_orts . phase_b ;
_execute_single_phase ( m_env . phase_control . phase_b ,
_execute_single_phase ( m_env . phase_control . phase_b ,
m_env . projection_voltage_input_b ,
m_env . projection_voltage_input_b ,
m_env . main_abc_orts . phase_b ,
m_env . regulator_current_limit_b ,
m_env . regulator_current_limit_b ,
m_env . regulator_current_pfc_b ,
m_env . regulator_current_pfc_b ,
m_env . regulator_dc_b ,
m_env . cell_dc_voltage_b ,
m_env . cell_dc_voltage_b ,
m_env . regulator_voltage_load_b_active ,
m_env . regulator_voltage_load_b_active ,
m_env . regulator_voltage_load_b_reactive ) ;
m_env . regulator_voltage_load_b_reactive ) ;
//
m_orts = m_env . main_abc_orts . phase_c ;
_execute_single_phase ( m_env . phase_control . phase_c ,
m_env . projection_voltage_input_c ,
m_env . regulator_current_limit_c ,
m_env . regulator_current_pfc_c ,
m_env . cell_dc_voltage_c ,
m_env . regulator_voltage_load_c_active ,
m_env . regulator_voltage_load_c_reactive ) ;
# endif
# if TYPE_ORTS == TYPE_ORTS_BACK
m_orts . active = m_env . main_abc_orts . phase_c . reactive ;
m_orts . reactive = - m_env . main_abc_orts . phase_c . active ;
_execute_single_phase ( m_env . phase_control . phase_a ,
m_env . projection_voltage_input_a ,
m_env . regulator_current_limit_a ,
m_env . regulator_current_pfc_a ,
m_env . cell_dc_voltage_a ,
m_env . regulator_voltage_load_a_active ,
m_env . regulator_voltage_load_a_reactive ) ;
//
m_orts . active = m_env . main_abc_orts . phase_a . reactive ;
m_orts . reactive = - m_env . main_abc_orts . phase_a . active ;
_execute_single_phase ( m_env . phase_control . phase_b ,
m_env . projection_voltage_input_b ,
m_env . regulator_current_limit_b ,
m_env . regulator_current_pfc_b ,
m_env . cell_dc_voltage_b ,
m_env . regulator_voltage_load_b_active ,
m_env . regulator_voltage_load_b_reactive ) ;
//
m_orts . active = m_env . main_abc_orts . phase_b . reactive ;
m_orts . reactive = - m_env . main_abc_orts . phase_b . active ;
_execute_single_phase ( m_env . phase_control . phase_c ,
m_env . projection_voltage_input_c ,
m_env . regulator_current_limit_c ,
m_env . regulator_current_pfc_c ,
m_env . cell_dc_voltage_c ,
m_env . regulator_voltage_load_c_active ,
m_env . regulator_voltage_load_c_reactive ) ;
# endif
# if TYPE_ORTS == TYPE_ORTS_FORWARD
m_orts . active = - m_env . main_abc_orts . phase_b . reactive ;
m_orts . reactive = m_env . main_abc_orts . phase_b . active ;
_execute_single_phase ( m_env . phase_control . phase_a ,
m_env . projection_voltage_input_a ,
m_env . regulator_current_limit_a ,
m_env . regulator_current_pfc_a ,
m_env . cell_dc_voltage_a ,
m_env . regulator_voltage_load_a_active ,
m_env . regulator_voltage_load_a_reactive ) ;
//
m_orts . active = - m_env . main_abc_orts . phase_c . reactive ;
m_orts . reactive = m_env . main_abc_orts . phase_c . active ;
_execute_single_phase ( m_env . phase_control . phase_b ,
m_env . projection_voltage_input_b ,
m_env . regulator_current_limit_b ,
m_env . regulator_current_pfc_b ,
m_env . cell_dc_voltage_b ,
m_env . regulator_voltage_load_b_active ,
m_env . regulator_voltage_load_b_reactive ) ;
//
m_orts . active = - m_env . main_abc_orts . phase_a . reactive ;
m_orts . reactive = m_env . main_abc_orts . phase_a . active ;
_execute_single_phase ( m_env . phase_control . phase_c ,
_execute_single_phase ( m_env . phase_control . phase_c ,
m_env . projection_voltage_input_c ,
m_env . projection_voltage_input_c ,
m_env . main_abc_orts . phase_c ,
m_env . regulator_current_limit_c ,
m_env . regulator_current_limit_c ,
m_env . regulator_current_pfc_c ,
m_env . regulator_current_pfc_c ,
m_env . regulator_dc_c ,
m_env . cell_dc_voltage_c ,
m_env . cell_dc_voltage_c ,
m_env . regulator_voltage_load_c_active ,
m_env . regulator_voltage_load_c_active ,
m_env . regulator_voltage_load_c_reactive ) ;
m_env . regulator_voltage_load_c_reactive ) ;
# endif
m_voltage_a = m_env . phase_control . phase_a . reference . voltage_cell_relative ;
m_voltage_a = m_env . phase_control . phase_a . reference . voltage_cell_relative ;
m_voltage_b = m_env . phase_control . phase_b . reference . voltage_cell_relative ;
m_voltage_b = m_env . phase_control . phase_b . reference . voltage_cell_relative ;
@ -233,14 +304,13 @@ void AlgorithmWork::_execute_run()
} //
} //
# endif
# endif
//
//
# if TYPECONTROL == SCALARCONTROL
# if (( TYPECONTROL == SCALARCONTROL)&&(SCALARCONTROL_VOLTAGEREGULATOR == SCALARCONTROL_VOLTAGEREGULATOR_ABC))
# pragma CODE_SECTION("ramfuncs");
# pragma CODE_SECTION("ramfuncs");
void AlgorithmWork : : _execute_single_phase ( SYSCTRL : : AlgorithmSinglePhaseControl & phase ,
void AlgorithmWork : : _execute_single_phase ( SYSCTRL : : AlgorithmSinglePhaseControl & phase ,
SYSCTRL : : ProjectionAnalogSignalStructure & projection ,
SYSCTRL : : ProjectionAnalogSignalStructure & projection ,
SYSCTRL : : VectorOrthogonalProjection & orts ,
FLTSYSLIB : : PIController & regulator_limit ,
FLTSYSLIB : : PIController & regulator_limit ,
FLTSYSLIB : : PIController & regulator_pfc ,
FLTSYSLIB : : PIController & regulator_pfc ,
FLTSYSLIB : : PIController & regulator_dc ,
//FLTSYSLIB::PIController& regulator_dc,
float & dc_volatage ,
float & dc_volatage ,
FLTSYSLIB : : PIController & regulator_active ,
FLTSYSLIB : : PIController & regulator_active ,
FLTSYSLIB : : PIController & regulator_reactive )
FLTSYSLIB : : PIController & regulator_reactive )
@ -255,8 +325,8 @@ void AlgorithmWork::_execute_single_phase(SYSCTRL::AlgorithmSinglePhaseControl&
if ( phase . control_bit . signal . enable_pfc )
if ( phase . control_bit . signal . enable_pfc )
{
{
phase . reference . voltage_pfc = regulator_pfc . execute ( phase . reference . current_ampl_pfc_const , phase . feedback . current_ampl_jm ) +
phase . reference . voltage_pfc = regulator_pfc . execute ( phase . reference . current_ampl_pfc_const , phase . feedback . current_ampl_jm ) ;
regulator_dc . execute ( phase . reference . voltage_dc , dc_volatage ) ;
//+ regulator_dc.execute(phase.reference.voltage_dc, dc_volatage);
}
}
else
else
{
{
@ -304,8 +374,8 @@ void AlgorithmWork::_execute_single_phase(SYSCTRL::AlgorithmSinglePhaseControl&
//
//
} //if
} //if
//
//
phase . reference . voltage_cell_real = phase . reference . voltage_cell_ampl_real * orts. active ;
phase . reference . voltage_cell_real = phase . reference . voltage_cell_ampl_real * m_ orts. active ;
phase . reference . voltage_cell_jm = phase . reference . voltage_cell_ampl_jm * orts. reactive ;
phase . reference . voltage_cell_jm = phase . reference . voltage_cell_ampl_jm * m_ orts. reactive ;
phase . reference . voltage_cell = phase . reference . voltage_cell_real - phase . reference . voltage_cell_jm ;
phase . reference . voltage_cell = phase . reference . voltage_cell_real - phase . reference . voltage_cell_jm ;
//
//
phase . reference . voltage_cell_relative = phase . reference . voltage_cell * phase . feedback . voltage_cell_dc_reciprocal ;
phase . reference . voltage_cell_relative = phase . reference . voltage_cell * phase . feedback . voltage_cell_dc_reciprocal ;
@ -405,6 +475,42 @@ void AlgorithmWork::_execute_run()
} //
} //
# endif
# endif
# if ((TYPECONTROL == SCALARCONTROL)&&(SCALARCONTROL_VOLTAGEREGULATOR == SCALARCONTROL_VOLTAGEREGULATOR_RMS))
# pragma CODE_SECTION("ramfuncs");
void AlgorithmWork : : _execute_run ( )
{
m_env . hardware . ref_control_order = ORDER_START ;
//
m_env . phase_control . phase_a . reference . voltage_ampl_real = m_env . reference_voltage_load_rms_intensity . execute ( ( 0.5774 ) * m_env . phase_control . common_ref . voltage_module_rms ) ;
m_env . phase_control . phase_a . reference . voltage_cell_real = m_env . regulator_voltage_load_rms . execute ( m_env . phase_control . phase_a . reference . voltage_ampl_real , m_env . rms_voltage_load_module ) ;
//
# if TYPE_ORTS == TYPE_ORTS_NORMAL
m_env . phase_control . phase_a . reference . voltage_cell = m_env . phase_control . phase_a . reference . voltage_cell_real * m_env . main_abc_orts . phase_a . active ;
m_env . phase_control . phase_b . reference . voltage_cell = m_env . phase_control . phase_a . reference . voltage_cell_real * m_env . main_abc_orts . phase_b . active ;
m_env . phase_control . phase_c . reference . voltage_cell = m_env . phase_control . phase_a . reference . voltage_cell_real * m_env . main_abc_orts . phase_c . active ;
# endif
# if TYPE_ORTS == TYPE_ORTS_BACK
m_env . phase_control . phase_a . reference . voltage_cell = m_env . phase_control . phase_a . reference . voltage_cell_real * m_env . main_abc_orts . phase_c . reactive ;
m_env . phase_control . phase_b . reference . voltage_cell = m_env . phase_control . phase_a . reference . voltage_cell_real * m_env . main_abc_orts . phase_a . reactive ;
m_env . phase_control . phase_c . reference . voltage_cell = m_env . phase_control . phase_a . reference . voltage_cell_real * m_env . main_abc_orts . phase_b . reactive ;
# endif
# if TYPE_ORTS == TYPE_ORTS_FORWARD
m_env . phase_control . phase_a . reference . voltage_cell = m_env . phase_control . phase_a . reference . voltage_cell_real * ( - m_env . main_abc_orts . phase_b . reactive ) ;
m_env . phase_control . phase_b . reference . voltage_cell = m_env . phase_control . phase_a . reference . voltage_cell_real * ( - m_env . main_abc_orts . phase_c . reactive ) ;
m_env . phase_control . phase_c . reference . voltage_cell = m_env . phase_control . phase_a . reference . voltage_cell_real * ( - m_env . main_abc_orts . phase_a . reactive ) ;
# endif
//
m_env . phase_control . phase_a . reference . voltage_cell_relative = m_env . phase_control . phase_a . reference . voltage_cell * m_env . cell_dc_voltage_a_reciprocal ;
m_env . phase_control . phase_b . reference . voltage_cell_relative = m_env . phase_control . phase_b . reference . voltage_cell * m_env . cell_dc_voltage_b_reciprocal ;
m_env . phase_control . phase_c . reference . voltage_cell_relative = m_env . phase_control . phase_c . reference . voltage_cell * m_env . cell_dc_voltage_c_reciprocal ;
//
m_voltage_a = m_env . phase_control . phase_a . reference . voltage_cell_relative ;
m_voltage_b = m_env . phase_control . phase_b . reference . voltage_cell_relative ;
m_voltage_c = m_env . phase_control . phase_c . reference . voltage_cell_relative ;
//
} //
# endif
//
//
} /* namespace SYSCTRL */
} /* namespace SYSCTRL */