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

mspider motor enhancements #2

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

Conversation

bbeschea
Copy link
Owner

No description provided.

leon927 and others added 30 commits August 28, 2019 14:36
- 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)
Changes:
- Uart TX interrupt
- Better ADC conversion accuracy (CLK/3)
- Small motor.c optimization (some time wasted waiting ADC conversion)
- Removed LCD3 code
- Changed PWM frequency to 18KHz
- ebike_app math operations optimizations
- configurable motor inductance
- PWM frequency set to 18KHz (#ifdef for 20KHz)
- decreased BATTERY_CURRENT_PER_10_BIT_ADC_STEP_X100 from 17 to 16
- 20KHz PWM frequency
- Added Field Weakening
SW speed optimization done.
Ready to implement improved rotor position detection.
… 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 Sensors calibration
- Motor Test (angle adjust)
- 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
@bbeschea bbeschea changed the base branch from master to startMspiderFork February 15, 2021 13:40
@bbeschea bbeschea changed the base branch from startMspiderFork to master February 15, 2021 13:42
- 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 mspider65 force-pushed the master branch 5 times, most recently from 4ced82e to ab25614 Compare June 14, 2021 18:22
- 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
Temporay removed brake signal check (bypass display HW problem)
New error sent if controller has UART reception problems
New communications_controller() algorithm (better resilience)
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