PID control loop slows down during execution.

Hi, I am a attaching a LV8.6 code that i am currently using to control my engine experiment. I use PID control where the input signal is an rpm value that i measure using a counter. The ttl signal from the sensor is not clean and so i use an analog trigger to generate pulses on the counter from where i measure the frequency and hence the rpm. The output is generated as an analog voltage on an output channel. The problem i am facing is that the loop runs really good when i start off but gradually the loop keeps slowing down and this greatly affects my ability to control engine speed. I am not sure why this is happening. I tried increasing the sample size and rate (so as to increase the buffer size) but this didnt have any effect on the speed. I am guessing its a problem with the way i have my loops setup.. any suggestions would be greatly appreciated.
Thanks, Shyam.
Attachments:
PID control loop.vi ‏33 KB

Hi all..I realised my mistake soon after posting as usually is the case..the create channel vi for doing the analog output to the output channel was within the loop and slowing things down..when i moved it out..it fixed the problem!!
Shyam.

Similar Messages

  • Loop slows down when certain parts of screen are active

    Hi, I've noticed that one of my loops, which is set to run at 50ms, slows down significantly when certain other parts of the screen are active.
    We have a dual screen setup where on the left side we have a bunch of controls and I'm also displaying the time that 50ms loop takes. On the 2nd screen, there is a tab control with several pages. When some of the pages are displayed (and those are the ones that are probably the "busiest" in terms of processing), the loop time slows down to anything in the range of 1-4 seconds.
    The loop runs at 50ms when other lower-processing tabs are showing. It will also run at 50ms when any other window (another VI, another application) is hiding that right tab display. Actually, it'll run at 50ms if another window hides about half of that right tab
    What can I do to be able to watch those tab pages and keep my loop running from slowing down? One of those tab pages is a fault message display, so it's good to watch while you're running a test!
    Thanks.

    I would start by checking what you're displaying in your pages. You might be doing something that doesn't need to be done all the time.
    I once ran into an issue where screen updates to a control in a tab would slow down the computer (100% CPU usage) even when another tab page was selected and would only stop when the tab was moved off the screen or when the control was moved out of the tab. Unfortunately, I was never able to reliably recreate that issue. In that case the problem was with updating the strings in an array of rings using a property node, but yours might be a different case.
    If what I described sounds similar to what you're seeing (increased CPU usage even when the real culprit is not displayed) I would be interested in seeing a demo.
    Try to take over the world!

  • Rendering speed is slowing down during process, almost up to freeze

    Hello there!
    First of all, I'm a new person to After Effects. I bet I just doing something wrong, but anyway I would like to ask an advice how to fix my issue because googling such subject won't solve it.
    The point is following:
    I rendering 120-minutes long video for YouTube. It almost static with no effects, just with a few simple fade-in/out transitions on couple of layers. You can find an example of such video on YouTube by this link: Daniel Lesden - Rave Podcast 056: guest mix NitroDrop (Israel) - YouTube (for some reason, specifically this video was rendered successfully previously).
    Process is going very well at first, 1 minute of playback rendering for about 30 seconds, so first hour of the video rendering for 30 minutes.
    The problem starts at about 70% of overall progress: it start to slowing down, and then goes to 1 frame rendering for 1 second. As you can imagine, it's a pain for such long videos, it will take a days to finish last 20-30%.
    Composition and render settings are following:
    Size: 1280 x 720 px
    FPS: 30
    Format: Quicktime
    Codec: ProRes 422. I've also tried: Animation, Photo JPEG, another ProRes and even H.264, but outcome was the same.
    Output module settings screenshot:
    Multi-processing settings:
    On this point I have to say that I've tried many different options with amount of CPU, RAM or with Multi-processing option turned off completely, but in the end it all was the same.
    After Effects version: CC 2014 (still on trial version, but it shouldn't be a problem since Adobe don't have any limitations for trial versions as far as I know).
    Computer and OS information:
    Any advices please? I'll very appreciate every possible solutions.

    "open AE preferences>General then move to the bottom tab and set AE to purge every 10 frames or so"
    — I've set this parameter to 10 as suggested, and here are the last render queue results:
    First 60-minutes video rendered superb good for 1 hour 17 minutes.
    Second 120-minutes video goes really badly: it took 8 hours to render about quarter due to error. Here is what I found in the error log: "There is an error in background rendering so switching to foreground rendering after 246 frames completed out of total 216000 frames. (26  ::  142)".
    Later I've tried to render second video again, and it was great almost till finish: 1 hour 45 minutes has been rendered for less than an hour. But then it suddenly slowed down (as described in the original post), so I had to stop it. I installed Memory Dig and "optimized" memory before rendering and once during process, but it didn't help. In the end I just rendered last 15 minutes of the video (with no issues) and just merged it into 120-minutes long file using Video Joiner. Pretty sad method, although.
    On a third attempt everything was fine until rendering stops by a new error in popup window: "After Effects error: internal verification failure, sorry! {could not find itemframe we just now checked in}".
    So the original problem still wasn't solved yet unfortunately.

  • Why do my loops slow down after many iterations

    My Vi seems to freeze up or slow down after several iterations of the loop. This is an Analog Input Capture VI.
    Attachments:
    Final_Main_VI_with_working_amp.vi ‏456 KB

    First of all, thank you for your contribution. You are right to say that I have no need in changing the AI Config every time that the loop runs. But as this is supposed to be a soft-scope, I need to be able to update the parameters associated with AI Start while the loop is running (e.g. trigger level).
    I have tried to move the AI Config subVI out of both loops but the error as a result is: "No transfer in progress for the specified source."
    I also need a sampling rate of exactly 96kHz. I realize that the laptop clock cannot attain this value. Do you know how I could get exactly 96kHz.
    Attachments:
    Final_Main_VI_with_working_amp.vi ‏498 KB

  • Teststand slows down during overnight testing

    Hello All,
    I have Teststand 4.2 and labview 9.0. I need to run a number of tests repeatedly where the duration of testing could be typically 48 hours. I have just started to run these extended tests but have found Teststand slows down after a number of hours to the point where I noticed a 1 second wait step takes 4-5 seconds to run. At this point the test system results are invalid.
    I have looked on the NI userforum and believe the issue relates to the report results getting larger and larger to the point where it reduces the performance of the PC. I have used the Teststand settings described here:
    http://forums.ni.com/t5/NI-TestStand/teststand-become-slow-and-slow/m-p/792363
    Is this the most efficient setup? I imagine theres a way to tell Teststand to save all the results every minute then flush the buffer so it doesnt affect the testing. I noticed the "Configure > Report Options > conserve memory ..." option stops results being logged when I terminate the sequence.
    Thanks In Advance
    Regards
    Chris

    Hi,
    If you are storing loads of results due to long execution runs then you need to use 'On the Fly' result logging because of the problems with the result being in ResultsList which will just grow and grow until you run out of memory or TestStand crashes.
    Regards
    Ray Farmer

  • Index slows down query execution

    Hello everybody,
    I have reordered the join conditions for the query...
    select (first_name||' '||middle_name||' '||last_name) name,regn_no,age,gender,
    (select loc_name from locations where loc_id=location_code and loc_h_id='L6') district,
    person_id from persons p,musers u where reg_center_id=u.center_id and
    p.ipop='RG' and u.user_id = '8832' and u.eff_end_dt is null and p.CID = '1' order by p.crt_dt desc
    like this...
    select (first_name||' '||middle_name||' '||last_name) name,regn_no,age,gender,
    (select loc_name from locations where loc_id=location_code and loc_h_id='L6') district,
    person_id from musers u, persons p where reg_center_id=u.center_id and u.user_id = '8832'
    and p.ipop='RG' and u.eff_end_dt is null and p.CID = '1'
    because
    select count(*) from persons p, musers u where reg_center_id=u.center_id and
    p.ipop='RG' is 13002
    and
    select count(*) from persons p, musers u where reg_center_id=u.center_id and u.user_id = '8832' is 1007.
    In this excercise I have a couple of questions..
    1. This did not show any difference in the CPU time.
    and,
    I have created an index 'idx_ipop_persons' on persons(ipop) "create index idx_ipop_persons on persons(ipop)".
    2. The query is taking more time to execute than it was before creating the index.
    Please help me...
    Thanks,
    Aswin.

    Please post the execution plan for your query.
    And also i need some details:
    select count(*) from person where ipop='RG';
    How many records fetch?
    select distinct ipop from persons; --How many
    records fetch?
    Regards
    RajaBaskar
    Execution plan:
    Execution Plan
    0 SELECT STATEMENT Optimizer=ALL_ROWS (Cost=921 Card=176 Bytes
    =11088)
    1 0 TABLE ACCESS (BY INDEX ROWID) OF 'LOCATIONS' (TABLE)
    (Cost=2 Card=1 Bytes=38)
    2 1 INDEX (RANGE SCAN) OF 'IDX_LOCID_LOCHDR_LOCATIONS' (INDE
    X) (Cost=1 Card=1)
    3 0 TABLE ACCESS (BY INDEX ROWID) OF 'PERSONS' (TABLE) (
    Cost=918 Card=176 Bytes=9152)
    4 3 NESTED LOOPS (Cost=921 Card=176 Bytes=11088)
    5 4 TABLE ACCESS (BY INDEX ROWID) OF 'MUSERS' (TA
    BLE) (Cost=3 Card=1 Bytes=11)
    6 5 INDEX (RANGE SCAN) OF 'PK_MUSERS' (INDEX (UNIQUE)
    ) (Cost=2 Card=1)
    7 4 INDEX (RANGE SCAN) OF 'IDX2_PERSONS' (INDEX) (Co
    st=1 Card=1464)
    select count(*) from person where ipop='RG';
    count(*)
    12135
    select distinct ipop from persons;
    distinct ipop
    RG
    OP
    IP
    RF
    CR

  • Consumer loop slowing down producer loop

    Hi All,
    I'm currently using a PXI to send commands to a chip, then retrieve the results with a DAQ. This process loops to populate a 256x50 array of values.
    Each time the loop is fully populated, I want to display the result onto a 3D plot, using 3d plot lvclass and plot helper. I noticed through the profiler and using timing functions in the loop that the 3D plot would take ~200 ms to update. The array would fully populate in about 100ms, so tripling the time to update was kind of nasty.
    I put the 3d plot into a consumer loop and everything else in a producer loop. It works fine, I don't mind about dropped frames, but it was running at the same speed. Apparently whenever the consumer loop executed, it would freeze completely the producer loop.
    Why is this? It seems like this fellow had the same problem:
    http://forums.ni.com/t5/LabVIEW/Producer-Consumer-Loops-not-independent/td-p/1115665
    But he "solved" it by removing the graph altogether. As showing the graph updating in real time is critically important, I can't just chuck it.

    No, an action engine is sometimes called a LabVIEW 2 Style global. They are basically a VI with a while loop and an unitialized shift register. They are useful when passing large amounts of data since it does not get copied. Also if you have transformations that are made on the data it is a single self contained VI that has data and actions which can be performed on it. Today a LVOOP implementation would be prefered. At any rate, this is a non-reentrant VI which will cause blocking to occur if called from two or more loops at the same time.
    Out of curiosity, what type of graphics card do you have in the PC? Would a better graphics card help?
    Mark Yedinak
    "Does anyone know where the love of God goes when the waves turn the minutes to hours?"
    Wreck of the Edmund Fitzgerald - Gordon Lightfoot

  • FCP gradually slows down during edit

    Using FCP 4 on a 1.8 G5 with 2GB ram. I have a feature length film I am cutting. 11 hours of footage on a Lacie external hard drive and an hour and a half project in my sequence. The project works great the first twenty minutes it's open or it seems until I rapidly command zoom or some other command, then every time I ask for another command it takes a half beat longer, then a full beat then two beats etc. until finally I have to reboot. It used to work fine. My main external is working off a 800 fire wire. Any suggestions? Thanks for your time.

    Welcome to the family.
    Search the forum for your term; it's been an issue with FCP for several years. I do not recall a favorable solution but what we most often suggest is to break up your project into shorter reels. It's not a satisfactory answer, we know, and the idea really upsets some types of editors. Hope you're not one of those.
    bogiesan

  • 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.

  • Report makes slow down

    I have some problem of performance due to the report generation.
    If I do not use "on the fly reporting", performance are ok, each item of my loop takes the same time. But I have nothing in the report.
    If I use "on the fly reporting", performance are bad, ecah item of my loop take more and more time which becomes inacceptable. On the contrary, my report is ok.
    Is possible to have a report without disturbing and slow down the execution of the sequence ?
    Thanks a lot for your support.

    Hey sfl,
    The short answer is NO. 
    Basically on the fly reporting is being updated everytime a step that records results gets executed.  So you have to store that in memory.  How many steps do you have?  If you have a bunch of steps and your report is really long then you will see performance drop dramatically.
    So you have to choose one or the other unfortunately.
    Regards,
    jigg
    CTA, CLA
    teststandhelp.com
    ~Will work for kudos and/or BBQ~

  • Importing slowing down my computer

    Whenever I import a cd now it takes much longer and slows down my whole computer. Songs and videos also skip while importing a cd. After importing everything is fine again. Does anyone know anything about this problem??

    This could be two different issues.
    When importing CDs change the program focus to another area like the library or mini store. This has worked for a lot of people to speed up importing with iTunes7.
    As for the whole computer slowing down during import, it depends on computer. iTunes7 and new Quicktime seem to need more resources than older versions. You could try ripping CDs using another program if you are making mp3 files.

  • When I attach my Samsung Galaxy Note 3 Sview case my phone slows down.  Has any one experienced this?

    After getting an S-view case for my Note 3, I noticed many of my apps slowing down during use.  When I remove the case, the phone acts normally.  Also, when I go to the sview settings to add weather, it prompts me that settings has stopped working and it does not add weather to the s view.  Has anyone experienced this or know of a fix?

    Wowuor, 
    Thank you so much for reaching to us today. I want to make sure that we get the device charging the correct way. There is no physical or liquid damage to the phone or to the power cord correct? Did this error just start to appear as of last week? Please keep us posted. 
    KevinR_VZW
    Follow us on Twitter @VZWSupport

  • Skype slows down intermittently (Starting to get r...

    I just re-installed Skype because my last hard drive died, but it slows down during the start up and in the middle of conversations. Are there solutions to this or what? 

    Seriously guys, you need to fix this. I posted about this slow preformance issue before and got nothing from the staff. I've had Skype die on me 6 times today and now I am afraid to use the stupid thing. Instead of trying to develop round about solutions, how about attacking it directly.
    FIX YOU PROGRAM NOW! 

  • Timeline slowing down playback / deleting tracks remedies problem

    Here's a nasty bug I've been running into lately.
    I've noticed (on the latest version of Premiere CC 2014) that sometimes a timeline/sequence in a project will start to slow down during playback. It slows down not only the advance of the playhead (in terms of how often it's refreshing) but more annoyingly, it slows down video playback in the program monitor. It happens even when footage has been rendered and should exhibit minimal stress on the system.
    To illustrate that it's just the timeline, not the video itself, the problem can be "fixed" in three ways:
    1. Zoom in on the timeline until playback smooths out again. If a small enough piece of the timeline is visible, it seems to smooth out playback again.
    2. Maximize the program monitor window (so that it's the only visible window in Premiere) and then again, immediately playback snaps to full speed again. I can full-screen the video playback, etc, without issue. And un-rendered portions of footage with effects applied play better as well.
    3. Reduce the number of video/audio tracks. This is what I think is actually slowing down Premiere. But the problem is, I don't have that many tracks to begin with. On the project I'm working on right now, I have 4 video tracks and 5 audio tracks. Simply deleting the bottom 3 audio tracks (which are sparse and only have a few incidental effects) fixes my video/GUI playback problem immediately.
    So my question is... why is Premiere slowing to a crawl just because I added a few audio tracks to a project? Apparently my machine is fast enough to edit 4K material off the GH4 with effects applied and not drop a frame. But add a few tracks of stereo audio? Premiere slows to a crawl.
    It wasn't like this in previous versions, guys. Please advise.

    Try accessing your audio from a different drive location.

  • Modified control loop.vi URGENT!!!!

    je souhaite utiliser le "modified PID control loop.vi" pour avoir deux entrées acquisition distinctes et une seule sortie output à gérer.dois je simplement dupliquer ce vi ? Dois je imbriquer les 2 boucles dans une seule ?
    merci si vous pouvez me fournir un vi adapté car je débute avec labview."

    Bonjour,
    De quel exemple parlez-vous? Pouvez-vous le poster ou me dire où le trouver?
    Merci.
    Matthieu Gourssies
    National Instruments France

Maybe you are looking for