kanflo / opendps

Give your DPS5005 the upgrade it deserves
MIT License
895 stars 124 forks source link

Change constant current calibration to not use a load resistor #122

Closed Xenoamor closed 5 years ago

Xenoamor commented 5 years ago

I've tweaked how the constant current calibration works. It no longer uses a load resistor and instead you short the output terminals. This is effectively the equivalent of the open circuit calibration routine for the voltage but for current

This means it now can sweep the entire current range giving a greater degree of accuracy output current sweep shorted As you can see here we have the entire range available as calibration data: output current calibration a_dac shorted

It now also uses the A_ADC to determine the output current used instead of the V_ADC. This will remove any potential errors that were introduced by #7

This has now made my device incredibly accurate

kanflo commented 5 years ago

Looks promising! I am somewhat curious as to where the current goes? Is it dumped into GND? Could a hardware change not make the DPS suddenly costume the 5A? Edit: In a puff of smoke perhaps ;)

Xenoamor commented 5 years ago

If you have a look at the second graph the DPS is passing through 5A. This might make it a bit clearer: image

If you think about it whatever the load resistor is (ideally shorted ~0 Ohms in this calibration mode) then the DPS will always be sinking that full current to ground. The hardware is designed to allow this so it will be safe to do so

You can max out the V_DAC and A_DAC values and short the output and the device will still operate fine. I have tested this to confirm