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

Implemented pwm frequency configurable by eeprom setting #65

Closed
wants to merge 2 commits into from

Conversation

damosvil
Copy link
Contributor

@damosvil damosvil commented Feb 9, 2023

This pr adds pwm configurable by the eeprom setting

Demag and stall events notification flag cleared during dshot configuration

Fixed 640ms scheduler step

Updated status frame to carry demag metric max, and demag, desync and stall event flags

Fixed stall bug

Added clear for demag metrix max

Scheduler has been rewritten and optimized to allow sending demag metric every 64ms and temperature, status, debug1 and debug2 every 256ms

Demag_Detected_Metric_Max scaled to take full advantage of 4bit, small optimization in temperature PWM limit to follow Temp_Pwm_Level_Setpoint

Improved comment in stat frame

Fixed max demag event load for the case it is below 120 (should happen only when motors are stopped)

Clear notification flags after sending status frame

Updated .gitignore

Fixed review findings

Rebased to develop

Set default power rating to 2S+
@damosvil
Copy link
Contributor Author

damosvil commented Feb 9, 2023

@stylesuxx In the comming days I will debug and smoke test it before moving from draft

@damosvil damosvil self-assigned this Feb 9, 2023
@damosvil damosvil force-pushed the pwm_setting branch 2 times, most recently from 23bfd54 to 5f3ba75 Compare February 11, 2023 08:01
Copy link
Contributor

@stylesuxx stylesuxx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright, this looks good to me. On first sights it seems to be more changes than it actually are but I guess git is not best in picking up only the white space changes in some sections.

What needs to be done is to bump the layout to 207, then I can add the functionality in the configurator. Also I don't see the variable being added to the "EEPROM" - or am I missing something?

@damosvil
Copy link
Contributor Author

damosvil commented Feb 12, 2023

The eeprom setting is Eep_Pgm_Pwm_Freq. It already existed, preloaded with [24, 48, 96] range of values.
imagen

@damosvil damosvil changed the title Implemented pwm configurable by eeprom setting Implemented pwm frequency configurable by eeprom setting Feb 12, 2023
@damosvil
Copy link
Contributor Author

Fixed whitespaces

@stylesuxx stylesuxx mentioned this pull request Feb 13, 2023
@stylesuxx stylesuxx linked an issue Feb 13, 2023 that may be closed by this pull request
3 tasks
@damosvil damosvil marked this pull request as ready for review February 13, 2023 18:04
@damosvil
Copy link
Contributor Author

damosvil commented Feb 13, 2023

No smoke during workbench testing, hovering and the first flight. All seems to work, but I am going to do more testing on my side

@damosvil
Copy link
Contributor Author

damosvil commented Feb 13, 2023

I made more flights abusing pretty hard my Meteor 65 and extracted several logs.
There were no problems and no smoke.
Please, use this blackbox viewer branch if you want to inspect the logs (there you can find a compiled version):
betaflight/blackbox-log-viewer#625

PWM_FREQ_SETTING_BTFL_BLACKBOX_LOG_Meteor65_20230213_191041.zip
PWM_FREQ_SETTING_BTFL_BLACKBOX_LOG_Meteor65_20230213_185103.zip

Fixed calculate_pwm_bits

Fixed calculate_pwm_bits function

Fixed some compiling errors

Fixed format

Fixed whitespaces

Merged latest edt_events changes

Optimized t1_int pwm bitN code paths
@damosvil damosvil changed the base branch from edt_events to develop February 16, 2023 18:15
@damosvil
Copy link
Contributor Author

damosvil commented Feb 16, 2023

@stylesuxx This pr has a subset of functionalities of Dinamic PWM #67 one. Please consider discarding it in favour of the latest one

@stylesuxx
Copy link
Contributor

Closing this in favor of #67

@stylesuxx stylesuxx closed this Feb 24, 2023
@stylesuxx stylesuxx deleted the pwm_setting branch June 21, 2023 07:11
@stylesuxx stylesuxx restored the pwm_setting branch June 21, 2023 07:11
@stylesuxx stylesuxx deleted the pwm_setting branch July 23, 2024 10:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"Variable" PWM
2 participants