05-13-2016 10:22 AM - last edited on 05-19-2016 02:49 PM by acordero0710
For structural, mechanical, & controls engineering projects, contact me.
Ryan Moore, PE, CLD
ryan.moore@aiken-engineering.com
Aiken Engineering Company
Office: 281-580-8468
This was more challenging than i originally thought. Please see the setup in the image below.
Motor: Grainger 1TMW5
Prox Sensor: Grainger 1EWP1, telemecanique XS230BLPAM12
cable: Telemecanique xszcd101y
Motor is 1725 rpm. this will be a 28.75 Hz signal. Prox sensor rated for 1000 Hz per page 71,72 of Telemecanique Catalogue Inductive proximity sensors OsiSense XS. NI9422 lists 250 microseconds or 4000 Hz.
Note the following program names & screenshot jpg names refer to the configuration of the NI 9422. To change the NI 9422 configuration, right click NI9422 module in the project>properties>specialty digital configuration. Read the below linked article "Configuring Counters (Scan Interface)" and the other linked articles under "Selecting the Measurement Mode" http://zone.ni.com/reference/en-XX/help/372603F-01/riohelprt/config_counter_rt/ IMPORTANT: i found a bug that requires you to change the specialty configuration to None & deploy the module within the project, in between changing the configuration to anything but None. If you do not do this you will receive an "Error -1950679035 occurred at Shared Variable in RPM SENSOR with RPM MEAS-COUNTER-COUNT EDGES.vi"
See RPM MEAS-None in the image below.
RPM MEAS-None does not work. Even for a slow rpm of 40, a 1.5 Hz signal, Datapoints are missed because of the "network overhead" of shared variables and the low priority of while loops per LabVIEW deterministic execution. i've found you cannot get the max samples per second of any module or reliable timed execution for anything but very simple codes with low Hz requirements. To understand more about this read the following NI articles
1. Tutorial: Creating a Real-Time Application
2. Getting Started with CompactRIO
3. Using the LabVIEW Shared Variable
4. Communication Between the FPGA, Real-Time Processor, and Distributed Systems
5. Getting Started with CompactRIO - Performing Basic Control
6. Using NI CompactRIO Scan Mode with NI LabVIEW Software
See RPM MEAS-COUNTER-COUNT EDGES in the image below.
RPM MEAS-COUNTER-COUNT EDGES works. It is more accurate & reliable than the below measure period method since it is averaging several periods. it uses the number of prox sensor trips over the RPM interval to calculate RPM. The key thing here is we are not relying on the while loop but more on direct I/O of the module per the NI 9422 configuration. Note that to reset the counter as shown in the 2nd frame of the sequence structure, you must use an invoke node, then drag and drop the NI 9422 module from the project to the block diagram to get the SD module constant "ni.var.io://ni-crio9075-019fe926/Mod3". then select the channel that the prox sensor is on.
See RPM MEAS-MEAS PERIOD in the image below.
RPM MEAS-MEAS PERIOD works & is the simplest. The I/O shared variable outputs the period in microseconds. Note, per the above linked article "Configuring Counters (Scan Interface)", you cannot select measure hertz in the specialty configuration of the NI 9422 because the min Hz required is 3.9 kHz. I believe this is more for vibration signals. if you try the measure Hertz specialty configuration, the shared variable will output 0 Hz.
See RT RPM MEAS-COUNTER-MEAS PERIOD with RT MAIN & RT Library in the image below.
RT RPM MEAS-COUNTER-MEAS PERIOD with RT MAIN & RT Library is the most efficient architecture & has data logging. it is the most complex.
Project is here
05-20-2016 10:42 AM
Specialty Digital mode allows your module to react to pattern based digital I/O at rates significantly faster than is available with the scan interface