@@ -79,14 +79,9 @@ template <symmetry_tag current_sensor_symmetry_> class CurrentSensor : public Ge
79
79
using UpdateType = CurrentSensorUpdate<current_sensor_symmetry>;
80
80
template <symmetry_tag sym_calc> using OutputType = CurrentSensorOutput<sym_calc>;
81
81
82
- // TODO: add u_rated to calculate base_current = base_power_3p / u_rated / sqrt3
83
- explicit CurrentSensor (CurrentSensorInput<current_sensor_symmetry> const & current_sensor_input)
84
- : GenericCurrentSensor{current_sensor_input},
85
- i_sigma_{current_sensor_input.i_sigma / base_power<current_sensor_symmetry>}, // TODO use base_current
86
- i_angle_sigma_{current_sensor_input.i_angle_sigma /
87
- base_power<current_sensor_symmetry>}, // TODO use base_current
88
- i_angle_measured_{current_sensor_input.i_angle_measured } {
89
- set_current (current_sensor_input.i_measured );
82
+ explicit CurrentSensor (CurrentSensorInput<current_sensor_symmetry> const & current_sensor_input, double u_rated)
83
+ : GenericCurrentSensor{current_sensor_input}, i_angle_measured_{current_sensor_input.i_angle_measured } {
84
+ set_current (current_sensor_input, u_rated);
90
85
};
91
86
92
87
UpdateChange update (CurrentSensorUpdate<current_sensor_symmetry> const & update_data) {
@@ -106,8 +101,11 @@ template <symmetry_tag current_sensor_symmetry_> class CurrentSensor : public Ge
106
101
double i_sigma_{};
107
102
double i_angle_sigma_{};
108
103
109
- void set_current (RealValue<current_sensor_symmetry> const & i_measured) {
110
- // TODO
104
+ void set_current (CurrentSensorInput<current_sensor_symmetry> const & input, double const & u_rated) {
105
+ double base_current = base_power_3p / u_rated / sqrt3 double scalar = convert_direction () / base_current;
106
+ i_sigma_ = input.i_sigma / base_current;
107
+ i_angle_sigma_ = input.i_angle_sigma / base_current; // TODO i_angle_sigma is optional
108
+ i_measured_ = input.i_measured / base_current;
111
109
}
112
110
113
111
CurrentSensorCalcParam<symmetric_t > sym_calc_param () const final {
0 commit comments