Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] Full H-bridge output Problem Using IR2113

Status
Not open for further replies.

adezie

Newbie level 4
Joined
May 10, 2020
Messages
6
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
58
greetings, I have built an H-Bridge circuit and using IR2113 to drive the high and low side, I've created an SPWM lookup table for my microcontroller to feed SPWM signals to LIN and HIN, here's the signal, 2.jpg blue is HIGH side MOSFET gate signal and yellow is LOW side MOSFET gate signal, Vgs of the HIGH side of MOSFET without VDC applied, but when I attached 12VDC, here's the signal 1.jpg purple is the output and its not Sine wave, there is no problem at bootstrapping since the VGS at high side always got 12V, what do I mess with ? is it the circuit ? or the PWM ? or what? I need advice so bad, here's the IR2113 layout Capture.JPG
here's the lookup table
Code:
int sine[] = {
  31.41552779, 31.41552779, 62.82866317, 94.23701391, 125.6381881, 157.0297945, 188.4094425, 219.7747423, 251.1233055, 282.4527446, 313.7606739, 345.0447091, 376.3024678, 407.5315696, 438.7296363, 469.894292,
  501.0231635, 532.1138801, 563.1640741, 594.1713811, 625.1334396, 656.0478918, 686.9123834, 717.7245639, 748.4820869, 779.1826102, 809.8237956, 840.4033099, 870.9188242, 901.3680146, 931.7485624,
  962.0581539, 992.2944809, 1022.455241, 1052.538137, 1082.540878, 1112.46118, 1142.296763, 1172.045356, 1201.704693, 1231.272516, 1260.746573, 1290.124618, 1319.404416, 1348.583736, 1377.660357,
  1406.632063, 1435.496648, 1464.251915, 1492.895674, 1521.425742, 1549.839949, 1578.136128, 1606.312127, 1634.365799, 1662.295008, 1690.097626, 1717.771537, 1745.314633, 1772.724816, 1800, 1827.138107,
  1854.13707, 1880.994833, 1907.709351, 1934.27859, 1960.700526, 1986.973147, 2013.094452, 2039.062453, 2064.875171, 2090.530641, 2116.026908, 2141.362032, 2166.534083, 2191.541144, 2216.381311,
  2241.052692, 2265.553408, 2289.881593, 2314.035395, 2338.012974, 2361.812504, 2385.432174, 2408.870183, 2432.124747, 2455.194096, 2478.076472, 2500.770134, 2523.273351, 2545.584412, 2567.701617,
  2589.623281, 2611.347736, 2632.873326, 2654.198413, 2675.321372, 2696.240595, 2716.954489, 2737.461476, 2757.759995, 2777.8485, 2797.725461, 2817.389365, 2836.838713, 2856.072025, 2875.087836,
  2893.884698, 2912.46118, 2930.815866, 2948.947359, 2966.854279, 2984.535261, 3001.988959, 3019.214045, 3036.209205, 3052.973146, 3069.504592, 3085.802283, 3101.864978, 3117.691454, 3133.280505,
  3148.630946, 3163.741606, 3178.611334, 3193.238999, 3207.623487, 3221.763702, 3235.658567, 3249.307024, 3262.708033, 3275.860575, 3288.763648, 3301.416268, 3313.817472, 3325.966317, 3337.861876,
  3349.503245, 3360.889535, 3372.019881, 3382.893435, 3393.509368, 3403.866872, 3403.866872, 3393.509368, 3382.893435, 3372.019881, 3360.889535, 3349.503245, 3337.861876, 3325.966317, 3313.817472, 3301.416268,
  3288.763648, 3275.860575, 3262.708033, 3249.307024, 3235.658567, 3221.763702, 3207.623487, 3193.238999, 3178.611334, 3163.741606, 3148.630946, 3133.280505, 3117.691454, 3101.864978, 3085.802283,
  3069.504592, 3052.973146, 3036.209205, 3019.214045, 3001.988959, 2984.535261, 2966.854279, 2948.947359, 2930.815866, 2912.46118, 2893.884698, 2875.087836, 2856.072025, 2836.838713, 2817.389365,
  2797.725461, 2777.8485, 2757.759995, 2737.461476, 2716.954489, 2696.240595, 2675.321372, 2654.198413, 2632.873326, 2611.347736, 2589.623281, 2567.701617, 2545.584412, 2523.273351, 2500.770134,
  2478.076472, 2455.194096, 2432.124747, 2408.870183, 2385.432174, 2361.812504, 2338.012974, 2314.035395, 2289.881593, 2265.553408, 2241.052692, 2216.381311, 2191.541144, 2166.534083, 2141.362032,
  2116.026908, 2090.530641, 2064.875171, 2039.062453, 2013.094452, 1986.973147, 1960.700526, 1934.27859, 1907.709351, 1880.994833, 1854.13707, 1827.138107, 1800, 1772.724816, 1745.314633, 1717.771537,
  1690.097626, 1662.295008, 1634.365799, 1606.312127, 1578.136128, 1549.839949, 1521.425742, 1492.895674, 1464.251915, 1435.496648, 1406.632063, 1377.660357, 1348.583736, 1319.404416, 1290.124618,
  1260.746573, 1231.272516, 1201.704693, 1172.045356, 1142.296763, 1112.46118, 1082.540878, 1052.538137, 1022.455241, 992.2944809, 962.0581539, 931.7485624, 901.3680146, 870.9188242, 840.4033099,
  809.8237956, 779.1826102, 748.4820869, 717.7245639, 686.9123834, 656.0478918, 625.1334396, 594.1713811, 563.1640741, 532.1138801, 501.0231635, 469.894292, 438.7296363, 407.5315696, 376.3024678,
  345.0447091, 313.7606739, 282.4527446, 251.1233055, 219.7747423, 188.4094425, 157.0297945, 125.6381881, 94.23701391, 62.82866317, 31.41552779, 31.41552779


};
here's the setup in my microcontroller
Code:
HardwareTimer timerA(3);
a=1;
char H1 = PB0;
char L1 = PB1;
void setup() {
  Serial1.begin(9600);
  //  pinMode(PA9, OUTPUT_OPEN_DRAIN);
  pinMode(H1, PWM_OPEN_DRAIN);//H1
  pinMode(L1, PWM_OPEN_DRAIN);//L1
  pinMode(PA1, INPUT);//Vac
  pinMode(PA7, INPUT_ANALOG);//Vdc
  pinMode(PA3, INPUT_ANALOG);//Iout
  timerA.setPrescaleFactor(1);
  timerA.setOverflow(3600);

}

Void Loop(){
  for (int i = 0; i < 20; i++) {
    pwmWrite(H1, (3600 - sine[i])*a);
    pwmWrite(L1, 3600);
  }
  for (int i = 20; i < 267; i++) {
    pwmWrite(H1, (3600 - sine[i])*a);
    pwmWrite(L1, 3600);
    delayMicroseconds(W);
  }
  for (int i = 267; i < 287; i++) {
    pwmWrite(H1, (3600 - sine[i])*a);
    pwmWrite(L1, 3600);
  }
  for (int i = 0; i < 20; i++) {
    pwmWrite(L1, (3600 - sine[i])*a);
    pwmWrite(H1, 3600);
  }
  for (int i = 20; i < 267; i++) {
    pwmWrite(L1, (3600 - sine[i])*a);
    pwmWrite(H1, 3600);
    delayMicroseconds(W);
  }
  for (int i = 267; i < 287; i++) {
    pwmWrite(L1, (3600 - sine[i])*a);
    pwmWrite(H1, 3600);
  }
}
 

Attachments

  • 1.jpg
    1.jpg
    17.9 KB · Views: 179
Last edited by a moderator:

Looks like the H-bridge is operated without any load. If so, the observed behavior is just expectable.

A resistive load is required to pull the output to zero while the transistors are switched off. You should consider that this simplified PWM scheme isn't suitable for reactive loads or LC output filters.
 
  • Like
Reactions: adezie

    adezie

    Points: 2
    Helpful Answer Positive Rating
thanks for the reply, i've connected it with 10Kohm Dummy load
 

Looks like the H-bridge is operated without any load. If so, the observed behavior is just expectable.

A resistive load is required to pull the output to zero while the transistors are switched off. You should consider that this simplified PWM scheme isn't suitable for reactive loads or LC output filters.

thanks for the advice, and after I connected 270 ohm dummy load, the output is alike a sinusoidal shape3.jpg
 

Hi,

when posting code please use [CODE] tag instead fo quote tags.

after I connected 270 ohm dummy load
What´s your expected load impedance?

Klaus
 

when posting code please use
Code:
 tag instead fo quote tags.[/QUOTE]
I'm sorry for my mistake it's my first time here
do you have any suggestion what kind of SPWM should I use?
 

do you have any suggestion what kind of SPWM should I use?

For an overall picture, your H-bridge duplicates the same action as a buck converter, first in one direction during one half of the cycle.

The second half of the cycle creates a buck converter in the other direction. Thus you apply AC to the load.

Only one transistor needs to perform rapid switching to one end of the bridge. The other end of the bridge has a path to the correct supply rail, for half a cycle.

Your orange and blue gating waveforms appear correct (top of your first image post #1).
However your post #5 waveform looks as though it could use a low-pass filter. That should give it more sine-like shape. Usually the filter is LC 2nd order type. It should be incorporated with the load across your H-bridge.
 
  • Like
Reactions: adezie

    adezie

    Points: 2
    Helpful Answer Positive Rating
Hi,

It's the PWM scheme, it means: how you control the Mosfets.

In your case ... for one half wave you pull it to one side. Only to one side. Next half wave you pull it to the other side only.

Let's try to find some analogy:
Imagine a rope, a box (resistor) fixed at the middle of the rope, one person (Mosfet) on one end of the rope (low side) and another person at the other end of the rope (high side).
What you do is:
For a periode of time you let one person pull the box to one direction, while the other person does nothing.
At the other period it's the other way round.
You are able to pull the box left and right.
This works well, since the box is passive.

Now replace the box with an animal. The animal is active (reactive load) and may move to left and right even if nobody pulls the rope.
Your control scheme "only one person pulls the rope" does not work satisfactory anymore...you can't control the position of the animal.
What you need to do:
All the time both persons need to be active. When you want to move the animal to the right, then one person has to pull the rope, while the other only partly releases ... still keeping the rope tight ... to control the animal's position more precisely.

(No animal was hurt with this test ;-) )

Klaus
 
  • Like
Reactions: adezie

    adezie

    Points: 2
    Helpful Answer Positive Rating
so it means I can give the high side MOSFET the SPWM and the active low side with only 50Hz square wave ?, that make sense actually, I'll try it for sure
 

Hi,

You must never activate High side and Low side at the same time. This means short circuit....

Klaus
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top