Optimum servo pid loop rate

Hi,
I want some confirmation on the optimum pid loop rate and the fastest servo motor operation that we can acheive with Pxi-7352 running on Window.
The manual of 7352 says "62 μs PID loop update rate for up to 2 axes". The requirment is to acheive periodic equi sized straight line and rotary motion ( using yaskawa servo motors in torque mode and 7352 to close position loop ) Both motion are independant and not operating simultaneous i.e rotary completes one full rotation in small steps and then linear moves by one small step then rotary completes next rotation in small steps and again linear motor moves this continues till end of test.
you can observe here that both rotary and liner motion are periodic and move equi spaced distance for each step with small stoppage/dwell time of 500 u sec , The catch is in addition to positional accuracy in terms of 50 -100 microns the time for complete each step is also very crucial and very small (many peridoc steps together consitute complete linear and rotary motion). Find expected velocity profile attached for more details on desired timing.
As the motors have simple and periodic straight line and rotary motion i suppose buffered contour moves are not needed which have limitation of 10 msec between two points, then can the time to acheive each step be as low as 2.5 to 5 msec considering best loop rate of 62.5 u sec and highest/worst pid loop rate of 500 usec.
1. Is the expected timing of 2.5 - 5 m sec feasible assuming that the motor is capable of reaching 5000 rpm which is well above desired speed.
2. 735x series being high performance motion controller what is the order of closed loop timing that we can expect for simple and periodic moves (say in order of 1000 usec or 10 msec)
3. Can i interface one stepper motor and another servo motor where both the motors and drives are in position mode on single 7352 and UMI 7772.
4. Are there any limitation if NI motion is not used for code development and NI motion Assistant along with LabVIEW is used instead.
This is precision application and the component is very small ,the weight of the component would be less than 400 grams so i hope we do not have to consider inertial affect on motion significantly.
Appriciate if some one with similar experience can provide more details.
Regards,
Bipin
Solved!
Go to Solution.
Attachments:
Velocity Profile.png ‏21 KB

Hi Bipin,
thank you for your comprehensive post. I had a close look at your timing specs and I strongly doubt, that these specs can be met with a 7352 board. Even though the PID loop rate of 62.5µs might be enough, both trajectory generator and the supervisory control (host communication, move command sequencing,...) are too slow to meet your requirements. Please note, that the trajectory generator always works with a timing interval of 10 ms, regardless of the operation mode (linear move, contouring, blending,...), so there is no way to reach your timing specs with this product. In general contouring is the fastest way to run a quick succession of moves, as it doesn't require host communication (by the way: onboard programs don't execute much faster, than programs that are running on the host).
I don't want to make negative mareketing for our 735x boards, but your timing requirements are just way beyond the requirements of typical motion control applications and it's probably quite hard to find any COTS product in the market, that can meet these specs. 
With this said, I would like to offer you an alternative solution, that is based on NI's FPGA technology. Additionally to a faster trajectory generator a faster control loop is probably also very desireable for your application. Even with the lowest price Virtex-II based R-Series multifunction board (PCI-7830R) you can run PID loops with 5µs cycle time and the trajectory generator at the same rate. You even can use a different type of control algorithm if required. This technology is leveraged very successfull in a lot of applications with very high performance and accuracy requirements (here are some examples).
So these are the pros, but where are the cons? Well, the R-Series boards are general purpose FPGA boards and not ready to run motion control boards, so you need to develop the low-level control application by yourself. The good news here is, that it can all be done graphically in LabVIEW and that there are many ready to run examples for motion control, that can be used as a base for your development. Additionally you may want to have a look at the NI SoftMotion Development Module for LabVIEW, that simplifies the development of motion control applications, but it is not a mandatory tool and the benefits of this module might not be as high for your application, as ithey are for more standard motion control applications.
I hope that helps.
Kind regards,
Jochen Klier
National Instruments

Similar Messages

  • PID loop rate with counters

    I'm trying to use a PXI-8106 RT and LabviewRT 8.5 as a PID controller to control 3 motors.  I'm measuring the speed of the motors by measuring the frequency of the encoder with a 6608.
    This article http://zone.ni.com/devzone/cda/tut/p/id/5423 claims a speed up to 107.5 khz.  I've set ethernet to polling and usb off, I didn't turn off  the CPU display, but I'll try that as soon as I can. However, I'm not anywhere close to 107khz, best I can get is about 10khz with one channel and about 2 khz with 3 channels.  I realize the tests were done with analog inputs, but I was hoping that  I'd get at least somewhere close using counters. With the 2Khz rate I really can't do what I need to do.
    Does anyone know what a realistic rate would be with this setup?
    I'm new at Labview so I may be doing something wrong, although I can't see what it could be. I've done quite a bit of research on the forums before I started to learn from other's examples.
    Here's a couple of things I've learned  trying to optimize my loops.
    Seems like Daqmx has some issues with applying a scale.  I have 2 scales, one is just a scale factor, 0.166, the other is .0002.  When applying the .0002 factor in Daqmx my performance takes  a huge hit, something like 10%!  If I just leave it at hz, and do the scaling myself I see no performance penalty.
    There is something strange about the timed loop % display in RT8.5, I wrote my own routine using expected end, actual end time, and the period to give me a % loop useage and it matches very well to the RT8.5 display for most of the time, however, when the loop starts missing iterations because I've gone over 100% the RT display drops down to about 50% which pretty much makes it useless.
    I've attached a couple of shots of my test loop. I can get this one to almost hit 10 khz. the other screen shots are of how I set up the counter, and how I read the counter. the read counter has the error trap to restart itself.  Also I set it to use DMA explicitly somewhere else in the program.
    Thanks for any help.
    Henri
    Attachments:
    Main Loop.JPG ‏55 KB
    Setup Counter.JPG ‏72 KB
    Read Counter.JPG ‏67 KB

    Devin,
    Thanks for the suggestions.
    A couple of related questions for you.
    The 200 uSec is leftover from my attempts at getting the 3 PID loops to work within the loop availability.  I can run  about 70 uSec i.e about 14khz  with only  a single counter.
    I've tried changing the buffers value and it has barely any effect on the speed of the loop. Right now I have 3 counters running with 200uSec timing and I get about 69% loop utilization. With a few missed iterations every once in a while. This is using 10000 samples, if I drop down to 100 samples utilization actually goes up to 70%!?  Doesn't make sense to me either, but this is using both my VI and the on screen Timed Structures % of LV8.5RT so I'm trusting it as real,
    In theory if I can get my loop rate up to 10 khz I'll only need 10 for the buffers since my top frequency to be measured is 100 kHz.
    Funny thing on the RT fifo variable... I turned on FIFO and it actually decreased performance by about 1%, both Total load and Time structures went up... so I turned it off for stop-RT, and got a 3% improvement! Down to 66% time structures.
    You mentioned the hardware timing to get a hardware timed single point. Unless I misunderstood the counters, this isn't possible since the sample rate is implicit in the frequency measured? i.e. it latches the count every rising edge.. so I'm my case I'd get a 100 khz sample rate (although obviouslyl that would be the max) Can you let me know if I've missed something there.
    I bought this system explicitly based on its dual core and its high speed so I could close my PID loops quickly enough with one CPU and still have processing time left over to log data, etc.  And the 6608 card is there so I can get high accuracy for my frequency measurements.   However, I'm really struggling to get this thing going.
    Any help would be greatly appreciated.
    Thanks
    Henri

  • PCI-7041 pid loop rate

    Hello,
    I have PCI-7041/6040 card with which I would like to perform single point PID control. I have looked at the DAQmx example PID control - single channel.vi to do this. The only thing I am unsure on how to do, is set the loop rate to a specific kHz value. Is this done by using the 'Input Rate' control and how could I verify that the loop is running deterministically and to the rate I have set?
    thanks,
    David

    Hi David
    You are correct that the "Input Rate" control will set the loop rate for the example that you are using. There are a few ways to determine if the loop is running deterministically.
    One thing you can do is use the "DAQmx is Read or Write Late" VI. If the "is late?" output goes true, your loop is not keeping up with the specified hardware timed acquisition and generation.
    Another recommended method to determine if your loop is running determinisitically is to benchmark it using the TimeStamp VI's.
    There is a great example in the LabVIEW Example Finder that you can use for this. From the Example Finder, go to
    Tookits and Modules >> Real-Time >> Timing >> NI Timestamp Code Timer.
    You can combine your PID example code with this example to determine how long it takes for your PID code to execute when running on the real-time target. Just place the code you wish to benchmark in sequence 0 of the sequence structure of the Timestamp Code Timer example VI. This VI will give you some great information including average execution time and maximum jitter.

  • Why do I have a rate-independent delay in my PID Loop?

    I am preparing to use an ETS Realtime target to do some fast PID loops. I have a 3 GHz P4 machine with a PCI-6259 DAQ card, ruuning LabVIEW 7.1RT with NI-DAQ 7.3 for the PCI-6259 board. For starters I decided to just do some speed tests, with the AO putting out exactly the value measured by the AI, with no PID calculations. I would expect the output to be an exact duplicate of the input, but jagged and with a small delay of approximately 1 loop time. What I see on the scope is that there is a fixed 0.1 msec delay between the input and output that is independent of the loop rate. I can run the loop up to 100 kHz rate. With this fast loop rate the output is a faithful replication of the input, but shifted by 0.1 msec. This delay will cause big problems in a real PID loop, since this is several sample periods. At first I thought that there was a buffer that was delaying the samples, but if that were the case the delay would be proportional to the sampling time and not independent of it. The delay is not in the loop itself, which can operate up to 10 times faster than the observed delay. I have attached the vi and configuration sub-vis. Please tell me what I am overlooking here.
    Thanks,
    Rich
    Attachments:
    Speed_test.zip ‏51 KB

    I am looking to run a very similar application with the same card, a similar computer, and do PID control. I'm amazed you were able to get a loop rate of 100 kHz even if it wasn't doing anything real! NI quotes 1 kHz max loop rates in most of its documentation, though I suspect most of it is quite old. I'm interested in what rate you were finally able to achieve with the PID control. I would also be interested in seeing the PID/DAQ communication part of your could if you are able/willing to share it. I was hoping to get 4-5 kHz with at least one channel and hopefully more.
    Thanks,
    Aaron

  • PWM PID loop on 7344 motion controller

    I need to control motion by PWM, with the help of 7344 motion controller.Please verify if it possible or not, and how can I do it.Please provide me(if it possible)any example of solution of this problem.

    Hello,
    The onboard PID circuitry can only be utilized with servos and closed loop steppers. You can write your own PID loop in software using the PWM functions and the Read Encoder Position.flx. This should work pretty well for low loop rates (since it's implemented in sw). I don't think there are any examples of it available but it should be pretty straight forward.
    Regards,
    Yusuf C.
    Applications Engineering
    National Instruments

  • Has anyone modeled the RABBIT SE3MICONDU​CTOR RCM3200 PID loop in labview ?

    I am considering buying labview for data aquisition and servomotor tuning. In order to use the tuning functionality of Labview, I believe I need a "VI" model of my motion controller PID loop. We are currently using the RABBIT SEMICONDUCTOR RCM3200 for this task in our OEM industrial equipment. Does anyone have any experience with this product and/or modeled it in Labview?

    Hi Ted,
    Thanks for using our discussion forums. What you are trying to do is probably something you can accomplish with our hardware and software. What you might try, first of all, is a servo motor board like the PCI-7344. When you install the drivers with this board, there will be a tuning utility automatically installed into the Measurement and Automation Explorer utility. This will allow you to "auto tune" with our built in algorithm or also manually tune the PID parameters.
    We also have built in VIs for servo driving as well. If you need to use a custom algorithm, however, other than PID, you may consider looking into our SoftMotion development module for LabVIEW. Let us know a little more about what exactly it is you are trying to do and we should better be able to suit your needs.
    Happy Holidays!
    Dan Q
    Applications Engineer
    National Instruments

  • Does PID loop transfer values to new instance

    Greetings Everyone,
    I'm a new forum user, but I've been using Labview for about three years now. 
    I have an application that uses PID VIs in multiple cases of a case structure.  Each case structure passes a different set of setpoints, gain schedules, limits, ect to the new instance of the PIDvi.  What I'm wondering is this:  When I switch cases to the new case structure, does all the integral and derivative information get lost in the shift registers of the old PID instance, or does labview keep them in memory and pass them to the new instance?  If it kept it in memory it would be a great help, becasue there would be less upset in my PID loop.  If not, then I'm going to have to pass a cluster of that information into the new instance...which I'd rather not do to save on system requirements (real time system). 
    Thanks for the input
    Grub
    Hell, there are no rules here...we're trying to accomplish something!!! - Thomas Edison

    Using the shift register will only work if you make the VIs not reentrant. In any other case, you will need some means of global data storage. I think the most memory efficient is LV2 Globals (also known as Functional Globals), but I haven't tested it, and I know of some benchmarks that showed that the fastest is single element queues globals.
    A single element queue global is a queue with the size of 1 where you always remove the element from the queue when doing an operation. This locks any other calls to the queue, because it's empty, and they will have to wait until you place the element back in the queue.
    You can search for the other terms to find some documentation about them.
    Try to take over the world!

  • [FPGA] Loop rate very slow: Do FPGA I/O nodes in parallel loops block each other?

    Hi,
    I am using cRIO-9075. Mod1 is NI 9263, Mod2 is NI 9227, Mod3 is 9215.
    Please see my VI attached or the given screenshot.
    The FPGA code is based on the "NI CompactRIO Waveform Reference Library" (it's the lower loop).
    The upper loop was added by me and is writing a waveform from blockmemory to the NI 9263 module (Mod 1).
    The data sampled in the lower loop is running at 1 kHz. The control "AO Update Period" for the upper loop has a value of (for example) 10 (=uS).
    The problem is, that this loop is running much much slower than it should. Once I disable the FPGA I/O node in the lower loop (as done in the attachments), it's running as fast as it should.
    It seems to me, that the FPGA I/O nodes are blocking each other. I tried to figure it out by reading through serveral NI documents, but until now I have no idea how to solve that.
    Can you give me some advices? Some general tipps about the VI?
    Thanks!
    Attachments:
    FPGA Loop Rate.PNG ‏72 KB
    FPGA Main.vi ‏251 KB

    Hi, thanks so far.
    Originally the control was inside the loop. Then I tried if it makes a difference if it's outside.
    Ok, i really seems to be that default value of "100000" for "AO Update Period".
    Starting the VI directly woks like expected. Having "AO Update period" inside the loop makes it possible to control it as it's running.
    But, please see the attachment. When starting the FPGA through RT and setting the appropiate value, it does not seem to work. The oscilloscope show's the same behavior like "AO Update Period" was 100000.
    But when reading the value of "AO Update Period" afterwards (while the FPGA is running), it shows the expected value of "10".
    Having changed the default value to 10 works so far, but I am not able to changed it (see attachment).
    So the problem is: Why is "Read/Write control" not working here? Why is still the default value used?
    Attachments:
    FPGA Loop Rate 2.PNG ‏5 KB

  • How many PID loops could I run on cRIO RT?

    Hi,
    I am trying to create a temperature process controller. I have 3 RS232-enabled OMEGA mass flow controllers, 12 thermocouples, 6 heaters (that will be connected in sets of two), and 3 PWM-enabled fan banks.
    My thinking is that I would connect the heaters in parallel to a phase-angle-fired SSR (http://www.chromalox.com/catalog/resources/PDS-PK308-SSR.pdf). That way, I could use a 0-20 mA output signal from the cRIO to control the power appplied to the heaters. I would use PID, and scale the output of the PID to a 0-20 mA signal to control the process temperature. I also want cascade control - I want to have 2 additional thermocouples that are connected to the PID loop acting as limit sensors. If the temperature limit is exceeded in either thermocouple, the PID loop is "turned off" until reset by a user. I would want three of these configurations (2 heaters, 3 thermocouples, 1 SSR - x3, so 6 heaters, 9 thermocouples, 3 SSRs).
    Rather than control the PWM fans with a PWM output directly from the cRIO (which I heard can be painful) I found a PWM controller that is controlled by a 0-5VDC signal. I wanted to use a thermocouple as a process value, and the 0-5VDC signal would scale to control the fans to achieve the desired temperature. I would want three of these configurations (1 fan bank, 1 thermocouple - x3, so 3 fan banks, 3 thermocouples).
    So now, my REAL question - Would one cRIO chassis be able to control these 6 PID loops AND my OMEGA mass flow controllers? I'm just unsure of the processing power that is required of PID/limit control.
    I appreciate any help I get - If need any more specifics, please let me know!
    Thanks!

    Just to follow up - I have no problem using FPGA as well, if leveraging both the RT and FPGA systems will allow me to achieve my goal. I have heard, though, that FPGA is only good if you are only maintaining one set point for the PID loops. My fan bank PID loops will keep a constant set-point, however my heater bank PID loops will require constant changing (the heaters will be used to create a cycle that maintains one temperature for 60 mins, than goes to a different temperature for another 60 minutes, and repeats).

  • Unable to download simple PID loop configuration.

    We have Foundation Fieldbus demonstration setup with Yokogawa's Flow meter , Positioner and Valve.
    NI-FBUS configurator Ver 3.2 is used. We are  trying to set up simple PID loop with AI & PID blocks of Flow meter & AO block of Positioner.
    We are unable to download the configuration.The error messages are
    ERROR-NIFCONF-ERR-CONFIGURATION FAILED,Error Code - 1057
    ERROR-NIF-ERR-MULTIPLE,ERROR code -3
    Kindly provide solutions to the above problem
    Regards,
    Bhagyashree

    The error ERROR-NIF-ERR-MULTIPLE indicates that there exists duplicated block tags in the configurator. Please check the block tags in your PID loop configuration, make sure that there are no duplicated tag names.
    Feilian (Vince) Shen

  • FPGA - Synchroniz​ation between two loops with different loop rates.

    Hi all,
    I am trying to implement an Analog and Quadrature Decoder. Simply put, I have two loops:  LOOP 1 with an Analog Input (AI) which is a slower loop rate. Another loop: LOOP 2 has a digital input (input) and counts the Quadrature counts. I understand that Analog conversion is slower, and as a result,  LOOP 1 will have a slower higher tick rate. I want to pass the "counts" from LOOP 2 into LOOP1, so that I can synchronize the Analog Input with the number of quadrature counts. My issue at hand is: since LOOP 2 updates at a higher rate. Will the "counts" value that I pass/tunnel from LOOP 2 to LOOP 1 refresh at the LOOP 2's rate or at LOOP 1's rate.
    Thanks,
    Herrick Chang

    hlchang wrote:
    Hi all,
    I am trying to implement an Analog and Quadrature Decoder. Simply put, I have two loops:  LOOP 1 with an Analog Input (AI) which is a slower loop rate. Another loop: LOOP 2 has a digital input (input) and counts the Quadrature counts. I understand that Analog conversion is slower, and as a result,  LOOP 1 will have a slower higher tick rate. I want to pass the "counts" from LOOP 2 into LOOP1, so that I can synchronize the Analog Input with the number of quadrature counts. My issue at hand is: since LOOP 2 updates at a higher rate. Will the "counts" value that I pass/tunnel from LOOP 2 to LOOP 1 refresh at the LOOP 2's rate or at LOOP 1's rate.
    Thanks,
    Herrick Chang
    The only way to pass values between two parallel loops is by some sort of global variable (global or locals are fine, as are shared variables although I wouldn't recommend that for FPGA if you don't want to go outside of the FPGA target at all). Don't tunnel anything between two independant loops as they won't be independant anymore.
    The local variable will be updated at the rate the writing loop updates it, though your slower read loop will obviously not see every value. Note that the FPGA compiler will protect the local variable access in both loops in order to avoid race conditions. This protection is necessary but expensive in terms of runtime performance of each loop as well as FPGA gate usage.
    Rolf Kalbermatter
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • Digital PID Loop Output from MV?

    I'm setting up a PID loop with a digital output. It's a heating pad (which heats up pretty quickly). I've been looking for a good example of PID loops with digital outputs and haven't really found much. It seems like I just need to find a way to turn a 0-100% value into a binary value which turns on and off rapidly.
    I made a simple little VI which I would attach to the output (MV) of the PID loops (standard). I just wondered if anyone could let me know if this is good enough? Is there a level of complexity I haven't thought of yet?
    Attachments:
    Digital PID Output.png ‏21 KB

    Are you looking for a PWM digital output?  If so, this thread might be useful.  It uses a USB-6008 for the digital ouput so it should work with any NI-DAQ device with a digtial output.  There are better ways of doing PWM with more capable devices but it's a start.
    ~Simon

  • Using PCI 625x for multiple PID loops

    I am looking to control several [between 2 and four] PID loops with one board.  The PID output  offset will be in the 0-20V range and about  +/-1V for the actual control variance to control a bi-morph piezo. The input signal will be on the order of 50mV with an error signal of up to about the same value (50mV).  I need the PID to contol loop to run at a minumum frequency of 1kHz.
    Would the PCI 6259 card, using an external reference voltage, be sufficient for this process or are there other DAQ hardware choices that would be more appropriate (and still around the same cost)?

    Dear Kevin,
    If you look at the Specs for the PCI-6259 you will see that the range for the External Reference is +/- 11V, so 20V is outside of the range. I looked through the specs for other NI boards and there aren't any boards with an analog output range that high. Good luck with your project.
    Sincerely,
    Marni S.

  • Need to slow down POLL loop rate

    I find that when I configure a device for polling and a connection is opened, the poll rate appears to run as fast as the computer will allow. I need to control the poll loop rate or "scan rate" so it scans once every 100ms. Some devices cannot handle a fast scan rate, must be slower than 10ms. How do I change my scan rate?

    Hello,
    Thanks for contacting National Instruments.
    I think you can accomplish what you are trying to do by using a different mode instead of Automatic. For example, if you use the Scanned mode, then you should be able to set the ExpPacketRate to the value you are interested in using as the poll rate. This information is documented on page 2-59 of the following manual.
    http://digital.ni.com/manuals.nsf/webAdvsearch/659F311DE89061978625680F0059DCF7?OpenDocument&vid=niwc&node=132100_US
    Hope this helps!
    Regards,
    Steven B.
    Applications Engineering
    National Instruments

  • Ni7842 FPGA RIO board loop rate

    Hi,
    Is it possible to achieve a loop rate of 1us with the Ni7842 RIO board. It has an onboard clock of 40MHz. I have tried the following approaches to achieve a 1us loop rate and generate a single pulse of 1us duration, but wasn't successful.
    1st approach: The above flat sequence was originally with 2 frames, I removed the second processing frame to reduce any possible processing delays and changed counter units to usec with a count of 1. This did not work, minimum pulse width I could generate was 1ms.
    2nd approach: I changed counter units to ticks with a count of 40. This also was able to generate a min pulse width of 1ms only.
    The AO channel is capable of 1MS/s update rate and with an onboard clock of 40Mhz you would think you can achieve 1us. Why is it being so difficult for me? Please help.
    Thanks,
    PG

    Show some actual code.  If possible, supply a stripped down project that shows this issue.  I recommend zipping up this project and any needed VIs and posting the zip file.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

Maybe you are looking for