LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

PWM to H-bridge switching

Hello, I am trying to commutate a BLDC motor without the use of Hall sensors and it has been brought to my attention that I would need a way to "float" one of the phases while activating the other two.  In order to do so I believe that I need some way of sending a PWM signal to the high side of Phase A (choose phase A for now) and keep the low side of Phase B open during the entire step.  THat way the voltage that is seen in Phase C is only the back emf.  I guess my question is is there a way to generate a PWM signal, have it on for a given time, then switch the same signal to the next phase or commutation step?  I.E. switch to another branch of the H-bridge controller.



If there isn't a way to simply turn off the PWM to one step and on for the next step then is there a way to create to create a PWM similar to the following:

  See how the PWM is only going to the high side of each phase?  Any suggestions would be great!  Thanks!

0 Kudos
Message 1 of 17
(4,546 Views)
Hello,

I am not exactly sure what you mean when you say you need to float a phase.  From the picture you posted, after a pulse stops running the output level goes low not floating.  I am not sure what hardware you are using, however if you are using an M Series board, and this is the behavior you are needing, then you can modify the example here to do this.

This example uses a counter to generate a clock for a digital task that pulses out a signal.  By default all channels in this example will generate the same pwm signal, but this is easily changed.  You could have the output generate 6 digital lines of data that match what you show.  Again, the output level would go low at the end of the pwm pulse on that phase not float.

I hope this helps, if not please let us know.

Regards,

Jesse O.
Applications Engineering
National Instruments


Jesse O. | National Instruments R&D
0 Kudos
Message 2 of 17
(4,518 Views)
I believe (not certain) that there are H bridge modules and/or commutation control chips that do this automatically in hardware. Thus no need to switch the PWM between the phases. Would that be a suitable approach?
~~~~~~~~~~~~~~~~~~~~~~~~~~
"It’s the questions that drive us.”
~~~~~~~~~~~~~~~~~~~~~~~~~~
0 Kudos
Message 3 of 17
(4,515 Views)
Well, for my project I am supposed to bypass the speed controller that came with the motor and directly commutate the phases via the D I/O from Labview.  Essentially, I am making my own H-bridge and I need to be able to set up a commutation sequence table that will send the PWM signal to the correct transistor pair.  Is there a way to do so in Labview?  I need to be able to set up a PWM..which I have done already...but I need to set up a way to tell each of the transistors when to open to allow the signal through in a certain order.  Does this make sense to anyone?  I guess the real question is is there a LabView VI that is already set up for a 3-phase commutation of a brushless DC motor?  Thanks for any help!
0 Kudos
Message 4 of 17
(4,506 Views)
Hello,

The closest example I know of I posted previously.  This is probably the closest application that is capable of performing controlled PWM signals.  There are no shipping example that are that specific.  The NI Developer Zone often has more specific examples, this is where you could find the example I posted earlier.  In the Developer Zone I am not aware of anything that performs more of what you are looking for than the PLL M Series example.

Regards,

Jesse O.
Applications Engineering
National Instruments
Jesse O. | National Instruments R&D
0 Kudos
Message 5 of 17
(4,489 Views)

Difficult problem, especially if you also need to vary phase-switching speed or PWM duty cycle.  Some incomplete thoughts, based on using counters:

1. 1 counter is the master clock and the 6 motor phase pulses are driven by it.  This counter effectively sets the phase-switching speed for the whole pattern as a group.  This counter's freq can be changed on the fly to change the motor speed.

2. Controlling the 3 low-side transistors for each leg is relatively straightforward.  These 3 counter outputs start together but have a different value for "initial delay".  They share the same frequency and 1/3 duty cycle which are defined in terms of "Ticks" from the master clock referenced earlier.  An easy way to get them to start together is to start their tasks before starting the master clock task.

3. The 3 high-side transistors *might* be able to operate like this:  Initially, think of them just like the 3 low-side counter outputs, using the same freq and 1/3 duty cycle but with their own distinct "initial delay" values. 

4. Configure the 8th and final counter as a PWM generating counter whose freq and duty cycle can be changed on the fly.  This one probably should NOT be driven by the master clock.

5. Configure your 3 high-side transistors to use the PWM counter as a "pause-trigger".  Here's how I *hope* it works: the physical signal output from the 3 high-side transistors is like a logical AND of their internal output state with the PWM output state.  When their internal output state is low, the PWM has no effect.  When high, the PWM does what it should.   (The alternate way it *might* work is that the internal timebase is logically AND'ed with the PWM so that "counting" is only enabled while the PWM is high.  Not sure if I haven't ever tested this or if I just don't remember the results.)

Hopefully, this produces a system that allows you to vary both speed and torque by changing either the master clock or PWM duty cycle respectively.  Not 100% sure though.

-Kevin P.

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
0 Kudos
Message 6 of 17
(4,476 Views)
Rather than using all the counters perhaps you could generate the patterns as an array of digital outputs. If your DO board supports hardware timing, you could vary the frequency of a single counter and use it to clock the the DO.

One complete cycle consists of a fairly small set of basic patterns except for the PWM part. And you know where those fit into the pattern. A shift of the patterns reverses the motor. Calculate the PWM for each cycle (or each group of cycles if you do not need such a rapid response). Then AND the PWM pattern with the High side basic patterns and write to the DO buffer.

Lynn
0 Kudos
Message 7 of 17
(4,473 Views)
Hello,

That is the idea behind the example I posted.  It uses 1 counter to generate a clock for the digital lines and from there you can specify the PWM frequency and it adjust the counter frequency.  If you adjust the data set generated you could produce the required digital pattern.

Regards,

Jesse O.

Jesse O. | National Instruments R&D
0 Kudos
Message 8 of 17
(4,465 Views)
Jesse,

I missed that as I did not follow your link.

Lynn
0 Kudos
Message 9 of 17
(4,462 Views)
Hello Lynn,

No problem.  I just wanted to make sure what I said before was clear just in case there was any confusion.

Regards,

Jesse O.
Jesse O. | National Instruments R&D
0 Kudos
Message 10 of 17
(4,457 Views)