Skip to content
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

Added Constant-Power draw. Increased PID frequency and changed PID fr… #9

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

aseiger
Copy link

@aseiger aseiger commented Jan 2, 2021

-Added a constant-power option
-Re-tuned and improved the PID
-Power limit increased significantly - requires a better heatsink. This can be changed back to 15W of course!
-Serial interface has a better command printout, making it easier to use

These changes were made to test a 25W Raspberry Pi power supply board. I changed the heatsink to one from an old CPU, and powered the fan off of the exposed 5V debug header.

…om F-I control to real PI control. Power limit changed to 50W,
@jbcall90
Copy link

jbcall90 commented Jul 4, 2021

Thank you for adding this additional functionality. I needed a simple circuit that could drain an alkaline battery at a constant load to estimate operating life under a set of controlled conditions. The SparkFun Variable Load Kit (KIT-14449) had the proper bits needed to perform this but the base functionality of the kit only provides constant current and constant voltage loads. Your changes add constant power to the feature set.

The command readout on the serial interface was a helpful improvement for my purposes. I am running with a USB connection and not with an attached LCD display.

After a careful review of your changes, I was able to directly build your code in PSoC Creator v4.4 and upload to the PSoC on the Variable Load. My application requires a 75 mW constant load and therefore I modified the <sprintf(buff,..> lines to %6.3f for the power readout.

To improve code maintenance and readability I would recommend having the 50 W maximum load limit as a #define instead of explicitly called out for each use:
#define DEFAULT_P_MAX 50000
and then use DEFAULT_P_MAX everywhere the maximum power limit is referenced. If the SparkFun released version were to include your changes this would allow the folks at SparkFun to safely dial the power down without risk of breaking your code or introducing bugs in the process.

@aseiger
Copy link
Author

aseiger commented Jul 5, 2021

Will do! Thank you for the input

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants