LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

PWM Closed Loop Control Question

I am attempting to perform closed loop control of a fuel pump using pulse width modulation.  What I would like to do is read two pulse signals in: (1) the desired pulse width from our programmable ADEC board which spits out a fuel pump rpm based upon the engine rpm and throttle position, and (2) the actual pulse width from the fuel pump encoder.  Using the difference between these two pulses, I want to send out a single adjusted pulse to achieve the desired fuel pump rpm.  As of now, just using the ADEC board works ok, but tends to wander.  The use of the encoder would help to keep the pump running smoothly.  Now, I have little experience in Labview but I think I could sort some of this out if I was pointed to some examples.  Currently, I can do all the simple math that takes the two pulses and spits out the adjusted pulse based upon controlled inputs which I have attached.  The difficulty arises in configuring the channels, syncing the timers, and extracting and writing the signals (I know a hefty question!).  Any help or examples code would be greatly appreciated.  NOTE: I am using Labview 6.1.
Thanks,
Nick Statom
0 Kudos
Message 1 of 3
(2,926 Views)
Nick,

Some things to consider: Unless you are using a real-time version of LV, the OS can introduce large, unpredictable latencies into your control system (tens, even hundreds of ms). If this could be a safety or equipment damage issue, you should probably not use LV this way.

Reading the timing of two pulses and sending out another pulse after doing some calculations may be strightforward or quite difficult, depending on the timng accuracy and resolution required and the hardware selected to do the job. Get the specs nailed down before you buy hardware, if you can.

If the "wandering" is not too fast, maybe you could adjust the setpoint to the ADEC board via LV rather than trying to compensate each pulse.

Lynn
0 Kudos
Message 2 of 3
(2,920 Views)

Hi Nick,

What Lynn mentioned about using an RT OS is true, for control systems that require some sort of feedback like a PID loop you are most likely going to be needing LabVIEW Real-Time.  Windows generally does not offer the determinism that is required for these sorts of applications.

As far as examples, your application is too specialized for much to exist.  It would probably be best to piece together what you need from a bunch of different examples.  LabVIEW ships with quite a few that I think will be helpful in getting you started.  Open the NI Example finder (Help >> Find Examples) and take a look at the examples for Analog Input, and Analog Output under the Hardware Input and Output.  There will be some there that also incorporate triggering and timing.  Also you might want to take a look at the NI Developer Zone, there are a bunch more examples there as well (www.ni.com/devzone). 

Bryan Snarr
Field Engineer
Northern California
National Instruments
0 Kudos
Message 3 of 3
(2,896 Views)