new approch on decades modelling
This commit is contained in:
@@ -7,14 +7,22 @@ void set_output_voltage(double setpoint_voltage, ESeries E_resistors) {
|
|||||||
double R_high_resistance = 0.0;
|
double R_high_resistance = 0.0;
|
||||||
double R_low_resistance = 0.0;
|
double R_low_resistance = 0.0;
|
||||||
|
|
||||||
int R_high_decade = 4;
|
//start at 10k for low resistor and at 1R for high resistor
|
||||||
int R_low_decade = 0;
|
int R_high_decade = 0;
|
||||||
|
int R_low_decade = 4;
|
||||||
|
|
||||||
|
// voltage computed from resistor configuration used to compare new result to previous optimum
|
||||||
double output_voltage = 0.0;
|
double output_voltage = 0.0;
|
||||||
|
|
||||||
|
// set the max array index for given e series
|
||||||
ESeriesMaxValue max_value = get_E_MAX(E_resistors);
|
ESeriesMaxValue max_value = get_E_MAX(E_resistors);
|
||||||
|
|
||||||
for (int e_value = 0; R_low_resistance <= 1E+6 * E_values[E_resistors][0]; e_value++) {
|
/*
|
||||||
|
* start at minimum given Rlow from datasheet and select optimal Rhigh for given Rlow and Vout.
|
||||||
|
* do this for all possible Rlows and choose the optimal combination
|
||||||
|
* (minimize |setpoint_voltage - output_voltage|)
|
||||||
|
*/
|
||||||
|
for () {
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user