Hi
I am trying a seemingly simple task but somehow not able to manage it.
My resource :
4 channel PWM Microcontroller (Ch0 to Ch3)
I have a MOSFET H-Bridge which are named anitclockwise as A,B,C,D (A-B -> first limb , D-C -> next limb , A,D->upper)
Up until now i created an Edge-Aligned PWM signal and run the limb-sharing MOSFETs with complementary PWM. This works for a high frequency PWM , modulated over a low frequency.
Now i have to run the scheme at 50Hz . Which means, 10ms conduction for diagonal FETs each.
For this i generated a 10ms PWM signal and ran each limb in complementary mode.A Duty-cycle was calculated by an Analog channel and this Duty determined the Duty of the FETs.
Algorithm is thus
main
{
Read ADC;
Calculate Duty-cycle;
}
Timer Overflow
{
Channel0 = 0; // runs as complement of channel1 -- as upper MOSFET of limb1
Channel1 = Duty_cycle; //-- as Lower MOSFET of limb1
Channel2 = 0; // runs as complement of channel1 -- as Lower MOSFET of limb2
Channel3 = Duty_cycle; //as upper MOSFET of limb2
}
But with this scheme i observe that the variation of the ADC value changes the duty of only the positive envelope (as is inherent) of the o/p
Can someone suggest a method for mirroring the duty change in both positive and negative envelope?
I hope i am clear enough.
Thanks in advance and thanks for reading