Sunday, October 16, 2022

DynCont#8 NIDAMX PID control Labview NI PXI

Tasks start and stop behavior:

  1.  If you are using finite samples, no need to stop after reading input. Always close only at the end of the complete program
  2. Create task once in the beginning of the program
  3. Start task once when using finite samples.
  4. If you allow regeneration, call backs will not work: Source = https://forums.ni.com/t5/Multifunction-DAQ/Continuous-write-analog-voltage-NI-cDAQ-9178-with-callbacks/td-p/4036271/page/2?profile.language=en

Don't use  USB/ETHERNET

If you are using a USB DAQ, keep in mind that the devices are optimised for data throughput not response latency. You don't want to service tasks (e.g. pull data off the board) more than about 5 times a second. Consequently you should plan to perform larger operations on a USB DAQ than on a PCI or PCIe-based device.
Source: https://github.com/tenss/Python_DAQmx_examples

Software timed IO:

Source = https://www.ni.com/docs/en-US/bundle/ni-daqmx/page/mxcncpts/controlappcase5_2.html

  1. For software timing, the software and operating system determines the rate at which the loop executes. Software timing is not deterministic. Controlling a while loop and using the Wait Until Next ms Multiple VI to handle timing is an example of a software-timed loop. 
  2. IO is triggered by the python code in the PC
  3. Use this mode when hardware time IO is not available
  4. Timing will have jitter due to software errors
  5. Configure the Timed Loop to run at the desired rate. 

Hardware timed IO:

source = https://www.ni.com/docs/en-US/bundle/ni-daqmx/page/mxcncpts/controlappcase1.html

  1. The current iteration's output samples are guaranteed to be aligned with the next iteration's input samples. 
  2. Use the DAQmx Wait For Next Sample Clock function
  3. Read, process, and write operations are confined to the time available between the moment the device starts acquiring data and the moment the next sample clock edge arrives.  
  4. Does exactly what we need = An example of this kind of application is an analog control loop that reads samples from a specific number of analog input channels, processes the data using a control algorithm (such as PID), and writes new control values to the analog output channels.  
Software develop helps
  1. https://github.com/mjablons1/twingo
  2. https://github.com/toastytato/DAQ_Interface
  3. https://github.com/czimm79/MuControl-release
  4. Relevant = https://github.com/tenss/Python_DAQmx_examples
  5. Relevant = https://github.com/mjablons1/nidaqmx-continuous-analog-io
  6. Relevant = https://github.com/mjablons1/nidaqmx-continuous-analog-io 
  7. https://github.com/tenss/SimplePyScanner
  8. https://github.com/petebachant/daqmx
  9. https://github.com/tenss/Python_DAQmx_examples/blob/master/pynidaqmxegs/mixed/AOandAI_sharedClock.py

No comments:

Post a Comment