Hi Alex,
Good job, i like to know a bit about the code.
How did you implement the 3 phase voltage and frequency?
I am thinking about making a BLDC driver myself but never got to it.
Mabe you can kickstart my project.
I did not implement the volt/hertz method, only just frequency atm.
for two reasons.
*at first test example i limited myself to 60vdc
* I could not get the code to execute as fast if i were to implement v/hz because you need to calculate the dutycycle based upon the frequency input.
ex:
I take the ADC value of the potentiometer input configured for left justification meaning i go from 0-255 as an char sized value.
then i divide that value with 5 and i get 0-51 i can then limit this value with if statement so i can get 5-50 and call it frequency input.
then this value goes into a timer reload algorithm e.x "timer0 reload = 65535 - (fosc/4(sine table entries * frequency input * timer prescaler)
so (8e+6/4 = 2e+6) / (36 * 50 * 1 = 1800) = 1111.
to confirm this:
Tcy(1/2e+6 = 0.0000005) * 1111 = 555.5 uS.
555.5uS * sinetable entries(36) = ~0.02ms
so every 555.5 us the timer interrupt routine has to increment the sinetable pointer.
and this gives us the timer reload frequency =1/555.5us = 1800.
timer0 reload frequency divided by the sinetable entries 1800/36 = 50
But if you want volt/hertz you have to scale the dutycycle value used by the sinetable acording to maximum dc bus voltage,
this is not really the correct way to do this but just an easy example.
ex full sine value cycle in with just 4 points in char size (0-255) 127(0deg) > 255(180deg) > 127(0deg) > 0(-180deg) > 127(0deg)
desired frequency/ max frequency (25/50 = 0.5)
volt/Herts = timer0 reload based upon frequency input & frequency input/max Frequency * dutycycle value from sinetable.
so if 25hz were used the sinetable would progress 63 > 127 > 63 > 0 > 63
But there is more to it, like how much of the dc bus voltage you actually utilize depending on which switching method you use,
I saw a figure of 0.88 * dcbus, so you might have to take that into account when you scale and and also put limits on max and min dutycycle to.
and preferbly do all this in fixed math unless you do it with a dsp.