Comments (14)
Awesome, I was just looking into how best to implement this.
How do the two DACs work on the DPS5005 to control voltage and current. Is it possible to set them to two different values and it will automatically switch between CV and CC modes?
EDIT: I've posted my findings here
from opendps.
Should I just prep the PID-controlled branch I had?
from opendps.
Thinking about it do we need a voltage PID? There's already a feedback loop in the hardware and with correct calibration in #17 and with a fix for #7 we should be able to say for certain (giving a bit for calibration errors and temperature drift) what the output is.
With the calibration I don't see the mismatch between the output and what's on the display that started the discussion. Excluding the one caused by #7 which is not accounted for by the PID loop anyway. I feel like we may have come full circle here and that Manawyrm's comment was correct to start with
from opendps.
Thanks for this project!
This is an essential feature for me, so I'm beginning work on this at https://github.com/BasedOnTechnology/opendps
Hopefully in the coming weeks I can get my DPS running and tune the PID constants.
Out of curiosity, is there either a loop in this code that takes a completely repeatable amount of time, or a timer running somewhere that I can use? PIDs rely on a consistent timestep per cycle.
from opendps.
Great, looking forward to your PR! There is a 1ms systick timer you could use to eg. add an event to the application event queue every X ms.
from opendps.
@kanflo Awesome, thanks a lot!
from opendps.
I found a nice writeup by @dannyf00 about PID controllers the other day if you need inspiration. You could of course be a PID ninja in which case I bow respectfully ;)
from opendps.
Sorry to bother you again. DPS5020 issue was caused by my incompetence.
Voltage PID is in and working:
I also added a CC term to the PID to make the CC behavior replicate that of my lab PSUs; that is, decrease voltage when current limit hit:
https://www.youtube.com/watch?v=WdlEo2w7u9c
There's a lot of startup overshoot with the current PID tunings; I've had the overshoot down to about 100 millivolts, but I forgot what tuning parameters caused that :(
Currently, I just have the PID function called from the mainloop; I've tried to add it as an event, but... I can't figure out how. Could you give me a pointer on how that's done?
Secondly (sorry), could you explain how the command_handler function works? I'm hoping to be able to input new PID tuning values through a command...do I need "COMMANDLINE=1" set as a flag? If I set that flag, I get a "missing ui.h" error.
Thanks again!
from opendps.
Cool! For adding a new command, add an entry to commands[]
containing the name of the command, the handler function and number of arguments and build with COMMANDLINE=1
which should build again.
from opendps.
@kanflo Huh, I didn't seem to get any response doing that. I tried sending a few of the other commands ("on", "off")with and without newlines and it didn't seem to parse it. Might be something at my end.
from opendps.
@0xDBFB7's branch wouldn't build for me for some weird reason, so I ended up implementing my own basic version of PID control, branched off the 10ae4b2 commit: https://github.com/tzarc/opendps/commits/pid_control
Not sure if it's any help, as I've only implemented it for CV, but perhaps it could be a reference for the proper implementation as well.
from opendps.
@tzarc Really sorry about that, I got super busy and didn't want to make pull request until I had the PID tunings perfect, since overshoot would kill target boards.
My branch has a few specific changes for my setup that probably prevented the build.
from opendps.
No problem; mine was hacked together relatively quickly so having a safer implementation is probably best!
from opendps.
Pushed to the following branch, based on current master:
https://github.com/tzarc/opendps/tree/pid_v3
Only handling CV, don't have a way to test CC.
If we're cool with that, I'll make the PR.
from opendps.
Related Issues (20)
- Blank screen on DPS3005 HOT 22
- White screen after flashing DPS5005 HOT 9
- wz5005e support possible? HOT 12
- Support Request: build/upload doesn't work HOT 1
- No respond beside ping over uart, calibration menu has no effect HOT 1
- Display is cut off at the bottom HOT 5
- What serial connector type does RuiDeng DPS5005 uses? HOT 3
- unexpected EOF while looking for matching ... HOT 19
- modbus
- Switching modes from the device HOT 3
- DPS5015 v2.6 Display blank HOT 2
- Support for DPH5005? Would be really useful because DPH can do StepUp
- remote control: show ascii strings to display from client
- Future of this project HOT 14
- Firmware HOT 4
- Support for Miniware MDP-XP HOT 1
- Rename master branch to main
- Weird behaviour DPS5015
- WZ3605E aka JL3605E-B (V1.0) Support, Buck-Boost, 36V, 5A HOT 2
- Feature request for Battery input power HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from opendps.