New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DPS8005 Support #68

Open
makefu opened this Issue Jan 2, 2019 · 16 comments

Comments

Projects
None yet
3 participants
@makefu
Copy link

makefu commented Jan 2, 2019

Hey all,

I would love to have my dps8005 supported, i attach the on/off files for 5,10,15V attached to a 20V power source.

I would love to understand how the values correlate to the inputs in dps-model.h.

5v-off.txt
5v-on.txt
10v-on.txt
10v-off.txt
15v-on.txt
15v-off.txt

cheers!

@Xenoamor

This comment has been minimized.

Copy link
Contributor

Xenoamor commented Jan 2, 2019

Hmm.. that's very odd. The DAC values are the same on all of the xxv-on.txt files.
This is different to how the other devices work.

Are you sure you collected these with a different output voltage actually set? I think you have to "confirm" the input value by pressing set or something. Looking at the files I'd guess that they're all set for the same output voltage/current. If you have a multimeter just checking what the output voltage is would be useful before running the register scraping scripts

@makefu

This comment has been minimized.

Copy link

makefu commented Jan 2, 2019

Hey @Xenoamor , yeah i am quite sure that we confirmed the output voltage. We checked the source code and discovered that setting the register DHR12R1 via openocd does not set the the output voltage ( as described in dsp-model.h ).
Additionally the static values for calculating the input voltage do not match the model ( in opendps/pwrctl.c ).

@Xenoamor

This comment has been minimized.

Copy link
Contributor

Xenoamor commented Jan 3, 2019

Hmmm.. well that's very concerning then. Perhaps the DPS8005 does not have a DAC controlled output then. I guess alternatives are PWM that's then smoothed to an analogue voltage (although this makes no sense on a device with a DAC), or there's a seperate device that handles the voltage/current setting that is controlled via SPI/UART/I2C. You may have to have a look at the PCB and see if things have drastically changed

The static values you mention are going to be phased out soon by #17 where you'll be able to run a routine to determine the correct values

@makefu

This comment has been minimized.

Copy link

makefu commented Jan 3, 2019

@Xenoamor i really do think that the hardware revision is different, unfortunately. It contains new-style connectors and there are different chips on the board. When i get to it i can make some pictures, unfortunately for viewing the middle plate it seems i need to de-solder the 8 pins to the display, which is always a huge pain.

@Xenoamor

This comment has been minimized.

Copy link
Contributor

Xenoamor commented Jan 3, 2019

If you do take pictures please grab as high resolution ones as possible as like you said. You really only want to take that display off the once
There's an annoying hardware design fault that we discovered in #7 so I'd be interested to know if this one gets around it. Also any output filtering and reverse voltage protection would be a very welcome addition

@makefu

This comment has been minimized.

Copy link

makefu commented Jan 6, 2019

Hey @Xenoamor , i wrote a teardown of the DPS8005 in my personal blog: https://euer.krebsco.de/teardown-and-disassembly-of-the-dps8005.html . I really hope this helps with adding support for the DPS8005!

cheers

@Xenoamor

This comment has been minimized.

Copy link
Contributor

Xenoamor commented Jan 6, 2019

Oh. Well now this looks very very similar to the DPS3003 schematic.
It's all based around the TLC594 PWM controller. It also uses the same SGM8582 dual opamp. They seem to have changed the 3.3V regulator from a M5333B to a HT7133-1. And it looks like the constant current output load is the same LM321 aka A63A

The processor is the same. Can you see if R8 near the TLC594 and R37 near the SGM8582 both connect to the DAC outputs on the STM32?

You mentioned that the OpenDPS firmware somewhat failed. Can you elaborate on this?

@Xenoamor

This comment has been minimized.

Copy link
Contributor

Xenoamor commented Jan 6, 2019

That D0 LED on the back of the mainboard looks interesting. I wonder if that is some sort of output load

@makefu

This comment has been minimized.

Copy link

makefu commented Jan 6, 2019

@Xenoamor I am unable to test the connectivity right now but i will try to to this tomorrow. The "failure" was that i essentially got some rough voltage measurement working on the display by tweaking some of the values but i was unable to actually set the output value. I am unsure if it is related to the ADC and DCA values not being correct or because of some internals working differently on the DSP8005.

What i did was to test with the values for the DPS5005, however i was unable to change the output voltage by setting the register described in dps-model.h. These were my last values (before desoldering):

#elif defined(DPS8005)
 #define ADC_CHA_IOUT_GOLDEN_VALUE  (0x45)
 //AMPERE
 #define A_ADC_K (double)0.713
 #define A_ADC_C (double)0.51
 #define A_DAC_K (double)0.652
 #define A_DAC_C (double)0.611

  // VOLTAGE
 #define V_DAC_K (double)5.072
 #define V_DAC_C (double)10.85

// maybe does the right thing tm
 #define V_ADC_K (double)26.04
 #define V_ADC_C (double)-58.5
 #define VIN_ADC_K (double)26.000
 #define VIN_ADC_C (double)00.112

I used your fork already to set the VIN_ADC_K and C values.
I also have not changed the Ampere values because i was unsure how to do it. Now to think of it i guess it would be trivial by measuring the voltage difference and a know resistor (ohms law).

I tried to get the raw values from the controller, however flashing with #define COMMANDLINE 1 resulted in build errors. After fixing them by removing the respective functionality the controller went unresponsive on the UART port.I also was unsure how to actually use the commandline mode afterwards anyway ... :)

That was my last progress anyway.

@Xenoamor

This comment has been minimized.

Copy link
Contributor

Xenoamor commented Jan 6, 2019

The VIN_ADC_K and C are now in the main repo so if you need these you can now use this repo

What you may well need to do is manually set the DAC values and then measure what the outputs are. You can then plot these and use them to workout the K and C values

I've never actually used the command line myself I'm afraid.. It was in place before I got involved and it probably needs some love now that we've made a lot of commits on top of it. Perhaps @kanflo can chime in more on how it works? (EDIT: responded in 10 seconds after my comment.. is Kanflo an AI construct?)

@kanflo

This comment has been minimized.

Copy link
Owner

kanflo commented Jan 6, 2019

@makefu . Could you please try to change the following line to set DAC_DHR12R1 to 0xfff? If the DAC if still used this should crank up the output voltage to the max setting.

DAC_DHR12R1 = pwrctl_calc_vout_dac(v_out);

The command line build works now, sorry for that. It's legacy as it was superseded by dpsctl so I should probably remove it. Perhaps it could be reintroduced as a "peek and poke" module for these kind of investigations.

@makefu

This comment has been minimized.

Copy link

makefu commented Jan 6, 2019

@kanflo @Xenoamor i will try this as soon as i have soldered everything together :) I think i tried changing some registers but i was not seeing any changes, however i could be wrong here. When i initially dumped the registers from the original firmware i was not seeing any changes in DAC_DHR12R1 but maybe i did something wrong and was not enabling the port correctly, however i am pretty sure that i pressed "enable" together with a friend.
Another nice addition would be a way to read raw ADC values via the serial interface instead of the command-line one.
How does the commandline mode is actually working? will it create a prompt on the serial console as well?

@Xenoamor

This comment has been minimized.

Copy link
Contributor

Xenoamor commented Jan 6, 2019

I do actually have something in my master branch that allows this which we called a "calibration report" This is part of the work for #17. It effectively gives the following:

python dpsctl.py -d COM7 -cr
Calibration Report:
        A_ADC_K = 1.71300005913
        A_ADC_C = -118.510002136
        A_DAC_K = 0.652000010014
        A_DAC_C = 288.610992432
        V_ADC_K = 13.1639995575
        V_ADC_C = -100.750999451
        V_DAC_K = 0.0719999969006
        V_DAC_C = 1.85000002384
        VIN_ADC_K = 16.7460002899
        VIN_ADC_C = 64.1119995117
        VIN_ADC = 913
        VOUT_ADC = 7
        IOUT_ADC = 0
        IOUT_DAC = 0
        VOUT_DAC = 0

I'll look at making a pull request for this tomorrow after work as I'm trying to break-up the calibration work I have into smaller requests anyway to prevent a behemoth of a pull request

@Xenoamor

This comment has been minimized.

Copy link
Contributor

Xenoamor commented Jan 6, 2019

I had a programming itch... let me know how that works out for you. If stuff is missing from this and it doesn't work please check my master branch for whatever I've missed out

@makefu

This comment has been minimized.

Copy link

makefu commented Jan 6, 2019

@Xenoamor will do once i put the dps8005 together again, thanks for your help!

@Xenoamor

This comment has been minimized.

Copy link
Contributor

Xenoamor commented Jan 7, 2019

Just a heads up this is now in the master branch. Good luck!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment