02-23-2009 09:57 AM
02-24-2009 11:25 AM
Hey Rob,
Thanks for taking the time to write such a detailed message. The overview of your setup definitely looks good and should be sufficient for you to pull off the dyno project. Just make sure you keep an eye on the number of inputs/outputs available on the card. You didn't really mention yet how you'll be measuring the horsepower produced by the engine.
The PID toolkit should give you the ability to control the RPM acceleration rate so that you can increase it steadily.One question here though: in your PID control loop, are you going to be taking torque measurements into account when adjusting your RPM rate? In other words, is your RPM rate adjusted based only on the previous RPM reading or both RPM and torque? In either case, you should be able to adjust the rate based on both inputs if you wanted to.
As far as learning more about DAQmx, probably your best resource are the examples in Labview's example finder (one useful feature is to select your hardware in the dropdown box in the bottom left corner and limit the results to hardware). For your counter task, for example, you could probably use the example in Hardware Input and Output > Daqmx > Counter measurements > Digital Frequency. One of those examples uses one counter. You'll notice that the example doesn't exlplicitly specify timing at all.
Also, see if you can find any useful information about getting started with DAQmx here.
Let me know if I didn't answer some of your questions - it was a pretty long post
02-24-2009 02:21 PM
02-25-2009 11:56 AM
03-23-2009 01:43 PM - edited 03-23-2009 01:47 PM
03-23-2009 02:17 PM
As it happens, I am involved with a large project that controls engines, as well. I have two control loops, one controls dyno drive based on speed, and the other controls throttle based on torque. Usually only one is in PID mode at a time, the other is open loop. I have to run the engine thru a prescribed speed-torque cycle and measure how much exhaust pollution occurs.
We do "Torque Maps" which are sweeps similar to what you describe. You put the throttle 100% ON, and ramp up the dyno speed, all the while capturing data. You get a map of how much torque you can obtain at any given speed.
I do it on a PXI box to avoid timing issues. When I last tried to use the host computer to do this, Windows was just not able to devote the time to getting the data right. The PXI box guarantees that I can control the loop at 100 Hz (I have tested it up to 1000 Hz).
Anyway, to your specific question:
I started to try different DAQmx Timing settings. It seems the three main options are Timing Source, Timing Rate and Number of Samples.
The counters are general-purpose, so they can be configured in many different ways.
The TIMING SOURCE is where the basic timebase comes from. If you're measuring a high-frequency signal, you want a higher-frequency timing source (so you have resolution to spare). If you're measuring a low-frequency signal, you want a low-freq timebase (so you don't run out of counter bits). If your max input is 3600 Hz (277 uSec), then a 1 MHz timebase (1 uSec) will give you one part in 277 resolution WORST CASE. A 10-MHz timebase will be 10 times as good.
I don't know where you are getting the TIMING RATE and # SAMPLES inputs, can you explain?
Blog for (mostly LabVIEW) programmers: Tips And Tricks
03-23-2009 03:23 PM
First off, your photos show enough parts to build a couple dynos. There is obviously the eddy current frame & brake. There is also parts of a Go Power water brake dyno. Don't think you'll need many parts from it.
I think turning the signal negative is perfectly acceptible as a PID is simply a box full of equations, tunable by coefs. Pretty sure this is standard procedure for cooling systems (you mention a heating PID).
As far as the system control being less than desired, this relies on careful coefficient tuning of the PID routine. I think the PV/SP graph indicates an unstable system that is overdamping. Try increasing Ki and maybe decreasing Kp. Also there is a little noise in your input signal. This could be causing havoc. Your sampling frequency seems overkill. I would probably use some of these samples for filtering. A simple boxcar filter could stabilize the PID tremendously by steadying the errors.
03-23-2009 03:29 PM
el bob wrote:It can be seen that the control output currently looks more like a rapidly-changing on/off switch instead of a continuously variable analog control signal. I'm not really sure what's causing this, but I would like to find out.
Are you certain your PID tuning parameters are good? If you've gone through a tuning process such as Ziegler-Nichols and you're still getting odd behavior, make sure you've got the units right - your integral and derivative parameter should be in minutes, even though the dt input is in seconds.
03-24-2009 01:37 PM - edited 03-24-2009 01:45 PM
CoastalMaineBird wrote:As it happens, I am involved with a large project that controls engines, as well. I have two control loops, one controls dyno drive based on speed, and the other controls throttle based on torque. Usually only one is in PID mode at a time, the other is open loop. I have to run the engine thru a prescribed speed-torque cycle and measure how much exhaust pollution occurs.
We do "Torque Maps" which are sweeps similar to what you describe. You put the throttle 100% ON, and ramp up the dyno speed, all the while capturing data. You get a map of how much torque you can obtain at any given speed.
I do it on a PXI box to avoid timing issues. When I last tried to use the host computer to do this, Windows was just not able to devote the time to getting the data right. The PXI box guarantees that I can control the loop at 100 Hz (I have tested it up to 1000 Hz).
Anyway, to your specific question:
I started to try different DAQmx Timing settings. It seems the three main options are Timing Source, Timing Rate and Number of Samples.
The counters are general-purpose, so they can be configured in many different ways.
The TIMING SOURCE is where the basic timebase comes from. If you're measuring a high-frequency signal, you want a higher-frequency timing source (so you have resolution to spare). If you're measuring a low-frequency signal, you want a low-freq timebase (so you don't run out of counter bits). If your max input is 3600 Hz (277 uSec), then a 1 MHz timebase (1 uSec) will give you one part in 277 resolution WORST CASE. A 10-MHz timebase will be 10 times as good.
I don't know where you are getting the TIMING RATE and # SAMPLES inputs, can you explain?
When I first looked at LabVIEW DAQmx reference materials, I suspectec I would need to go beyond the DAQ Assistant and break down DAQmx tasks into their lower level start, read, write, stop and clear components. After reading more and working with additional LabVIEW PID examples, it looks like I may be able to stick with DAQ Assistant sub-VI's. I was confused at the time by the different DAQmx timing components and chose to begin with a question on the counter input. Today, a DAQ Assistant sub-VI seems to be handling the counter input well enough.
I most likely need to focus on PID parameter tuning at this time. If it turns out that the timing configuration of the counter RPM input is preventing the system from working as required to perform a power sweep, or follow a Torque Map like you mentioned, then I will need to revisit it. For now I'm just going to be happy that its portion of the system seems to be working. 🙂
03-24-2009 01:40 PM
walter-donovan wrote:First off, your photos show enough parts to build a couple dynos. There is obviously the eddy current frame & brake. There is also parts of a Go Power water brake dyno. Don't think you'll need many parts from it.
I think turning the signal negative is perfectly acceptible as a PID is simply a box full of equations, tunable by coefs. Pretty sure this is standard procedure for cooling systems (you mention a heating PID).
As far as the system control being less than desired, this relies on careful coefficient tuning of the PID routine. I think the PV/SP graph indicates an unstable system that is overdamping. Try increasing Ki and maybe decreasing Kp. Also there is a little noise in your input signal. This could be causing havoc. Your sampling frequency seems overkill. I would probably use some of these samples for filtering. A simple boxcar filter could stabilize the PID tremendously by steadying the errors.