Firmware: digital PI current controller with soft-start and OC latch#3
Open
electricalhog wants to merge 1 commit into
Open
Firmware: digital PI current controller with soft-start and OC latch#3electricalhog wants to merge 1 commit into
electricalhog wants to merge 1 commit into
Conversation
- 2 kHz control loop (500 us tick): encoder-adjustable setpoint (100 mA/click, 20 A ceiling), soft-start ramp 20 A/s - Scaled-integer PI with anti-windup clamp to the PWM range - Overcurrent fault latches the load off at setpoint + 2 A - ADC feedback via embedded-hal 0.2 OneShot (INA output, 12-bit) - Drop embedded-time; add embedded-hal 0.2 compat alongside 1.0 - Untrack electronic_load/target build artifacts (already gitignored) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
embedded-hal0.2OneShotcompat (kept alongside e-h 1.0); dropsembedded-timeelectronic_load/target/build artifacts (already gitignored)Notes
ADC calibration constant assumes gain-50 sense at 1 mΩ; the hardware PR moves to INA185A1 (gain 20) + 2 mΩ TGHG →
ADC_COUNTS_AT_MAX_MAwill need updating to ≈(20×0.002×20)/3.3×4095 ≈ 993when the frontends merge.Test plan
cargo build --target thumbv6m-none-eabi🤖 Generated with Claude Code