kanflo / opendps Goto Github PK
View Code? Open in Web Editor NEWGive your DPS5005 the upgrade it deserves
License: MIT License
Give your DPS5005 the upgrade it deserves
License: MIT License
I seeing a weird issue where the output voltage does not turn off after pressing on/off button.
When the press the on/off button (after resetting opendps) the power turn on but it does not turn off (goes back to zero) after pressing button again (though the lcd shows power off). Voltage remains the same even if i set the voltage to something else. Is this the intended behaviour or is it a bug in the firmware?
It would be good to have debug printing be a compile time option. I'm happy to implement this in due time
When connecting a 4.7ohm 10W resistor at 5V, voltage drops to 1.4V. Currently the OpenDPS firmware is incapable of driving higher loads. Why remains to be found out.
open dps is undergrade without the current limiter for usage in a lab , also ad in the front panel watts mesurment
When running the following on completion I get the following error:
python dpsctl.py -d COM7 -U opendps/opendps.bin
Download progress: 100%
Traceback (most recent call last):
File "dpsctl/dpsctl.py", line 630, in <module>
main()
File "dpsctl/dpsctl.py", line 625, in main
handle_commands(args)
File "dpsctl/dpsctl.py", line 392, in handle_commands
run_upgrade(comms, args.firmware, args)
File "dpsctl/dpsctl.py", line 496, in run_upgrade
sys.exit(os.EX_OK)
AttributeError: 'module' object has no attribute 'EX_OK'
Hello guys. I would like to ask your opinion about SCPI support for opendps.
SCPI (Standard Commands for Programmable Instruments) is industrial standard for controlling of measuring equipment and also programmable power supply over Serial/USB/GPIB/Ethernet. As for opendps I can implement serial version of SCPI and it will be compatible with true serial (RS-232), USB (over USB-UART adapter) and even ethernet (wifi over esp8266 or RTL8710AF).
This give us ability to use standard software (anybody using it already?). As for me, I using whis protocol with my oscilloscope, but my software have no support for anything apart this oscilloscope.
You can see example command set for power supply here http://www.manson.com.hk/getimage3/index/action/images/name/SDP_SCPI_command_list_1_2.pdf
and https://github.com/eez-open/psu-firmware/blob/master/doc/SCPI%20reference%20guide/EEZ%20PSU%20SCPI%20reference%20guide.pdf
Not sure if this is an actual bug. But I got my DPS today flashed it with OpenDPS and was playing with it. I currently set the voltage to 5.00 and when I turn it on it drops down to 4.74 even with out a load attached? Is this normal/expected behavior?
Is the change made to solve #52 correct? It seems like we want to limit the settable output to what the device can actually output so around 90-95% of the input voltage
With stock python installations, I get the following errors. Maybe there is a module missing or something?
Windows:
C:\Users\bla\Downloads\opendps-master\dpsctl>python dpsctl.py -d COM5 --ping
File "dpsctl.py", line 143
except socket.error, msg:
^
SyntaxError: invalid syntax
Linux:
~/opendps/dpsctl $ sudo python dpsctl.py -d /dev/ttyUSB0 --power on
Traceback (most recent call last):
File "dpsctl.py", line 429, in <module>
main()
File "dpsctl.py", line 426, in main
handle_commands(args)
File "dpsctl.py", line 293, in handle_commands
communicate(comms, create_power_enable(pwr), args)
File "dpsctl.py", line 237, in communicate
resp = comms.read()
File "dpsctl.py", line 108, in read
if b == uframe._SOF:
NameError: global name 'uframe' is not defined
Hi, i think I fail to compile opendps correctly.
To test that hypothesis - can someone please post a working opendps.bin file?
I use an old Thinkpad power supply for the input source for my DPS5005, which gives me 20.5V. Would it be nice if the output voltage will be caped to that voltage, because higher voltages makes no sense (no boost converter). Or do I miss something here?
I am interested in providing support for the bluetooth module that comes with the newer DPS. With the ultimate goal of eventually making OpenDPS available via an iOS application using Bluetooth.
As far as I can tell, the Bluetooth module just appears as a serial device.
I guess my questions are:
It would be nice to be able to get the GIT hash strings for the bootloader and the application for debugging. This could be done via a new protocol command in dpsctl
Hi,
I have a DPS3005 power supply and would love to know if it is supported by OpenDPS. At the moment, the only difference I see is the max. output current of 3A instead of 5A as DPS5005 has. Is it sufficient to just change the MAX_CURRENT to 3000 in opendps/Makefile?
Most, if not all, benchtop power supplies operate by setting both a voltage and a current level and limiting whichever one is reached first. This is in effect operating seemlessly in both CV and CC modes
I sat down and watched Dave's great video series on designing a PSU and I believe we have a circuit similar to the one below (which can be found in the TL594 datasheet):
The way this works is it uses the feedback from the output to regulate the voltage. However the way the current limiting works is it uses the error amplifier as a comparator without feedback. This is on the contrary to the DPS3003 schematics that are present in this repo.
To test this I made some minor changes to func_cv.c so that both the voltage and current DACs can be controlled directly. This now works exactly as I would I expect it to.
In my opinion this is how the device should work. Although this does function it is still very important to calibrate the device and some kind of indicator would be necessary to indicate when the device is in CC mode. This could be done by turning the current value on the screen red using #49 for example
It is worth noting that some sort of software feedback loop is still required however as at high current loads the voltages drift from it's target set point. This appears to be a steady state error and employing just the "I" (integral) part of a PID would correct this. As there is already a hardware feedback loop I don't believe employing the "P" (proportional) or "D" (derivative) sections is necessary or really a good idea as the two systems may fight each other and cause instability.
Pin B11, which controls the fan on DPS5015, is channel 4 of timer 2. Theoretically, I believe we should be able to set up Timer 2 for PWM control of the fan, so the operating speed can be ramped according to output wattage (since there's no temperature sensor AFAIK).
It looks like the isolated USB serial adapter that comes with the DPS5005 from this Aliexpress link doesn't operate at 115200 baud. Changing the default baudrate of opendps, dpsboot and dpsctl to 9600 fixes this problem.
It appears to be a CH341 IC that communicates through 2x EL357N optocouplers. It is the optocouplers that are too slow to respond
I'm not sure if this is worth changing for the general users as I have no idea how many people actually use this supplied device. One possible solution would be to have the firmware default to 9600 and then have a command that can renegotiate a different baudrate.
I'd be happy to implement this if anyone else is having a similar issue. If not I'll make a push with the baudrate set in the makefile so it's easy to change
Are the files in the opendps/hardware/reverse-engineering/dps3003/ directory for the DPS3003 or the DPS3203? The folder name doesn't match the filenames
`$ git clone --recursive https://github.com/kanflo/opendps.git
Cloning into 'opendps'...
remote: Counting objects: 864, done.
remote: Compressing objects: 100% (26/26), done.
remote: Total 864 (delta 13), reused 19 (delta 8), pack-reused 830
Receiving objects: 100% (864/864), 1.26 MiB | 1.20 MiB/s, done.
Resolving deltas: 100% (433/433), done.
Checking connectivity... done.
Submodule 'dpsctl/uhej' (https://github.com/kanflo/uhej-python.git) registered for path 'dpsctl/uhej'
Submodule 'esp8266-proxy/esp-open-rtos' ([email protected]:SuperHouse/esp-open-rtos.git) registered for path 'esp8266-proxy/esp-open-rtos'
Submodule 'esp8266-proxy/uhej' (https://github.com/kanflo/uhej) registered for path 'esp8266-proxy/uhej'
Submodule 'libopencm3' (https://github.com/libopencm3/libopencm3.git) registered for path 'libopencm3'
Cloning into 'dpsctl/uhej'...
remote: Counting objects: 30, done.
remote: Total 30 (delta 0), reused 0 (delta 0), pack-reused 30
Unpacking objects: 100% (30/30), done.
Checking connectivity... done.
Submodule path 'dpsctl/uhej': checked out 'dbb0a8aa12c58b739a4d3e5a0a4a812187ecc6a8'
Cloning into 'esp8266-proxy/esp-open-rtos'...
The authenticity of host 'github.com (192.30.253.113)' can't be established.
RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'github.com,192.30.253.113' (RSA) to the list of known hosts.
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
fatal: clone of '[email protected]:SuperHouse/esp-open-rtos.git' into submodule path 'esp8266-proxy/esp-open-rtos' failed`
Any possibility of implementing Constant Current mode?
A bug in past_read_unit
makes the bootloader halt when the current past block is completely full. As past_read_unit
does not check if the unit was found, it breaks as it reaches the end of the past block and returns the current address. This tricks the BL into thinking the past_upgrade_started
unit exists and thus halts.
The workaround will be simple but for people not having proper/easy JTAG access, upgrading the BL might be difficult. The fix will include garbage collection of the past area when it becomes full after a write, rather than the current scheme of garbage collecting a full past before writing a new unit.
Hi, I bought a dps5015 fairly recently from a distributor called "KKmoon" from Amazon EU, and I quickly put in opendps after I did some testing on the stock firmware.
Two problems as I can tell right now. First off the settings in dps-model.h does not work correctly on the hardware I have (on the PCB it says version V2.3):
The second issue is the fan, somehow the fan is slowing ramping up speed regardless of what kind of load is on the output, it feels there's some DAC/PWM output drifted upwards and causing the power supply to the fan to go up. It does turn off if I press the power button to disable output.
Saying that, for the first one, at least on the voltage DAC, I can give it a try and measure the numbers then refine the dps-model.h, as long as I know where to measure, any guidance on that?
Thanks for all your answers in advance!
/Tao
I have to double check but the linker is complaining. The .data section is overflowing into .rom.
I did not build the CC branch before, but this is in a new 17.10 VM. 5015 support is still broken it seems, so we will see...
There is an issue with the DPS5005s (at least the three I tested so far) resulting in output voltage drops at high currents. If outputting 6V (according to UI settings and UI feedback) and drawing 1.2A, a multimeter will show a 340mV drop on the output voltage compared to the UI. The value on DAC1 needs to be increased to maintain 6A @ 1.2A which also increases the displayed voltage ADC measurement.
More measurements here under the 'Voltage drop at high current draw' tab
The following table shows DAC1 values maintaining an output voltage of 6V under different current draw:
I [mA] DAC1
-------------
16 430
133 432
416 436
1263 456
2494 468
This is not OpenDPS related as the stock firmware has the same "feature". Fixing it would be a nice OpenDPS addition.
Is there anything that could be used for this purpose, replacing STLink? I have a GoodFET... but it seems I will have to wait it out until a ST-Link clone arrives from China.
$ make -C opendps flash
Results in
FLASH opendps.elf
(echo "halt; program /Users/sparky/Documents/Making Projects/DPS5015 Upgrade/opendps/opendps/opendps.elf verify reset" | nc -4 localhost 4444 2>/dev/null) || \
openocd -f interface/stlink-v2.cfg \
-f target/stm32f1.cfg \
-c "program opendps.elf verify reset exit" \
2>/dev/null
๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝOpen On-Chip Debugger
> halt; program /Users/sparky/Documents/Making Projects/DPS5015 Upgrade/opendps/opendps/opendps.elf verify reset
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0xfffffffe msp: 0xfffffffc
** Programming Started **
auto erase enabled
Invalid command argument
image.base_address option value ('Upgrade/opendps/opendps/opendps.elf') is not valid
embedded:startup.tcl:476: Error: ** Programming Failed **
in procedure 'program'
in procedure 'program_error' called at file "embedded:startup.tcl", line 532
at file "embedded:startup.tcl", line 476
> %
I have flashed the dps5005 unit successfully and tested cc mode which works ok (setting 1A results in 1.6A running). Then i tried cv mode but when i go to set the voltage it jumps from 0.00 to 17.46 then 17.63 then 17.80. I cannot set the voltage correctly, tried rebuilding/reflashing without success. Not sure if this issue is just me or the version i have compiled
Can we add an overvoltage limit in constant current mode?
My DPS5015 display freezes every time if I press buttons too fast. Firmware self still seems to work because I can switch output on and off but display doesn't update.
I tried to debug it my self but this hw platform is new for me, so I haven't managed to setup debugger yet..
Hey there,
I just received my DPS Power-Supply. It's a DPS5005 to be exact. I also ordered the additional Parts (Bluetooth and USB Board) along with it. Now my Board has a connector for these to interface, but I'm unsure whether these pins are the ones referenced for the installation of OpenDPS.
Attached are some images of the DPS I received.
Off topic: I'm also thinking about an OpenDps companion App for PC or Mobile... Maybe if I find some time.
Hey guys,
I wanted to play a bit with SCPI a implementation, although I am at the very beginning and currently trying to understand this project structure.
My idea was to make a Makefile definition to use either SCPI or the currently used protocol.
From:
Line 717 in d906c10
I come to:
opendps/opendps/serialhandler.h
Line 28 in d906c10
And than there are two implementations:
opendps/opendps/protocol_handler.c
Line 408 in c9b7eca
opendps/opendps/command_handler.c
Line 76 in 4588761
As far as I understand it command_handler.c is used to start the execution of the received commands.
protocol_handler.c parses the received payloads and also executes the commands?
I guess I don't understand how two functions can have two same definitions and when which is executed.
Thanks for the help.
Hi, first at all, great work !!
After burned the CC firmware in my "small" DPS3003 the enable/disable button does not disconnect the output, the voltage is getting out always :-( ...
I have this DPS5005:
https://www.banggood.com/RD-DPS5005-50V-5A-Communication-Function-Constant-Voltage-Current-Step-down-Power-Supply-Module-p-1161704.html
I followed the instructions from Readme.md in order to upgrade it, but without success.
The errors I get are:
Traceback (most recent call last):
File "dpsctl/dpsctl.py", line 617, in <module>
main()
File "dpsctl/dpsctl.py", line 612, in main
handle_commands(args)
File "dpsctl/dpsctl.py", line 385, in handle_commands
run_upgrade(comms, args.firmware, args)
File "dpsctl/dpsctl.py", line 451, in run_upgrade
ret_dict = communicate(comms, create_upgrade_start(chunk_size, crc), args)
File "dpsctl/dpsctl.py", line 349, in communicate
if not comms.open():
File "dpsctl/dpsctl.py", line 102, in open
self._port_handle.open()
File "/usr/local/lib/python2.7/dist-packages/serial/serialposix.py", line 286, in open
self._update_dtr_state()
File "/usr/local/lib/python2.7/dist-packages/serial/serialposix.py", line 634, in _update_dtr_state
fcntl.ioctl(self.fd, TIOCMBIS, TIOCM_DTR_str)
IOError: [Errno 110] Connection timed out
root@ubuntu:/opt/kit/opendps# dpsctl/dpsctl.py -v -d /dev/ttyUSB0 -U opendps/opendps.bin
Communicating with /dev/ttyUSB0
TX 9 bytes [7e 09 04 00 d2 26 55 6c 7f]
Error: timeout talking to device /dev/ttyUSB0.
I checked and the TTL to USB device name is ttyUSB0.
I also ran these commands with success:
make -C libopencm3
make -C opendps bin
pip install pyserial
pip install pycrc
I tried on Ubuntu 18.04 and also on Fedora 28.
Any ideas?
Thank you
I suggest a look at this as a really fun project:
https://www.aisec.fraunhofer.de/en/FirmwareProtection.html
Long story short, we could dump the firmware. I have one remaining 50V5A while the 5015 remains non functional (I have not found the cause for the disabled power output yet).
If someone wants to send a module my way, or can do this on his own, be my guest!
Any chance you could release pre-compiled binaries for the different supported models and publish these in the "Releases" section?
I have a DPS5015 and a ST-LINK/V2 flasher but not much experience compiling the builds.
As mentioned in #17, a PID controller would be very useful to maintain output power while under load.
start_app function should set MSP register to address from the application interrupt vector before jumping to the application.
Code should look like this:
https://github.com/robots/STM32/blob/master/can_boot/main.c#L57
powering up the DPS5005 and try controll by dpsctl.py only, the output voltage seems not to be set.
python dpsctl.py -d com4 -v -u 1000
Communicating with com4
TX 7 bytes [7e 02 03 e8 47 15 7f]
RX 6 bytes [7e 82 01 6d db 7f]
python dpsctl.py -d com4 -v -i 1000
Communicating with com4
TX 7 bytes [7e 03 03 e8 70 25 7f]
RX 6 bytes [7e 83 01 5e ea 7f]
python dpsctl.py -d com4 -v -p 1
Communicating with com4
TX 6 bytes [7e 05 01 ef d4 7f]
RX 6 bytes [7e 85 01 f4 4c 7f]
python dpsctl.py -d com4 -v -s
Communicating with com4
TX 5 bytes [7e 04 40 84 7f]
RX 17 bytes [7e 84 01 13 df 03 e8 00 00 00 00 03 e8 01 59 7b 7f]
V_in : 5.08 V
V_set : 1.00 V
V_out : 0.00 V (on)
I_lim : 1.000 A
I_out : 0.000 A
also the new set values are not shown in the dps5005 display (may its a following issue)
There are a lot of magic numbers in number_draw() that could be removed to allow for better rendering of all fonts. The widest glyph could be determined by the font generator in #79.
Lines 111 to 164 in 507da61
I'm happy to work on this once we have some of the outstanding font pull requests merged in
I did not note today is Friday the 13th until I found a bug in the past.c code. Writing a unit smaller than 4 bytes will corrupt the past. Guess I could have been worse off today :D
$ make -C dpsboot
make: Entering directory '/home/mike/dev/opendps/dpsboot'
CC common.c
CC hw.c
CC dpsboot.c
LD dpsboot.elf
/usr/lib/gcc/arm-none-eabi/8.1.0/../../../../arm-none-eabi/bin/ld: dpsboot.elf section `.text' will not fit in region `rom'
/usr/lib/gcc/arm-none-eabi/8.1.0/../../../../arm-none-eabi/bin/ld: section .app VMA [0000000008001400,000000000800f7ff] overlaps section .text VMA [0000000008000000,00000000080014a3]
/usr/lib/gcc/arm-none-eabi/8.1.0/../../../../arm-none-eabi/bin/ld: region `rom' overflowed by 176 bytes
collect2: error: ld returned 1 exit status
make: *** [../libopencm3.rules.mk:199: dpsboot.elf] Error 1
make: Leaving directory '/home/mike/dev/opendps/dpsboot'
$ arm-none-eabi-gcc --version
arm-none-eabi-gcc (Arch Repository) 8.1.0
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
I managed to build it okay with GCC 6.3.1, but it's close too:
0x0000000000001400 boot_size = 0x1400
...
.text 0x0000000008000000 0x1394
When I am in the CV-mode and V_In is greater than 32.7V I can't setup the voltage correctly. As you can see here in the pictures the voltage jumps between 0V and approximately 83V. Even if I am at the last digit.
My suggestion is a overflow of a 16-bit signed variable as the problem seems to happen when V_In is greater than 2^15 mV.
DPS5015 and DPS5020 seem to act the same to me. I have compiled the source with make -C opendps MODEL=DPS5015 MAX_CURRENT=9999
I also use a DP50V5A with the same issue.
Originally posted by @Jantek in #50 (comment)
I have been checking the headers and it would be very useful to advertise which JST-GH connector and socket match would fit. Both pitch and number of pins, as UART and JTAG/programmer IO are exposed together. Is it 1.25 pitch? I suppose we need both a 4P(in) and a 5P(in).
I seem to be missing the values after the decimal point on my display for the input voltage
This is contrary to what I see on my current development work so I think when the font changes were pulled into this repo something got messed up. Looking closely it looks like the decimal point has shifted and is taking up too much room?
My development version (ignore the camera capturing the 3/4)
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!
For resistors drawing, say, 400mA, the current limit needs to be set to 600mA or the OCP will kick in immediately when enabling power.
The inrush current needs to be handled, eg. by accepting inrush current > I_limit for a short period of time.
Has anyone tried this with the DPH3205 which is the buck-boost converter version of this?
I modified my power icon to be red, and ran the graphics convert. However, when programmed, this rendered blue.
I modified line 29 of ili9163c_settings.h
to the following:
#define __COLORSPC 0// 1:GBR - 0:RGB
instead of
#define __COLORSPC 1// 1:GBR - 0:RGB
and the problem was solved. This may be due further investigation into which units have which colour space, as it is not immediately apparent either way with the original black and white scheme.
They use the same front-panel, and are probably quite similar on the controller side, though the DC/DC converter is on a separate board. I guess it's unlikely, but maybe I can retrace the steps taken and try to identify where they differ? I'm in need of a couple of boost capable PSUs for a 12V electrical system, but am severely put off by the cluttered and clunky stock UI - I would only buy them if there's a decent chance of success with performing this firmware replacement.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.