Throttle body PID control using pulse width modulation

Hello all,
I am trying to do a PID control for a throttle body (using pulse width modulation) for a set value of feedback voltage. The process variable is the pulse width duty cycle. The throttle body is expected to be fully open at a feedback voltage of 5V and pulse width duty cycle of 42.5%.  When I use the highlight execution using the attached file, I can see the throttle body fully open (the values observed are: PID output 42.5 %, feedback voltage approximately 4.7V). However, when the highlight execution is unclicked, the throttle body flutters in the closed condition (still PID output 42.5%, feedback voltage approximately 0.9 V). Can any one please help by suggesting any modification to this attached file to make this throttle body respond to the set value of feedback voltage.
Many thanks 
Ajith
Attachments:
Throttle body control using PWM technique - PID.vi ‏525 KB

How did you determine your P, I, and D gains? If you have not tuned your controller, you'll get poor performance. Running with execution highlighting will slow down the execution, which will change the effect of the gains. I would start with pure proportional control (I and D = 0) with a small proportional gain, and see if it responds in approximately the way you want. If so, then your code is probably correct, and you just need to do a full tuning to get good performance. There are many resources available on the web, on this forum and elsewhere, for PID tuning. Note that since your code uses a simple PID example, and not the one from the PID toolkit, the gains do not have the units that are used in many tutorials so you'll have to correct the calculations to compensate.

Similar Messages

  • Using pulse width modulated signal (square wave) to control when a signal is turned on or off

    Using pulse width modulated signal (square wave) to control when a signal is turned on or off
    Greetings All
    I'm trying to use a labview created pulse width modulated signal (square wave) to control when a signal is turned on or off.
    Here's my logic and graphic example:
    1) The source wave signal is continuous
    2) Use a PWM (square wave) created in labview to control when the signal is turned on or off
    3) If PWM signal (amplitude) is greater than 0 play signal if PWM is not greater than 0 don't play signal.
    I'm actually using this to step sequence / pulse several separate magnetic coils using my audio card (which has several audio output channels), I have a signal in labview played constantly.  Than compare it to the PWM (square wave) which controls if the signal gets played on each separate channel or not.  That way I can control which coil is on and off and in what sequence they are activated. 
    I couldn't find an edge detection for a square wave created in labview so I tried Limits but that doesn't seem to work unless I change the phase manually and that only goes from 1 to -1.  I'm just trying to compare the PWM (square wave edges) already created by labview / play a signal if the pulse is greater than 0 and it turns off the signal if it's less than 0.
    Should I be doing this another way
    Tia
    Message Edited by sal22 on 08-16-2009 06:09 PM
    Message Edited by sal22 on 08-16-2009 06:10 PM
    Solved!
    Go to Solution.
    Attachments:
    PWM control signal block.png ‏23 KB
    PWM control signal front.png ‏48 KB
    pwm test.vi ‏36 KB

    Greetings,
    I tried it two ways using amplitude and levels and fft spectrum.  The values don't seem to update the way I need them to (basiclly showing a 0 or a 1).   I compare the Y values like you recommended but they don't ever seem to update.
    tia
    Message Edited by sal22 on 08-19-2009 10:05 AM
    Attachments:
    pwm magnitude not updating.png ‏29 KB
    pwm test.vi ‏41 KB

  • Does the new ipad use pulse width modulation to control the brightness of the display?

    Does the new ipad use pulse width modulation to control the brightness of the display? I have photophobia and migraines and am unable to use displays that use this technology due to it triggering a headache.

    You'll have to go to an Apple Store and view the screen to see if it's OK for you.  If a store is not convenient, buy one from Apple online and check it out.  You have 14 days to return it for a full refund, no questions asked.

  • Cannot Find Pulse Width Modulation(FPGA, Use in SCTL)

    Hello All,
    Can someone tell me where I can find Pulse Width Modulation (FPGA, Use in SCTL).vi? I couldn't find it in LabVIEW Example Finder.
    Thanks
    Message Edited by John Edwards on 02-01-2009 09:30 PM
    Solved!
    Go to Solution.

    Here it is...
    Attachments:
    Pulse Width Modulation (FPGA, Use in SCTL).vi ‏43 KB

  • Building delays in pulse width modulation

    HI there I am trying to build a vi to control a speed controller for a motor.
    The specification that the technician gave me is to produce a pulse width modulation waveform with constant gap time and variable "on" time.
    This will give the motor a variable speed that can be manipulate.
    I already build a pulse width modulation vi but I don't understand how can I make the gap time constant eg 20ms while varying the on time 1-3ms.
    Is there a method that I could use or an example that I can look at? Any help will do thanks in advance.
     ill attach my current vi.
    Solved!
    Go to Solution.
    Attachments:
    pulse.vi ‏20 KB

    You want to vary the ON time between 1 to 3ms? 
    Did you do a search using the keyword "pwm"?  There are many posts that have examples.
    The idea is that you want to preserve the same frequency and change your duty cycle.
    (Example)
    Let say you want a waveform at every 20ms, which translates to 50 Hz.
    2 ms is 10% duty cycle, 1ms is 5% duty cycle, and 3ms is 15% duty cycle.
    Did I understand your question correctly?  Somehow, I feel like I missed something..

  • Lenovo x240 and PWM (Pulse Width Modulation)

    Hello everyone!
    Does Lenevo Thinkpad x240 use PWM (Pulse Width Modulation) to control screen brightness?
    If so, is there a flickering effect like in this video?
    https://www.youtube.com/watch?v=SpDdy9jSx7Y

    There is an analog modulation with which there is no pulsation at low brightness levels. For example, HP Elitebook 8740w. Watch video: http://www.youtube.com/watch?v=Dk4ckdQ9rvE
    How poor the implementation of PWM (if x230 has PWM) is in this model?

  • Pulse width modulation on sbRIO 9631

    need to control 150 RPM DC motor with help of pulse width modulation from sbRIO 9631. need a simple VI in which i can take some DIO's and with help of a slider i can increase or decrease speed of motor simultaneously. 

    A 12V geared DC motor is hard time figuring out how to control or maintain it.Torque in from speed 0 to 150 RPM.

  • Pulse width modulated signals

    Is it possible to generate a fixed frequency with variable duty cycle signals using counter/timer channels of my DAQ 700?
    If yes, is there any example I could download?
    If no, I am looking for a DAQ card that can handle
    the job, I'd appreciate any recommendation.
    Another part of my project is to read in a analog signal while generating this pulse width modulated
    signal. So far I am not very lucky with one DAQ,
    I am thinking of getting two. Does it sound overkill?
    Please help.
    Thanks

    Could you provide a timing diagram for your digital signal?
    I am a firm believer that a digital output device such as an NI timer can create any signal, given the proper software or hardware. I once did a high speed, gated, triggered data acquisition with only a single NI timer chip on the AT MIO 16E-1. It required about 75 feet of BNC cable, more PFI wires than you can imagine, four external logic devices (AND and OR, NAND and NOR boxes) all interconnected and basically tangled. I don't think I could repeat that setup without my documentation, but the point is, it worked.
    The most important thing from that example is that I used a timing diagram. These are so vital in digital IO and timer applications that its not funny.
    If you can't determine ho
    w to do what you need from a timing diagram, just send me a copy, let me know what the basic specs are of the DAQ 700 (how many counters, interconnect capabilities, etc) and I can try to help.
    Good luck.
    As far as reading the analog signal at the same time...well, look at my example. I generated the trigger/gate signal with the card, and then read in the analog data (on several channels simultaneously.)

  • Pulse width modulation with daq mx

    Im trying to change the pulse width modulation on the fly with daq mx. All I have found so far are examples useing traditional DAQ, but not DaqMX. It would be a lot easier if I were to use DaqMX since I will be useing other daq applications in my program and would rather use mx.

    Does this help?
    Attachments:
    PWM-Counter_Output_Folder.zip ‏63 KB

  • Samples Not Acquired on NI 660x or NI 6624 Devices When using pulse width, semi-period or two-edge separation buffered measurements with the NI 660x and NI 6624 on counters 0 and 1, some samples may not be acquired under certain circumstances.

    In the DAQmx 9.4 Readme the following is stated:
    Samples Not Acquired on NI 660x or NI 6624 Devices When using pulse width, semi-period or two-edge separation buffered measurements with the NI 660x and NI 6624 on counters 0 and 1, some samples may not be acquired under certain circumstances.
    Could anyone elaborate on this? I am particularly interested in knowing under what circumstances this problem arises for the 6602 PCI devices.
    How should I understand 'NI 660x and NI 6624 on counters 0 and 1'. Is it only a problem on counter 0 and 1 for the 660x or does this only apply for the 6624 devices.
    /mola 

    Are there any NI Product Support Engineers out there who has an answer to this question and who are willing to share it with me?

  • Level Control with PID Control & Pulse-Width Modulation

    Hi all,
          I have attached my program which I'm having trouble wiring up in the block diagram.... I'm fairly new to labview, but basically I have a level control project with an analog input cistern arm turning a pot for my test tank (configured as DAQ assistant voltage analog i/p) and a pump working off a reservoir (configured as DAQ assistant voltage digital o/p). My electrical side of things is working correctly and I have tested both DAQ assistants I/O's successfully off a basic program, minus the PID & PWM... I found a simple PID control subvi which I think I have wired up correctly, apart from the output variable... I also found a bit of code for PWM using the square waveform vi (far right side of the program) which I have tried to include in the program, but I've been unsuccessful with that. The ideal operation i'm looking for with this project is to be able to enter different values for the setpoint, for the PID to kick in to find that setpoint each time using the PWM to drive the pump, which has a flow rate of 13L/min. I have a manual valve to release water from my test tank which I can set accordingly.
    My questions are;
    - How do I connect the 'output variable' of the PID subvi to my DAQ assistant digital output(both DAQ assistants are set at 1 sample on demand)?
    I have a 'number to boolean array' function, but this gives an error saying that the number of tasks generated are not the same...
    - How do I wire up the PWM bit of code? Do I need to include the 'error in & out' tabs?
    -Am I on the right track with this program or am I way off the mark?!
    Any feedback on this would be greatly appreciated. Thanks for your time,
    Richie
    Attachments:
    PID-RichLevelControl.vi ‏91 KB

    Rich-MechatronicsStudent wrote:My questions are;
    - How do I connect the 'output variable' of the PID subvi to my DAQ assistant digital output(both DAQ assistants are set at 1 sample on demand)?
    I have a 'number to boolean array' function, but this gives an error saying that the number of tasks generated are not the same...
    - How do I wire up the PWM bit of code? Do I need to include the 'error in & out' tabs?
    -Am I on the right track with this program or am I way off the mark?!
    You're a bit off track.  You need the output of the PID to go into the PWM generator, and the output of the PWM to be written to the digital output.  Right now you have the output of the PID connected directly to the Digital Output in a way that won't work, and the PWM generator hanging off the side not really connected to anything.  Also, the PWM generator isn't really going to work since you're generating it at the same frequency as your PID loop runs.  Try a simpler algorithm such as on/off control first and see if that works for your system.

  • Mult-channel PID control using PID Toolkit

    I am controlling the light level in six locations (zones) using light sensors, dimmable ballasts (which respond to a 2 to 10 VDC signal) and the PID toolkit.  In my VI, I loop through 6 times (once for each zone) to control the light levels.  I use the simple PID.vi to determine the next setpoint for the dimmable ballast on the lights.  My problem is as follows, I think:
    The PID algorithm uses past response and the current difference between the measured variable and the setpoint to calculate the next setpoint.  If my understanding is correct, then I am confusing the PID algorithm by calling it with 6 different data sets.  It is almost as if I need 6 separate PID functions, one for each zone. 
    Perhaps I am wrong about the operation of the PID algorithm.  Can someone straighten me out?
    Attached is a snapshot of the VI.  The FOR loop goes from 1 to 6, that is, once for each sensor zone.
    Message Edited by rgentry on 04-29-2007 09:11 PM
    Attachments:
    temp.jpg ‏92 KB

    rgentry,
    The PID has two modes of operation: Single Channel and Muti-channel. The way you developed your algorithm, you are using single channel algorithm with multiple setpoint and variables. This will not work properly since LV will not keep the internal states correct for each channel.
    To fix this, it is pretty simple. Remove the For Loop and provide the whole 1D array to the PID.vi. This will enable the "multi-channel" mode and every time you call your VI, it will keep the internal states for each channel, as if you had 6 different PIDs in parallel. Notice that the interpolation also will work the same way, you just need to remove the build array primitive.
    Hope this helps!
    Barp - Control and Simulation Group - LabVIEW R&D - National Instruments

  • PID control using LabView 6i

    Hallo,
    We use NI PCI 6024E Card in PC with Celeron 1,1 GHz, 256 MB SDRAM,
    The Card has 16 Analog input and 2 analog output. I plan to use this card as
    a PID controller.
    Our LabView contains the modules for motions and all the add ons to.
    The question is, whether the PCI 6024E is capable to do controling, since we
    have to
    control the velocity of 2 mm/s with scan rate 50 S/s.
    thanks

    I can tell you that using a PC of similar horsepower under XP Pro and a PCI-6071E I've successfully run PID loops with sample rates of 10KS/s in 100msec bursts. At first I was seeing a fairly high rate of input buffer overflows. But when I set LabVIEW's execution priority to "High" this problem all but disappeared. (At some time in the future we plan to migrate to LabVIEW RT, which I hope will cure this problem completely.) 50S/s should be a breeze. You might want to add memory. I've got 512Meg in my machine.

  • Inverted pendulum PID control using Arduino

    Hi everyone, I still have a ongoing problem trying to control the inverted pendulum using a self built PID algorithm. The problem is not with the algorithm itself but the program around the algorithm. Anyway this is what IM trying to do.
     I want to be able to constantly read the angle of the pendulum, which will be done using the arduino read analog vi. Now the pendulum angle will be represented as a voltage. This is all fine. Now:
    1. If the angle(voltage) is inside a specified correction range I want the PID algorithm to turn on  and let the algorithm work on the error as it would normally (while updating the angle(voltage) reading after each PID loop.
    2. Also when this angle(voltage) goes back outside the specific correction range I would like the PID algorithm to STOP, however at this stage I would like the overall program to continue running and keep checking the angle(voltage) to see if its value comes back into range and if it does switch back again to the PID algorithm.
    I don't have great knowledge of labview and IM still learning about it. I have included my program so far below. rev2 is the higher layer and the PID algorithm itself is rev1. 
    I have tested my program with the arduino but what happens is this:
    the checking of the angle range works but once the value is true i.e. Angle is inside correction range , the angle value moves into the PID algorithm however is never updated at this stage and I can not get back out of the PID while loop.
    Sorry if what I have been saying does not make sense and was hard to follow, however I have include my code below for help. And I would really appreciate help on this and what I could look at in order to get it working all comments are very welcome.
    Thanks
    Fran
    Attachments:
    PID rev2.vi ‏1143 KB
    PID rev1.vi ‏1158 KB

    ladysman217f wrote:
    the checking of the angle range works but once the value is true i.e. Angle is inside correction range , the angle value moves into the PID algorithm however is never updated at this stage and I can not get back out of the PID while loop.
    That's a very accurate description of the problem with your code - enough so that I think you could figure out how to solve it.  You might find it helpful to run your code with execution highlighting enabled.  Remember that values at loop tunnels never change.  At the moment you take one measurement of the angle, feed it into the PID loop, and then the PID continues to run in its own loop without ever measuring the angle again.  You either need to put the measurement and the PID algorithm in the same loop; you could do this by making the PID run only once per call, or by moving the angle measurement into the loop that implements the algorithm.

  • Harmonics analysis with Pulse Width Modulation

    I stuck in how to show the harmonics contents of the PWM Inverter.
    Which is the right input connect to the  signal in port of FFT power spectrum component? and then that can show the PWM inverter harmonics contents.
    Please help me , this is my final year project
    Attachments:
    1.jpg ‏31 KB
    PWM_2013_10_16.vi ‏30 KB

    Dear Lynn,
    Thanks for your useful information. I was successful to obtain the power spectrum from the FFT component, But I would like to know how can I get the power spectrum exactly same as my attached picture?
     ( In my VI, all the parameters and type of  control and carrier signal are same as the picture, but the power specturm is not the same. )
    Which is show the x axis and y axis  is modulation frequency ratio and modulation amplitude respectively, and the modulation amplitude will be changed in different harmonics frequencies.
    The formula also is attached. I have no idea how to apply those equation in the FFT power spectrum analyzer. 
    In the other hand, I would like to know how to use harmonics analyzer to get the THD, since I connected the wire from modulation output to singal input of harmonics analysis and then show error.
    Thank You!!'
    Jason 
    Attachments:
    1.jpg ‏31 KB
    formula.jpg ‏14 KB
    PWM_2013_10_30.vi ‏156 KB

Maybe you are looking for

  • Vbscript, change page size

    So I have folder with numerous word/excel files that need to be converted to PDF on Legal Size "paper". We have the "Save As PDF" plugin for Office so converting the files to PDF is no problem, however, using that plugin you cannot specify a "Print S

  • Child table linked to what Parent?

    Hello, As I am learning db management, I am at a point where I am totally lost and I feel I am getting nowhere with Google. What I am doing is deleting a field from Table_A, it tells me ORA-02292: Integreity Constraint <random.table_B_FK2> violated -

  • Photo Steam appears in photo albums even though its turned off in settings.

    When I turned off photo stream in my iCloud settings on my iPhone 4, the empty Photo Stream album still appears in the Pictures app. When I try to turn it back on, an additional photo stream album appears and works correctly. I'm not really intereste

  • How to reach an Oracle BI Server (client 1) from another client (client 2)

    Hi all, I'm new to the BI EE's world and I have a connection's problem. I have installed Oracle BI EE 10.1.3.3.2 (Complete installation - all component) & Oracle 10g DB on my pc (pc 1). The BI server is started. ..and then another colleague of mine i

  • Error in DTR, when creating the Projects in Local DCs

    Hi All, When I am trying to create project in Local DCs in DTR, it is giving the following error. <b>Archive Sync is not permitted because variant unknown on CBS</b> com.sap.tc.devconf.SyncException: Could not load component sap.com_SAP_JTECHS_1sap.c