-
Notifications
You must be signed in to change notification settings - Fork 9
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
BLDC Driver issue #97
Comments
@guo-max It definitely doesn't just change the motor direction - as an example, I've changed the |
@finger563 I found out that changing the |
You're correct - if you keep everything else the same (including the |
* Update to set output to low when counting up, and high when counting down. This means that setting a value of 25% will actually have the output high for 25% of the time. Fixes #97
* fix(bldc_driver): fix driver level inversion * Update to set output to low when counting up, and high when counting down. This means that setting a value of 25% will actually have the output high for 25% of the time. Fixes #97 * feat(bldc): updated examples * Update examples to always calibrate by setting zero electrical offset to 0. * example(bldc_motor): update * Update bldc motor example to 1) always calibrate sensor direction, 2) always calibrate electrical angle, and 3) enable the motor so it actually runs * fix(bldc_driver): configure low side * Update bldc driver to configure the compare actions for the low side generators * Check error of tiemr functions to not enable if they fail (since it wont work anyway). Havent seen those errors, but just in queso. * example(bldc_haptics): update * Update example to always calibrate sensor direction (since its a test) * Updated example to debug log since its a test
Answers checklist.
What is the expected behavior?
I am review the bldc_driver code by comparing to your code and found some issue.
bldc_driver.set_pwm(25,25,25);
// for exampleI assume the A,B,C high pin should be 25% high, 75% low. But instead, the high pin now is 75% high, 25% low.
ESP_ERROR_CHECK(mcpwm_generator_set_actions_on_compare_event( gen_high, MCPWM_GEN_COMPARE_EVENT_ACTION(MCPWM_TIMER_DIRECTION_UP, comp, MCPWM_GEN_ACTION_HIGH), MCPWM_GEN_COMPARE_EVENT_ACTION(MCPWM_TIMER_DIRECTION_DOWN, comp, MCPWM_GEN_ACTION_LOW), MCPWM_GEN_COMPARE_EVENT_ACTION_END())); }
This function set gpio
high
atup direction
andlow
atdown direction
.For a counter counting from 0 -> 100->0, if set to 25%, the gpio will set
high
at24->25
and setlow
at26->25
, which will givehigh
time from25->100->25
which is 75% high.What is the actual behavior?
When set pwm to 25%, the high side at a_high_gpio show be 25% high, 75% low.
Steps to reproduce.
...
Build or installation Logs.
No response
More Information.
I know it works with your FOC controller. If this is a issue, what will change in the FOC controller?
All the highs lows are inverted, May only change the motor direction?
The text was updated successfully, but these errors were encountered: