PWM - Half Bridge control

Please add any feature requests for Flowcode version 7 here

Moderator: Benj

Post Reply
johnsondav
Posts: 188
Joined: Thu Jun 28, 2012 7:29 pm
Location: Durham
Has thanked: 86 times
Been thanked: 186 times
Contact:

PWM - Half Bridge control

Post by johnsondav »

Hi Everyone

My attention has been drawn to the use of a PIC to control a 'Push-Pull' Half-Bridge PWM output power controller. This would be to drive a 'Step-Up' power supply from 9 volts to 400 volts, as used in geiger counters. There are of course many other ways of achieving very low current step up voltage drivers. However, by using a pic it would be possible to used feedback to control the voltage produced, hence sensitivity/battery drain changes (and component count).

The PWM components within FC7 are extremely versatile such as the PIC18F4550, which has two PWM modules.

Q. Can they be configured as Half-Bridge? ( Using maths whilst one is increasing duty cycle the other decreasing) Yes they can but not by Flowcode (or am I missing something). :(

I just cannot see if there is a way to achieve this currently.

Would this make for future development for a component to drive Half-Bridge output from chips such as the PIC18F4550 and others?

Regards
Dave

User avatar
QMESAR
Valued Contributor
Valued Contributor
Posts: 1287
Joined: Sun Oct 05, 2014 3:20 pm
Location: Russia
Has thanked: 384 times
Been thanked: 614 times
Contact:

Re: PWM - Half Bridge control

Post by QMESAR »

Hi Dave,

yes the normal PWM component in FC setup the PWM in a single channel free running mode ,you can however calculate new Duty cycle or Period values and then write it to the PWM module during run time which allows you to update the Period/Duty Cycle on the fly

With this said We do a lot or Power supply designs and we found that the Standard PWM modules work but not as well as a controller that has a dedicated Power switch module there are many of then in the Microchip range one example would be the PIC18F2331,2431,4331 and 4431 this module is ideal for such application as you are describing although the Module is not supported with a component in FC I use a standard C call component to setup the module as they are fairly easy to work with and do the PID loops necessary for Close loop control of the PSU and update the PWM Period and Duty cycle registers again with a C call components take a look at these devices they are prefect for Motor Control and PSU designs ,if you are looking at a high processing power due to complex maths and speed then the dsPIC33GS family is the Family to look at when working with complex PSU or FOC motor Controls :D

This module allows for setup of Half bridge mode PWM with dead times ect with no code intervention during run time the module know which PWM must be high and which must be low no checking required in SW as just one of the options see the data sheet for more info where all this is necessary with the standard PWM modules and of course you have to handle dead time in SW :D

If you look at the new PIC16F1XX devices which has a math accelerator module with Power switch module you do not need to do any maths for your PSU in code the PID's are calulated for you in Hardware you only set the set point and the K;P and I parts in confuguration there after the controller does every thing in hardware the only time you need to do something in code is when you want to cahnge the setpoint

Hope this helps you
:D
Attachments
2.JPG
2.JPG (43.51 KiB) Viewed 12605 times

johnsondav
Posts: 188
Joined: Thu Jun 28, 2012 7:29 pm
Location: Durham
Has thanked: 86 times
Been thanked: 186 times
Contact:

Re: PWM - Half Bridge control

Post by johnsondav »

Hi QMesar

Thanks for the info regarding Microchips range of chips, this may be the way to go. I'll have to do some further research on your suggestion though. I like the idea of changing duty cycle. Maybe use an invertor on one of the outputs. This may give the inverse (push-pull) effect. mmmh

I'll do some experimentation.

Thanks for your help.

Kind Regards
Dave

User avatar
QMESAR
Valued Contributor
Valued Contributor
Posts: 1287
Joined: Sun Oct 05, 2014 3:20 pm
Location: Russia
Has thanked: 384 times
Been thanked: 614 times
Contact:

Re: PWM - Half Bridge control

Post by QMESAR »

Dave

You are welcome yes sure you have to research what options will work best for you and of course that fits the product budget, development time and yields very good end result in the over all operation and efficiency as the PWM go up to 14 bit resolution and in the dsPIc devices it is n to the power of 2 depending the Oscillator frequency

Good luck and keep us informesd how you getting along

User avatar
QMESAR
Valued Contributor
Valued Contributor
Posts: 1287
Joined: Sun Oct 05, 2014 3:20 pm
Location: Russia
Has thanked: 384 times
Been thanked: 614 times
Contact:

Re: PWM - Half Bridge control

Post by QMESAR »

Maybe use an invertor on one of the outputs. This may give the inverse (push-pull) effect. mmmh
Dave I am not 100% sure haven't worked with the standard modules for a long time however I seem to remember that it is possible to switch the polarity of the Outputs in the Config register that will give you the same effect and no extra components may be something to look at for you

johnsondav
Posts: 188
Joined: Thu Jun 28, 2012 7:29 pm
Location: Durham
Has thanked: 86 times
Been thanked: 186 times
Contact:

Re: PWM - Half Bridge control

Post by johnsondav »

Hi Qmesar

Yes, got it. As you said changing the polarity would be the same as using an invertor, this would work. It would give the solution as

CH1 - 10% on duty cycle
CH2 - 10% off duty cycle (with invertor or changing polarity. The 90% ON become OFF and the 10% off becomes ON)

This would produce a switching effect of 10% duty cycle, one pulse following the other, and allow me to increase/decrease the duty cycle up to 50% without overlapping cycles.

Many Thanks - just need to test it. I'll keep you posted as to how I go. The only problem I can see though, would be that the repeated 1st cycle would immediately follow the last cycle (no time between pulses. Could be a problem with HF interference.

Kind Regards
Dave

User avatar
QMESAR
Valued Contributor
Valued Contributor
Posts: 1287
Joined: Sun Oct 05, 2014 3:20 pm
Location: Russia
Has thanked: 384 times
Been thanked: 614 times
Contact:

Re: PWM - Half Bridge control

Post by QMESAR »

Good luck Dave :D

As said I am not sure on PIC18 about the polarity change however I am 100% sure on the dsPIC as I use this feature all the time worth checking on the device you select to work with,

User avatar
Steve001
Valued Contributor
Valued Contributor
Posts: 1189
Joined: Wed Dec 31, 2008 3:37 pm
Has thanked: 460 times
Been thanked: 523 times
Contact:

Re: PWM - Half Bridge control

Post by Steve001 »

Success always occurs in private and failure in full view.

johnsondav
Posts: 188
Joined: Thu Jun 28, 2012 7:29 pm
Location: Durham
Has thanked: 86 times
Been thanked: 186 times
Contact:

Re: PWM - Half Bridge control

Post by johnsondav »

Hi Steve001

The onsemi application guide is extremely helpful, thank you. The Half-Bridge output is working well. I should be able to reduce the battery voltage requirements considerably. All is going well so far.

Best Regards
Dave

johnsondav
Posts: 188
Joined: Thu Jun 28, 2012 7:29 pm
Location: Durham
Has thanked: 86 times
Been thanked: 186 times
Contact:

Re: PWM - Half Bridge control

Post by johnsondav »

Hi Steve001

I have tried, without success, to achieve my goal using the half bridge PWM output to power the step-up voltage required (400 volts) to power the Geiger counter sensor. At 50% duty cycle, this was not enough to get close (315 volts only). However, I have studied your research document (PWM Power Supply Guide SMPSRM-D) and this has given me what was required for a battery powered device capable of producing 400 volts using a LT44 high frequency transformer. The problem was down to the choice of diodes I had originally used, 1N4007. These were changed to Ultra Fast type and now I have success - 9 volts producing up to 480 volts. To achieve this, I had to tune the PWM frequency and duty cycle to get best performance from the transformer (as per the research doc above). Here is the PWM circuit I used to 'Tune' the output. This program displays the frequency and duty cycle and whilst using a volt meter to measure the output voltage. This enabled me to find the best possible settings to achieve maximum performance.
HF Controller 1 V10_v7.fcfx
(34.79 KiB) Downloaded 398 times
I have included the program should anyone else required ideas for a adjustable PWM output (frequency and duty cycle changed on-the-fly) program for testing purposes.

Many Thanks for your help. :D

Regards
Dave

User avatar
Steve001
Valued Contributor
Valued Contributor
Posts: 1189
Joined: Wed Dec 31, 2008 3:37 pm
Has thanked: 460 times
Been thanked: 523 times
Contact:

Re: PWM - Half Bridge control

Post by Steve001 »

Hi Dave

Glad your up and running

I have used this diode on a power supply and had good results

http://uk.farnell.com/multicomp/mur160/ ... dp/1625173

Steve
Success always occurs in private and failure in full view.

johnsondav
Posts: 188
Joined: Thu Jun 28, 2012 7:29 pm
Location: Durham
Has thanked: 86 times
Been thanked: 186 times
Contact:

Re: PWM - Half Bridge control

Post by johnsondav »

Hi Steve

Thank you for your advice upon the choice of diode. I used - UF4007-E3/54 Vishay for the test. This diode had a recovery time of 75ns and the one you had used 50ns. So I am guessing (I am not knowledgeable on electronics) that it is the recovery time that makes the difference. I haven't decided yet if I should try surface mount for a change as apposed to through the hole. I am put off by double sided PCB as I don't have that good of a workshop to produce accurate double sided PCB's. I need to keep everything compact.

Q. Would it make much of a difference if I had the 400 volt circuit sharing the same PCB as the PIC?

Very much appreciate your help.

Regards
Dave

User avatar
Steve001
Valued Contributor
Valued Contributor
Posts: 1189
Joined: Wed Dec 31, 2008 3:37 pm
Has thanked: 460 times
Been thanked: 523 times
Contact:

Re: PWM - Half Bridge control

Post by Steve001 »

Hi Dave

As you are going to be making the pcbs at home personally i would separate the 400 volts stuff and the transformer from the micro and use a good varnish.

we use ultimeg 2000 varnish at work but this is red

No disrespect to your self and your availability to make pcb's the board houses manufacture to tighter tolerances and use various resist coatings and are able to mill creepage and clearance slots into the boards all these things help preventing a flash over.

attached a guide on pcb clearances for high voltages and other guidelines

Hope this helps


Steve
Attachments
Aspects of Track Width and Clearance.pdf
(214.48 KiB) Downloaded 271 times
Success always occurs in private and failure in full view.

johnsondav
Posts: 188
Joined: Thu Jun 28, 2012 7:29 pm
Location: Durham
Has thanked: 86 times
Been thanked: 186 times
Contact:

Re: PWM - Half Bridge control

Post by johnsondav »

Hi Steve

Thank you for the tip on using a varnish coating to stop high voltage leakages, great idea, didn't know such things were available. I couldn't find the one you had suggested (ultimeg 2000 varnish), but found this one:

- AMBERSIL  63700M7036  Varnish, Red, Elec Spray, Can, 400ml (Farnell 1666252)

I agree with your suggestion to keep both PCB's separate, sounds a safer solution. What I was trying to do, was to have a voltage divider to feed a voltage follower OP-Amp so the PIC could keep a check on voltage output. However, not all was going to plan. I now know why. I was using only three resistor to step down the voltage, but didn't realise that the voltage across them was exceeding the max rated voltage, so they gave completely the wrong readings (using a meter of course, not the PIC - Phew). I now have 5 resistors (Higher voltage ratings) to form the divider and I am now getting correct voltage reading at the OP-Amp output (1.5 volts) from 400 volts across the voltage divider circuit. I am starting the PCB design now.

Very much appreciate your help. :D

Regards
Dave

User avatar
Steve001
Valued Contributor
Valued Contributor
Posts: 1189
Joined: Wed Dec 31, 2008 3:37 pm
Has thanked: 460 times
Been thanked: 523 times
Contact:

Re: PWM - Half Bridge control

Post by Steve001 »

Hi Dave

That will do the trick

ultimeg is from advanced electrical varnishes in Liverpool

http://www.aev.co.uk/aev_ultimeg_2000.php


for your voltage feedback have you seen this post ?

http://www.matrixtsl.com/mmforums/viewt ... +voltmeter

if you put two 15K 11W resistors in the +VE , -VE input to the board it will be good for your voltage, not sure if it will pull your volts down though don't know the current rating of your transformer

Regards

Steve
Success always occurs in private and failure in full view.

Post Reply