Open source brushless direct current (permanent magnet alternating current) hardware and software.
rampagy / bldc Goto Github PK
View Code? Open in Web Editor NEWLicense: GNU General Public License v3.0
License: GNU General Public License v3.0
bldc/software/Control/pwm_output.c
Line 94 in b7856c2
should be
TIM_BaseStruct.TIM_CounterMode = TIM_CounterMode_Up;
bldc/software/Control/motor_control.c
Lines 37 to 44 in d132e3d
The above code incorrectly drives the quadrature angle 60 degrees ahead of the direct angle when PHASE_PREDICTION is enabled. To fix this issue the below changes are recommended:
#ifdef PHASE_PREDICTION
uint16_t currentTimerCount = motorSpeedTimerOverrun ? TIM13_PERIOD : TIM13->CNT;
uint16_t predictedPhaseAngle = (((uint32_t)currentTimerCount * 100 * 60) / motorSpeedCount) / 100;
#else
// half of the hall effect resolution, so that active torque region is centered around max torque point
uint16_t predictedPhaseAngle = 30;
#endif
int16_t quadratureAxisAngle = checkAngleOverflow(directAxisAngle + 90 + predictedPhaseAngle);
bldc/software/Control/pwm_output.c
Line 103 in b7856c2
should be
TIM_OCStruct.TIM_OCMode = TIM_OCMode_PWM1;
bldc/software/Control/pwm_output.c
Lines 107 to 111 in 72862fa
Let's give the below configuration a try and see if it gets us what we want.
TIM_OCInitStructure.TIM_OCPolarity = TIM_OCPolarity_Low;
TIM_OCInitStructure.TIM_OCNPolarity = TIM_OCNPolarity_Low;
/* Set Idle state to Reset for all FETs, so break can be used for neutral */
TIM_OCInitStructure.TIM_OCIdleState = TIM_OCIdleState_Set;
TIM_OCInitStructure.TIM_OCNIdleState = TIM_OCIdleState_Reset;
bldc/software/Control/pwm_output.c
Line 86 in b7856c2
should be
timerPeriod = (uint16_t)(((uint32_t)SystemCoreClock / PWM_FREQ_HZ) - 1);
This is to account for the fact that we are no longer doing center aligned mode.
bldc/software/Control/pwm_output.c
Line 124 in b7856c2
should be
TIM_BDTRInitStructure.TIM_AutomaticOutput = TIM_AutomaticOutput_Disable;
bldc/software/Control/pwm_output.c
Lines 107 to 108 in b7856c2
should be
TIM_OCStruct.TIM_OCPolarity = TIM_OCPolarity_High;
TIM_OCStruct.TIM_OCNPolarity = TIM_OCNPolarity_High;
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.