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

Enable High Power and Voltage Limit #7

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

swissfreek
Copy link
Contributor

@swissfreek swissfreek commented Jan 29, 2021

This enables high power via auto detection of tip resistance (1.5-2.5ohm for RTM, 3-4ohm for RTU, otherwise UNKNOWN).

It dynamically adjusts output power as it runs based on the determined tip resistance. For RTM tips, it allows a max of 40W. For RTU tips, it currently only allows a max of 15W, until testing can validate that the code works properly, and then max power will be increased to the full 150W.

It limits power to 150mW in case the tip is UNKNOWN in order to prevent damage. This is set every time the _start() cycle runs so that switching from RTU to RTM does not cause damage.

It adjusts the scale of the power display bar for 40W or 150W output.

It also forces a stop and displays an error on the display if voltage is more than 14V when an RTM tip is plugged in, or 25V when an RTU tip is plugged in.

Sorry I'm creating a new pull request, I couldn't figure out how to change the code when I found errors before, so I started over.

swissfreek added 11 commits January 23, 2021 13:45
Added class for TipType (RTM, RTU, Unknown)
Added code to determine tip type based on resistance
Added code to account for new low and high resistance in tip heater status
Added code to start() to select appropriate max power based on tip type and send it to pid constants call
Moved pid constant setting from init() to start() so that max power gets updated in real time
Added code to power output bar to account for 150W output if using RTU tip
Removed code that checked for high power setting in start(). If power will be set by menu instead of automatically, this will not be needed, and if power is set automatically instead of manually, this will not be needed because the power setting will be removed
Removed extra } in if/else statement for tip type
Now there is one maximum voltage for RTM (14V) and one for RTU (25V) tips. Currently RTU tip limit is set to 25V due to the input capacitor limit of HW1.0.
Added line to start() that forces _tip_type to TipType::UNKNOWN with the rest of the variable initialization. This forces the iron to limit max output power to 150mW until a tip type is determined (RTM or RTU), which prevents 150W being sent to a 40W tip for even a single cycle when tips are changed.
Automatically detects tip type (RTM vs. RTU) and applies appropriate maximum power during _start() process (either 40W or 150W). If tip type is unknown, max power is 150mW for safety.

Currently, "150W" setting is limited to 15W in order to test without risk of destroying anything until code is verified to work correctly.
Changed code so that power output bar properly scales when max power is 150W instead of 40W.
@swissfreek
Copy link
Contributor Author

One thing I have noticed is that the additions to the code definitely have an impact on the PID loop, and the controller now appears to be over damped. It doesn't overshoot a few degrees like it used to, and doesn't reach the set temperature, but instead settles about 3ºC too low. I doubt constantly setting the PID constants would cause that since they're... constant. But maybe the extra processing time that the new code adds slows the response time just enough that the PIDs are a little off? Not even sure if that makes sense. I should be smarter on this stuff since I went to school for it, but sadly it has been a while and I'm not.

Ultimately, I'm not sure that settling 3 degrees low is a very big deal, but I haven't been able to put a real thermal load on the tip to test and see if there's a more significant effect while working. So far I'm just looking at the idle behavior. But it looks possible that these new features may also require slightly tweaked PIDs, even for the RTM tips.

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.

None yet

1 participant