Thank you all for replies. Let me explain more about this. First of all, this topic is in programming questions rather than motors caterory here on the forum, because do not have issues with motors and clearly understand all parts but more in depth Arduino programming. I need features of stepper motor, but without problem of RPM limit which stepper motors have (they dramatically lose torque with RPM increase). For such purpose people usually get servomotors from CNC industry, but they are bad by price, size, weight and their drivers still noisy according to videos. There are some youtube videos about boards for DIY robots which allow to use rc BLDC motors so popular everywhere now (you may find them by "BLDC robot arm", f.e.), so I would like to make similar controller for several projects. I do have rc motors of 1350 watts, rc 75 watts, 500 watts from hoverboard, CNC nema17 format 78 watts. Also similar thing used for controlling gimbal motors. Misunderstanding here seems that I did picture of waveform which is not full cycle of three phases, but what expect to see with oscilloscope after all PWM are applied, hundreds and thousands of those short square forms produce every sinus with 120 degrees shift each. I dont have any problem to write this as code, except that this require some skills beyong mine about microcontrollers. I just found how to change PWM frequency, but nothing how to make several timers to start at same moment (or to stop). I don't even know what happens when change width of PWM, if currently running somehow resets on change, this would lead to noise. When I feed pure sinus waves to BLDC from hoverboard or CNC, they are silent enough for me till maybe 600 RPM when bearing noise starts to be audible. Let's say have pseudocode like the following:
for (int i=0; i<100000; i++)
it will make motor very noisy because time to execute each function fluctuates even with frequency 100Khz (less cause of functions of course). When use PWM with NE555 timer or any other hardware implementations, including Arduino one - noise disappear. The higher fluctuation, the stronger noise is. So I have to find some solution to output 3 pins somehow very precisely at ultrasonic frequency. There are projects which use ultrasonic emitters to generate directional audio and they use PWM to make it, but in my cause it's negative side effect which must to get rid off. Imagine like there are no motors, the question is just how to make those outputs precise and synced enough. Writing pins to registers do not helps too, still computing delays or measuring time ruin the process. Hope this helps to understand better. Thanks again.