simplefoc / Arduino-FOC

Arduino FOC for BLDC and Stepper motors - Arduino Based Field Oriented Control Algorithm Library
https://docs.simplefoc.com
MIT License
2.03k stars 521 forks source link

dev´s #261

Open Juanduino opened 1 year ago

Juanduino commented 1 year ago

Feel free to integrate it, if you have some ideas?

Juanduino commented 1 year ago

This is compiling on my end

runger1101001 commented 1 year ago

Oooof....

In terms of the CORDIC stuff, this won't work like this. I don't want to merge anything related to CORDIC into the main library. It's not useful to 99.8% of our users, and it will make all the test-builds fail if left in like this. To get the CORDIC functionality, I have recently merged to the dev branch changes which enable you to supply your own versions of the _sin() and _cos() functions.

In terms of the 8-PWM stuff, I can't follow all these changes :-) It should be possible to do it, but the model is not clear to me:

These are relevant questions because the code can't just work on any PWM pins - I believe in the 8-PWM configuration requires complementary PWMs, like in 6-PWM? That means the complimentary signals have to come from the same timer. But they don't necessarily have to use CHx CHxN pins - it can also work with CHx CHy - but then there is no HW dead-time, only software. Also you can't mix and match hardware dead-time and software dead-time - it's either one or the other for all the pins. And you can't use CHxN on the high side, e.g. you can only use those when doing all HW dead-time. So there are loads of complexities and constraints :-(