FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix: HybridStepper: center around supply voltage by schnili · Pull Request #536 · simplefoc/Arduino-FOC · GitHub

fix: HybridStepper: center around supply voltage - #536

Open
schnili wants to merge 1 commit into
simplefoc:devfrom
schnili:dev
Open

fix: HybridStepper: center around supply voltage#536
schnili wants to merge 1 commit into
simplefoc:devfrom
schnili:dev

Conversation

schnili commented May 17, 2026

Copy link
Copy Markdown
Contributor

Description

The Hybrid stepper centered its voltage around the driver voltage limit and not the current supply voltage. In the case the voltage limit of the driver is bigger than the supply this leads the center not really being the center.

Type of change

To respect the current logic the center point is now min(supply_voltage, driver_max_voltage)

How Has This Been Tested?

  • Hardware: esp32s3 with custom DRV8323 driver (with voltage_power_supply measurement)
  • IDE: Platformio
  • MCU package version: arduino-esp32

Copy link
Copy Markdown
Member

This seems to make sense from a code point of view, but from a use-case point of view, what would be the point of setting the voltage limit higher than the power supply voltage?

It seems to me this is checking for what is essentially a configuration error, but at the level of the setPwm().

I'd prefer to check it in the updateVoltageLimit(float new_voltage_limit) function, and mention it in the documentation (which it is), and leave it there rather than incur the runtime penalty of checking in each call to setPwm()...

schnili commented May 19, 2026

Copy link
Copy Markdown
Contributor Author

hm, then i have to check the doc again what the driver voltage is supposed to do.

This did come up as a problem as i am updating voltage_power supply to some thing that gets measured. if then it is e.g. going from 24 to 20 gradualy it goes below the driver limit.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL