forked from leon927/TSDZ2-Smart-EBike
-
Notifications
You must be signed in to change notification settings - Fork 1
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
mspider motor enhancements #2
Open
bbeschea
wants to merge
64
commits into
bbeschea:master
Choose a base branch
from
TSDZ2-ESP32:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains 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
- Added FW revision info to the 7 MSB bits of brake state (ui8_tx_buffer[6]) - Removed Human Power (ui8_tx_buffer[23-24]: could be calculated from torque and cadence fields)
… less power losses. - 40KHz TIM1 Interrupt rate -> max HAL sensor detection offset 25us - Rotor speed calculated two times each Electrical Revolution
- TIM1 PWM Freq to 19KHz - Better rotor interpolation: + Double TIM1 IRQ rate + Hal sensor detection running at 38KHz - Updated motor svm_table according to TIM1 PWM freqency and to upper bound of TIM1 counter - Motor ref speed calculated two times every electr. revol. - Battery current sampled in the middle of PWM duty cycle (counter = 0) - Max Field Weakening angle calculated based on motor speed - Higher Power Assist multiplier resolution (2% insted of 10%) - ADC Freq. = CPU Freq/3
…KHz) - OK - ADC conversion started by HW TRGO signal (TIM1 OC4 Compare) - OK - Hall sensor position calibration - WIP
- Hall angles Calibration - Updated message from ESP32
- New Motor control algorithm: - IRQ based Hall detection - Hall counter @ 250KHz - Hall Calibration (Angular and Time correction) - Hall counter correction based on Hall state - Phase adjust step by step - HW tirggered ADC conversion (OC4Ref) - Added calibration mode to riding modes
- Use different Hall counter offset for every Hall state - Updated low pass filter() function
- Solved Power delay issue on restart.
- ADC values Right aligned. - To avoid overrun errors, ADC buffered values no more readed in ebike_app but in pwm-up interrupt (end of conversion) - Fixed minor bug in main loop timings - PWM freq decreased to 18KHz (all values parametrized in main.h) - Power glitch bug fix (race condition between PWM interrupt and Hall GPIO interrupt) - FOC angle asin_table optimization (thanks to beemac) - PWM Dead Time increased from 1us to 1.5us (OEM firmware uses a value of 3us!)
- motor_controller() loop removed - FOC Angle calculation algorithm changed - Field Weakening Enable/Disable
mspider65
force-pushed
the
master
branch
5 times, most recently
from
June 14, 2021 18:22
4ced82e
to
ab25614
Compare
- Battery overcurrent check in main loop - FOC angle calculation code optimization - Slightly increased FOC angle multiplicator default values (36v/48v) - OTA FW update using Watchdog reset instead of Power OFF/ON - Motor blocked counter fix
- New Torque Smooth function
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.
No description provided.