PWM, H-Bridge and NCO - PIC16F18446


+ Reply to Thread
Results 1 to 27 of 27

Hybrid View

  1. #1
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,132


    Did you find this post helpful? Yes | No

    Default Re: PWM, H-Bridge and NCO - PIC16F18446

    Thanks Richard.

    Have not used about that module yet. I will have a look at that to see what can do.

    Here is a small simulation on LTSpice to describe what I want to do. Please delete the .txt at the end of the file name and run it on LTSpice.

    The load is driven at 1Hz with a PWM signal of 1KHz.

    Ioannis
    Attached Files Attached Files

  2. #2
    Join Date
    May 2013
    Location
    australia
    Posts
    2,644


    Did you find this post helpful? Yes | No

    Default Re: PWM, H-Bridge and NCO - PIC16F18446

    i can't see what you are trying to do. the spice sim does not help.

    its easy enough to modulate a 1khz pwm signal @50hz , it's easy to lock a h-bridge one way or another.
    i am having difficulty seeing how the top and bottom halves of a h-bridge can be different frequencies without shoot through destroying every thing
    Warning I'm not a teacher

  3. #3
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,132


    Did you find this post helpful? Yes | No

    Default Re: PWM, H-Bridge and NCO - PIC16F18446

    The main task is to drive a load (this is a big coil of around 19mH of thick 2mm wire at 60cm diameter) with:

    1. Unipolar, 0-20 volts, pulsating power of 0-50Hz

    2. Bipolar 0-20 Volts, pulsating power of 0-50Hz

    Because of 2. a full bridge is needed.

    But because of the high currents at low frequency (below say 30Hz) the MosFets of the Bridge are not in the SOA and decided to use PWM to adjust the mean voltage driven to load along with the On/Off period just to cool the MosFets.

    That PWM signal will drive the one of the upper transistors of the bridge while the NCO low frequency of 0-50Hz will drive one of the lower transistor of the same bridge.

    In other words, say I want to drive with unipolar signal the load:

    1. Upper right MosFet is modulated with PWM 1KHz 30% DC signal
    2. Lower left Mosfet is modulated with NCO of say 10Hz


    If I want to drive bipolar signal to the load:

    1. Upper right MosFet is modulated with PWM 1KHz 30% DC signal
    2. Lower left Mosfet is ON for x msec.
    3. Lower left MosFet is OFF
    4. Upper right MosFet is OFF
    5. Upper left Mosfet is modulated with PWM 1KHz 30% DC signal
    6. Lower right MosFet is ON for x msec
    7. Lower right MosFet is OFF
    8. Upper left MosFet is OFF
    9. Loop from step 1

    Alternatively, as the simulator shows:

    1. Upper right MosFet and lower left MosFet is modulated with PWM 1KHz 30% DC signal for 1/2 of NCO signal
    2. Upper left Mosfet and lower right MosFet is modulated with PWM 1KHz 30% DC signal for 1/2 of NCO signal
    3. Loop from step 1

    Simple, right? Well no. Cannot figure how this can be done...

    On the Simulator file this is shown on two cycles of the 1Hz signal modulating the PWM of 1KHz signal.

    I do understand that there is great danger of shoot through current and have to be very carefull.

    Ioannis

    P.S. Maybe add a 5th MosFet on the lower side of the H-Bridge and modulate that one with the PWM signal? Then how will the pairs in the bridge change according to the NCO signal?
    Last edited by Ioannis; - 12th March 2025 at 12:49.

  4. #4
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,612


    Did you find this post helpful? Yes | No

    Default Re: PWM, H-Bridge and NCO - PIC16F18446

    I'm probably missing something...
    Why not simply turn on the lower MOSFET in question, apply your 1kHz PWM signal to the (correct) upper MOSFET and then modulate it using your 0-50Hz signal. In other words, turn the 1kHz carrier on/off at whatever rate you want.

    If that's possible or not at the hardware level, ie "route" the NCO output to the enable bit of the PWM carrier is beyond my knowledge at the moment but at such low frequency (0-50Hz) a software (perhaps interrupt driven) aproach sounds more than reasoanble.

  5. #5
    Join Date
    May 2013
    Location
    australia
    Posts
    2,644


    Did you find this post helpful? Yes | No

    Default Re: PWM, H-Bridge and NCO - PIC16F18446

    or use the clc module to steer the low freq osc,
    should be shoot through proof if 1khz osc had adequate dead time
    Name:  Untitled.jpg
Views: 12997
Size:  47.0 KB
    Last edited by richard; - 12th March 2025 at 22:24.
    Warning I'm not a teacher

  6. #6
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,132


    Did you find this post helpful? Yes | No

    Default Re: PWM, H-Bridge and NCO - PIC16F18446

    Henrik, I like your idea if can be handled by hardware as I am afraid of software that may hang. Also it gets complicated when you want to control the output as bipolar and have to switch all transistors both at PWM and low freq. signal.

    Do not know if or how NCO can be steered PWM/CWG module.

    Richard, also nice idea about CLC module. I suppose the low freq signal is external of the PIC. Or may be the NCO signal too.

    Ioannis
    Last edited by Ioannis; - 13th March 2025 at 14:36.

  7. #7
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,612


    Did you find this post helpful? Yes | No

    Default Re: PWM, H-Bridge and NCO - PIC16F18446

    Ah, I didn't quite get you wanted locked antiphase PWM, ie the polarity of bridge is "reversed" every PWM cycle.
    I thought you wanted to run it "forward" for x ms and then "in reverse" for x ms while also modulating the 1kHz PWM frequency with 0-50Hz.

    I guess I still don't quite understand what you want...

Similar Threads

  1. Enhanced PWM Full-Bridge Mode
    By Zapman in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 14th September 2022, 19:08
  2. Replies: 4
    Last Post: - 7th June 2011, 05:02
  3. Need guidance with DC motor controller - PWM & H-Bridge
    By rfetech in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 12th November 2010, 03:33
  4. PWM with PIC16F88 controlling h-bridge
    By deimantas in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 20th May 2010, 22:03
  5. Half-bridge PWM with a 16F684 ?
    By Byte_Butcher in forum General
    Replies: 7
    Last Post: - 17th January 2010, 22:18

Members who have read this thread : 16

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts