01-15-2016 11:01 AM - edited 01-15-2016 11:02 AM
Hi
I'm currently running the following program but I am experiencing a strange problem:
- I can read all analog and digital inputs, and write to the analog outputs (I measure the voltage I write on the AO card)
- But the valves I have connected to the analog output, flashes a red light (which according to the data sheet means the electrical signal I am sending to them through the AO module is incorrect)
- However, if I remove the DC and RMS block and do not perform any averaging of the samples, but leave everything the same (still two loops and two seperate FPGA I/O nodes), the valves are operational and do not flash a red light,
I have a cRIO with four modules:
- 1. AO cards (Mod1)
- 2. AI card (Mod2)
- 3. DI/O card (Mod 3)
- 4. Secondary AI card (Mod4)
I currently have two while loops on the fpga:
- "Main Loop (ML)": reads and writes I/O for cards 1-3, with a wait at 300us
- "Top Pressure Sensors Loop (TPSL)" reads two AI's from the fourth module (Mod4), with no wait
These two loops are shown in 'fpga - part 1.png' and 'fpga - part 2.png'.
The settings for the DC and RMS Measurements VI, as well as the front panel are shown in 'fpga - part 3.png'
The second loop use 12002 ticks to execute, the first loop use 160 ticks to execute
Previously I had a similar problem that was fixed by setting the initial values shown on the front panel for the analog output to the valves.
I currently do not have any target VI running and I am only using fpga VI
Any suggestions? Thanks!
Solved! Go to Solution.
01-15-2016 11:30 AM
Update:
I tried placing all the code in one single loop, but the same problem still occurs:
- I can read and write I/O
- But the valves flash red indicating something wrong with the input signals I am sending from the cRio
The modified code is shown in 'updated code.png'
01-15-2016 11:42 AM
Are you able to measure the voltage being sent to the valves before and after removing the DC block? Is there any difference?
01-15-2016 12:18 PM
I already checked, around 6V both times (the valves require a signal between 3V and 9V, with 6V being the 'zero position')
01-15-2016 12:51 PM
I just calculated the loop execution time, and the loop is much slower than when I was running in two seperate loops, about half the speed, I believe this is the reason I placed the code in two loops to begin with
Is it bad practice to have two I/O nodes on one fpga VI, in two different loops? (the second loop only uses module 4, whereas the first loop uses only module 1-3)
01-15-2016 01:09 PM
It's usually ok (and quite common) to put IO in separate loops, if it's necessary. May I ask which modules, backplane, and valves you are using?
I'm wondering if the AO is momentarilly outputting a voltage that puts the valve in a bad state, before you are able to catch it. But that doesn't explain why the DC block would make a difference.
01-15-2016 01:25 PM
The modules are:
- NI 9263
- NI 9401
- NI 9201 (2x)
The valves in question are two hydraulic valves, PVG32's (pressure compensated proportional valves)
I also have a third valve, a D633 servo valve from moog
I'm sorry I don't know what a backplane is?
I have a cRIO-9022 with a cRIO-9111 chassis if that is what you mean
01-15-2016 02:01 PM
Everything is now working with my original program, but I don't know what the problem was
I'd like to know the problem if I could, the valves shouldn't fail like that, so I'm hoping to get some feedback on the following suggestions:
First of all, being new to the CompactRio, I might not be doing everything correctly when I start my programs, here is what I do:
I have a project containing:
- FPGA VI
- Target VI
- Host VI
1. I open the FPGA vi and run it, just to see that everything is working; then I close it
2. I start the target VI by opening it and clicking run, and I keep it open (this one reads and writes I/O to/from the FPGA)
3. Then I start the host VI that does logging
I seem to recall a similar problem occuring a few days ago, which I fixed by turning off the cRio, and closing and reopening my labview project
Could the problem be in how I treat the compactrio with regards to starting/running my VIs?
Thanks!
01-15-2016 02:23 PM
Would you be able to post the .lvproj and VIs here? It would make it much easier to understand how you have it set up.
01-16-2016 03:02 AM
What is you power supply to the valve set to? 12 volts?