Using change voltage to reduce the voltage during It measurements yields a range error due to the fact that the source range is set to the target voltage before ramping down.
Change voltage needs two strategies: increase voltage and decrease voltage, eg. (pseudo code)
def increase_voltage(current_voltage, target_voltage, step_voltage):
context.set_source_range(target_voltage) # set higher target range
for voltage in linear_range(current_voltage, target_voltage, step_voltage):
context.set_source_voltage(voltage)
def decrease_voltage(current_voltage, target_voltage, step_voltage):
for voltage in linear_range(current_voltage, target_voltage, step_voltage):
context.set_source_voltage(voltage)
context.set_source_range(target_voltage) # set lower target range
def change_voltage(current_voltage, target_voltage, step_voltage):
if abs(current_voltage) > abs(target_voltage):
decrease_voltage(current_voltage, target_voltage, step_voltage)
else:
increase_voltage(current_voltage, target_voltage, step_voltage)
Using change voltage to reduce the voltage during It measurements yields a range error due to the fact that the source range is set to the target voltage before ramping down.
Change voltage needs two strategies: increase voltage and decrease voltage, eg. (pseudo code)